@abi-software/scaffoldvuer 1.13.0 → 1.13.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/scaffoldvuer.js +217 -175
- package/dist/scaffoldvuer.umd.cjs +5 -5
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/App.vue +2 -2
- package/src/components/ScaffoldOverlay.vue +5 -0
- package/src/components/ScaffoldVuer.vue +107 -20
- package/src/components/TextureSlidesControls.vue +1 -1
- package/src/components/TransformationControls.vue +19 -24
- package/src/scripts/OrgansRenderer.js +31 -31
- package/src/scripts/Utilities.js +24 -8
|
@@ -17,7 +17,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:i,curr
|
|
|
17
17
|
z-index:-1000 !important;
|
|
18
18
|
top:0 !important;
|
|
19
19
|
right:0 !important;
|
|
20
|
-
`,RT=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function FT(n){const e=window.getComputedStyle(n),t=e.getPropertyValue("box-sizing"),i=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),r=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:RT.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:i,borderSize:r,boxSizing:t}}function Im(n,e=1,t){var i;Ln||(Ln=document.createElement("textarea"),document.body.appendChild(Ln));const{paddingSize:r,borderSize:s,boxSizing:o,contextStyle:l}=FT(n);Ln.setAttribute("style",`${l};${LT}`),Ln.value=n.value||n.placeholder||"";let u=Ln.scrollHeight;const c={};o==="border-box"?u=u+s:o==="content-box"&&(u=u-r),Ln.value="";const f=Ln.scrollHeight-r;if(tt(e)){let h=f*e;o==="border-box"&&(h=h+r+s),u=Math.max(h,u),c.minHeight=`${h}px`}if(tt(t)){let h=f*t;o==="border-box"&&(h=h+r+s),u=Math.min(h,u)}return c.height=`${u}px`,(i=Ln.parentNode)==null||i.removeChild(Ln),Ln=void 0,c}const PT=$e({id:{type:String,default:void 0},size:Hi,disabled:Boolean,modelValue:{type:Ve([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Ve([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:Ui},prefixIcon:{type:Ui},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Ve([Object,Array,String]),default:()=>pi({})},autofocus:Boolean,rows:{type:Number,default:2},...Wi(["ariaLabel"])}),IT={[ot]:n=>Ht(n),input:n=>Ht(n),change:n=>Ht(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},OT=a.defineComponent({name:"ElInput",inheritAttrs:!1}),NT=a.defineComponent({...OT,props:PT,emits:IT,setup(n,{expose:e,emit:t}){const i=n,r=a.useAttrs(),s=a.useSlots(),o=a.computed(()=>{const ce={};return i.containerRole==="combobox"&&(ce["aria-haspopup"]=r["aria-haspopup"],ce["aria-owns"]=r["aria-owns"],ce["aria-expanded"]=r["aria-expanded"]),ce}),l=a.computed(()=>[i.type==="textarea"?b.b():d.b(),d.m(v.value),d.is("disabled",m.value),d.is("exceed",J.value),{[d.b("group")]:s.prepend||s.append,[d.m("prefix")]:s.prefix||i.prefixIcon,[d.m("suffix")]:s.suffix||i.suffixIcon||i.clearable||i.showPassword,[d.bm("suffix","password-clear")]:D.value&&k.value,[d.b("hidden")]:i.type==="hidden"},r.class]),u=a.computed(()=>[d.e("wrapper"),d.is("focus",T.value)]),c=jS({excludeKeys:a.computed(()=>Object.keys(o.value))}),{form:f,formItem:h}=ys(),{inputId:p}=fl(i,{formItemContext:h}),v=Er(),m=Go(),d=Ge("input"),b=Ge("textarea"),y=a.shallowRef(),g=a.shallowRef(),w=a.ref(!1),A=a.ref(!1),S=a.ref(),M=a.shallowRef(i.inputStyle),F=a.computed(()=>y.value||g.value),{wrapperRef:R,isFocused:T,handleFocus:P,handleBlur:_}=Lm(F,{beforeFocus(){return m.value},afterBlur(){var ce;i.validateEvent&&((ce=h==null?void 0:h.validate)==null||ce.call(h,"blur").catch(ge=>gt(ge)))}}),E=a.computed(()=>{var ce;return(ce=f==null?void 0:f.statusIcon)!=null?ce:!1}),C=a.computed(()=>(h==null?void 0:h.validateState)||""),L=a.computed(()=>C.value&&jp[C.value]),I=a.computed(()=>A.value?VS:PS),x=a.computed(()=>[r.style]),O=a.computed(()=>[i.inputStyle,M.value,{resize:i.resize}]),B=a.computed(()=>jn(i.modelValue)?"":String(i.modelValue)),D=a.computed(()=>i.clearable&&!m.value&&!i.readonly&&!!B.value&&(T.value||w.value)),k=a.computed(()=>i.showPassword&&!m.value&&!i.readonly&&!!B.value&&(!!B.value||T.value)),V=a.computed(()=>i.showWordLimit&&!!i.maxlength&&(i.type==="text"||i.type==="textarea")&&!m.value&&!i.readonly&&!i.showPassword),G=a.computed(()=>B.value.length),J=a.computed(()=>!!V.value&&G.value>Number(i.maxlength)),j=a.computed(()=>!!s.suffix||!!i.suffixIcon||D.value||i.showPassword||V.value||!!C.value&&E.value),[te,ee]=hT(y);bn(g,ce=>{if(Z(),!V.value||i.resize!=="both")return;const ge=ce[0],{width:re}=ge.contentRect;S.value={right:`calc(100% - ${re+15+6}px)`}});const ae=()=>{const{type:ce,autosize:ge}=i;if(!(!Rt||ce!=="textarea"||!g.value))if(ge){const re=en(ge)?ge.minRows:void 0,he=en(ge)?ge.maxRows:void 0,ve=Im(g.value,re,he);M.value={overflowY:"hidden",...ve},a.nextTick(()=>{g.value.offsetHeight,M.value=ve})}else M.value={minHeight:Im(g.value).minHeight}},Z=(ce=>{let ge=!1;return()=>{var re;if(ge||!i.autosize)return;((re=g.value)==null?void 0:re.offsetParent)===null||(ce(),ge=!0)}})(ae),$=()=>{const ce=F.value,ge=i.formatter?i.formatter(B.value):B.value;!ce||ce.value===ge||(ce.value=ge)},se=async ce=>{te();let{value:ge}=ce.target;if(i.formatter&&(ge=i.parser?i.parser(ge):ge),!W.value){if(ge===B.value){$();return}t(ot,ge),t("input",ge),await a.nextTick(),$(),ee()}},z=ce=>{t("change",ce.target.value)},{isComposing:W,handleCompositionStart:q,handleCompositionUpdate:le,handleCompositionEnd:oe}=Rm({emit:t,afterComposition:se}),U=()=>{A.value=!A.value,N()},N=async()=>{var ce;await a.nextTick(),(ce=F.value)==null||ce.focus()},X=()=>{var ce;return(ce=F.value)==null?void 0:ce.blur()},Y=ce=>{w.value=!1,t("mouseleave",ce)},ie=ce=>{w.value=!0,t("mouseenter",ce)},ue=ce=>{t("keydown",ce)},me=()=>{var ce;(ce=F.value)==null||ce.select()},be=()=>{t(ot,""),t("change",""),t("clear"),t("input","")};return a.watch(()=>i.modelValue,()=>{var ce;a.nextTick(()=>ae()),i.validateEvent&&((ce=h==null?void 0:h.validate)==null||ce.call(h,"change").catch(ge=>gt(ge)))}),a.watch(B,()=>$()),a.watch(()=>i.type,async()=>{await a.nextTick(),$(),ae()}),a.onMounted(()=>{!i.formatter&&i.parser&>("ElInput","If you set the parser, you also need to set the formatter."),$(),a.nextTick(ae)}),e({input:y,textarea:g,ref:F,textareaStyle:O,autosize:a.toRef(i,"autosize"),isComposing:W,focus:N,blur:X,select:me,clear:be,resizeTextarea:ae}),(ce,ge)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps(a.unref(o),{class:[a.unref(l),{[a.unref(d).bm("group","append")]:ce.$slots.append,[a.unref(d).bm("group","prepend")]:ce.$slots.prepend}],style:a.unref(x),role:ce.containerRole,onMouseenter:ie,onMouseleave:Y}),[a.createCommentVNode(" input "),ce.type!=="textarea"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createCommentVNode(" prepend slot "),ce.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(d).be("group","prepend"))},[a.renderSlot(ce.$slots,"prepend")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref_key:"wrapperRef",ref:R,class:a.normalizeClass(a.unref(u))},[a.createCommentVNode(" prefix slot "),ce.$slots.prefix||ce.prefixIcon?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(d).e("prefix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("prefix-inner"))},[a.renderSlot(ce.$slots,"prefix"),ce.prefixIcon?(a.openBlock(),a.createBlock(a.unref(ht),{key:0,class:a.normalizeClass(a.unref(d).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ce.prefixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("input",a.mergeProps({id:a.unref(p),ref_key:"input",ref:y,class:a.unref(d).e("inner")},a.unref(c),{minlength:ce.minlength,maxlength:ce.maxlength,type:ce.showPassword?A.value?"text":"password":ce.type,disabled:a.unref(m),readonly:ce.readonly,autocomplete:ce.autocomplete,tabindex:ce.tabindex,"aria-label":ce.ariaLabel,placeholder:ce.placeholder,style:ce.inputStyle,form:ce.form,autofocus:ce.autofocus,onCompositionstart:a.unref(q),onCompositionupdate:a.unref(le),onCompositionend:a.unref(oe),onInput:se,onChange:z,onKeydown:ue}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),a.createCommentVNode(" suffix slot "),a.unref(j)?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(a.unref(d).e("suffix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("suffix-inner"))},[!a.unref(D)||!a.unref(k)||!a.unref(V)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(ce.$slots,"suffix"),ce.suffixIcon?(a.openBlock(),a.createBlock(a.unref(ht),{key:0,class:a.normalizeClass(a.unref(d).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ce.suffixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],64)):a.createCommentVNode("v-if",!0),a.unref(D)?(a.openBlock(),a.createBlock(a.unref(ht),{key:1,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("clear")]),onMousedown:a.withModifiers(a.unref(To),["prevent"]),onClick:be},{default:a.withCtx(()=>[a.createVNode(a.unref(vu))]),_:1},8,["class","onMousedown"])):a.createCommentVNode("v-if",!0),a.unref(k)?(a.openBlock(),a.createBlock(a.unref(ht),{key:2,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("password")]),onClick:U},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(I))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),a.unref(V)?(a.openBlock(),a.createElementBlock("span",{key:3,class:a.normalizeClass(a.unref(d).e("count"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("count-inner"))},a.toDisplayString(a.unref(G))+" / "+a.toDisplayString(ce.maxlength),3)],2)):a.createCommentVNode("v-if",!0),a.unref(C)&&a.unref(L)&&a.unref(E)?(a.openBlock(),a.createBlock(a.unref(ht),{key:4,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("validateIcon"),a.unref(d).is("loading",a.unref(C)==="validating")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(L))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0)],2),a.createCommentVNode(" append slot "),ce.$slots.append?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(a.unref(d).be("group","append"))},[a.renderSlot(ce.$slots,"append")],2)):a.createCommentVNode("v-if",!0)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createCommentVNode(" textarea "),a.createElementVNode("textarea",a.mergeProps({id:a.unref(p),ref_key:"textarea",ref:g,class:[a.unref(b).e("inner"),a.unref(d).is("focus",a.unref(T))]},a.unref(c),{minlength:ce.minlength,maxlength:ce.maxlength,tabindex:ce.tabindex,disabled:a.unref(m),readonly:ce.readonly,autocomplete:ce.autocomplete,style:a.unref(O),"aria-label":ce.ariaLabel,placeholder:ce.placeholder,form:ce.form,autofocus:ce.autofocus,rows:ce.rows,onCompositionstart:a.unref(q),onCompositionupdate:a.unref(le),onCompositionend:a.unref(oe),onInput:se,onFocus:a.unref(P),onBlur:a.unref(_),onChange:z,onKeydown:ue}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),a.unref(V)?(a.openBlock(),a.createElementBlock("span",{key:0,style:a.normalizeStyle(S.value),class:a.normalizeClass(a.unref(d).e("count"))},a.toDisplayString(a.unref(G))+" / "+a.toDisplayString(ce.maxlength),7)):a.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var BT=We(NT,[["__file","input.vue"]]);const DT=Nt(BT),bs=4,VT={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},kT=({move:n,size:e,bar:t})=>({[t.size]:e,transform:`translate${t.axis}(${n}%)`}),Iu=Symbol("scrollbarContextKey"),zT=$e({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),UT="Thumb";var Om=We(a.defineComponent({__name:"thumb",props:zT,setup(n){const e=n,t=a.inject(Iu),i=Ge("scrollbar");t||us(UT,"can not inject scrollbar context");const r=a.ref(),s=a.ref(),o=a.ref({}),l=a.ref(!1);let u=!1,c=!1,f=Rt?document.onselectstart:null;const h=a.computed(()=>VT[e.vertical?"vertical":"horizontal"]),p=a.computed(()=>kT({size:e.size,move:e.move,bar:h.value})),v=a.computed(()=>r.value[h.value.offset]**2/t.wrapElement[h.value.scrollSize]/e.ratio/s.value[h.value.offset]),m=M=>{var F;if(M.stopPropagation(),M.ctrlKey||[1,2].includes(M.button))return;(F=window.getSelection())==null||F.removeAllRanges(),b(M);const R=M.currentTarget;R&&(o.value[h.value.axis]=R[h.value.offset]-(M[h.value.client]-R.getBoundingClientRect()[h.value.direction]))},d=M=>{if(!s.value||!r.value||!t.wrapElement)return;const F=Math.abs(M.target.getBoundingClientRect()[h.value.direction]-M[h.value.client]),R=s.value[h.value.offset]/2,T=(F-R)*100*v.value/r.value[h.value.offset];t.wrapElement[h.value.scroll]=T*t.wrapElement[h.value.scrollSize]/100},b=M=>{M.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",y),document.addEventListener("mouseup",g),f=document.onselectstart,document.onselectstart=()=>!1},y=M=>{if(!r.value||!s.value||u===!1)return;const F=o.value[h.value.axis];if(!F)return;const R=(r.value.getBoundingClientRect()[h.value.direction]-M[h.value.client])*-1,T=s.value[h.value.offset]-F,P=(R-T)*100*v.value/r.value[h.value.offset];t.wrapElement[h.value.scroll]=P*t.wrapElement[h.value.scrollSize]/100},g=()=>{u=!1,o.value[h.value.axis]=0,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",g),S(),c&&(l.value=!1)},w=()=>{c=!1,l.value=!!e.size},A=()=>{c=!0,l.value=u};a.onBeforeUnmount(()=>{S(),document.removeEventListener("mouseup",g)});const S=()=>{document.onselectstart!==f&&(document.onselectstart=f)};return kt(a.toRef(t,"scrollbarElement"),"mousemove",w),kt(a.toRef(t,"scrollbarElement"),"mouseleave",A),(M,F)=>(a.openBlock(),a.createBlock(a.Transition,{name:a.unref(i).b("fade"),persisted:""},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{ref_key:"instance",ref:r,class:a.normalizeClass([a.unref(i).e("bar"),a.unref(i).is(a.unref(h).key)]),onMousedown:d},[a.createElementVNode("div",{ref_key:"thumb",ref:s,class:a.normalizeClass(a.unref(i).e("thumb")),style:a.normalizeStyle(a.unref(p)),onMousedown:m},null,38)],34),[[a.vShow,M.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const GT=$e({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var HT=We(a.defineComponent({__name:"bar",props:GT,setup(n,{expose:e}){const t=n,i=a.inject(Iu),r=a.ref(0),s=a.ref(0),o=a.ref(""),l=a.ref(""),u=a.ref(1),c=a.ref(1);return e({handleScroll:p=>{if(p){const v=p.offsetHeight-bs,m=p.offsetWidth-bs;s.value=p.scrollTop*100/v*u.value,r.value=p.scrollLeft*100/m*c.value}},update:()=>{const p=i==null?void 0:i.wrapElement;if(!p)return;const v=p.offsetHeight-bs,m=p.offsetWidth-bs,d=v**2/p.scrollHeight,b=m**2/p.scrollWidth,y=Math.max(d,t.minSize),g=Math.max(b,t.minSize);u.value=d/(v-d)/(y/(v-y)),c.value=b/(m-b)/(g/(m-g)),l.value=y+bs<v?`${y}px`:"",o.value=g+bs<m?`${g}px`:""}}),(p,v)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(Om,{move:r.value,ratio:c.value,size:o.value,always:p.always},null,8,["move","ratio","size","always"]),a.createVNode(Om,{move:s.value,ratio:u.value,size:l.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const WT=$e({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Ve([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...Wi(["ariaLabel","ariaOrientation"])}),jT={scroll:({scrollTop:n,scrollLeft:e})=>[n,e].every(tt)},Ou="ElScrollbar",$T=a.defineComponent({name:Ou}),ZT=a.defineComponent({...$T,props:WT,emits:jT,setup(n,{expose:e,emit:t}){const i=n,r=Ge("scrollbar");let s,o,l=0,u=0;const c=a.ref(),f=a.ref(),h=a.ref(),p=a.ref(),v=a.computed(()=>{const S={};return i.height&&(S.height=el(i.height)),i.maxHeight&&(S.maxHeight=el(i.maxHeight)),[i.wrapStyle,S]}),m=a.computed(()=>[i.wrapClass,r.e("wrap"),{[r.em("wrap","hidden-default")]:!i.native}]),d=a.computed(()=>[r.e("view"),i.viewClass]),b=()=>{var S;f.value&&((S=p.value)==null||S.handleScroll(f.value),l=f.value.scrollTop,u=f.value.scrollLeft,t("scroll",{scrollTop:f.value.scrollTop,scrollLeft:f.value.scrollLeft}))};function y(S,M){en(S)?f.value.scrollTo(S):tt(S)&&tt(M)&&f.value.scrollTo(S,M)}const g=S=>{if(!tt(S)){gt(Ou,"value must be a number");return}f.value.scrollTop=S},w=S=>{if(!tt(S)){gt(Ou,"value must be a number");return}f.value.scrollLeft=S},A=()=>{var S;(S=p.value)==null||S.update()};return a.watch(()=>i.noresize,S=>{S?(s==null||s(),o==null||o()):({stop:s}=bn(h,A),o=kt("resize",A))},{immediate:!0}),a.watch(()=>[i.maxHeight,i.height],()=>{i.native||a.nextTick(()=>{var S;A(),f.value&&((S=p.value)==null||S.handleScroll(f.value))})}),a.provide(Iu,a.reactive({scrollbarElement:c,wrapElement:f})),a.onActivated(()=>{f.value&&(f.value.scrollTop=l,f.value.scrollLeft=u)}),a.onMounted(()=>{i.native||a.nextTick(()=>{A()})}),a.onUpdated(()=>A()),e({wrapRef:f,update:A,scrollTo:y,setScrollTop:g,setScrollLeft:w,handleScroll:b}),(S,M)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"scrollbarRef",ref:c,class:a.normalizeClass(a.unref(r).b())},[a.createElementVNode("div",{ref_key:"wrapRef",ref:f,class:a.normalizeClass(a.unref(m)),style:a.normalizeStyle(a.unref(v)),tabindex:S.tabindex,onScroll:b},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(S.tag),{id:S.id,ref_key:"resizeRef",ref:h,class:a.normalizeClass(a.unref(d)),style:a.normalizeStyle(S.viewStyle),role:S.role,"aria-label":S.ariaLabel,"aria-orientation":S.ariaOrientation},{default:a.withCtx(()=>[a.renderSlot(S.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),S.native?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(HT,{key:0,ref_key:"barRef",ref:p,always:S.always,"min-size":S.minSize},null,8,["always","min-size"]))],2))}});var XT=We(ZT,[["__file","scrollbar.vue"]]);const YT=Nt(XT),Nu=Symbol("popper"),Nm=Symbol("popperContent"),Bm=$e({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),JT=a.defineComponent({name:"ElPopper",inheritAttrs:!1}),KT=a.defineComponent({...JT,props:Bm,setup(n,{expose:e}){const t=n,i=a.ref(),r=a.ref(),s=a.ref(),o=a.ref(),l=a.computed(()=>t.role),u={triggerRef:i,popperInstanceRef:r,contentRef:s,referenceRef:o,role:l};return e(u),a.provide(Nu,u),(c,f)=>a.renderSlot(c.$slots,"default")}});var qT=We(KT,[["__file","popper.vue"]]);const Dm=$e({arrowOffset:{type:Number,default:5}}),QT=a.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),eE=a.defineComponent({...QT,props:Dm,setup(n,{expose:e}){const t=n,i=Ge("popper"),{arrowOffset:r,arrowRef:s,arrowStyle:o}=a.inject(Nm,void 0);return a.watch(()=>t.arrowOffset,l=>{r.value=l}),a.onBeforeUnmount(()=>{s.value=void 0}),e({arrowRef:s}),(l,u)=>(a.openBlock(),a.createElementBlock("span",{ref_key:"arrowRef",ref:s,class:a.normalizeClass(a.unref(i).e("arrow")),style:a.normalizeStyle(a.unref(o)),"data-popper-arrow":""},null,6))}});var tE=We(eE,[["__file","arrow.vue"]]);const Bu="ElOnlyChild",nE=a.defineComponent({name:Bu,setup(n,{slots:e,attrs:t}){var i;const r=a.inject(wm),s=dT((i=r==null?void 0:r.setForwardRef)!=null?i:To);return()=>{var o;const l=(o=e.default)==null?void 0:o.call(e,t);if(!l)return null;if(l.length>1)return gt(Bu,"requires exact only one valid child."),null;const u=Vm(l);return u?a.withDirectives(a.cloneVNode(u,t),[[s]]):(gt(Bu,"no valid child node found"),null)}}});function Vm(n){if(!n)return null;const e=n;for(const t of e){if(en(t))switch(t.type){case a.Comment:continue;case a.Text:case"svg":return km(t);case a.Fragment:return Vm(t.children);default:return t}return km(t)}return null}function km(n){const e=Ge("only-child");return a.createVNode("span",{class:e.e("content")},[n])}const zm=$e({virtualRef:{type:Ve(Object)},virtualTriggering:Boolean,onMouseenter:{type:Ve(Function)},onMouseleave:{type:Ve(Function)},onClick:{type:Ve(Function)},onKeydown:{type:Ve(Function)},onFocus:{type:Ve(Function)},onBlur:{type:Ve(Function)},onContextmenu:{type:Ve(Function)},id:String,open:Boolean}),iE=a.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),rE=a.defineComponent({...iE,props:zm,setup(n,{expose:e}){const t=n,{role:i,triggerRef:r}=a.inject(Nu,void 0);uT(r);const s=a.computed(()=>l.value?t.id:void 0),o=a.computed(()=>{if(i&&i.value==="tooltip")return t.open&&t.id?t.id:void 0}),l=a.computed(()=>{if(i&&i.value!=="tooltip")return i.value}),u=a.computed(()=>l.value?`${t.open}`:void 0);let c;const f=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return a.onMounted(()=>{a.watch(()=>t.virtualRef,h=>{h&&(r.value=li(h))},{immediate:!0}),a.watch(r,(h,p)=>{c==null||c(),c=void 0,Ar(h)&&(f.forEach(v=>{var m;const d=t[v];d&&(h.addEventListener(v.slice(2).toLowerCase(),d),(m=p==null?void 0:p.removeEventListener)==null||m.call(p,v.slice(2).toLowerCase(),d))}),c=a.watch([s,o,l,u],v=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((m,d)=>{jn(v[d])?h.removeAttribute(m):h.setAttribute(m,v[d])})},{immediate:!0})),Ar(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(v=>p.removeAttribute(v))},{immediate:!0})}),a.onBeforeUnmount(()=>{if(c==null||c(),c=void 0,r.value&&Ar(r.value)){const h=r.value;f.forEach(p=>{const v=t[p];v&&h.removeEventListener(p.slice(2).toLowerCase(),v)}),r.value=void 0}}),e({triggerRef:r}),(h,p)=>h.virtualTriggering?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(a.unref(nE),a.mergeProps({key:0},h.$attrs,{"aria-controls":a.unref(s),"aria-describedby":a.unref(o),"aria-expanded":a.unref(u),"aria-haspopup":a.unref(l)}),{default:a.withCtx(()=>[a.renderSlot(h.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var sE=We(rE,[["__file","trigger.vue"]]);const Du="focus-trap.focus-after-trapped",Vu="focus-trap.focus-after-released",oE="focus-trap.focusout-prevented",Um={cancelable:!0,bubbles:!1},aE={cancelable:!0,bubbles:!1},Gm="focusAfterTrapped",Hm="focusAfterReleased",lE=Symbol("elFocusTrap"),ku=a.ref(),pl=a.ref(0),zu=a.ref(0);let ml=0;const Wm=n=>{const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0||i===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e},jm=(n,e)=>{for(const t of n)if(!cE(t,e))return t},cE=(n,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},uE=n=>{const e=Wm(n),t=jm(e,n),i=jm(e.reverse(),n);return[t,i]},dE=n=>n instanceof HTMLInputElement&&"select"in n,ji=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),zu.value=window.performance.now(),n!==t&&dE(n)&&e&&n.select()}};function $m(n,e){const t=[...n],i=n.indexOf(e);return i!==-1&&t.splice(i,1),t}const hE=()=>{let n=[];return{push:i=>{const r=n[0];r&&i!==r&&r.pause(),n=$m(n,i),n.unshift(i)},remove:i=>{var r,s;n=$m(n,i),(s=(r=n[0])==null?void 0:r.resume)==null||s.call(r)}}},fE=(n,e=!1)=>{const t=document.activeElement;for(const i of n)if(ji(i,e),document.activeElement!==t)return},Zm=hE(),pE=()=>pl.value>zu.value,gl=()=>{ku.value="pointer",pl.value=window.performance.now()},Xm=()=>{ku.value="keyboard",pl.value=window.performance.now()},mE=()=>(a.onMounted(()=>{ml===0&&(document.addEventListener("mousedown",gl),document.addEventListener("touchstart",gl),document.addEventListener("keydown",Xm)),ml++}),a.onBeforeUnmount(()=>{ml--,ml<=0&&(document.removeEventListener("mousedown",gl),document.removeEventListener("touchstart",gl),document.removeEventListener("keydown",Xm))}),{focusReason:ku,lastUserFocusTimestamp:pl,lastAutomatedFocusTimestamp:zu}),vl=n=>new CustomEvent(oE,{...aE,detail:n}),gE=a.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Gm,Hm,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=a.ref();let i,r;const{focusReason:s}=mE();sT(m=>{n.trapped&&!o.paused&&e("release-requested",m)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=m=>{if(!n.loop&&!n.trapped||o.paused)return;const{key:d,altKey:b,ctrlKey:y,metaKey:g,currentTarget:w,shiftKey:A}=m,{loop:S}=n,M=d===$n.tab&&!b&&!y&&!g,F=document.activeElement;if(M&&F){const R=w,[T,P]=uE(R);if(T&&P){if(!A&&F===P){const E=vl({focusReason:s.value});e("focusout-prevented",E),E.defaultPrevented||(m.preventDefault(),S&&ji(T,!0))}else if(A&&[T,R].includes(F)){const E=vl({focusReason:s.value});e("focusout-prevented",E),E.defaultPrevented||(m.preventDefault(),S&&ji(P,!0))}}else if(F===R){const E=vl({focusReason:s.value});e("focusout-prevented",E),E.defaultPrevented||m.preventDefault()}}};a.provide(lE,{focusTrapRef:t,onKeydown:l}),a.watch(()=>n.focusTrapEl,m=>{m&&(t.value=m)},{immediate:!0}),a.watch([t],([m],[d])=>{m&&(m.addEventListener("keydown",l),m.addEventListener("focusin",f),m.addEventListener("focusout",h)),d&&(d.removeEventListener("keydown",l),d.removeEventListener("focusin",f),d.removeEventListener("focusout",h))});const u=m=>{e(Gm,m)},c=m=>e(Hm,m),f=m=>{const d=a.unref(t);if(!d)return;const b=m.target,y=m.relatedTarget,g=b&&d.contains(b);n.trapped||y&&d.contains(y)||(i=y),g&&e("focusin",m),!o.paused&&n.trapped&&(g?r=b:ji(r,!0))},h=m=>{const d=a.unref(t);if(!(o.paused||!d))if(n.trapped){const b=m.relatedTarget;!jn(b)&&!d.contains(b)&&setTimeout(()=>{if(!o.paused&&n.trapped){const y=vl({focusReason:s.value});e("focusout-prevented",y),y.defaultPrevented||ji(r,!0)}},0)}else{const b=m.target;b&&d.contains(b)||e("focusout",m)}};async function p(){await a.nextTick();const m=a.unref(t);if(m){Zm.push(o);const d=m.contains(document.activeElement)?i:document.activeElement;if(i=d,!m.contains(d)){const y=new Event(Du,Um);m.addEventListener(Du,u),m.dispatchEvent(y),y.defaultPrevented||a.nextTick(()=>{let g=n.focusStartEl;Ht(g)||(ji(g),document.activeElement!==g&&(g="first")),g==="first"&&fE(Wm(m),!0),(document.activeElement===d||g==="container")&&ji(m)})}}}function v(){const m=a.unref(t);if(m){m.removeEventListener(Du,u);const d=new CustomEvent(Vu,{...Um,detail:{focusReason:s.value}});m.addEventListener(Vu,c),m.dispatchEvent(d),!d.defaultPrevented&&(s.value=="keyboard"||!pE()||m.contains(document.activeElement))&&ji(i??document.body),m.removeEventListener(Vu,c),Zm.remove(o)}}return a.onMounted(()=>{n.trapped&&p(),a.watch(()=>n.trapped,m=>{m?p():v()})}),a.onBeforeUnmount(()=>{n.trapped&&v(),t.value&&(t.value.removeEventListener("keydown",l),t.value.removeEventListener("focusin",f),t.value.removeEventListener("focusout",h),t.value=void 0)}),{onKeydown:l}}});function vE(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var yE=We(gE,[["render",vE],["__file","focus-trap.vue"]]);const bE=["fixed","absolute"],xE=$e({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Ve(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:hs,default:"bottom"},popperOptions:{type:Ve(Object),default:()=>({})},strategy:{type:String,values:bE,default:"absolute"}}),Ym=$e({...xE,id:String,style:{type:Ve([String,Array,Object])},className:{type:Ve([String,Array,Object])},effect:{type:Ve(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:Ve([String,Array,Object])},popperStyle:{type:Ve([String,Array,Object])},referenceEl:{type:Ve(Object)},triggerTargetEl:{type:Ve(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Wi(["ariaLabel"])}),wE={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},ME=(n,e=[])=>{const{placement:t,strategy:i,popperOptions:r}=n,s={placement:t,strategy:i,...r,modifiers:[...SE(n),...e]};return _E(s,r==null?void 0:r.modifiers),s},AE=n=>{if(Rt)return li(n)};function SE(n){const{offset:e,gpuAcceleration:t,fallbackPlacements:i}=n;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:i}},{name:"computeStyles",options:{gpuAcceleration:t}}]}function _E(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const TE=0,EE=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:i,role:r}=a.inject(Nu,void 0),s=a.ref(),o=a.ref(),l=a.computed(()=>({name:"eventListeners",enabled:!!n.visible})),u=a.computed(()=>{var y;const g=a.unref(s),w=(y=a.unref(o))!=null?y:TE;return{name:"arrow",enabled:!hS(g),options:{element:g,padding:w}}}),c=a.computed(()=>({onFirstUpdate:()=>{m()},...ME(n,[a.unref(u),a.unref(l)])})),f=a.computed(()=>AE(n.referenceEl)||a.unref(i)),{attributes:h,state:p,styles:v,update:m,forceUpdate:d,instanceRef:b}=nT(f,t,c);return a.watch(b,y=>e.value=y),a.onMounted(()=>{a.watch(()=>{var y;return(y=a.unref(f))==null?void 0:y.getBoundingClientRect()},()=>{m()})}),{attributes:h,arrowRef:s,contentRef:t,instanceRef:b,state:p,styles:v,role:r,forceUpdate:d,update:m}},CE=(n,{attributes:e,styles:t,role:i})=>{const{nextZIndex:r}=Em(),s=Ge("popper"),o=a.computed(()=>a.unref(e).popper),l=a.ref(tt(n.zIndex)?n.zIndex:r()),u=a.computed(()=>[s.b(),s.is("pure",n.pure),s.is(n.effect),n.popperClass]),c=a.computed(()=>[{zIndex:a.unref(l)},a.unref(t).popper,n.popperStyle||{}]),f=a.computed(()=>i.value==="dialog"?"false":void 0),h=a.computed(()=>a.unref(t).arrow||{});return{ariaModal:f,arrowStyle:h,contentAttrs:o,contentClass:u,contentStyle:c,contentZIndex:l,updateZIndex:()=>{l.value=tt(n.zIndex)?n.zIndex:r()}}},LE=(n,e)=>{const t=a.ref(!1),i=a.ref();return{focusStartRef:i,trapped:t,onFocusAfterReleased:c=>{var f;((f=c.detail)==null?void 0:f.focusReason)!=="pointer"&&(i.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:c=>{n.visible&&!t.value&&(c.target&&(i.value=c.target),t.value=!0)},onFocusoutPrevented:c=>{n.trapping||(c.detail.focusReason==="pointer"&&c.preventDefault(),t.value=!1)},onReleaseRequested:()=>{t.value=!1,e("close")}}},RE=a.defineComponent({name:"ElPopperContent"}),FE=a.defineComponent({...RE,props:Ym,emits:wE,setup(n,{expose:e,emit:t}){const i=n,{focusStartRef:r,trapped:s,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:u,onFocusoutPrevented:c,onReleaseRequested:f}=LE(i,t),{attributes:h,arrowRef:p,contentRef:v,styles:m,instanceRef:d,role:b,update:y}=EE(i),{ariaModal:g,arrowStyle:w,contentAttrs:A,contentClass:S,contentStyle:M,updateZIndex:F}=CE(i,{styles:m,attributes:h,role:b}),R=a.inject(hl,void 0),T=a.ref();a.provide(Nm,{arrowStyle:w,arrowRef:p,arrowOffset:T}),R&&a.provide(hl,{...R,addInputId:To,removeInputId:To});let P;const _=(C=!0)=>{y(),C&&F()},E=()=>{_(!1),i.visible&&i.focusOnShow?s.value=!0:i.visible===!1&&(s.value=!1)};return a.onMounted(()=>{a.watch(()=>i.triggerTargetEl,(C,L)=>{P==null||P(),P=void 0;const I=a.unref(C||v.value),x=a.unref(L||v.value);Ar(I)&&(P=a.watch([b,()=>i.ariaLabel,g,()=>i.id],O=>{["role","aria-label","aria-modal","id"].forEach((B,D)=>{jn(O[D])?I.removeAttribute(B):I.setAttribute(B,O[D])})},{immediate:!0})),x!==I&&Ar(x)&&["role","aria-label","aria-modal","id"].forEach(O=>{x.removeAttribute(O)})},{immediate:!0}),a.watch(()=>i.visible,E,{immediate:!0})}),a.onBeforeUnmount(()=>{P==null||P(),P=void 0}),e({popperContentRef:v,popperInstanceRef:d,updatePopper:_,contentStyle:M}),(C,L)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps({ref_key:"contentRef",ref:v},a.unref(A),{style:a.unref(M),class:a.unref(S),tabindex:"-1",onMouseenter:I=>C.$emit("mouseenter",I),onMouseleave:I=>C.$emit("mouseleave",I)}),[a.createVNode(a.unref(yE),{trapped:a.unref(s),"trap-on-focus-in":!0,"focus-trap-el":a.unref(v),"focus-start-el":a.unref(r),onFocusAfterTrapped:a.unref(l),onFocusAfterReleased:a.unref(o),onFocusin:a.unref(u),onFocusoutPrevented:a.unref(c),onReleaseRequested:a.unref(f)},{default:a.withCtx(()=>[a.renderSlot(C.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var PE=We(FE,[["__file","content.vue"]]);const IE=Nt(qT),Uu=Symbol("elTooltip"),un=$e({...lT,...Ym,appendTo:{type:Ve([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Ve(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Wi(["ariaLabel"])}),Ho=$e({...zm,disabled:Boolean,trigger:{type:Ve([String,Array]),default:"hover"},triggerKeys:{type:Ve(Array),default:()=>[$n.enter,$n.space]}}),{useModelToggleProps:OE,useModelToggleEmits:NE,useModelToggle:BE}=QS("visible"),DE=$e({...Bm,...OE,...un,...Ho,...Dm,showArrow:{type:Boolean,default:!0}}),VE=[...NE,"before-show","before-hide","show","hide","open","close"],kE=(n,e)=>sn(n)?n.includes(e):n===e,xs=(n,e,t)=>i=>{kE(a.unref(n),e)&&t(i)},zE=a.defineComponent({name:"ElTooltipTrigger"}),UE=a.defineComponent({...zE,props:Ho,setup(n,{expose:e}){const t=n,i=Ge("tooltip"),{controlled:r,id:s,open:o,onOpen:l,onClose:u,onToggle:c}=a.inject(Uu,void 0),f=a.ref(null),h=()=>{if(a.unref(r)||t.disabled)return!0},p=a.toRef(t,"trigger"),v=ai(h,xs(p,"hover",l)),m=ai(h,xs(p,"hover",u)),d=ai(h,xs(p,"click",A=>{A.button===0&&c(A)})),b=ai(h,xs(p,"focus",l)),y=ai(h,xs(p,"focus",u)),g=ai(h,xs(p,"contextmenu",A=>{A.preventDefault(),c(A)})),w=ai(h,A=>{const{code:S}=A;t.triggerKeys.includes(S)&&(A.preventDefault(),c(A))});return e({triggerRef:f}),(A,S)=>(a.openBlock(),a.createBlock(a.unref(sE),{id:a.unref(s),"virtual-ref":A.virtualRef,open:a.unref(o),"virtual-triggering":A.virtualTriggering,class:a.normalizeClass(a.unref(i).e("trigger")),onBlur:a.unref(y),onClick:a.unref(d),onContextmenu:a.unref(g),onFocus:a.unref(b),onMouseenter:a.unref(v),onMouseleave:a.unref(m),onKeydown:a.unref(w)},{default:a.withCtx(()=>[a.renderSlot(A.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var GE=We(UE,[["__file","trigger.vue"]]);const HE=$e({to:{type:Ve([String,Object]),required:!0},disabled:Boolean});var WE=We(a.defineComponent({__name:"teleport",props:HE,setup(n){return(e,t)=>e.disabled?a.renderSlot(e.$slots,"default",{key:0}):(a.openBlock(),a.createBlock(a.Teleport,{key:1,to:e.to},[a.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const jE=Nt(WE),$E=a.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),ZE=a.defineComponent({...$E,props:un,setup(n,{expose:e}){const t=n,{selector:i}=xm(),r=Ge("tooltip"),s=a.ref(null);let o;const{controlled:l,id:u,open:c,trigger:f,onClose:h,onOpen:p,onShow:v,onHide:m,onBeforeShow:d,onBeforeHide:b}=a.inject(Uu,void 0),y=a.computed(()=>t.transition||`${r.namespace.value}-fade-in-linear`),g=a.computed(()=>process.env.NODE_ENV==="test"?!0:t.persistent);a.onBeforeUnmount(()=>{o==null||o()});const w=a.computed(()=>a.unref(g)?!0:a.unref(c)),A=a.computed(()=>t.disabled?!1:a.unref(c)),S=a.computed(()=>t.appendTo||i.value),M=a.computed(()=>{var x;return(x=t.style)!=null?x:{}}),F=a.ref(!0),R=()=>{m(),F.value=!0},T=()=>{if(a.unref(l))return!0},P=ai(T,()=>{t.enterable&&a.unref(f)==="hover"&&p()}),_=ai(T,()=>{a.unref(f)==="hover"&&h()}),E=()=>{var x,O;(O=(x=s.value)==null?void 0:x.updatePopper)==null||O.call(x),d==null||d()},C=()=>{b==null||b()},L=()=>{v(),o=iw(a.computed(()=>{var x;return(x=s.value)==null?void 0:x.popperContentRef}),()=>{if(a.unref(l))return;a.unref(f)!=="hover"&&h()})},I=()=>{t.virtualTriggering||h()};return a.watch(()=>a.unref(c),x=>{x?F.value=!1:o==null||o()},{flush:"post"}),a.watch(()=>t.content,()=>{var x,O;(O=(x=s.value)==null?void 0:x.updatePopper)==null||O.call(x)}),e({contentRef:s}),(x,O)=>(a.openBlock(),a.createBlock(a.unref(jE),{disabled:!x.teleported,to:a.unref(S)},{default:a.withCtx(()=>[a.createVNode(a.Transition,{name:a.unref(y),onAfterLeave:R,onBeforeEnter:E,onAfterEnter:L,onBeforeLeave:C},{default:a.withCtx(()=>[a.unref(w)?a.withDirectives((a.openBlock(),a.createBlock(a.unref(PE),a.mergeProps({key:0,id:a.unref(u),ref_key:"contentRef",ref:s},x.$attrs,{"aria-label":x.ariaLabel,"aria-hidden":F.value,"boundaries-padding":x.boundariesPadding,"fallback-placements":x.fallbackPlacements,"gpu-acceleration":x.gpuAcceleration,offset:x.offset,placement:x.placement,"popper-options":x.popperOptions,strategy:x.strategy,effect:x.effect,enterable:x.enterable,pure:x.pure,"popper-class":x.popperClass,"popper-style":[x.popperStyle,a.unref(M)],"reference-el":x.referenceEl,"trigger-target-el":x.triggerTargetEl,visible:a.unref(A),"z-index":x.zIndex,onMouseenter:a.unref(P),onMouseleave:a.unref(_),onBlur:I,onClose:a.unref(h)}),{default:a.withCtx(()=>[a.renderSlot(x.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[a.vShow,a.unref(A)]]):a.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var XE=We(ZE,[["__file","content.vue"]]);const YE=a.defineComponent({name:"ElTooltip"}),JE=a.defineComponent({...YE,props:DE,emits:VE,setup(n,{expose:e,emit:t}){const i=n;aT();const r=Uo(),s=a.ref(),o=a.ref(),l=()=>{var y;const g=a.unref(s);g&&((y=g.popperInstanceRef)==null||y.update())},u=a.ref(!1),c=a.ref(),{show:f,hide:h,hasUpdateHandler:p}=BE({indicator:u,toggleReason:c}),{onOpen:v,onClose:m}=cT({showAfter:a.toRef(i,"showAfter"),hideAfter:a.toRef(i,"hideAfter"),autoClose:a.toRef(i,"autoClose"),open:f,close:h}),d=a.computed(()=>Po(i.visible)&&!p.value);a.provide(Uu,{controlled:d,id:r,open:a.readonly(u),trigger:a.toRef(i,"trigger"),onOpen:y=>{v(y)},onClose:y=>{m(y)},onToggle:y=>{a.unref(u)?m(y):v(y)},onShow:()=>{t("show",c.value)},onHide:()=>{t("hide",c.value)},onBeforeShow:()=>{t("before-show",c.value)},onBeforeHide:()=>{t("before-hide",c.value)},updatePopper:l}),a.watch(()=>i.disabled,y=>{y&&u.value&&(u.value=!1)});const b=y=>{var g,w;const A=(w=(g=o.value)==null?void 0:g.contentRef)==null?void 0:w.popperContentRef,S=(y==null?void 0:y.relatedTarget)||document.activeElement;return A&&A.contains(S)};return a.onDeactivated(()=>u.value&&h()),e({popperRef:s,contentRef:o,isFocusInsideContent:b,updatePopper:l,onOpen:v,onClose:m,hide:h}),(y,g)=>(a.openBlock(),a.createBlock(a.unref(IE),{ref_key:"popperRef",ref:s,role:y.role},{default:a.withCtx(()=>[a.createVNode(GE,{disabled:y.disabled,trigger:y.trigger,"trigger-keys":y.triggerKeys,"virtual-ref":y.virtualRef,"virtual-triggering":y.virtualTriggering},{default:a.withCtx(()=>[y.$slots.default?a.renderSlot(y.$slots,"default",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),a.createVNode(XE,{ref_key:"contentRef",ref:o,"aria-label":y.ariaLabel,"boundaries-padding":y.boundariesPadding,content:y.content,disabled:y.disabled,effect:y.effect,enterable:y.enterable,"fallback-placements":y.fallbackPlacements,"hide-after":y.hideAfter,"gpu-acceleration":y.gpuAcceleration,offset:y.offset,persistent:y.persistent,"popper-class":y.popperClass,"popper-style":y.popperStyle,placement:y.placement,"popper-options":y.popperOptions,pure:y.pure,"raw-content":y.rawContent,"reference-el":y.referenceEl,"trigger-target-el":y.triggerTargetEl,"show-after":y.showAfter,strategy:y.strategy,teleported:y.teleported,transition:y.transition,"virtual-triggering":y.virtualTriggering,"z-index":y.zIndex,"append-to":y.appendTo},{default:a.withCtx(()=>[a.renderSlot(y.$slots,"content",{},()=>[y.rawContent?(a.openBlock(),a.createElementBlock("span",{key:0,innerHTML:y.content},null,8,["innerHTML"])):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(y.content),1))]),y.showArrow?(a.openBlock(),a.createBlock(a.unref(tE),{key:0,"arrow-offset":y.arrowOffset},null,8,["arrow-offset"])):a.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var KE=We(JE,[["__file","tooltip.vue"]]);const Gu=Nt(KE),Jm=Symbol("buttonGroupContextKey"),qE=(n,e)=>{Zp({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},a.computed(()=>n.type==="text"));const t=a.inject(Jm,void 0),i=Fu("button"),{form:r}=ys(),s=Er(a.computed(()=>t==null?void 0:t.size)),o=Go(),l=a.ref(),u=a.useSlots(),c=a.computed(()=>n.type||(t==null?void 0:t.type)||""),f=a.computed(()=>{var m,d,b;return(b=(d=n.autoInsertSpace)!=null?d:(m=i.value)==null?void 0:m.autoInsertSpace)!=null?b:!1}),h=a.computed(()=>n.tag==="button"?{ariaDisabled:o.value||n.loading,disabled:o.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),p=a.computed(()=>{var m;const d=(m=u.default)==null?void 0:m.call(u);if(f.value&&(d==null?void 0:d.length)===1){const b=d[0];if((b==null?void 0:b.type)===a.Text){const y=b.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(y.trim())}}return!1});return{_disabled:o,_size:s,_type:c,_ref:l,_props:h,shouldAddSpace:p,handleClick:m=>{if(o.value||n.loading){m.stopPropagation();return}n.nativeType==="reset"&&(r==null||r.resetFields()),e("click",m)}}},Hu=$e({size:Hi,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Ui},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Ui,default:()=>Gp},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:Ve([String,Object]),default:"button"}}),QE={click:n=>n instanceof MouseEvent};function Wt(n,e){eC(n)&&(n="100%");var t=tC(n);return n=e===360?n:Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(String(n*e),10)/100),Math.abs(n-e)<1e-6?1:(e===360?n=(n<0?n%e+e:n%e)/parseFloat(String(e)):n=n%e/parseFloat(String(e)),n)}function yl(n){return Math.min(1,Math.max(0,n))}function eC(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function tC(n){return typeof n=="string"&&n.indexOf("%")!==-1}function Km(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function bl(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Cr(n){return n.length===1?"0"+n:String(n)}function nC(n,e,t){return{r:Wt(n,255)*255,g:Wt(e,255)*255,b:Wt(t,255)*255}}function qm(n,e,t){n=Wt(n,255),e=Wt(e,255),t=Wt(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=0,l=(i+r)/2;if(i===r)o=0,s=0;else{var u=i-r;switch(o=l>.5?u/(2-i-r):u/(i+r),i){case n:s=(e-t)/u+(e<t?6:0);break;case e:s=(t-n)/u+2;break;case t:s=(n-e)/u+4;break}s/=6}return{h:s,s:o,l}}function Wu(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 iC(n,e,t){var i,r,s;if(n=Wt(n,360),e=Wt(e,100),t=Wt(t,100),e===0)r=t,s=t,i=t;else{var o=t<.5?t*(1+e):t+e-t*e,l=2*t-o;i=Wu(l,o,n+1/3),r=Wu(l,o,n),s=Wu(l,o,n-1/3)}return{r:i*255,g:r*255,b:s*255}}function Qm(n,e,t){n=Wt(n,255),e=Wt(e,255),t=Wt(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=i,l=i-r,u=i===0?0:l/i;if(i===r)s=0;else{switch(i){case n:s=(e-t)/l+(e<t?6:0);break;case e:s=(t-n)/l+2;break;case t:s=(n-e)/l+4;break}s/=6}return{h:s,s:u,v:o}}function rC(n,e,t){n=Wt(n,360)*6,e=Wt(e,100),t=Wt(t,100);var i=Math.floor(n),r=n-i,s=t*(1-e),o=t*(1-r*e),l=t*(1-(1-r)*e),u=i%6,c=[t,o,s,s,l,t][u],f=[l,t,t,o,s,s][u],h=[s,s,l,t,t,o][u];return{r:c*255,g:f*255,b:h*255}}function eg(n,e,t,i){var r=[Cr(Math.round(n).toString(16)),Cr(Math.round(e).toString(16)),Cr(Math.round(t).toString(16))];return i&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function sC(n,e,t,i,r){var s=[Cr(Math.round(n).toString(16)),Cr(Math.round(e).toString(16)),Cr(Math.round(t).toString(16)),Cr(oC(i))];return r&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function oC(n){return Math.round(parseFloat(n)*255).toString(16)}function tg(n){return dn(n)/255}function dn(n){return parseInt(n,16)}function aC(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var ju={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function lC(n){var e={r:0,g:0,b:0},t=1,i=null,r=null,s=null,o=!1,l=!1;return typeof n=="string"&&(n=dC(n)),typeof n=="object"&&(gi(n.r)&&gi(n.g)&&gi(n.b)?(e=nC(n.r,n.g,n.b),o=!0,l=String(n.r).substr(-1)==="%"?"prgb":"rgb"):gi(n.h)&&gi(n.s)&&gi(n.v)?(i=bl(n.s),r=bl(n.v),e=rC(n.h,i,r),o=!0,l="hsv"):gi(n.h)&&gi(n.s)&&gi(n.l)&&(i=bl(n.s),s=bl(n.l),e=iC(n.h,i,s),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=Km(t),{ok:o,format:n.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var cC="[-\\+]?\\d+%?",uC="[-\\+]?\\d*\\.\\d+%?",$i="(?:".concat(uC,")|(?:").concat(cC,")"),$u="[\\s|\\(]+(".concat($i,")[,|\\s]+(").concat($i,")[,|\\s]+(").concat($i,")\\s*\\)?"),Zu="[\\s|\\(]+(".concat($i,")[,|\\s]+(").concat($i,")[,|\\s]+(").concat($i,")[,|\\s]+(").concat($i,")\\s*\\)?"),Rn={CSS_UNIT:new RegExp($i),rgb:new RegExp("rgb"+$u),rgba:new RegExp("rgba"+Zu),hsl:new RegExp("hsl"+$u),hsla:new RegExp("hsla"+Zu),hsv:new RegExp("hsv"+$u),hsva:new RegExp("hsva"+Zu),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function dC(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(ju[n])n=ju[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Rn.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=Rn.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Rn.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=Rn.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Rn.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=Rn.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Rn.hex8.exec(n),t?{r:dn(t[1]),g:dn(t[2]),b:dn(t[3]),a:tg(t[4]),format:e?"name":"hex8"}:(t=Rn.hex6.exec(n),t?{r:dn(t[1]),g:dn(t[2]),b:dn(t[3]),format:e?"name":"hex"}:(t=Rn.hex4.exec(n),t?{r:dn(t[1]+t[1]),g:dn(t[2]+t[2]),b:dn(t[3]+t[3]),a:tg(t[4]+t[4]),format:e?"name":"hex8"}:(t=Rn.hex3.exec(n),t?{r:dn(t[1]+t[1]),g:dn(t[2]+t[2]),b:dn(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function gi(n){return!!Rn.CSS_UNIT.exec(String(n))}var hC=function(){function n(e,t){e===void 0&&(e=""),t===void 0&&(t={});var i;if(e instanceof n)return e;typeof e=="number"&&(e=aC(e)),this.originalInput=e;var r=lC(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(i=t.format)!==null&&i!==void 0?i:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return n.prototype.isDark=function(){return this.getBrightness()<128},n.prototype.isLight=function(){return!this.isDark()},n.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},n.prototype.getLuminance=function(){var e=this.toRgb(),t,i,r,s=e.r/255,o=e.g/255,l=e.b/255;return s<=.03928?t=s/12.92:t=Math.pow((s+.055)/1.055,2.4),o<=.03928?i=o/12.92:i=Math.pow((o+.055)/1.055,2.4),l<=.03928?r=l/12.92:r=Math.pow((l+.055)/1.055,2.4),.2126*t+.7152*i+.0722*r},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(e){return this.a=Km(e),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},n.prototype.toHsv=function(){var e=Qm(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},n.prototype.toHsvString=function(){var e=Qm(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var e=qm(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},n.prototype.toHslString=function(){var e=qm(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(e){return e===void 0&&(e=!1),eg(this.r,this.g,this.b,e)},n.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},n.prototype.toHex8=function(e){return e===void 0&&(e=!1),sC(this.r,this.g,this.b,this.a,e)},n.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},n.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},n.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},n.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),i=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(i,")"):"rgba(".concat(e,", ").concat(t,", ").concat(i,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(Wt(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(Wt(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+eg(this.r,this.g,this.b,!1),t=0,i=Object.entries(ju);t<i.length;t++){var r=i[t],s=r[0],o=r[1];if(e===o)return s}return!1},n.prototype.toString=function(e){var t=!!e;e=e??this.format;var i=!1,r=this.a<1&&this.a>=0,s=!t&&r&&(e.startsWith("hex")||e==="name");return s?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},n.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},n.prototype.clone=function(){return new n(this.toString())},n.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=yl(t.l),new n(t)},n.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new n(t)},n.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=yl(t.l),new n(t)},n.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},n.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},n.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=yl(t.s),new n(t)},n.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=yl(t.s),new n(t)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(e){var t=this.toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,new n(t)},n.prototype.mix=function(e,t){t===void 0&&(t=50);var i=this.toRgb(),r=new n(e).toRgb(),s=t/100,o={r:(r.r-i.r)*s+i.r,g:(r.g-i.g)*s+i.g,b:(r.b-i.b)*s+i.b,a:(r.a-i.a)*s+i.a};return new n(o)},n.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var i=this.toHsl(),r=360/t,s=[this];for(i.h=(i.h-(r*e>>1)+720)%360;--e;)i.h=(i.h+r)%360,s.push(new n(i));return s},n.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new n(e)},n.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),i=t.h,r=t.s,s=t.v,o=[],l=1/e;e--;)o.push(new n({h:i,s:r,v:s})),s=(s+l)%1;return o},n.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new n({h:(t+72)%360,s:e.s,l:e.l}),new n({h:(t+216)%360,s:e.s,l:e.l})]},n.prototype.onBackground=function(e){var t=this.toRgb(),i=new n(e).toRgb(),r=t.a+i.a*(1-t.a);return new n({r:(t.r*t.a+i.r*i.a*(1-t.a))/r,g:(t.g*t.a+i.g*i.a*(1-t.a))/r,b:(t.b*t.a+i.b*i.a*(1-t.a))/r,a:r})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(e){for(var t=this.toHsl(),i=t.h,r=[this],s=360/e,o=1;o<e;o++)r.push(new n({h:(i+o*s)%360,s:t.s,l:t.l}));return r},n.prototype.equals=function(e){return this.toRgbString()===new n(e).toRgbString()},n}();function Zi(n,e=20){return n.mix("#141414",e).toString()}function fC(n){const e=Go(),t=Ge("button");return a.computed(()=>{let i={},r=n.color;if(r){const s=r.match(/var\((.*?)\)/);s&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1]));const o=new hC(r),l=n.dark?o.tint(20).toString():Zi(o,20);if(n.plain)i=t.cssVarBlock({"bg-color":n.dark?Zi(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?Zi(o,50):o.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":l,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(i[t.cssVarBlockName("disabled-bg-color")]=n.dark?Zi(o,90):o.tint(90).toString(),i[t.cssVarBlockName("disabled-text-color")]=n.dark?Zi(o,50):o.tint(50).toString(),i[t.cssVarBlockName("disabled-border-color")]=n.dark?Zi(o,80):o.tint(80).toString());else{const u=n.dark?Zi(o,30):o.tint(30).toString(),c=o.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(i=t.cssVarBlock({"bg-color":r,"text-color":c,"border-color":r,"hover-bg-color":u,"hover-text-color":c,"hover-border-color":u,"active-bg-color":l,"active-border-color":l}),e.value){const f=n.dark?Zi(o,50):o.tint(50).toString();i[t.cssVarBlockName("disabled-bg-color")]=f,i[t.cssVarBlockName("disabled-text-color")]=n.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,i[t.cssVarBlockName("disabled-border-color")]=f}}}return i})}const pC=a.defineComponent({name:"ElButton"}),mC=a.defineComponent({...pC,props:Hu,emits:QE,setup(n,{expose:e,emit:t}){const i=n,r=fC(i),s=Ge("button"),{_ref:o,_size:l,_type:u,_disabled:c,_props:f,shouldAddSpace:h,handleClick:p}=qE(i,t),v=a.computed(()=>[s.b(),s.m(u.value),s.m(l.value),s.is("disabled",c.value),s.is("loading",i.loading),s.is("plain",i.plain),s.is("round",i.round),s.is("circle",i.circle),s.is("text",i.text),s.is("link",i.link),s.is("has-bg",i.bg)]);return e({ref:o,size:l,type:u,disabled:c,shouldAddSpace:h}),(m,d)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.tag),a.mergeProps({ref_key:"_ref",ref:o},a.unref(f),{class:a.unref(v),style:a.unref(r),onClick:a.unref(p)}),{default:a.withCtx(()=>[m.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[m.$slots.loading?a.renderSlot(m.$slots,"loading",{key:0}):(a.openBlock(),a.createBlock(a.unref(ht),{key:1,class:a.normalizeClass(a.unref(s).is("loading"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.loadingIcon)))]),_:1},8,["class"]))],64)):m.icon||m.$slots.icon?(a.openBlock(),a.createBlock(a.unref(ht),{key:1},{default:a.withCtx(()=>[m.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.icon),{key:0})):a.renderSlot(m.$slots,"icon",{key:1})]),_:3})):a.createCommentVNode("v-if",!0),m.$slots.default?(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass({[a.unref(s).em("text","expand")]:a.unref(h)})},[a.renderSlot(m.$slots,"default")],2)):a.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var gC=We(mC,[["__file","button.vue"]]);const vC={size:Hu.size,type:Hu.type},yC=a.defineComponent({name:"ElButtonGroup"}),bC=a.defineComponent({...yC,props:vC,setup(n){const e=n;a.provide(Jm,a.reactive({size:a.toRef(e,"size"),type:a.toRef(e,"type")}));const t=Ge("button");return(i,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(t).b("group"))},[a.renderSlot(i.$slots,"default")],2))}});var ng=We(bC,[["__file","button-group.vue"]]);const ws=Nt(gC,{ButtonGroup:ng});En(ng);var Xi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function xl(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}const Yi=new Map;if(Rt){let n;document.addEventListener("mousedown",e=>n=e),document.addEventListener("mouseup",e=>{if(n){for(const t of Yi.values())for(const{documentHandler:i}of t)i(e,n);n=void 0}})}function ig(n,e){let t=[];return Array.isArray(e.arg)?t=e.arg:Ar(e.arg)&&t.push(e.arg),function(i,r){const s=e.instance.popperRef,o=i.target,l=r==null?void 0:r.target,u=!e||!e.instance,c=!o||!l,f=n.contains(o)||n.contains(l),h=n===o,p=t.length&&t.some(m=>m==null?void 0:m.contains(o))||t.length&&t.includes(l),v=s&&(s.contains(o)||s.contains(l));u||c||f||h||p||v||e.value(i,r)}}const wC={beforeMount(n,e){Yi.has(n)||Yi.set(n,[]),Yi.get(n).push({documentHandler:ig(n,e),bindingFn:e.value})},updated(n,e){Yi.has(n)||Yi.set(n,[]);const t=Yi.get(n),i=t.findIndex(s=>s.bindingFn===e.oldValue),r={documentHandler:ig(n,e),bindingFn:e.value};i>=0?t.splice(i,1,r):t.push(r)},unmounted(n){Yi.delete(n)}},MC=100,AC=600,rg={beforeMount(n,e){const t=e.value,{interval:i=MC,delay:r=AC}=Jt(t)?{}:t;let s,o;const l=()=>Jt(t)?t():t.handler(),u=()=>{o&&(clearTimeout(o),o=void 0),s&&(clearInterval(s),s=void 0)};n.addEventListener("mousedown",c=>{c.button===0&&(u(),l(),document.addEventListener("mouseup",()=>u(),{once:!0}),o=setTimeout(()=>{s=setInterval(()=>{l()},i)},r))})}},sg=$e({modelValue:{type:[String,Number,Boolean],default:void 0},size:Hi,disabled:Boolean,label:{type:[String,Number,Boolean],default:void 0},value:{type:[String,Number,Boolean],default:void 0},name:{type:String,default:void 0}}),SC=$e({...sg,border:Boolean}),og={[ot]:n=>Ht(n)||tt(n)||Po(n),[fi]:n=>Ht(n)||tt(n)||Po(n)},ag=Symbol("radioGroupKey"),lg=(n,e)=>{const t=a.ref(),i=a.inject(ag,void 0),r=a.computed(()=>!!i),s=a.computed(()=>Dp(n.value)?n.label:n.value),o=a.computed({get(){return r.value?i.modelValue:n.modelValue},set(h){r.value?i.changeEvent(h):e&&e(ot,h),t.value.checked=n.modelValue===s.value}}),l=Er(a.computed(()=>i==null?void 0:i.size)),u=Go(a.computed(()=>i==null?void 0:i.disabled)),c=a.ref(!1),f=a.computed(()=>u.value||r.value&&o.value!==s.value?-1:0);return Zp({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-radio",ref:"https://element-plus.org/en-US/component/radio.html"},a.computed(()=>r.value&&Dp(n.value))),{radioRef:t,isGroup:r,radioGroup:i,focus:c,size:l,disabled:u,tabIndex:f,modelValue:o,actualValue:s}},_C=a.defineComponent({name:"ElRadio"}),TC=a.defineComponent({..._C,props:SC,emits:og,setup(n,{emit:e}){const t=n,i=Ge("radio"),{radioRef:r,radioGroup:s,focus:o,size:l,disabled:u,modelValue:c,actualValue:f}=lg(t,e);function h(){a.nextTick(()=>e("change",c.value))}return(p,v)=>{var m;return a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass([a.unref(i).b(),a.unref(i).is("disabled",a.unref(u)),a.unref(i).is("focus",a.unref(o)),a.unref(i).is("bordered",p.border),a.unref(i).is("checked",a.unref(c)===a.unref(f)),a.unref(i).m(a.unref(l))])},[a.createElementVNode("span",{class:a.normalizeClass([a.unref(i).e("input"),a.unref(i).is("disabled",a.unref(u)),a.unref(i).is("checked",a.unref(c)===a.unref(f))])},[a.withDirectives(a.createElementVNode("input",{ref_key:"radioRef",ref:r,"onUpdate:modelValue":d=>a.isRef(c)?c.value=d:null,class:a.normalizeClass(a.unref(i).e("original")),value:a.unref(f),name:p.name||((m=a.unref(s))==null?void 0:m.name),disabled:a.unref(u),checked:a.unref(c)===a.unref(f),type:"radio",onFocus:d=>o.value=!0,onBlur:d=>o.value=!1,onChange:h,onClick:a.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","checked","onFocus","onBlur","onClick"]),[[a.vModelRadio,a.unref(c)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(i).e("inner"))},null,2)],2),a.createElementVNode("span",{class:a.normalizeClass(a.unref(i).e("label")),onKeydown:a.withModifiers(()=>{},["stop"])},[a.renderSlot(p.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(p.label),1)])],42,["onKeydown"])],2)}}});var EC=We(TC,[["__file","radio.vue"]]);const CC=$e({...sg}),LC=a.defineComponent({name:"ElRadioButton"}),RC=a.defineComponent({...LC,props:CC,setup(n){const e=n,t=Ge("radio"),{radioRef:i,focus:r,size:s,disabled:o,modelValue:l,radioGroup:u,actualValue:c}=lg(e),f=a.computed(()=>({backgroundColor:(u==null?void 0:u.fill)||"",borderColor:(u==null?void 0:u.fill)||"",boxShadow:u!=null&&u.fill?`-1px 0 0 0 ${u.fill}`:"",color:(u==null?void 0:u.textColor)||""}));return(h,p)=>{var v;return a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass([a.unref(t).b("button"),a.unref(t).is("active",a.unref(l)===a.unref(c)),a.unref(t).is("disabled",a.unref(o)),a.unref(t).is("focus",a.unref(r)),a.unref(t).bm("button",a.unref(s))])},[a.withDirectives(a.createElementVNode("input",{ref_key:"radioRef",ref:i,"onUpdate:modelValue":m=>a.isRef(l)?l.value=m:null,class:a.normalizeClass(a.unref(t).be("button","original-radio")),value:a.unref(c),type:"radio",name:h.name||((v=a.unref(u))==null?void 0:v.name),disabled:a.unref(o),onFocus:m=>r.value=!0,onBlur:m=>r.value=!1,onClick:a.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","onFocus","onBlur","onClick"]),[[a.vModelRadio,a.unref(l)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(t).be("button","inner")),style:a.normalizeStyle(a.unref(l)===a.unref(c)?a.unref(f):{}),onKeydown:a.withModifiers(()=>{},["stop"])},[a.renderSlot(h.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(h.label),1)])],46,["onKeydown"])],2)}}});var cg=We(RC,[["__file","radio-button.vue"]]);const FC=$e({id:{type:String,default:void 0},size:Hi,disabled:Boolean,modelValue:{type:[String,Number,Boolean],default:void 0},fill:{type:String,default:""},textColor:{type:String,default:""},name:{type:String,default:void 0},validateEvent:{type:Boolean,default:!0},...Wi(["ariaLabel"])}),PC=og,IC=a.defineComponent({name:"ElRadioGroup"}),OC=a.defineComponent({...IC,props:FC,emits:PC,setup(n,{emit:e}){const t=n,i=Ge("radio"),r=Uo(),s=a.ref(),{formItem:o}=ys(),{inputId:l,isLabeledByFormItem:u}=fl(t,{formItemContext:o}),c=h=>{e(ot,h),a.nextTick(()=>e("change",h))};a.onMounted(()=>{const h=s.value.querySelectorAll("[type=radio]"),p=h[0];!Array.from(h).some(v=>v.checked)&&p&&(p.tabIndex=0)});const f=a.computed(()=>t.name||r.value);return a.provide(ag,a.reactive({...a.toRefs(t),changeEvent:c,name:f})),a.watch(()=>t.modelValue,()=>{t.validateEvent&&(o==null||o.validate("change").catch(h=>gt(h)))}),(h,p)=>(a.openBlock(),a.createElementBlock("div",{id:a.unref(l),ref_key:"radioGroupRef",ref:s,class:a.normalizeClass(a.unref(i).b("group")),role:"radiogroup","aria-label":a.unref(u)?void 0:h.ariaLabel||"radio-group","aria-labelledby":a.unref(u)?a.unref(o).labelId:void 0},[a.renderSlot(h.$slots,"default")],10,["id","aria-label","aria-labelledby"]))}});var ug=We(OC,[["__file","radio-group.vue"]]);const dg=Nt(EC,{RadioButton:cg,RadioGroup:ug}),hg=En(ug);En(cg);const Xu=$e({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:$p},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),NC={close:n=>n instanceof MouseEvent,click:n=>n instanceof MouseEvent},BC=a.defineComponent({name:"ElTag"}),DC=a.defineComponent({...BC,props:Xu,emits:NC,setup(n,{emit:e}){const t=n,i=Er(),r=Ge("tag"),s=a.computed(()=>{const{type:c,hit:f,effect:h,closable:p,round:v}=t;return[r.b(),r.is("closable",p),r.m(c||"primary"),r.m(i.value),r.m(h),r.is("hit",f),r.is("round",v)]}),o=c=>{e("close",c)},l=c=>{e("click",c)},u=c=>{c.component.subTree.component.bum=null};return(c,f)=>c.disableTransitions?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(ht),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(yu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)):(a.openBlock(),a.createBlock(a.Transition,{key:1,name:`${a.unref(r).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:u},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(ht),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(yu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var VC=We(DC,[["__file","tag.vue"]]);const kC=Nt(VC),fg=Symbol("rowContextKey"),zC=$e({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),UC=a.defineComponent({name:"ElRow"}),GC=a.defineComponent({...UC,props:zC,setup(n){const e=n,t=Ge("row"),i=a.computed(()=>e.gutter);a.provide(fg,{gutter:i});const r=a.computed(()=>{const o={};return e.gutter&&(o.marginRight=o.marginLeft=`-${e.gutter/2}px`),o}),s=a.computed(()=>[t.b(),t.is(`justify-${e.justify}`,e.justify!=="start"),t.is(`align-${e.align}`,!!e.align)]);return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var HC=We(GC,[["__file","row.vue"]]);const Yn=Nt(HC),WC=$e({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:Ve([Number,Object]),default:()=>pi({})},sm:{type:Ve([Number,Object]),default:()=>pi({})},md:{type:Ve([Number,Object]),default:()=>pi({})},lg:{type:Ve([Number,Object]),default:()=>pi({})},xl:{type:Ve([Number,Object]),default:()=>pi({})}}),jC=a.defineComponent({name:"ElCol"}),$C=a.defineComponent({...jC,props:WC,setup(n){const e=n,{gutter:t}=a.inject(fg,{gutter:a.computed(()=>0)}),i=Ge("col"),r=a.computed(()=>{const o={};return t.value&&(o.paddingLeft=o.paddingRight=`${t.value/2}px`),o}),s=a.computed(()=>{const o=[];return["span","offset","pull","push"].forEach(c=>{const f=e[c];tt(f)&&(c==="span"?o.push(i.b(`${e[c]}`)):f>0&&o.push(i.b(`${c}-${e[c]}`)))}),["xs","sm","md","lg","xl"].forEach(c=>{tt(e[c])?o.push(i.b(`${c}-${e[c]}`)):en(e[c])&&Object.entries(e[c]).forEach(([f,h])=>{o.push(f!=="span"?i.b(`${c}-${f}-${h}`):i.b(`${c}-${h}`))})}),t.value&&o.push(i.is("guttered")),[i.b(),o]});return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var ZC=We($C,[["__file","col.vue"]]);const Fn=Nt(ZC),pg=n=>tt(n)||Ht(n)||sn(n),XC=$e({accordion:Boolean,modelValue:{type:Ve([Array,String,Number]),default:()=>pi([])}}),YC={[ot]:pg,[fi]:pg},mg=Symbol("collapseContextKey"),JC=(n,e)=>{const t=a.ref(Wn(n.modelValue)),i=s=>{t.value=s;const o=n.accordion?t.value[0]:t.value;e(ot,o),e(fi,o)},r=s=>{if(n.accordion)i([t.value[0]===s?"":s]);else{const o=[...t.value],l=o.indexOf(s);l>-1?o.splice(l,1):o.push(s),i(o)}};return a.watch(()=>n.modelValue,()=>t.value=Wn(n.modelValue),{deep:!0}),a.provide(mg,{activeNames:t,handleItemClick:r}),{activeNames:t,setActiveNames:i}},KC=()=>{const n=Ge("collapse");return{rootKls:a.computed(()=>n.b())}},qC=a.defineComponent({name:"ElCollapse"}),QC=a.defineComponent({...qC,props:XC,emits:YC,setup(n,{expose:e,emit:t}){const i=n,{activeNames:r,setActiveNames:s}=JC(i,t),{rootKls:o}=KC();return e({activeNames:r,setActiveNames:s}),(l,u)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(o))},[a.renderSlot(l.$slots,"default")],2))}});var e2=We(QC,[["__file","collapse.vue"]]);const t2=a.defineComponent({name:"ElCollapseTransition"}),n2=a.defineComponent({...t2,setup(n){const e=Ge("collapse-transition"),t=r=>{r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom},i={beforeEnter(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.style.height&&(r.dataset.elExistsHeight=r.style.height),r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0},enter(r){requestAnimationFrame(()=>{r.dataset.oldOverflow=r.style.overflow,r.dataset.elExistsHeight?r.style.maxHeight=r.dataset.elExistsHeight:r.scrollHeight!==0?r.style.maxHeight=`${r.scrollHeight}px`:r.style.maxHeight=0,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom,r.style.overflow="hidden"})},afterEnter(r){r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow},enterCancelled(r){t(r)},beforeLeave(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.dataset.oldOverflow=r.style.overflow,r.style.maxHeight=`${r.scrollHeight}px`,r.style.overflow="hidden"},leave(r){r.scrollHeight!==0&&(r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0)},afterLeave(r){t(r)},leaveCancelled(r){t(r)}};return(r,s)=>(a.openBlock(),a.createBlock(a.Transition,a.mergeProps({name:a.unref(e).b()},a.toHandlers(i)),{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default")]),_:3},16,["name"]))}});var i2=We(n2,[["__file","collapse-transition.vue"]]);const r2=Nt(i2),s2=$e({title:{type:String,default:""},name:{type:Ve([String,Number]),default:void 0},icon:{type:Ui,default:zi},disabled:Boolean}),o2=n=>{const e=a.inject(mg),{namespace:t}=Ge("collapse"),i=a.ref(!1),r=a.ref(!1),s=Ru(),o=a.computed(()=>s.current++),l=a.computed(()=>{var p;return(p=n.name)!=null?p:`${t.value}-id-${s.prefix}-${a.unref(o)}`}),u=a.computed(()=>e==null?void 0:e.activeNames.value.includes(a.unref(l)));return{focusing:i,id:o,isActive:u,handleFocus:()=>{setTimeout(()=>{r.value?r.value=!1:i.value=!0},50)},handleHeaderClick:()=>{n.disabled||(e==null||e.handleItemClick(a.unref(l)),i.value=!1,r.value=!0)},handleEnterClick:()=>{e==null||e.handleItemClick(a.unref(l))}}},a2=(n,{focusing:e,isActive:t,id:i})=>{const r=Ge("collapse"),s=a.computed(()=>[r.b("item"),r.is("active",a.unref(t)),r.is("disabled",n.disabled)]),o=a.computed(()=>[r.be("item","header"),r.is("active",a.unref(t)),{focusing:a.unref(e)&&!n.disabled}]),l=a.computed(()=>[r.be("item","arrow"),r.is("active",a.unref(t))]),u=a.computed(()=>r.be("item","wrap")),c=a.computed(()=>r.be("item","content")),f=a.computed(()=>r.b(`content-${a.unref(i)}`)),h=a.computed(()=>r.b(`head-${a.unref(i)}`));return{arrowKls:l,headKls:o,rootKls:s,itemWrapperKls:u,itemContentKls:c,scopedContentId:f,scopedHeadId:h}},l2=a.defineComponent({name:"ElCollapseItem"}),c2=a.defineComponent({...l2,props:s2,setup(n,{expose:e}){const t=n,{focusing:i,id:r,isActive:s,handleFocus:o,handleHeaderClick:l,handleEnterClick:u}=o2(t),{arrowKls:c,headKls:f,rootKls:h,itemWrapperKls:p,itemContentKls:v,scopedContentId:m,scopedHeadId:d}=a2(t,{focusing:i,isActive:s,id:r});return e({isActive:s}),(b,y)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(h))},[a.createElementVNode("button",{id:a.unref(d),class:a.normalizeClass(a.unref(f)),"aria-expanded":a.unref(s),"aria-controls":a.unref(m),"aria-describedby":a.unref(m),tabindex:b.disabled?-1:0,type:"button",onClick:a.unref(l),onKeydown:a.withKeys(a.withModifiers(a.unref(u),["stop","prevent"]),["space","enter"]),onFocus:a.unref(o),onBlur:g=>i.value=!1},[a.renderSlot(b.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(b.title),1)]),a.renderSlot(b.$slots,"icon",{isActive:a.unref(s)},()=>[a.createVNode(a.unref(ht),{class:a.normalizeClass(a.unref(c))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(b.icon)))]),_:1},8,["class"])])],42,["id","aria-expanded","aria-controls","aria-describedby","tabindex","onClick","onKeydown","onFocus","onBlur"]),a.createVNode(a.unref(r2),null,{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{id:a.unref(m),role:"region",class:a.normalizeClass(a.unref(p)),"aria-hidden":!a.unref(s),"aria-labelledby":a.unref(d)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(v))},[a.renderSlot(b.$slots,"default")],2)],10,["id","aria-hidden","aria-labelledby"]),[[a.vShow,a.unref(s)]])]),_:3})],2))}});var gg=We(c2,[["__file","collapse-item.vue"]]);const vg=Nt(e2,{CollapseItem:gg}),yg=En(gg),u2=a.defineComponent({name:"ElContainer"}),d2=a.defineComponent({...u2,props:{direction:{type:String}},setup(n){const e=n,t=a.useSlots(),i=Ge("container"),r=a.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:t&&t.default?t.default().some(o=>{const l=o.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(s,o)=>(a.openBlock(),a.createElementBlock("section",{class:a.normalizeClass([a.unref(i).b(),a.unref(i).is("vertical",a.unref(r))])},[a.renderSlot(s.$slots,"default")],2))}});var h2=We(d2,[["__file","container.vue"]]);const f2=a.defineComponent({name:"ElAside"}),p2=a.defineComponent({...f2,props:{width:{type:String,default:null}},setup(n){const e=n,t=Ge("aside"),i=a.computed(()=>e.width?t.cssVarBlock({width:e.width}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("aside",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var bg=We(p2,[["__file","aside.vue"]]);const m2=a.defineComponent({name:"ElFooter"}),g2=a.defineComponent({...m2,props:{height:{type:String,default:null}},setup(n){const e=n,t=Ge("footer"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("footer",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var xg=We(g2,[["__file","footer.vue"]]);const v2=a.defineComponent({name:"ElHeader"}),y2=a.defineComponent({...v2,props:{height:{type:String,default:null}},setup(n){const e=n,t=Ge("header"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("header",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var wg=We(y2,[["__file","header.vue"]]);const b2=a.defineComponent({name:"ElMain"}),x2=a.defineComponent({...b2,setup(n){const e=Ge("main");return(t,i)=>(a.openBlock(),a.createElementBlock("main",{class:a.normalizeClass(a.unref(e).b())},[a.renderSlot(t.$slots,"default")],2))}});var Mg=We(x2,[["__file","main.vue"]]);const Jn=Nt(h2,{Aside:bg,Footer:xg,Header:wg,Main:Mg});En(bg);const Ag=En(xg),w2=En(wg),vi=En(Mg),M2=a.defineComponent({inheritAttrs:!1});function A2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var S2=We(M2,[["render",A2],["__file","collection.vue"]]);const _2=a.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function T2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var E2=We(_2,[["render",T2],["__file","collection-item.vue"]]);const C2="data-el-collection-item",L2=n=>{const e=`El${n}Collection`,t=`${e}Item`,i=Symbol(e),r=Symbol(t),s={...S2,name:e,setup(){const l=a.ref(null),u=new Map,c=()=>{const f=a.unref(l);if(!f)return[];const h=Array.from(f.querySelectorAll(`[${C2}]`));return[...u.values()].sort((v,m)=>h.indexOf(v.ref)-h.indexOf(m.ref))};a.provide(i,{itemMap:u,getItems:c,collectionRef:l})}},o={...E2,name:t,setup(l,{attrs:u}){const c=a.ref(null),f=a.inject(i,void 0);a.provide(r,{collectionItemRef:c}),a.onMounted(()=>{const h=a.unref(c);h&&f.itemMap.set(h,{ref:h,...u})}),a.onBeforeUnmount(()=>{const h=a.unref(c);f.itemMap.delete(h)})}};return{COLLECTION_INJECTION_KEY:i,COLLECTION_ITEM_INJECTION_KEY:r,ElCollection:s,ElCollectionItem:o}},Yu=$e({trigger:Ho.trigger,effect:{...un.effect,default:"light"},type:{type:Ve(String)},placement:{type:Ve(String),default:"bottom"},popperOptions:{type:Ve(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:Ve([Number,String]),default:0},maxHeight:{type:Ve([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:Ve(Object)},teleported:un.teleported});$e({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:Ui}}),$e({onKeydown:{type:Ve(Function)}}),L2("Dropdown");const R2=$e({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:Hi,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:n=>n===null||tt(n)||["min","max"].includes(n),default:null},name:String,placeholder:String,precision:{type:Number,validator:n=>n>=0&&n===Number.parseInt(`${n}`,10)},validateEvent:{type:Boolean,default:!0},...Wi(["ariaLabel"])}),F2={[fi]:(n,e)=>e!==n,blur:n=>n instanceof FocusEvent,focus:n=>n instanceof FocusEvent,[Sr]:n=>tt(n)||jn(n),[ot]:n=>tt(n)||jn(n)},P2=a.defineComponent({name:"ElInputNumber"}),I2=a.defineComponent({...P2,props:R2,emits:F2,setup(n,{expose:e,emit:t}){const i=n,{t:r}=sl(),s=Ge("input-number"),o=a.ref(),l=a.reactive({currentValue:i.modelValue,userInput:null}),{formItem:u}=ys(),c=a.computed(()=>tt(i.modelValue)&&i.modelValue<=i.min),f=a.computed(()=>tt(i.modelValue)&&i.modelValue>=i.max),h=a.computed(()=>{const I=y(i.step);return Tn(i.precision)?Math.max(y(i.modelValue),I):(I>i.precision&>("InputNumber","precision should not be less than the decimal places of step"),i.precision)}),p=a.computed(()=>i.controls&&i.controlsPosition==="right"),v=Er(),m=Go(),d=a.computed(()=>{if(l.userInput!==null)return l.userInput;let I=l.currentValue;if(jn(I))return"";if(tt(I)){if(Number.isNaN(I))return"";Tn(i.precision)||(I=I.toFixed(i.precision))}return I}),b=(I,x)=>{if(Tn(x)&&(x=h.value),x===0)return Math.round(I);let O=String(I);const B=O.indexOf(".");if(B===-1||!O.replace(".","").split("")[B+x])return I;const V=O.length;return O.charAt(V-1)==="5"&&(O=`${O.slice(0,Math.max(0,V-1))}6`),Number.parseFloat(Number(O).toFixed(x))},y=I=>{if(jn(I))return 0;const x=I.toString(),O=x.indexOf(".");let B=0;return O!==-1&&(B=x.length-O-1),B},g=(I,x=1)=>tt(I)?b(I+i.step*x):l.currentValue,w=()=>{if(i.readonly||m.value||f.value)return;const I=Number(d.value)||0,x=g(I);M(x),t(Sr,l.currentValue),C()},A=()=>{if(i.readonly||m.value||c.value)return;const I=Number(d.value)||0,x=g(I,-1);M(x),t(Sr,l.currentValue),C()},S=(I,x)=>{const{max:O,min:B,step:D,precision:k,stepStrictly:V,valueOnClear:G}=i;O<B&&us("InputNumber","min should not be greater than max.");let J=Number(I);if(jn(I)||Number.isNaN(J))return null;if(I===""){if(G===null)return null;J=Ht(G)?{min:B,max:O}[G]:G}return V&&(J=b(Math.round(J/D)*D,k),J!==I&&x&&t(ot,J)),Tn(k)||(J=b(J,k)),(J>O||J<B)&&(J=J>O?O:B,x&&t(ot,J)),J},M=(I,x=!0)=>{var O;const B=l.currentValue,D=S(I);if(!x){t(ot,D);return}B===D&&I||(l.userInput=null,t(ot,D),B!==D&&t(fi,D,B),i.validateEvent&&((O=u==null?void 0:u.validate)==null||O.call(u,"change").catch(k=>gt(k))),l.currentValue=D)},F=I=>{l.userInput=I;const x=I===""?null:Number(I);t(Sr,x),M(x,!1)},R=I=>{const x=I!==""?Number(I):"";(tt(x)&&!Number.isNaN(x)||I==="")&&M(x),C(),l.userInput=null},T=()=>{var I,x;(x=(I=o.value)==null?void 0:I.focus)==null||x.call(I)},P=()=>{var I,x;(x=(I=o.value)==null?void 0:I.blur)==null||x.call(I)},_=I=>{t("focus",I)},E=I=>{var x;l.userInput=null,t("blur",I),i.validateEvent&&((x=u==null?void 0:u.validate)==null||x.call(u,"blur").catch(O=>gt(O)))},C=()=>{l.currentValue!==i.modelValue&&(l.currentValue=i.modelValue)},L=I=>{document.activeElement===I.target&&I.preventDefault()};return a.watch(()=>i.modelValue,(I,x)=>{const O=S(I,!0);l.userInput===null&&O!==x&&(l.currentValue=O)},{immediate:!0}),a.onMounted(()=>{var I;const{min:x,max:O,modelValue:B}=i,D=(I=o.value)==null?void 0:I.input;if(D.setAttribute("role","spinbutton"),Number.isFinite(O)?D.setAttribute("aria-valuemax",String(O)):D.removeAttribute("aria-valuemax"),Number.isFinite(x)?D.setAttribute("aria-valuemin",String(x)):D.removeAttribute("aria-valuemin"),D.setAttribute("aria-valuenow",l.currentValue||l.currentValue===0?String(l.currentValue):""),D.setAttribute("aria-disabled",String(m.value)),!tt(B)&&B!=null){let k=Number(B);Number.isNaN(k)&&(k=null),t(ot,k)}D.addEventListener("wheel",L,{passive:!1})}),a.onUpdated(()=>{var I,x;const O=(I=o.value)==null?void 0:I.input;O==null||O.setAttribute("aria-valuenow",`${(x=l.currentValue)!=null?x:""}`)}),e({focus:T,blur:P}),(I,x)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([a.unref(s).b(),a.unref(s).m(a.unref(v)),a.unref(s).is("disabled",a.unref(m)),a.unref(s).is("without-controls",!I.controls),a.unref(s).is("controls-right",a.unref(p))]),onDragstart:a.withModifiers(()=>{},["prevent"])},[I.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:0,role:"button","aria-label":a.unref(r)("el.inputNumber.decrease"),class:a.normalizeClass([a.unref(s).e("decrease"),a.unref(s).is("disabled",a.unref(c))]),onKeydown:a.withKeys(A,["enter"])},[a.renderSlot(I.$slots,"decrease-icon",{},()=>[a.createVNode(a.unref(ht),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(gu),{key:0})):(a.openBlock(),a.createBlock(a.unref(NS),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(rg),A]]):a.createCommentVNode("v-if",!0),I.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:1,role:"button","aria-label":a.unref(r)("el.inputNumber.increase"),class:a.normalizeClass([a.unref(s).e("increase"),a.unref(s).is("disabled",a.unref(f))]),onKeydown:a.withKeys(w,["enter"])},[a.renderSlot(I.$slots,"increase-icon",{},()=>[a.createVNode(a.unref(ht),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(_S),{key:0})):(a.openBlock(),a.createBlock(a.unref(nl),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(rg),w]]):a.createCommentVNode("v-if",!0),a.createVNode(a.unref(DT),{id:I.id,ref_key:"input",ref:o,type:"number",step:I.step,"model-value":a.unref(d),placeholder:I.placeholder,readonly:I.readonly,disabled:a.unref(m),size:a.unref(v),max:I.max,min:I.min,name:I.name,"aria-label":I.ariaLabel,"validate-event":!1,onKeydown:[a.withKeys(a.withModifiers(w,["prevent"]),["up"]),a.withKeys(a.withModifiers(A,["prevent"]),["down"])],onBlur:E,onFocus:_,onInput:F,onChange:R},a.createSlots({_:2},[I.$slots.prefix?{name:"prefix",fn:a.withCtx(()=>[a.renderSlot(I.$slots,"prefix")])}:void 0,I.$slots.suffix?{name:"suffix",fn:a.withCtx(()=>[a.renderSlot(I.$slots,"suffix")])}:void 0]),1032,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","onKeydown"])],42,["onDragstart"]))}});var O2=We(I2,[["__file","input-number.vue"]]);const yi=Nt(O2),Sg=Symbol("ElSelectGroup"),wl=Symbol("ElSelect");function N2(n,e){const t=a.inject(wl),i=a.inject(Sg,{disabled:!1}),r=a.computed(()=>f(Wn(t.props.modelValue),n.value)),s=a.computed(()=>{var v;if(t.props.multiple){const m=Wn((v=t.props.modelValue)!=null?v:[]);return!r.value&&m.length>=t.props.multipleLimit&&t.props.multipleLimit>0}else return!1}),o=a.computed(()=>n.label||(en(n.value)?"":n.value)),l=a.computed(()=>n.value||n.label||""),u=a.computed(()=>n.disabled||e.groupDisabled||s.value),c=a.getCurrentInstance(),f=(v=[],m)=>{if(en(n.value)){const d=t.props.valueKey;return v&&v.some(b=>a.toRaw(di(b,d))===di(m,d))}else return v&&v.includes(m)},h=()=>{!n.disabled&&!i.disabled&&(t.states.hoveringIndex=t.optionsArray.indexOf(c.proxy))},p=v=>{const m=new RegExp(yS(v),"i");e.visible=m.test(o.value)||n.created};return a.watch(()=>o.value,()=>{!n.created&&!t.props.remote&&t.setSelected()}),a.watch(()=>n.value,(v,m)=>{const{remote:d,valueKey:b}=t.props;if(v!==m&&(t.onOptionDestroy(m,c.proxy),t.onOptionCreate(c.proxy)),!n.created&&!d){if(b&&en(v)&&en(m)&&v[b]===m[b])return;t.setSelected()}}),a.watch(()=>i.disabled,()=>{e.groupDisabled=i.disabled},{immediate:!0}),{select:t,currentLabel:o,currentValue:l,itemSelected:r,isDisabled:u,hoverItem:h,updateOption:p}}const B2=a.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(n){const e=Ge("select"),t=Uo(),i=a.computed(()=>[e.be("dropdown","item"),e.is("disabled",a.unref(l)),e.is("selected",a.unref(o)),e.is("hovering",a.unref(p))]),r=a.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f}=N2(n,r),{visible:h,hover:p}=a.toRefs(r),v=a.getCurrentInstance().proxy;u.onOptionCreate(v),a.onBeforeUnmount(()=>{const d=v.value,{selected:b}=u.states,g=(u.props.multiple?b:[b]).some(w=>w.value===v.value);a.nextTick(()=>{u.states.cachedOptions.get(d)===v&&!g&&u.states.cachedOptions.delete(d)}),u.onOptionDestroy(d,v)});function m(){l.value||u.handleOptionSelect(v)}return{ns:e,id:t,containerKls:i,currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f,visible:h,hover:p,selectOptionClick:m,states:r}}});function D2(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("li",{id:n.id,class:a.normalizeClass(n.containerKls),role:"option","aria-disabled":n.isDisabled||void 0,"aria-selected":n.itemSelected,onMouseenter:n.hoverItem,onClick:a.withModifiers(n.selectOptionClick,["stop"])},[a.renderSlot(n.$slots,"default",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[a.vShow,n.visible]])}var Ju=We(B2,[["render",D2],["__file","option.vue"]]);const V2=a.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const n=a.inject(wl),e=Ge("select"),t=a.computed(()=>n.props.popperClass),i=a.computed(()=>n.props.multiple),r=a.computed(()=>n.props.fitInputWidth),s=a.ref("");function o(){var l;s.value=`${(l=n.selectRef)==null?void 0:l.offsetWidth}px`}return a.onMounted(()=>{o(),bn(n.selectRef,o)}),{ns:e,minWidth:s,popperClass:t,isMultiple:i,isFitInputWidth:r}}});function k2(n,e,t,i,r,s){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([n.ns.b("dropdown"),n.ns.is("multiple",n.isMultiple),n.popperClass]),style:a.normalizeStyle({[n.isFitInputWidth?"width":"minWidth"]:n.minWidth})},[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.ns.be("dropdown","header"))},[a.renderSlot(n.$slots,"header")],2)):a.createCommentVNode("v-if",!0),a.renderSlot(n.$slots,"default"),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.ns.be("dropdown","footer"))},[a.renderSlot(n.$slots,"footer")],2)):a.createCommentVNode("v-if",!0)],6)}var z2=We(V2,[["render",k2],["__file","select-dropdown.vue"]]);const U2=11,G2=(n,e)=>{const{t}=sl(),i=Uo(),r=Ge("select"),s=Ge("input"),o=a.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=a.ref(null),u=a.ref(null),c=a.ref(null),f=a.ref(null),h=a.ref(null),p=a.ref(null),v=a.ref(null),m=a.ref(null),d=a.ref(null),b=a.ref(null),y=a.ref(null),g=a.ref(null),{isComposing:w,handleCompositionStart:A,handleCompositionUpdate:S,handleCompositionEnd:M}=Rm({afterComposition:fe=>re(fe)}),{wrapperRef:F,isFocused:R}=Lm(h,{beforeFocus(){return x.value},afterFocus(){n.automaticDropdown&&!T.value&&(T.value=!0,o.menuVisibleOnFocus=!0)},beforeBlur(fe){var xe,Se;return((xe=c.value)==null?void 0:xe.isFocusInsideContent(fe))||((Se=f.value)==null?void 0:Se.isFocusInsideContent(fe))},afterBlur(){T.value=!1,o.menuVisibleOnFocus=!1}}),T=a.ref(!1),P=a.ref(),{form:_,formItem:E}=ys(),{inputId:C}=fl(n,{formItemContext:E}),{valueOnClear:L,isEmptyValue:I}=xT(n),x=a.computed(()=>n.disabled||(_==null?void 0:_.disabled)),O=a.computed(()=>sn(n.modelValue)?n.modelValue.length>0:!I(n.modelValue)),B=a.computed(()=>n.clearable&&!x.value&&o.inputHovering&&O.value),D=a.computed(()=>n.remote&&n.filterable&&!n.remoteShowSuffix?"":n.suffixIcon),k=a.computed(()=>r.is("reverse",D.value&&T.value)),V=a.computed(()=>(E==null?void 0:E.validateState)||""),G=a.computed(()=>jp[V.value]),J=a.computed(()=>n.remote?300:0),j=a.computed(()=>n.loading?n.loadingText||t("el.select.loading"):n.remote&&!o.inputValue&&o.options.size===0?!1:n.filterable&&o.inputValue&&o.options.size>0&&te.value===0?n.noMatchText||t("el.select.noMatch"):o.options.size===0?n.noDataText||t("el.select.noData"):null),te=a.computed(()=>ee.value.filter(fe=>fe.visible).length),ee=a.computed(()=>{const fe=Array.from(o.options.values()),xe=[];return o.optionValues.forEach(Se=>{const Fe=fe.findIndex(Ie=>Ie.value===Se);Fe>-1&&xe.push(fe[Fe])}),xe.length>=fe.length?xe:fe}),ae=a.computed(()=>Array.from(o.cachedOptions.values())),H=a.computed(()=>{const fe=ee.value.filter(xe=>!xe.created).some(xe=>xe.currentLabel===o.inputValue);return n.filterable&&n.allowCreate&&o.inputValue!==""&&!fe}),Z=()=>{n.filterable&&Jt(n.filterMethod)||n.filterable&&n.remote&&Jt(n.remoteMethod)||ee.value.forEach(fe=>{var xe;(xe=fe.updateOption)==null||xe.call(fe,o.inputValue)})},$=Er(),se=a.computed(()=>["small"].includes($.value)?"small":"default"),z=a.computed({get(){return T.value&&j.value!==!1},set(fe){T.value=fe}}),W=a.computed(()=>{if(n.multiple&&!Tn(n.modelValue))return Wn(n.modelValue).length===0&&!o.inputValue;const fe=sn(n.modelValue)?n.modelValue[0]:n.modelValue;return n.filterable||Tn(fe)?!o.inputValue:!0}),q=a.computed(()=>{var fe;const xe=(fe=n.placeholder)!=null?fe:t("el.select.placeholder");return n.multiple||!O.value?xe:o.selectedLabel}),le=a.computed(()=>Yc?null:"mouseenter");a.watch(()=>n.modelValue,(fe,xe)=>{n.multiple&&n.filterable&&!n.reserveKeyword&&(o.inputValue="",oe("")),N(),!mu(fe,xe)&&n.validateEvent&&(E==null||E.validate("change").catch(Se=>gt(Se)))},{flush:"post",deep:!0}),a.watch(()=>T.value,fe=>{fe?oe(o.inputValue):(o.inputValue="",o.previousQuery=null,o.isBeforeHide=!0),e("visible-change",fe)}),a.watch(()=>o.options.entries(),()=>{var fe;if(!Rt)return;const xe=((fe=l.value)==null?void 0:fe.querySelectorAll("input"))||[];(!n.filterable&&!n.defaultFirstOption&&!Tn(n.modelValue)||!Array.from(xe).includes(document.activeElement))&&N(),n.defaultFirstOption&&(n.filterable||n.remote)&&te.value&&U()},{flush:"post"}),a.watch(()=>o.hoveringIndex,fe=>{tt(fe)&&fe>-1?P.value=ee.value[fe]||{}:P.value={},ee.value.forEach(xe=>{xe.hover=P.value===xe})}),a.watchEffect(()=>{o.isBeforeHide||Z()});const oe=fe=>{o.previousQuery===fe||w.value||(o.previousQuery=fe,n.filterable&&Jt(n.filterMethod)?n.filterMethod(fe):n.filterable&&n.remote&&Jt(n.remoteMethod)&&n.remoteMethod(fe),n.defaultFirstOption&&(n.filterable||n.remote)&&te.value?a.nextTick(U):a.nextTick(Y))},U=()=>{const fe=ee.value.filter(Fe=>Fe.visible&&!Fe.disabled&&!Fe.states.groupDisabled),xe=fe.find(Fe=>Fe.created),Se=fe[0];o.hoveringIndex=st(ee.value,xe||Se)},N=()=>{if(n.multiple)o.selectedLabel="";else{const xe=sn(n.modelValue)?n.modelValue[0]:n.modelValue,Se=X(xe);o.selectedLabel=Se.currentLabel,o.selected=[Se];return}const fe=[];Tn(n.modelValue)||Wn(n.modelValue).forEach(xe=>{fe.push(X(xe))}),o.selected=fe},X=fe=>{let xe;const Se=Jc(fe).toLowerCase()==="object",Fe=Jc(fe).toLowerCase()==="null",Ie=Jc(fe).toLowerCase()==="undefined";for(let Qe=o.cachedOptions.size-1;Qe>=0;Qe--){const Lt=ae.value[Qe];if(Se?di(Lt.value,n.valueKey)===di(fe,n.valueKey):Lt.value===fe){xe={value:fe,currentLabel:Lt.currentLabel,get isDisabled(){return Lt.isDisabled}};break}}if(xe)return xe;const Ue=Se?fe.label:!Fe&&!Ie?fe:"";return{value:fe,currentLabel:Ue}},Y=()=>{o.hoveringIndex=ee.value.findIndex(fe=>o.selected.some(xe=>we(xe)===we(fe)))},ie=()=>{o.selectionWidth=u.value.getBoundingClientRect().width},ue=()=>{o.calculatorWidth=p.value.getBoundingClientRect().width},me=()=>{o.collapseItemWidth=y.value.getBoundingClientRect().width},be=()=>{var fe,xe;(xe=(fe=c.value)==null?void 0:fe.updatePopper)==null||xe.call(fe)},ce=()=>{var fe,xe;(xe=(fe=f.value)==null?void 0:fe.updatePopper)==null||xe.call(fe)},ge=()=>{o.inputValue.length>0&&!T.value&&(T.value=!0),oe(o.inputValue)},re=fe=>{if(o.inputValue=fe.target.value,n.remote)he();else return ge()},he=pu(()=>{ge()},J.value),ve=fe=>{mu(n.modelValue,fe)||e(fi,fe)},Ee=fe=>dS(fe,xe=>!o.disabledOptions.has(xe)),_e=fe=>{if(n.multiple&&fe.code!==$n.delete&&fe.target.value.length<=0){const xe=Wn(n.modelValue).slice(),Se=Ee(xe);if(Se<0)return;const Fe=xe[Se];xe.splice(Se,1),e(ot,xe),ve(xe),e("remove-tag",Fe)}},Ne=(fe,xe)=>{const Se=o.selected.indexOf(xe);if(Se>-1&&!x.value){const Fe=Wn(n.modelValue).slice();Fe.splice(Se,1),e(ot,Fe),ve(Fe),e("remove-tag",xe.value)}fe.stopPropagation(),mt()},Je=fe=>{fe.stopPropagation();const xe=n.multiple?[]:L.value;if(n.multiple)for(const Se of o.selected)Se.isDisabled&&xe.push(Se.value);e(ot,xe),ve(xe),o.hoveringIndex=-1,T.value=!1,e("clear"),mt()},ze=fe=>{var xe;if(n.multiple){const Se=Wn((xe=n.modelValue)!=null?xe:[]).slice(),Fe=st(Se,fe.value);Fe>-1?Se.splice(Fe,1):(n.multipleLimit<=0||Se.length<n.multipleLimit)&&Se.push(fe.value),e(ot,Se),ve(Se),fe.created&&oe(""),n.filterable&&!n.reserveKeyword&&(o.inputValue="")}else e(ot,fe.value),ve(fe.value),T.value=!1;mt(),!T.value&&a.nextTick(()=>{Ce(fe)})},st=(fe=[],xe)=>{if(!en(xe))return fe.indexOf(xe);const Se=n.valueKey;let Fe=-1;return fe.some((Ie,Ue)=>a.toRaw(di(Ie,Se))===di(xe,Se)?(Fe=Ue,!0):!1),Fe},Ce=fe=>{var xe,Se,Fe,Ie,Ue;const De=sn(fe)?fe[0]:fe;let Qe=null;if(De!=null&&De.value){const Lt=ee.value.filter(Gt=>Gt.value===De.value);Lt.length>0&&(Qe=Lt[0].$el)}if(c.value&&Qe){const Lt=(Ie=(Fe=(Se=(xe=c.value)==null?void 0:xe.popperRef)==null?void 0:Se.contentRef)==null?void 0:Fe.querySelector)==null?void 0:Ie.call(Fe,`.${r.be("dropdown","wrap")}`);Lt&&xS(Lt,Qe)}(Ue=g.value)==null||Ue.handleScroll()},je=fe=>{o.options.set(fe.value,fe),o.cachedOptions.set(fe.value,fe),fe.disabled&&o.disabledOptions.set(fe.value,fe)},He=(fe,xe)=>{o.options.get(fe)===xe&&o.options.delete(fe)},Pt=a.computed(()=>{var fe,xe;return(xe=(fe=c.value)==null?void 0:fe.popperRef)==null?void 0:xe.contentRef}),It=()=>{o.isBeforeHide=!1,a.nextTick(()=>Ce(o.selected))},mt=()=>{var fe;(fe=h.value)==null||fe.focus()},bt=()=>{var fe;(fe=h.value)==null||fe.blur()},Oi=fe=>{Je(fe)},Ni=()=>{T.value=!1,R.value&&bt()},Un=()=>{o.inputValue.length>0?o.inputValue="":T.value=!1},ss=()=>{x.value||(Yc&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:T.value=!T.value)},ne=()=>{T.value?ee.value[o.hoveringIndex]&&ze(ee.value[o.hoveringIndex]):ss()},we=fe=>en(fe.value)?di(fe.value,n.valueKey):fe.value,Te=a.computed(()=>ee.value.filter(fe=>fe.visible).every(fe=>fe.disabled)),Be=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(0,n.maxCollapseTags):o.selected:[]),qe=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(n.maxCollapseTags):[]:[]),K=fe=>{if(!T.value){T.value=!0;return}if(!(o.options.size===0||o.filteredOptionsCount===0||w.value)&&!Te.value){fe==="next"?(o.hoveringIndex++,o.hoveringIndex===o.options.size&&(o.hoveringIndex=0)):fe==="prev"&&(o.hoveringIndex--,o.hoveringIndex<0&&(o.hoveringIndex=o.options.size-1));const xe=ee.value[o.hoveringIndex];(xe.disabled===!0||xe.states.groupDisabled===!0||!xe.visible)&&K(fe),a.nextTick(()=>Ce(P.value))}},pe=()=>{if(!u.value)return 0;const fe=window.getComputedStyle(u.value);return Number.parseFloat(fe.gap||"6px")},de=a.computed(()=>{const fe=pe();return{maxWidth:`${y.value&&n.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-fe:o.selectionWidth}px`}}),ye=a.computed(()=>({maxWidth:`${o.selectionWidth}px`})),Me=a.computed(()=>({width:`${Math.max(o.calculatorWidth,U2)}px`}));return bn(u,ie),bn(p,ue),bn(d,be),bn(F,be),bn(b,ce),bn(y,me),a.onMounted(()=>{N()}),{inputId:C,contentId:i,nsSelect:r,nsInput:s,states:o,isFocused:R,expanded:T,optionsArray:ee,hoverOption:P,selectSize:$,filteredOptionsCount:te,resetCalculatorWidth:ue,updateTooltip:be,updateTagTooltip:ce,debouncedOnInputChange:he,onInput:re,deletePrevTag:_e,deleteTag:Ne,deleteSelected:Je,handleOptionSelect:ze,scrollToOption:Ce,hasModelValue:O,shouldShowPlaceholder:W,currentPlaceholder:q,mouseEnterEventName:le,showClose:B,iconComponent:D,iconReverse:k,validateState:V,validateIcon:G,showNewOption:H,updateOptions:Z,collapseTagSize:se,setSelected:N,selectDisabled:x,emptyText:j,handleCompositionStart:A,handleCompositionUpdate:S,handleCompositionEnd:M,onOptionCreate:je,onOptionDestroy:He,handleMenuEnter:It,focus:mt,blur:bt,handleClearClick:Oi,handleClickOutside:Ni,handleEsc:Un,toggleMenu:ss,selectOption:ne,getValueKey:we,navigateOptions:K,dropdownMenuVisible:z,showTagList:Be,collapseTagList:qe,tagStyle:de,collapseTagStyle:ye,inputStyle:Me,popperRef:Pt,inputRef:h,tooltipRef:c,tagTooltipRef:f,calculatorRef:p,prefixRef:v,suffixRef:m,selectRef:l,wrapperRef:F,selectionRef:u,scrollbarRef:g,menuRef:d,tagMenuRef:b,collapseItemRef:y}};var H2=a.defineComponent({name:"ElOptions",setup(n,{slots:e}){const t=a.inject(wl);let i=[];return()=>{var r,s;const o=(r=e.default)==null?void 0:r.call(e),l=[];function u(c){sn(c)&&c.forEach(f=>{var h,p,v,m;const d=(h=(f==null?void 0:f.type)||{})==null?void 0:h.name;d==="ElOptionGroup"?u(!Ht(f.children)&&!sn(f.children)&&Jt((p=f.children)==null?void 0:p.default)?(v=f.children)==null?void 0:v.default():f.children):d==="ElOption"?l.push((m=f.props)==null?void 0:m.value):sn(f.children)&&u(f.children)})}return o.length&&u((s=o[0])==null?void 0:s.children),mu(l,i)||(i=l,t&&(t.states.optionValues=l)),o}}});const W2=$e({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:Hi,effect:{type:Ve(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Ve(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:un.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:Ui,default:vu},fitInputWidth:Boolean,suffixIcon:{type:Ui,default:gu},tagType:{...Xu.type,default:"info"},tagEffect:{...Xu.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:Ve(String),values:hs,default:"bottom-start"},fallbackPlacements:{type:Ve(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...bT,...Wi(["ariaLabel"])}),_g="ElSelect",j2=a.defineComponent({name:_g,componentName:_g,components:{ElSelectMenu:z2,ElOption:Ju,ElOptions:H2,ElTag:kC,ElScrollbar:YT,ElTooltip:Gu,ElIcon:ht},directives:{ClickOutside:wC},props:W2,emits:[ot,fi,"remove-tag","clear","visible-change","focus","blur"],setup(n,{emit:e}){const t=a.computed(()=>{const{modelValue:s,multiple:o}=n,l=o?[]:void 0;return sn(s)?o?s:l:o?l:s}),i=a.reactive({...a.toRefs(n),modelValue:t}),r=G2(i,e);return a.provide(wl,a.reactive({props:i,states:r.states,optionsArray:r.optionsArray,handleOptionSelect:r.handleOptionSelect,onOptionCreate:r.onOptionCreate,onOptionDestroy:r.onOptionDestroy,selectRef:r.selectRef,setSelected:r.setSelected})),{...r,modelValue:t}}});function $2(n,e,t,i,r,s){const o=a.resolveComponent("el-tag"),l=a.resolveComponent("el-tooltip"),u=a.resolveComponent("el-icon"),c=a.resolveComponent("el-option"),f=a.resolveComponent("el-options"),h=a.resolveComponent("el-scrollbar"),p=a.resolveComponent("el-select-menu"),v=a.resolveDirective("click-outside");return a.withDirectives((a.openBlock(),a.createElementBlock("div",{ref:"selectRef",class:a.normalizeClass([n.nsSelect.b(),n.nsSelect.m(n.selectSize)]),[a.toHandlerKey(n.mouseEnterEventName)]:m=>n.states.inputHovering=!0,onMouseleave:m=>n.states.inputHovering=!1},[a.createVNode(l,{ref:"tooltipRef",visible:n.dropdownMenuVisible,placement:n.placement,teleported:n.teleported,"popper-class":[n.nsSelect.e("popper"),n.popperClass],"popper-options":n.popperOptions,"fallback-placements":n.fallbackPlacements,effect:n.effect,pure:"",trigger:"click",transition:`${n.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:n.persistent,"append-to":n.appendTo,onBeforeShow:n.handleMenuEnter,onHide:m=>n.states.isBeforeHide=!1},{default:a.withCtx(()=>{var m;return[a.createElementVNode("div",{ref:"wrapperRef",class:a.normalizeClass([n.nsSelect.e("wrapper"),n.nsSelect.is("focused",n.isFocused),n.nsSelect.is("hovering",n.states.inputHovering),n.nsSelect.is("filterable",n.filterable),n.nsSelect.is("disabled",n.selectDisabled)]),onClick:a.withModifiers(n.toggleMenu,["prevent"])},[n.$slots.prefix?(a.openBlock(),a.createElementBlock("div",{key:0,ref:"prefixRef",class:a.normalizeClass(n.nsSelect.e("prefix"))},[a.renderSlot(n.$slots,"prefix")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref:"selectionRef",class:a.normalizeClass([n.nsSelect.e("selection"),n.nsSelect.is("near",n.multiple&&!n.$slots.prefix&&!!n.states.selected.length)])},[n.multiple?a.renderSlot(n.$slots,"tag",{key:0},()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.showTagList,d=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(d),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!n.selectDisabled&&!d.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.tagStyle),onClose:b=>n.deleteTag(b,d)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:d.currentLabel,value:d.value},()=>[a.createTextVNode(a.toDisplayString(d.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),n.collapseTags&&n.states.selected.length>n.maxCollapseTags?(a.openBlock(),a.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:n.dropdownMenuVisible||!n.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:n.effect,placement:"bottom",teleported:n.teleported},{default:a.withCtx(()=>[a.createElementVNode("div",{ref:"collapseItemRef",class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!1,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.collapseTagStyle)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))}," + "+a.toDisplayString(n.states.selected.length-n.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:a.withCtx(()=>[a.createElementVNode("div",{ref:"tagMenuRef",class:a.normalizeClass(n.nsSelect.e("selection"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.collapseTagList,d=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(d),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{class:"in-tooltip",closable:!n.selectDisabled&&!d.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",onClose:b=>n.deleteTag(b,d)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:d.currentLabel,value:d.value},()=>[a.createTextVNode(a.toDisplayString(d.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):a.createCommentVNode("v-if",!0)]):a.createCommentVNode("v-if",!0),n.selectDisabled?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("input-wrapper"),n.nsSelect.is("hidden",!n.filterable)])},[a.withDirectives(a.createElementVNode("input",{id:n.inputId,ref:"inputRef","onUpdate:modelValue":d=>n.states.inputValue=d,type:"text",name:n.name,class:a.normalizeClass([n.nsSelect.e("input"),n.nsSelect.is(n.selectSize)]),disabled:n.selectDisabled,autocomplete:n.autocomplete,style:a.normalizeStyle(n.inputStyle),role:"combobox",readonly:!n.filterable,spellcheck:"false","aria-activedescendant":((m=n.hoverOption)==null?void 0:m.id)||"","aria-controls":n.contentId,"aria-expanded":n.dropdownMenuVisible,"aria-label":n.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[a.withKeys(a.withModifiers(d=>n.navigateOptions("next"),["stop","prevent"]),["down"]),a.withKeys(a.withModifiers(d=>n.navigateOptions("prev"),["stop","prevent"]),["up"]),a.withKeys(a.withModifiers(n.handleEsc,["stop","prevent"]),["esc"]),a.withKeys(a.withModifiers(n.selectOption,["stop","prevent"]),["enter"]),a.withKeys(a.withModifiers(n.deletePrevTag,["stop"]),["delete"])],onCompositionstart:n.handleCompositionStart,onCompositionupdate:n.handleCompositionUpdate,onCompositionend:n.handleCompositionEnd,onInput:n.onInput,onClick:a.withModifiers(n.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[a.vModelText,n.states.inputValue]]),n.filterable?(a.openBlock(),a.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:a.normalizeClass(n.nsSelect.e("input-calculator")),textContent:a.toDisplayString(n.states.inputValue)},null,10,["textContent"])):a.createCommentVNode("v-if",!0)],2)),n.shouldShowPlaceholder?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("placeholder"),n.nsSelect.is("transparent",!n.hasModelValue||n.expanded&&!n.states.inputValue)])},[n.hasModelValue?a.renderSlot(n.$slots,"label",{key:0,label:n.currentPlaceholder,value:n.modelValue},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentPlaceholder),1)]):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(n.currentPlaceholder),1))],2)):a.createCommentVNode("v-if",!0)],2),a.createElementVNode("div",{ref:"suffixRef",class:a.normalizeClass(n.nsSelect.e("suffix"))},[n.iconComponent&&!n.showClose?(a.openBlock(),a.createBlock(u,{key:0,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.iconReverse])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),n.showClose&&n.clearIcon?(a.openBlock(),a.createBlock(u,{key:1,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.nsSelect.e("clear")]),onClick:n.handleClearClick},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.clearIcon)))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0),n.validateState&&n.validateIcon?(a.openBlock(),a.createBlock(u,{key:2,class:a.normalizeClass([n.nsInput.e("icon"),n.nsInput.e("validateIcon")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.validateIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:a.withCtx(()=>[a.createVNode(p,{ref:"menuRef"},{default:a.withCtx(()=>[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.nsSelect.be("dropdown","header")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"header")],10,["onClick"])):a.createCommentVNode("v-if",!0),a.withDirectives(a.createVNode(h,{id:n.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":n.nsSelect.be("dropdown","wrap"),"view-class":n.nsSelect.be("dropdown","list"),class:a.normalizeClass([n.nsSelect.is("empty",n.filteredOptionsCount===0)]),role:"listbox","aria-label":n.ariaLabel,"aria-orientation":"vertical"},{default:a.withCtx(()=>[n.showNewOption?(a.openBlock(),a.createBlock(c,{key:0,value:n.states.inputValue,created:!0},null,8,["value"])):a.createCommentVNode("v-if",!0),a.createVNode(f,null,{default:a.withCtx(()=>[a.renderSlot(n.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[a.vShow,n.states.options.size>0&&!n.loading]]),n.$slots.loading&&n.loading?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.nsSelect.be("dropdown","loading"))},[a.renderSlot(n.$slots,"loading")],2)):n.loading||n.filteredOptionsCount===0?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(n.nsSelect.be("dropdown","empty"))},[a.renderSlot(n.$slots,"empty",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.emptyText),1)])],2)):a.createCommentVNode("v-if",!0),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:3,class:a.normalizeClass(n.nsSelect.be("dropdown","footer")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"footer")],10,["onClick"])):a.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[v,n.handleClickOutside,n.popperRef]])}var Z2=We(j2,[["render",$2],["__file","select.vue"]]);const X2=a.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(n){const e=Ge("select"),t=a.ref(null),i=a.getCurrentInstance(),r=a.ref([]);a.provide(Sg,a.reactive({...a.toRefs(n)}));const s=a.computed(()=>r.value.some(c=>c.visible===!0)),o=c=>{var f,h;return((f=c.type)==null?void 0:f.name)==="ElOption"&&!!((h=c.component)!=null&&h.proxy)},l=c=>{const f=Wn(c),h=[];return f.forEach(p=>{var v,m;o(p)?h.push(p.component.proxy):(v=p.children)!=null&&v.length?h.push(...l(p.children)):(m=p.component)!=null&&m.subTree&&h.push(...l(p.component.subTree))}),h},u=()=>{r.value=l(i.subTree)};return a.onMounted(()=>{u()}),dw(t,u,{attributes:!0,subtree:!0,childList:!0}),{groupRef:t,visible:s,ns:e}}});function Y2(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("ul",{ref:"groupRef",class:a.normalizeClass(n.ns.be("group","wrap"))},[a.createElementVNode("li",{class:a.normalizeClass(n.ns.be("group","title"))},a.toDisplayString(n.label),3),a.createElementVNode("li",null,[a.createElementVNode("ul",{class:a.normalizeClass(n.ns.b("group"))},[a.renderSlot(n.$slots,"default")],2)])],2)),[[a.vShow,n.visible]])}var Tg=We(X2,[["render",Y2],["__file","option-group.vue"]]);const Ms=Nt(Z2,{Option:Ju,OptionGroup:Tg}),As=En(Ju);En(Tg);const J2=$e({trigger:Ho.trigger,placement:Yu.placement,disabled:Ho.disabled,visible:un.visible,transition:un.transition,popperOptions:Yu.popperOptions,tabindex:Yu.tabindex,content:un.content,popperStyle:un.popperStyle,popperClass:un.popperClass,enterable:{...un.enterable,default:!0},effect:{...un.effect,default:"light"},teleported:un.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),K2={"update:visible":n=>Po(n),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},q2="onUpdate:visible",Q2=a.defineComponent({name:"ElPopover"}),eL=a.defineComponent({...Q2,props:J2,emits:K2,setup(n,{expose:e,emit:t}){const i=n,r=a.computed(()=>i[q2]),s=Ge("popover"),o=a.ref(),l=a.computed(()=>{var b;return(b=a.unref(o))==null?void 0:b.popperRef}),u=a.computed(()=>[{width:el(i.width)},i.popperStyle]),c=a.computed(()=>[s.b(),i.popperClass,{[s.m("plain")]:!!i.content}]),f=a.computed(()=>i.transition===`${s.namespace.value}-fade-in-linear`),h=()=>{var b;(b=o.value)==null||b.hide()},p=()=>{t("before-enter")},v=()=>{t("before-leave")},m=()=>{t("after-enter")},d=()=>{t("update:visible",!1),t("after-leave")};return e({popperRef:l,hide:h}),(b,y)=>(a.openBlock(),a.createBlock(a.unref(Gu),a.mergeProps({ref_key:"tooltipRef",ref:o},b.$attrs,{trigger:b.trigger,placement:b.placement,disabled:b.disabled,visible:b.visible,transition:b.transition,"popper-options":b.popperOptions,tabindex:b.tabindex,content:b.content,offset:b.offset,"show-after":b.showAfter,"hide-after":b.hideAfter,"auto-close":b.autoClose,"show-arrow":b.showArrow,"aria-label":b.title,effect:b.effect,enterable:b.enterable,"popper-class":a.unref(c),"popper-style":a.unref(u),teleported:b.teleported,persistent:b.persistent,"gpu-acceleration":a.unref(f),"onUpdate:visible":a.unref(r),onBeforeShow:p,onBeforeHide:v,onShow:m,onHide:d}),{content:a.withCtx(()=>[b.title?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(s).e("title")),role:"title"},a.toDisplayString(b.title),3)):a.createCommentVNode("v-if",!0),a.renderSlot(b.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(b.content),1)])]),default:a.withCtx(()=>[b.$slots.reference?a.renderSlot(b.$slots,"reference",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var tL=We(eL,[["__file","popover.vue"]]);const Eg=(n,e)=>{const t=e.arg||e.value,i=t==null?void 0:t.popperRef;i&&(i.triggerRef=n)};var nL={mounted(n,e){Eg(n,e)},updated(n,e){Eg(n,e)}};const iL=US(nL,"popover"),Ml=Nt(tL,{directive:iL}),Cg=Symbol("sliderContextKey"),rL=$e({modelValue:{type:Ve([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:Hi,inputSize:Hi,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:Ve(Function),default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:Ve(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:hs,default:"top"},marks:{type:Ve(Object)},validateEvent:{type:Boolean,default:!0},...Wi(["ariaLabel"])}),Ku=n=>tt(n)||sn(n)&&n.every(tt),sL={[ot]:Ku,[Sr]:Ku,[fi]:Ku},oL=(n,e,t)=>{const i=a.ref();return a.onMounted(async()=>{n.range?(Array.isArray(n.modelValue)?(e.firstValue=Math.max(n.min,n.modelValue[0]),e.secondValue=Math.min(n.max,n.modelValue[1])):(e.firstValue=n.min,e.secondValue=n.max),e.oldValue=[e.firstValue,e.secondValue]):(typeof n.modelValue!="number"||Number.isNaN(n.modelValue)?e.firstValue=n.min:e.firstValue=Math.min(n.max,Math.max(n.min,n.modelValue)),e.oldValue=e.firstValue),kt(window,"resize",t),await a.nextTick(),t()}),{sliderWrapper:i}},aL=n=>a.computed(()=>n.marks?Object.keys(n.marks).map(Number.parseFloat).sort((t,i)=>t-i).filter(t=>t<=n.max&&t>=n.min).map(t=>({point:t,position:(t-n.min)*100/(n.max-n.min),mark:n.marks[t]})):[]),lL=(n,e,t)=>{const{form:i,formItem:r}=ys(),s=a.shallowRef(),o=a.ref(),l=a.ref(),u={firstButton:o,secondButton:l},c=a.computed(()=>n.disabled||(i==null?void 0:i.disabled)||!1),f=a.computed(()=>Math.min(e.firstValue,e.secondValue)),h=a.computed(()=>Math.max(e.firstValue,e.secondValue)),p=a.computed(()=>n.range?`${100*(h.value-f.value)/(n.max-n.min)}%`:`${100*(e.firstValue-n.min)/(n.max-n.min)}%`),v=a.computed(()=>n.range?`${100*(f.value-n.min)/(n.max-n.min)}%`:"0%"),m=a.computed(()=>n.vertical?{height:n.height}:{}),d=a.computed(()=>n.vertical?{height:p.value,bottom:v.value}:{width:p.value,left:v.value}),b=()=>{s.value&&(e.sliderSize=s.value[`client${n.vertical?"Height":"Width"}`])},y=E=>{const C=n.min+E*(n.max-n.min)/100;if(!n.range)return o;let L;return Math.abs(f.value-C)<Math.abs(h.value-C)?L=e.firstValue<e.secondValue?"firstButton":"secondButton":L=e.firstValue>e.secondValue?"firstButton":"secondButton",u[L]},g=E=>{const C=y(E);return C.value.setPosition(E),C},w=E=>{e.firstValue=E??n.min,S(n.range?[f.value,h.value]:E??n.min)},A=E=>{e.secondValue=E,n.range&&S([f.value,h.value])},S=E=>{t(ot,E),t(Sr,E)},M=async()=>{await a.nextTick(),t(fi,n.range?[f.value,h.value]:n.modelValue)},F=E=>{var C,L,I,x,O,B;if(c.value||e.dragging)return;b();let D=0;if(n.vertical){const k=(I=(L=(C=E.touches)==null?void 0:C.item(0))==null?void 0:L.clientY)!=null?I:E.clientY;D=(s.value.getBoundingClientRect().bottom-k)/e.sliderSize*100}else{const k=(B=(O=(x=E.touches)==null?void 0:x.item(0))==null?void 0:O.clientX)!=null?B:E.clientX,V=s.value.getBoundingClientRect().left;D=(k-V)/e.sliderSize*100}if(!(D<0||D>100))return g(D)};return{elFormItem:r,slider:s,firstButton:o,secondButton:l,sliderDisabled:c,minValue:f,maxValue:h,runwayStyle:m,barStyle:d,resetSize:b,setPosition:g,emitChange:M,onSliderWrapperPrevent:E=>{var C,L;((C=u.firstButton.value)!=null&&C.dragging||(L=u.secondButton.value)!=null&&L.dragging)&&E.preventDefault()},onSliderClick:E=>{F(E)&&M()},onSliderDown:async E=>{const C=F(E);C&&(await a.nextTick(),C.value.onButtonDown(E))},onSliderMarkerDown:E=>{c.value||e.dragging||g(E)},setFirstValue:w,setSecondValue:A}},{left:cL,down:uL,right:dL,up:hL,home:fL,end:pL,pageUp:mL,pageDown:gL}=$n,vL=(n,e,t)=>{const i=a.ref(),r=a.ref(!1),s=a.computed(()=>e.value instanceof Function),o=a.computed(()=>s.value&&e.value(n.modelValue)||n.modelValue),l=pu(()=>{t.value&&(r.value=!0)},50),u=pu(()=>{t.value&&(r.value=!1)},50);return{tooltip:i,tooltipVisible:r,formatValue:o,displayTooltip:l,hideTooltip:u}},yL=(n,e,t)=>{const{disabled:i,min:r,max:s,step:o,showTooltip:l,precision:u,sliderSize:c,formatTooltip:f,emitChange:h,resetSize:p,updateDragging:v}=a.inject(Cg),{tooltip:m,tooltipVisible:d,formatValue:b,displayTooltip:y,hideTooltip:g}=vL(n,f,l),w=a.ref(),A=a.computed(()=>`${(n.modelValue-r.value)/(s.value-r.value)*100}%`),S=a.computed(()=>n.vertical?{bottom:A.value}:{left:A.value}),M=()=>{e.hovering=!0,y()},F=()=>{e.hovering=!1,e.dragging||g()},R=G=>{i.value||(G.preventDefault(),B(G),window.addEventListener("mousemove",D),window.addEventListener("touchmove",D),window.addEventListener("mouseup",k),window.addEventListener("touchend",k),window.addEventListener("contextmenu",k),w.value.focus())},T=G=>{i.value||(e.newPosition=Number.parseFloat(A.value)+G/(s.value-r.value)*100,V(e.newPosition),h())},P=()=>{T(-o.value)},_=()=>{T(o.value)},E=()=>{T(-o.value*4)},C=()=>{T(o.value*4)},L=()=>{i.value||(V(0),h())},I=()=>{i.value||(V(100),h())},x=G=>{let J=!0;[cL,uL].includes(G.key)?P():[dL,hL].includes(G.key)?_():G.key===fL?L():G.key===pL?I():G.key===gL?E():G.key===mL?C():J=!1,J&&G.preventDefault()},O=G=>{let J,j;return G.type.startsWith("touch")?(j=G.touches[0].clientY,J=G.touches[0].clientX):(j=G.clientY,J=G.clientX),{clientX:J,clientY:j}},B=G=>{e.dragging=!0,e.isClick=!0;const{clientX:J,clientY:j}=O(G);n.vertical?e.startY=j:e.startX=J,e.startPosition=Number.parseFloat(A.value),e.newPosition=e.startPosition},D=G=>{if(e.dragging){e.isClick=!1,y(),p();let J;const{clientX:j,clientY:te}=O(G);n.vertical?(e.currentY=te,J=(e.startY-e.currentY)/c.value*100):(e.currentX=j,J=(e.currentX-e.startX)/c.value*100),e.newPosition=e.startPosition+J,V(e.newPosition)}},k=()=>{e.dragging&&(setTimeout(()=>{e.dragging=!1,e.hovering||g(),e.isClick||V(e.newPosition),h()},0),window.removeEventListener("mousemove",D),window.removeEventListener("touchmove",D),window.removeEventListener("mouseup",k),window.removeEventListener("touchend",k),window.removeEventListener("contextmenu",k))},V=async G=>{if(G===null||Number.isNaN(+G))return;G<0?G=0:G>100&&(G=100);const J=100/((s.value-r.value)/o.value);let te=Math.round(G/J)*J*(s.value-r.value)*.01+r.value;te=Number.parseFloat(te.toFixed(u.value)),te!==n.modelValue&&t(ot,te),!e.dragging&&n.modelValue!==e.oldValue&&(e.oldValue=n.modelValue),await a.nextTick(),e.dragging&&y(),m.value.updatePopper()};return a.watch(()=>e.dragging,G=>{v(G)}),kt(w,"touchstart",R,{passive:!1}),{disabled:i,button:w,tooltip:m,tooltipVisible:d,showTooltip:l,wrapperStyle:S,formatValue:b,handleMouseEnter:M,handleMouseLeave:F,onButtonDown:R,onKeyDown:x,setPosition:V}},bL=(n,e,t,i)=>({stops:a.computed(()=>{if(!n.showStops||n.min>n.max)return[];if(n.step===0)return gt("ElSlider","step should not be 0."),[];const o=(n.max-n.min)/n.step,l=100*n.step/(n.max-n.min),u=Array.from({length:o-1}).map((c,f)=>(f+1)*l);return n.range?u.filter(c=>c<100*(t.value-n.min)/(n.max-n.min)||c>100*(i.value-n.min)/(n.max-n.min)):u.filter(c=>c>100*(e.firstValue-n.min)/(n.max-n.min))}),getStopStyle:o=>n.vertical?{bottom:`${o}%`}:{left:`${o}%`}}),xL=(n,e,t,i,r,s)=>{const o=c=>{r(ot,c),r(Sr,c)},l=()=>n.range?![t.value,i.value].every((c,f)=>c===e.oldValue[f]):n.modelValue!==e.oldValue,u=()=>{var c,f;n.min>n.max&&us("Slider","min should not be greater than max.");const h=n.modelValue;n.range&&Array.isArray(h)?h[1]<n.min?o([n.min,n.min]):h[0]>n.max?o([n.max,n.max]):h[0]<n.min?o([n.min,h[1]]):h[1]>n.max?o([h[0],n.max]):(e.firstValue=h[0],e.secondValue=h[1],l()&&(n.validateEvent&&((c=s==null?void 0:s.validate)==null||c.call(s,"change").catch(p=>gt(p))),e.oldValue=h.slice())):!n.range&&typeof h=="number"&&!Number.isNaN(h)&&(h<n.min?o(n.min):h>n.max?o(n.max):(e.firstValue=h,l()&&(n.validateEvent&&((f=s==null?void 0:s.validate)==null||f.call(s,"change").catch(p=>gt(p))),e.oldValue=h)))};u(),a.watch(()=>e.dragging,c=>{c||u()}),a.watch(()=>n.modelValue,(c,f)=>{e.dragging||Array.isArray(c)&&Array.isArray(f)&&c.every((h,p)=>h===f[p])&&e.firstValue===c[0]&&e.secondValue===c[1]||u()},{deep:!0}),a.watch(()=>[n.min,n.max],()=>{u()})},wL=$e({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:hs,default:"top"}}),ML={[ot]:n=>tt(n)},AL=a.defineComponent({name:"ElSliderButton"}),SL=a.defineComponent({...AL,props:wL,emits:ML,setup(n,{expose:e,emit:t}){const i=n,r=Ge("slider"),s=a.reactive({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:i.modelValue}),{disabled:o,button:l,tooltip:u,showTooltip:c,tooltipVisible:f,wrapperStyle:h,formatValue:p,handleMouseEnter:v,handleMouseLeave:m,onButtonDown:d,onKeyDown:b,setPosition:y}=yL(i,s,t),{hovering:g,dragging:w}=a.toRefs(s);return e({onButtonDown:d,onKeyDown:b,setPosition:y,hovering:g,dragging:w}),(A,S)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"button",ref:l,class:a.normalizeClass([a.unref(r).e("button-wrapper"),{hover:a.unref(g),dragging:a.unref(w)}]),style:a.normalizeStyle(a.unref(h)),tabindex:a.unref(o)?-1:0,onMouseenter:a.unref(v),onMouseleave:a.unref(m),onMousedown:a.unref(d),onFocus:a.unref(v),onBlur:a.unref(m),onKeydown:a.unref(b)},[a.createVNode(a.unref(Gu),{ref_key:"tooltip",ref:u,visible:a.unref(f),placement:A.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":A.tooltipClass,disabled:!a.unref(c),persistent:""},{content:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(p)),1)]),default:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass([a.unref(r).e("button"),{hover:a.unref(g),dragging:a.unref(w)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,["tabindex","onMouseenter","onMouseleave","onMousedown","onFocus","onBlur","onKeydown"]))}});var Lg=We(SL,[["__file","button.vue"]]);const _L=$e({mark:{type:Ve([String,Object]),default:void 0}});var TL=a.defineComponent({name:"ElSliderMarker",props:_L,setup(n){const e=Ge("slider"),t=a.computed(()=>Ht(n.mark)?n.mark:n.mark.label),i=a.computed(()=>Ht(n.mark)?void 0:n.mark.style);return()=>a.h("div",{class:e.e("marks-text"),style:i.value},t.value)}});const EL=a.defineComponent({name:"ElSlider"}),CL=a.defineComponent({...EL,props:rL,emits:sL,setup(n,{expose:e,emit:t}){const i=n,r=Ge("slider"),{t:s}=sl(),o=a.reactive({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:l,slider:u,firstButton:c,secondButton:f,sliderDisabled:h,minValue:p,maxValue:v,runwayStyle:m,barStyle:d,resetSize:b,emitChange:y,onSliderWrapperPrevent:g,onSliderClick:w,onSliderDown:A,onSliderMarkerDown:S,setFirstValue:M,setSecondValue:F}=lL(i,o,t),{stops:R,getStopStyle:T}=bL(i,o,p,v),{inputId:P,isLabeledByFormItem:_}=fl(i,{formItemContext:l}),E=Er(),C=a.computed(()=>i.inputSize||E.value),L=a.computed(()=>i.ariaLabel||s("el.slider.defaultLabel",{min:i.min,max:i.max})),I=a.computed(()=>i.range?i.rangeStartLabel||s("el.slider.defaultRangeStartLabel"):L.value),x=a.computed(()=>i.formatValueText?i.formatValueText(J.value):`${J.value}`),O=a.computed(()=>i.rangeEndLabel||s("el.slider.defaultRangeEndLabel")),B=a.computed(()=>i.formatValueText?i.formatValueText(j.value):`${j.value}`),D=a.computed(()=>[r.b(),r.m(E.value),r.is("vertical",i.vertical),{[r.m("with-input")]:i.showInput}]),k=aL(i);xL(i,o,p,v,t,l);const V=a.computed(()=>{const ae=[i.min,i.max,i.step].map(H=>{const Z=`${H}`.split(".")[1];return Z?Z.length:0});return Math.max.apply(null,ae)}),{sliderWrapper:G}=oL(i,o,b),{firstValue:J,secondValue:j,sliderSize:te}=a.toRefs(o),ee=ae=>{o.dragging=ae};return kt(G,"touchstart",g,{passive:!1}),kt(G,"touchmove",g,{passive:!1}),a.provide(Cg,{...a.toRefs(i),sliderSize:te,disabled:h,precision:V,emitChange:y,resetSize:b,updateDragging:ee}),e({onSliderClick:w}),(ae,H)=>{var Z,$;return a.openBlock(),a.createElementBlock("div",{id:ae.range?a.unref(P):void 0,ref_key:"sliderWrapper",ref:G,class:a.normalizeClass(a.unref(D)),role:ae.range?"group":void 0,"aria-label":ae.range&&!a.unref(_)?a.unref(L):void 0,"aria-labelledby":ae.range&&a.unref(_)?(Z=a.unref(l))==null?void 0:Z.labelId:void 0},[a.createElementVNode("div",{ref_key:"slider",ref:u,class:a.normalizeClass([a.unref(r).e("runway"),{"show-input":ae.showInput&&!ae.range},a.unref(r).is("disabled",a.unref(h))]),style:a.normalizeStyle(a.unref(m)),onMousedown:a.unref(A),onTouchstartPassive:a.unref(A)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("bar")),style:a.normalizeStyle(a.unref(d))},null,6),a.createVNode(Lg,{id:ae.range?void 0:a.unref(P),ref_key:"firstButton",ref:c,"model-value":a.unref(J),vertical:ae.vertical,"tooltip-class":ae.tooltipClass,placement:ae.placement,role:"slider","aria-label":ae.range||!a.unref(_)?a.unref(I):void 0,"aria-labelledby":!ae.range&&a.unref(_)?($=a.unref(l))==null?void 0:$.labelId:void 0,"aria-valuemin":ae.min,"aria-valuemax":ae.range?a.unref(j):ae.max,"aria-valuenow":a.unref(J),"aria-valuetext":a.unref(x),"aria-orientation":ae.vertical?"vertical":"horizontal","aria-disabled":a.unref(h),"onUpdate:modelValue":a.unref(M)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),ae.range?(a.openBlock(),a.createBlock(Lg,{key:0,ref_key:"secondButton",ref:f,"model-value":a.unref(j),vertical:ae.vertical,"tooltip-class":ae.tooltipClass,placement:ae.placement,role:"slider","aria-label":a.unref(O),"aria-valuemin":a.unref(J),"aria-valuemax":ae.max,"aria-valuenow":a.unref(j),"aria-valuetext":a.unref(B),"aria-orientation":ae.vertical?"vertical":"horizontal","aria-disabled":a.unref(h),"onUpdate:modelValue":a.unref(F)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):a.createCommentVNode("v-if",!0),ae.showStops?(a.openBlock(),a.createElementBlock("div",{key:1},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(R),(se,z)=>(a.openBlock(),a.createElementBlock("div",{key:z,class:a.normalizeClass(a.unref(r).e("stop")),style:a.normalizeStyle(a.unref(T)(se))},null,6))),128))])):a.createCommentVNode("v-if",!0),a.unref(k).length>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createElementVNode("div",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(k),(se,z)=>(a.openBlock(),a.createElementBlock("div",{key:z,style:a.normalizeStyle(a.unref(T)(se.position)),class:a.normalizeClass([a.unref(r).e("stop"),a.unref(r).e("marks-stop")])},null,6))),128))]),a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("marks"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(k),(se,z)=>(a.openBlock(),a.createBlock(a.unref(TL),{key:z,mark:se.mark,style:a.normalizeStyle(a.unref(T)(se.position)),onMousedown:a.withModifiers(W=>a.unref(S)(se.position),["stop"])},null,8,["mark","style","onMousedown"]))),128))],2)],64)):a.createCommentVNode("v-if",!0)],46,["onMousedown","onTouchstartPassive"]),ae.showInput&&!ae.range?(a.openBlock(),a.createBlock(a.unref(yi),{key:0,ref:"input","model-value":a.unref(J),class:a.normalizeClass(a.unref(r).e("input")),step:ae.step,disabled:a.unref(h),controls:ae.showInputControls,min:ae.min,max:ae.max,precision:a.unref(V),debounce:ae.debounce,size:a.unref(C),"onUpdate:modelValue":a.unref(M),onChange:a.unref(y)},null,8,["model-value","class","step","disabled","controls","min","max","precision","debounce","size","onUpdate:modelValue","onChange"])):a.createCommentVNode("v-if",!0)],10,["id","role","aria-label","aria-labelledby"])}}});var LL=We(CL,[["__file","slider.vue"]]);const An=Nt(LL),Al=Symbol("tabsRootContextKey"),RL=$e({tabs:{type:Ve(Array),default:()=>pi([])}}),Rg="ElTabBar",FL=a.defineComponent({name:Rg}),PL=a.defineComponent({...FL,props:RL,setup(n,{expose:e}){const t=n,i=a.getCurrentInstance(),r=a.inject(Al);r||us(Rg,"<el-tabs><el-tab-bar /></el-tabs>");const s=Ge("tabs"),o=a.ref(),l=a.ref(),u=()=>{let v=0,m=0;const d=["top","bottom"].includes(r.props.tabPosition)?"width":"height",b=d==="width"?"x":"y",y=b==="x"?"left":"top";return t.tabs.every(g=>{var w,A;const S=(A=(w=i.parent)==null?void 0:w.refs)==null?void 0:A[`tab-${g.uid}`];if(!S)return!1;if(!g.active)return!0;v=S[`offset${Vi(y)}`],m=S[`client${Vi(d)}`];const M=window.getComputedStyle(S);return d==="width"&&(m-=Number.parseFloat(M.paddingLeft)+Number.parseFloat(M.paddingRight),v+=Number.parseFloat(M.paddingLeft)),!1}),{[d]:`${m}px`,transform:`translate${Vi(b)}(${v}px)`}},c=()=>l.value=u(),f=[],h=()=>{var v;f.forEach(d=>d.stop()),f.length=0;const m=(v=i.parent)==null?void 0:v.refs;if(m){for(const d in m)if(d.startsWith("tab-")){const b=m[d];b&&f.push(bn(b,c))}}};a.watch(()=>t.tabs,async()=>{await a.nextTick(),c(),h()},{immediate:!0});const p=bn(o,()=>c());return a.onBeforeUnmount(()=>{f.forEach(v=>v.stop()),f.length=0,p.stop()}),e({ref:o,update:c}),(v,m)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"barRef",ref:o,class:a.normalizeClass([a.unref(s).e("active-bar"),a.unref(s).is(a.unref(r).props.tabPosition)]),style:a.normalizeStyle(l.value)},null,6))}});var IL=We(PL,[["__file","tab-bar.vue"]]);const OL=$e({panes:{type:Ve(Array),default:()=>pi([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),NL={tabClick:(n,e,t)=>t instanceof Event,tabRemove:(n,e)=>e instanceof Event},Fg="ElTabNav",BL=a.defineComponent({name:Fg,props:OL,emits:NL,setup(n,{expose:e,emit:t}){const i=a.inject(Al);i||us(Fg,"<el-tabs><tab-nav /></el-tabs>");const r=Ge("tabs"),s=rw(),o=gw(),l=a.ref(),u=a.ref(),c=a.ref(),f=a.ref(),h=a.ref(!1),p=a.ref(0),v=a.ref(!1),m=a.ref(!0),d=a.computed(()=>["top","bottom"].includes(i.props.tabPosition)?"width":"height"),b=a.computed(()=>({transform:`translate${d.value==="width"?"X":"Y"}(-${p.value}px)`})),y=()=>{if(!l.value)return;const R=l.value[`offset${Vi(d.value)}`],T=p.value;if(!T)return;const P=T>R?T-R:0;p.value=P},g=()=>{if(!l.value||!u.value)return;const R=u.value[`offset${Vi(d.value)}`],T=l.value[`offset${Vi(d.value)}`],P=p.value;if(R-P<=T)return;const _=R-P>T*2?P+T:R-T;p.value=_},w=async()=>{const R=u.value;if(!h.value||!c.value||!l.value||!R)return;await a.nextTick();const T=c.value.querySelector(".is-active");if(!T)return;const P=l.value,_=["top","bottom"].includes(i.props.tabPosition),E=T.getBoundingClientRect(),C=P.getBoundingClientRect(),L=_?R.offsetWidth-C.width:R.offsetHeight-C.height,I=p.value;let x=I;_?(E.left<C.left&&(x=I-(C.left-E.left)),E.right>C.right&&(x=I+E.right-C.right)):(E.top<C.top&&(x=I-(C.top-E.top)),E.bottom>C.bottom&&(x=I+(E.bottom-C.bottom))),x=Math.max(x,0),p.value=Math.min(x,L)},A=()=>{var R;if(!u.value||!l.value)return;n.stretch&&((R=f.value)==null||R.update());const T=u.value[`offset${Vi(d.value)}`],P=l.value[`offset${Vi(d.value)}`],_=p.value;P<T?(h.value=h.value||{},h.value.prev=_,h.value.next=_+P<T,T-_<P&&(p.value=T-P)):(h.value=!1,_>0&&(p.value=0))},S=R=>{const T=R.code,{up:P,down:_,left:E,right:C}=$n;if(![P,_,E,C].includes(T))return;const L=Array.from(R.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),I=L.indexOf(R.target);let x;T===E||T===P?I===0?x=L.length-1:x=I-1:I<L.length-1?x=I+1:x=0,L[x].focus({preventScroll:!0}),L[x].click(),M()},M=()=>{m.value&&(v.value=!0)},F=()=>v.value=!1;return a.watch(s,R=>{R==="hidden"?m.value=!1:R==="visible"&&setTimeout(()=>m.value=!0,50)}),a.watch(o,R=>{R?setTimeout(()=>m.value=!0,50):m.value=!1}),bn(c,A),a.onMounted(()=>setTimeout(()=>w(),0)),a.onUpdated(()=>A()),e({scrollToActiveTab:w,removeFocus:F}),()=>{const R=h.value?[a.createVNode("span",{class:[r.e("nav-prev"),r.is("disabled",!h.value.prev)],onClick:y},[a.createVNode(ht,null,{default:()=>[a.createVNode(ki,null,null)]})]),a.createVNode("span",{class:[r.e("nav-next"),r.is("disabled",!h.value.next)],onClick:g},[a.createVNode(ht,null,{default:()=>[a.createVNode(zi,null,null)]})])]:null,T=n.panes.map((P,_)=>{var E,C,L,I;const x=P.uid,O=P.props.disabled,B=(C=(E=P.props.name)!=null?E:P.index)!=null?C:`${_}`,D=!O&&(P.isClosable||n.editable);P.index=`${_}`;const k=D?a.createVNode(ht,{class:"is-icon-close",onClick:J=>t("tabRemove",P,J)},{default:()=>[a.createVNode(yu,null,null)]}):null,V=((I=(L=P.slots).label)==null?void 0:I.call(L))||P.props.label,G=!O&&P.active?0:-1;return a.createVNode("div",{ref:`tab-${x}`,class:[r.e("item"),r.is(i.props.tabPosition),r.is("active",P.active),r.is("disabled",O),r.is("closable",D),r.is("focus",v.value)],id:`tab-${B}`,key:`tab-${x}`,"aria-controls":`pane-${B}`,role:"tab","aria-selected":P.active,tabindex:G,onFocus:()=>M(),onBlur:()=>F(),onClick:J=>{F(),t("tabClick",P,B,J)},onKeydown:J=>{D&&(J.code===$n.delete||J.code===$n.backspace)&&t("tabRemove",P,J)}},[V,k])});return a.createVNode("div",{ref:c,class:[r.e("nav-wrap"),r.is("scrollable",!!h.value),r.is(i.props.tabPosition)]},[R,a.createVNode("div",{class:r.e("nav-scroll"),ref:l},[a.createVNode("div",{class:[r.e("nav"),r.is(i.props.tabPosition),r.is("stretch",n.stretch&&["top","bottom"].includes(i.props.tabPosition))],ref:u,style:b.value,role:"tablist",onKeydown:S},[n.type?null:a.createVNode(IL,{ref:f,tabs:[...n.panes]},null),T])])])}}}),DL=$e({type:{type:String,values:["card","border-card",""],default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:Ve(Function),default:()=>!0},stretch:Boolean}),qu=n=>Ht(n)||tt(n),VL={[ot]:n=>qu(n),tabClick:(n,e)=>e instanceof Event,tabChange:n=>qu(n),edit:(n,e)=>["remove","add"].includes(e),tabRemove:n=>qu(n),tabAdd:()=>!0},kL=a.defineComponent({name:"ElTabs",props:DL,emits:VL,setup(n,{emit:e,slots:t,expose:i}){var r;const s=Ge("tabs"),o=a.computed(()=>["left","right"].includes(n.tabPosition)),{children:l,addChild:u,removeChild:c}=pT(a.getCurrentInstance(),"ElTabPane"),f=a.ref(),h=a.ref((r=n.modelValue)!=null?r:"0"),p=async(y,g=!1)=>{var w,A,S;if(!(h.value===y||Tn(y)))try{await((w=n.beforeLeave)==null?void 0:w.call(n,y,h.value))!==!1&&(h.value=y,g&&(e(ot,y),e("tabChange",y)),(S=(A=f.value)==null?void 0:A.removeFocus)==null||S.call(A))}catch{}},v=(y,g,w)=>{y.props.disabled||(p(g,!0),e("tabClick",y,w))},m=(y,g)=>{y.props.disabled||Tn(y.props.name)||(g.stopPropagation(),e("edit",y.props.name,"remove"),e("tabRemove",y.props.name))},d=()=>{e("edit",void 0,"add"),e("tabAdd")};a.watch(()=>n.modelValue,y=>p(y)),a.watch(h,async()=>{var y;await a.nextTick(),(y=f.value)==null||y.scrollToActiveTab()}),a.provide(Al,{props:n,currentName:h,registerPane:y=>{l.value.push(y)},sortPane:u,unregisterPane:c}),i({currentName:h});const b=({render:y})=>y();return()=>{const y=t["add-icon"],g=n.editable||n.addable?a.createVNode("div",{class:[s.e("new-tab"),o.value&&s.e("new-tab-vertical")],tabindex:"0",onClick:d,onKeydown:S=>{S.code===$n.enter&&d()}},[y?a.renderSlot(t,"add-icon"):a.createVNode(ht,{class:s.is("icon-plus")},{default:()=>[a.createVNode(nl,null,null)]})]):null,w=a.createVNode("div",{class:[s.e("header"),o.value&&s.e("header-vertical"),s.is(n.tabPosition)]},[a.createVNode(b,{render:()=>{const S=l.value.some(M=>M.slots.label);return a.createVNode(BL,{ref:f,currentName:h.value,editable:n.editable,type:n.type,panes:l.value,stretch:n.stretch,onTabClick:v,onTabRemove:m},{$stable:!S})}},null),g]),A=a.createVNode("div",{class:s.e("content")},[a.renderSlot(t,"default")]);return a.createVNode("div",{class:[s.b(),s.m(n.tabPosition),{[s.m("card")]:n.type==="card",[s.m("border-card")]:n.type==="border-card"}]},[A,w])}}}),zL=$e({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),Pg="ElTabPane",UL=a.defineComponent({name:Pg}),GL=a.defineComponent({...UL,props:zL,setup(n){const e=n,t=a.getCurrentInstance(),i=a.useSlots(),r=a.inject(Al);r||us(Pg,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const s=Ge("tab-pane"),o=a.ref(),l=a.computed(()=>e.closable||r.props.closable),u=Df(()=>{var v;return r.currentName.value===((v=e.name)!=null?v:o.value)}),c=a.ref(u.value),f=a.computed(()=>{var v;return(v=e.name)!=null?v:o.value}),h=Df(()=>!e.lazy||c.value||u.value);a.watch(u,v=>{v&&(c.value=!0)});const p=a.reactive({uid:t.uid,slots:i,props:e,paneName:f,active:u,index:o,isClosable:l});return r.registerPane(p),a.onMounted(()=>{r.sortPane(p)}),a.onUnmounted(()=>{r.unregisterPane(p.uid)}),(v,m)=>a.unref(h)?a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:0,id:`pane-${a.unref(f)}`,class:a.normalizeClass(a.unref(s).b()),role:"tabpanel","aria-hidden":!a.unref(u),"aria-labelledby":`tab-${a.unref(f)}`},[a.renderSlot(v.$slots,"default")],10,["id","aria-hidden","aria-labelledby"])),[[a.vShow,a.unref(u)]]):a.createCommentVNode("v-if",!0)}});var Ig=We(GL,[["__file","tab-pane.vue"]]);const Og=Nt(kL,{TabPane:Ig}),Ng=En(Ig);function HL(n){let e;const t=a.ref(!1),i=a.reactive({...n,originalPosition:"",originalOverflow:"",visible:!1});function r(p){i.text=p}function s(){const p=i.parent,v=h.ns;if(!p.vLoadingAddClassList){let m=p.getAttribute("loading-number");m=Number.parseInt(m)-1,m?p.setAttribute("loading-number",m.toString()):(Qa(p,v.bm("parent","relative")),p.removeAttribute("loading-number")),Qa(p,v.bm("parent","hidden"))}o(),f.unmount()}function o(){var p,v;(v=(p=h.$el)==null?void 0:p.parentNode)==null||v.removeChild(h.$el)}function l(){var p;n.beforeClose&&!n.beforeClose()||(t.value=!0,clearTimeout(e),e=setTimeout(u,400),i.visible=!1,(p=n.closed)==null||p.call(n))}function u(){if(!t.value)return;const p=i.parent;t.value=!1,p.vLoadingAddClassList=void 0,s()}const c=a.defineComponent({name:"ElLoading",setup(p,{expose:v}){const{ns:m,zIndex:d}=MT("loading");return v({ns:m,zIndex:d}),()=>{const b=i.spinner||i.svg,y=a.h("svg",{class:"circular",viewBox:i.svgViewBox?i.svgViewBox:"0 0 50 50",...b?{innerHTML:b}:{}},[a.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),g=i.text?a.h("p",{class:m.b("text")},[i.text]):void 0;return a.h(a.Transition,{name:m.b("fade"),onAfterLeave:u},{default:a.withCtx(()=>[a.withDirectives(a.createVNode("div",{style:{backgroundColor:i.background||""},class:[m.b("mask"),i.customClass,i.fullscreen?"is-fullscreen":""]},[a.h("div",{class:m.b("spinner")},[y,g])]),[[a.vShow,i.visible]])])})}}}),f=a.createApp(c),h=f.mount(document.createElement("div"));return{...a.toRefs(i),setText:r,removeElLoadingChild:o,close:l,handleAfterLeave:u,vm:h,get $el(){return h.$el}}}let Sl;const Qu=function(n={}){if(!Rt)return;const e=WL(n);if(e.fullscreen&&Sl)return Sl;const t=HL({...e,closed:()=>{var r;(r=e.closed)==null||r.call(e),e.fullscreen&&(Sl=void 0)}});jL(e,e.parent,t),Bg(e,e.parent,t),e.parent.vLoadingAddClassList=()=>Bg(e,e.parent,t);let i=e.parent.getAttribute("loading-number");return i?i=`${Number.parseInt(i)+1}`:i="1",e.parent.setAttribute("loading-number",i),e.parent.appendChild(t.$el),a.nextTick(()=>t.visible.value=e.visible),e.fullscreen&&(Sl=t),t},WL=n=>{var e,t,i,r;let s;return Ht(n.target)?s=(e=document.querySelector(n.target))!=null?e:document.body:s=n.target||document.body,{parent:s===document.body||n.body?document.body:s,background:n.background||"",svg:n.svg||"",svgViewBox:n.svgViewBox||"",spinner:n.spinner||!1,text:n.text||"",fullscreen:s===document.body&&((t=n.fullscreen)!=null?t:!0),lock:(i=n.lock)!=null?i:!1,customClass:n.customClass||"",visible:(r=n.visible)!=null?r:!0,beforeClose:n.beforeClose,closed:n.closed,target:s}},jL=async(n,e,t)=>{const{nextZIndex:i}=t.vm.zIndex||t.vm._.exposed.zIndex,r={};if(n.fullscreen)t.originalPosition.value=Io(document.body,"position"),t.originalOverflow.value=Io(document.body,"overflow"),r.zIndex=i();else if(n.parent===document.body){t.originalPosition.value=Io(document.body,"position"),await a.nextTick();for(const s of["top","left"]){const o=s==="top"?"scrollTop":"scrollLeft";r[s]=`${n.target.getBoundingClientRect()[s]+document.body[o]+document.documentElement[o]-Number.parseInt(Io(document.body,`margin-${s}`),10)}px`}for(const s of["height","width"])r[s]=`${n.target.getBoundingClientRect()[s]}px`}else t.originalPosition.value=Io(e,"position");for(const[s,o]of Object.entries(r))t.$el.style[s]=o},Bg=(n,e,t)=>{const i=t.vm.ns||t.vm._.exposed.ns;["absolute","fixed","sticky"].includes(t.originalPosition.value)?Qa(e,i.bm("parent","relative")):Up(e,i.bm("parent","relative")),n.fullscreen&&n.lock?Up(e,i.bm("parent","hidden")):Qa(e,i.bm("parent","hidden"))},_l=Symbol("ElLoading"),Dg=(n,e)=>{var t,i,r,s;const o=e.instance,l=p=>en(e.value)?e.value[p]:void 0,u=p=>{const v=Ht(p)&&(o==null?void 0:o[p])||p;return v&&a.ref(v)},c=p=>u(l(p)||n.getAttribute(`element-loading-${Sw(p)}`)),f=(t=l("fullscreen"))!=null?t:e.modifiers.fullscreen,h={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:f,target:(i=l("target"))!=null?i:f?void 0:n,body:(r=l("body"))!=null?r:e.modifiers.body,lock:(s=l("lock"))!=null?s:e.modifiers.lock};n[_l]={options:h,instance:Qu(h)}},$L=(n,e)=>{for(const t of Object.keys(e))a.isRef(e[t])&&(e[t].value=n[t])},ed={mounted(n,e){e.value&&Dg(n,e)},updated(n,e){const t=n[_l];e.oldValue!==e.value&&(e.value&&!e.oldValue?Dg(n,e):e.value&&e.oldValue?en(e.value)&&$L(e.value,t.options):t==null||t.instance.close())},unmounted(n){var e;(e=n[_l])==null||e.instance.close(),n[_l]=null}},ZL={install(n){n.directive("loading",ed),n.config.globalProperties.$loading=Qu},directive:ed,service:Qu},Kn=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t},XL=[{position:"top",mode:"vertical",text:"Begin interaction here to rotate on the x-axis"},{position:"bottom",mode:"vertical",text:"Begin interaction here to rotate on the x-axis"},{position:"left",mode:"horizontal",text:"Begin interaction here to rotate on the y-axis"},{position:"right",mode:"horizontal",text:"Begin interaction here to rotate on the y-axis"}],YL={name:"ScaffoldOverlay",data:function(){return{lockRotationMode:!1,touchActive:!1,rotationOverlays:XL}},props:{positionalRotation:{type:Boolean,default:!1}},methods:{contentMouseActive:function(n,e){if(this.positionalRotation){const t=this.$refs.topLayer;t&&(e?(this.lockRotationMode=!0,t.style.pointerEvents="none",n.type==="touchstart"&&(this.touchActive=!0)):(this.lockRotationMode=!1,this.setRotationMode(void 0,"free"),t.style.pointerEvents="auto",n.type==="touchend"&&(this.touchActive=!1)))}},setRotationMode:function(n,e){this.lockRotationMode||this.$emit("onRotationModeChange",e),n&&(n.preventDefault(),n.stopPropagation())},skipWhenInBound:function(n){if(this.positionalRotation){const e=this.$refs.topLayer,t=this.$refs.contentLayer;if(e&&t){const i=e.style.pointerEvents;e.style.pointerEvents="none";const r=document.elementFromPoint(n.clientX,n.clientY);e.style.pointerEvents=i,t.contains(r)&&n.stopPropagation()}}},forwardEvent:function(n){const e=this.$refs.topLayer;if(!e)return;const t=e.style.pointerEvents;e.style.pointerEvents="none";const i=document.elementFromPoint(n.clientX,n.clientY);if(e.style.pointerEvents=t,i){const r=new MouseEvent(n.type,{bubbles:n.bubbles,cancelable:n.cancelable,view:n.view,clientX:n.clientX,clientY:n.clientY,button:n.button});i.dispatchEvent(r),n.stopPropagation()}n.preventDefault()},forwardTouchEvent:function(n){const e=this.$refs.topLayer;if(!e)return;const t=e.style.pointerEvents;e.style.pointerEvents="none";const i=n.changedTouches[0],r=i.clientX,s=i.clientY,o=document.elementFromPoint(r,s);if(e.style.pointerEvents=t,o){const l=new Touch({identifier:i.identifier,target:o,clientX:i.clientX,clientY:i.clientY,pageX:i.pageX,pageY:i.pageY,screenX:i.screenX,screenY:i.screenY,radiusX:i.radiusX,radiusY:i.radiusY,rotationAngle:i.rotationAngle,force:i.force}),u=new TouchEvent(n.type,{bubbles:n.bubbles,cancelable:n.cancelable,composed:!0,view:n.view,touches:[l],targetTouches:[l],changedTouches:[l]});o.dispatchEvent(u),n.stopPropagation()}n.preventDefault()}}},JL={ref:"overlay"},KL=["onMousedown","onTouchstart"];function qL(n,e,t,i,r,s){return a.openBlock(),a.createElementBlock("div",JL,[a.createElementVNode("div",{class:"content-layer",ref:"contentLayer",onMouseleaveCapture:e[0]||(e[0]=(...o)=>s.skipWhenInBound&&s.skipWhenInBound(...o)),onMousedownCapture:e[1]||(e[1]=o=>s.contentMouseActive(o,!0)),onMouseupCapture:e[2]||(e[2]=o=>s.contentMouseActive(o,!1)),onTouchstartCapture:e[3]||(e[3]=o=>s.contentMouseActive(o,!0)),onTouchendCapture:e[4]||(e[4]=o=>s.contentMouseActive(o,!1))},[a.renderSlot(n.$slots,"default",{},void 0,!0)],544),t.positionalRotation?(a.openBlock(),a.createElementBlock("div",{key:0,ref:"topLayer",onMousemoveCapture:e[7]||(e[7]=(...o)=>s.forwardEvent&&s.forwardEvent(...o)),onMouseoverCapture:e[8]||(e[8]=(...o)=>s.forwardEvent&&s.forwardEvent(...o)),onTouchmoveCapture:e[9]||(e[9]=(...o)=>s.forwardTouchEvent&&s.forwardTouchEvent(...o)),onClickCapture:e[10]||(e[10]=(...o)=>s.forwardEvent&&s.forwardEvent(...o))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.rotationOverlays,o=>(a.openBlock(),a.createElementBlock("div",{key:o.position,class:a.normalizeClass(["rotation-overlay",o.position,n.touchActive?"touch-active":""]),onMousedown:l=>{s.setRotationMode(l,o.mode),s.forwardEvent(l)},onMouseup:e[5]||(e[5]=(...l)=>s.forwardEvent&&s.forwardEvent(...l)),onTouchstart:l=>{s.setRotationMode(l,o.mode),s.forwardTouchEvent(l)},onTouchend:e[6]||(e[6]=(...l)=>s.forwardTouchEvent&&s.forwardTouchEvent(...l))},[a.createElementVNode("span",null,a.toDisplayString(o.text),1)],42,KL))),128))],544)):a.createCommentVNode("",!0)],512)}const Vg=Kn(YL,[["render",qL],["__scopeId","data-v-24f88254"]]);var kg={exports:{}},zg={},Ug;function QL(){return Ug||(Ug=1,function(n){var e=function(){try{return!!Symbol.iterator}catch{return!1}},t=e(),i=function(c){var f={next:function(){var h=c.shift();return{done:h===void 0,value:h}}};return t&&(f[Symbol.iterator]=function(){return f}),f},r=function(c){return encodeURIComponent(c).replace(/%20/g,"+")},s=function(c){return decodeURIComponent(String(c).replace(/\+/g," "))},o=function(){var c=function(h){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var p=typeof h;if(p!=="undefined")if(p==="string")h!==""&&this._fromString(h);else if(h instanceof c){var v=this;h.forEach(function(y,g){v.append(g,y)})}else if(h!==null&&p==="object")if(Object.prototype.toString.call(h)==="[object Array]")for(var m=0;m<h.length;m++){var d=h[m];if(Object.prototype.toString.call(d)==="[object Array]"||d.length!==2)this.append(d[0],d[1]);else throw new TypeError("Expected [string, any] as entry at index "+m+" of URLSearchParams's input")}else for(var b in h)h.hasOwnProperty(b)&&this.append(b,h[b]);else throw new TypeError("Unsupported input's type for URLSearchParams")},f=c.prototype;f.append=function(h,p){h in this._entries?this._entries[h].push(String(p)):this._entries[h]=[String(p)]},f.delete=function(h){delete this._entries[h]},f.get=function(h){return h in this._entries?this._entries[h][0]:null},f.getAll=function(h){return h in this._entries?this._entries[h].slice(0):[]},f.has=function(h){return h in this._entries},f.set=function(h,p){this._entries[h]=[String(p)]},f.forEach=function(h,p){var v;for(var m in this._entries)if(this._entries.hasOwnProperty(m)){v=this._entries[m];for(var d=0;d<v.length;d++)h.call(p,v[d],m,this)}},f.keys=function(){var h=[];return this.forEach(function(p,v){h.push(v)}),i(h)},f.values=function(){var h=[];return this.forEach(function(p){h.push(p)}),i(h)},f.entries=function(){var h=[];return this.forEach(function(p,v){h.push([v,p])}),i(h)},t&&(f[Symbol.iterator]=f.entries),f.toString=function(){var h=[];return this.forEach(function(p,v){h.push(r(v)+"="+r(p))}),h.join("&")},n.URLSearchParams=c},l=function(){try{var c=n.URLSearchParams;return new c("?a=1").toString()==="a=1"&&typeof c.prototype.set=="function"&&typeof c.prototype.entries=="function"}catch{return!1}};l()||o();var u=n.URLSearchParams.prototype;typeof u.sort!="function"&&(u.sort=function(){var c=this,f=[];this.forEach(function(p,v){f.push([v,p]),c._entries||c.delete(v)}),f.sort(function(p,v){return p[0]<v[0]?-1:p[0]>v[0]?1:0}),c._entries&&(c._entries={});for(var h=0;h<f.length;h++)this.append(f[h][0],f[h][1])}),typeof u._fromString!="function"&&Object.defineProperty(u,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(c){if(this._entries)this._entries={};else{var f=[];this.forEach(function(m,d){f.push(d)});for(var h=0;h<f.length;h++)this.delete(f[h])}c=c.replace(/^\?/,"");for(var p=c.split("&"),v,h=0;h<p.length;h++)v=p[h].split("="),this.append(s(v[0]),v.length>1?s(v[1]):"")}})}(typeof Xi<"u"?Xi:typeof window<"u"?window:typeof self<"u"?self:Xi),function(n){var e=function(){try{var r=new n.URL("b","http://a");return r.pathname="c d",r.href==="http://a/c%20d"&&r.searchParams}catch{return!1}},t=function(){var r=n.URL,s=function(u,c){typeof u!="string"&&(u=String(u)),c&&typeof c!="string"&&(c=String(c));var f=document,h;if(c&&(n.location===void 0||c!==n.location.href)){c=c.toLowerCase(),f=document.implementation.createHTMLDocument(""),h=f.createElement("base"),h.href=c,f.head.appendChild(h);try{if(h.href.indexOf(c)!==0)throw new Error(h.href)}catch(w){throw new Error("URL unable to set base "+c+" due to "+w)}}var p=f.createElement("a");p.href=u,h&&(f.body.appendChild(p),p.href=p.href);var v=f.createElement("input");if(v.type="url",v.value=u,p.protocol===":"||!/:/.test(p.href)||!v.checkValidity()&&!c)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:p});var m=new n.URLSearchParams(this.search),d=!0,b=!0,y=this;["append","delete","set"].forEach(function(w){var A=m[w];m[w]=function(){A.apply(m,arguments),d&&(b=!1,y.search=m.toString(),b=!0)}}),Object.defineProperty(this,"searchParams",{value:m,enumerable:!0});var g=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==g&&(g=this.search,b&&(d=!1,this.searchParams._fromString(this.search),d=!0))}})},o=s.prototype,l=function(u){Object.defineProperty(o,u,{get:function(){return this._anchorElement[u]},set:function(c){this._anchorElement[u]=c},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(u){l(u)}),Object.defineProperty(o,"search",{get:function(){return this._anchorElement.search},set:function(u){this._anchorElement.search=u,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(o,{toString:{get:function(){var u=this;return function(){return u.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(u){this._anchorElement.href=u,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(u){this._anchorElement.pathname=u},enumerable:!0},origin:{get:function(){var u={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],c=this._anchorElement.port!=u&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(c?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(u){},enumerable:!0},username:{get:function(){return""},set:function(u){},enumerable:!0}}),s.createObjectURL=function(u){return r.createObjectURL.apply(r,arguments)},s.revokeObjectURL=function(u){return r.revokeObjectURL.apply(r,arguments)},n.URL=s};if(e()||t(),n.location!==void 0&&!("origin"in n.location)){var i=function(){return n.location.protocol+"//"+n.location.hostname+(n.location.port?":"+n.location.port:"")};try{Object.defineProperty(n.location,"origin",{get:i,enumerable:!0})}catch{setInterval(function(){n.location.origin=i()},100)}}}(typeof Xi<"u"?Xi:typeof window<"u"?window:typeof self<"u"?self:Xi)),zg}/**
|
|
20
|
+
`,RT=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function FT(n){const e=window.getComputedStyle(n),t=e.getPropertyValue("box-sizing"),i=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),r=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:RT.map(o=>`${o}:${e.getPropertyValue(o)}`).join(";"),paddingSize:i,borderSize:r,boxSizing:t}}function Im(n,e=1,t){var i;Ln||(Ln=document.createElement("textarea"),document.body.appendChild(Ln));const{paddingSize:r,borderSize:s,boxSizing:o,contextStyle:l}=FT(n);Ln.setAttribute("style",`${l};${LT}`),Ln.value=n.value||n.placeholder||"";let u=Ln.scrollHeight;const c={};o==="border-box"?u=u+s:o==="content-box"&&(u=u-r),Ln.value="";const f=Ln.scrollHeight-r;if(tt(e)){let h=f*e;o==="border-box"&&(h=h+r+s),u=Math.max(h,u),c.minHeight=`${h}px`}if(tt(t)){let h=f*t;o==="border-box"&&(h=h+r+s),u=Math.min(h,u)}return c.height=`${u}px`,(i=Ln.parentNode)==null||i.removeChild(Ln),Ln=void 0,c}const PT=$e({id:{type:String,default:void 0},size:Hi,disabled:Boolean,modelValue:{type:Ve([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Ve([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:Ui},prefixIcon:{type:Ui},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Ve([Object,Array,String]),default:()=>pi({})},autofocus:Boolean,rows:{type:Number,default:2},...Wi(["ariaLabel"])}),IT={[ot]:n=>Ht(n),input:n=>Ht(n),change:n=>Ht(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},OT=a.defineComponent({name:"ElInput",inheritAttrs:!1}),NT=a.defineComponent({...OT,props:PT,emits:IT,setup(n,{expose:e,emit:t}){const i=n,r=a.useAttrs(),s=a.useSlots(),o=a.computed(()=>{const ce={};return i.containerRole==="combobox"&&(ce["aria-haspopup"]=r["aria-haspopup"],ce["aria-owns"]=r["aria-owns"],ce["aria-expanded"]=r["aria-expanded"]),ce}),l=a.computed(()=>[i.type==="textarea"?b.b():d.b(),d.m(v.value),d.is("disabled",m.value),d.is("exceed",J.value),{[d.b("group")]:s.prepend||s.append,[d.m("prefix")]:s.prefix||i.prefixIcon,[d.m("suffix")]:s.suffix||i.suffixIcon||i.clearable||i.showPassword,[d.bm("suffix","password-clear")]:D.value&&k.value,[d.b("hidden")]:i.type==="hidden"},r.class]),u=a.computed(()=>[d.e("wrapper"),d.is("focus",T.value)]),c=jS({excludeKeys:a.computed(()=>Object.keys(o.value))}),{form:f,formItem:h}=ys(),{inputId:p}=fl(i,{formItemContext:h}),v=Er(),m=Go(),d=Ge("input"),b=Ge("textarea"),y=a.shallowRef(),g=a.shallowRef(),w=a.ref(!1),A=a.ref(!1),S=a.ref(),M=a.shallowRef(i.inputStyle),F=a.computed(()=>y.value||g.value),{wrapperRef:R,isFocused:T,handleFocus:P,handleBlur:_}=Lm(F,{beforeFocus(){return m.value},afterBlur(){var ce;i.validateEvent&&((ce=h==null?void 0:h.validate)==null||ce.call(h,"blur").catch(ge=>gt(ge)))}}),E=a.computed(()=>{var ce;return(ce=f==null?void 0:f.statusIcon)!=null?ce:!1}),C=a.computed(()=>(h==null?void 0:h.validateState)||""),L=a.computed(()=>C.value&&jp[C.value]),I=a.computed(()=>A.value?VS:PS),x=a.computed(()=>[r.style]),O=a.computed(()=>[i.inputStyle,M.value,{resize:i.resize}]),B=a.computed(()=>jn(i.modelValue)?"":String(i.modelValue)),D=a.computed(()=>i.clearable&&!m.value&&!i.readonly&&!!B.value&&(T.value||w.value)),k=a.computed(()=>i.showPassword&&!m.value&&!i.readonly&&!!B.value&&(!!B.value||T.value)),V=a.computed(()=>i.showWordLimit&&!!i.maxlength&&(i.type==="text"||i.type==="textarea")&&!m.value&&!i.readonly&&!i.showPassword),G=a.computed(()=>B.value.length),J=a.computed(()=>!!V.value&&G.value>Number(i.maxlength)),j=a.computed(()=>!!s.suffix||!!i.suffixIcon||D.value||i.showPassword||V.value||!!C.value&&E.value),[te,ee]=hT(y);bn(g,ce=>{if(Z(),!V.value||i.resize!=="both")return;const ge=ce[0],{width:re}=ge.contentRect;S.value={right:`calc(100% - ${re+15+6}px)`}});const ae=()=>{const{type:ce,autosize:ge}=i;if(!(!Rt||ce!=="textarea"||!g.value))if(ge){const re=en(ge)?ge.minRows:void 0,he=en(ge)?ge.maxRows:void 0,ve=Im(g.value,re,he);M.value={overflowY:"hidden",...ve},a.nextTick(()=>{g.value.offsetHeight,M.value=ve})}else M.value={minHeight:Im(g.value).minHeight}},Z=(ce=>{let ge=!1;return()=>{var re;if(ge||!i.autosize)return;((re=g.value)==null?void 0:re.offsetParent)===null||(ce(),ge=!0)}})(ae),$=()=>{const ce=F.value,ge=i.formatter?i.formatter(B.value):B.value;!ce||ce.value===ge||(ce.value=ge)},se=async ce=>{te();let{value:ge}=ce.target;if(i.formatter&&(ge=i.parser?i.parser(ge):ge),!W.value){if(ge===B.value){$();return}t(ot,ge),t("input",ge),await a.nextTick(),$(),ee()}},z=ce=>{t("change",ce.target.value)},{isComposing:W,handleCompositionStart:q,handleCompositionUpdate:le,handleCompositionEnd:oe}=Rm({emit:t,afterComposition:se}),U=()=>{A.value=!A.value,N()},N=async()=>{var ce;await a.nextTick(),(ce=F.value)==null||ce.focus()},X=()=>{var ce;return(ce=F.value)==null?void 0:ce.blur()},Y=ce=>{w.value=!1,t("mouseleave",ce)},ie=ce=>{w.value=!0,t("mouseenter",ce)},ue=ce=>{t("keydown",ce)},me=()=>{var ce;(ce=F.value)==null||ce.select()},be=()=>{t(ot,""),t("change",""),t("clear"),t("input","")};return a.watch(()=>i.modelValue,()=>{var ce;a.nextTick(()=>ae()),i.validateEvent&&((ce=h==null?void 0:h.validate)==null||ce.call(h,"change").catch(ge=>gt(ge)))}),a.watch(B,()=>$()),a.watch(()=>i.type,async()=>{await a.nextTick(),$(),ae()}),a.onMounted(()=>{!i.formatter&&i.parser&>("ElInput","If you set the parser, you also need to set the formatter."),$(),a.nextTick(ae)}),e({input:y,textarea:g,ref:F,textareaStyle:O,autosize:a.toRef(i,"autosize"),isComposing:W,focus:N,blur:X,select:me,clear:be,resizeTextarea:ae}),(ce,ge)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps(a.unref(o),{class:[a.unref(l),{[a.unref(d).bm("group","append")]:ce.$slots.append,[a.unref(d).bm("group","prepend")]:ce.$slots.prepend}],style:a.unref(x),role:ce.containerRole,onMouseenter:ie,onMouseleave:Y}),[a.createCommentVNode(" input "),ce.type!=="textarea"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createCommentVNode(" prepend slot "),ce.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(d).be("group","prepend"))},[a.renderSlot(ce.$slots,"prepend")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref_key:"wrapperRef",ref:R,class:a.normalizeClass(a.unref(u))},[a.createCommentVNode(" prefix slot "),ce.$slots.prefix||ce.prefixIcon?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(d).e("prefix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("prefix-inner"))},[a.renderSlot(ce.$slots,"prefix"),ce.prefixIcon?(a.openBlock(),a.createBlock(a.unref(ht),{key:0,class:a.normalizeClass(a.unref(d).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ce.prefixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("input",a.mergeProps({id:a.unref(p),ref_key:"input",ref:y,class:a.unref(d).e("inner")},a.unref(c),{minlength:ce.minlength,maxlength:ce.maxlength,type:ce.showPassword?A.value?"text":"password":ce.type,disabled:a.unref(m),readonly:ce.readonly,autocomplete:ce.autocomplete,tabindex:ce.tabindex,"aria-label":ce.ariaLabel,placeholder:ce.placeholder,style:ce.inputStyle,form:ce.form,autofocus:ce.autofocus,onCompositionstart:a.unref(q),onCompositionupdate:a.unref(le),onCompositionend:a.unref(oe),onInput:se,onChange:z,onKeydown:ue}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),a.createCommentVNode(" suffix slot "),a.unref(j)?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(a.unref(d).e("suffix"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("suffix-inner"))},[!a.unref(D)||!a.unref(k)||!a.unref(V)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.renderSlot(ce.$slots,"suffix"),ce.suffixIcon?(a.openBlock(),a.createBlock(a.unref(ht),{key:0,class:a.normalizeClass(a.unref(d).e("icon"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(ce.suffixIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],64)):a.createCommentVNode("v-if",!0),a.unref(D)?(a.openBlock(),a.createBlock(a.unref(ht),{key:1,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("clear")]),onMousedown:a.withModifiers(a.unref(To),["prevent"]),onClick:be},{default:a.withCtx(()=>[a.createVNode(a.unref(vu))]),_:1},8,["class","onMousedown"])):a.createCommentVNode("v-if",!0),a.unref(k)?(a.openBlock(),a.createBlock(a.unref(ht),{key:2,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("password")]),onClick:U},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(I))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),a.unref(V)?(a.openBlock(),a.createElementBlock("span",{key:3,class:a.normalizeClass(a.unref(d).e("count"))},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(d).e("count-inner"))},a.toDisplayString(a.unref(G))+" / "+a.toDisplayString(ce.maxlength),3)],2)):a.createCommentVNode("v-if",!0),a.unref(C)&&a.unref(L)&&a.unref(E)?(a.openBlock(),a.createBlock(a.unref(ht),{key:4,class:a.normalizeClass([a.unref(d).e("icon"),a.unref(d).e("validateIcon"),a.unref(d).is("loading",a.unref(C)==="validating")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(a.unref(L))))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],2)):a.createCommentVNode("v-if",!0)],2),a.createCommentVNode(" append slot "),ce.$slots.append?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(a.unref(d).be("group","append"))},[a.renderSlot(ce.$slots,"append")],2)):a.createCommentVNode("v-if",!0)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createCommentVNode(" textarea "),a.createElementVNode("textarea",a.mergeProps({id:a.unref(p),ref_key:"textarea",ref:g,class:[a.unref(b).e("inner"),a.unref(d).is("focus",a.unref(T))]},a.unref(c),{minlength:ce.minlength,maxlength:ce.maxlength,tabindex:ce.tabindex,disabled:a.unref(m),readonly:ce.readonly,autocomplete:ce.autocomplete,style:a.unref(O),"aria-label":ce.ariaLabel,placeholder:ce.placeholder,form:ce.form,autofocus:ce.autofocus,rows:ce.rows,onCompositionstart:a.unref(q),onCompositionupdate:a.unref(le),onCompositionend:a.unref(oe),onInput:se,onFocus:a.unref(P),onBlur:a.unref(_),onChange:z,onKeydown:ue}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),a.unref(V)?(a.openBlock(),a.createElementBlock("span",{key:0,style:a.normalizeStyle(S.value),class:a.normalizeClass(a.unref(d).e("count"))},a.toDisplayString(a.unref(G))+" / "+a.toDisplayString(ce.maxlength),7)):a.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var BT=We(NT,[["__file","input.vue"]]);const DT=Nt(BT),bs=4,VT={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},kT=({move:n,size:e,bar:t})=>({[t.size]:e,transform:`translate${t.axis}(${n}%)`}),Iu=Symbol("scrollbarContextKey"),zT=$e({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),UT="Thumb";var Om=We(a.defineComponent({__name:"thumb",props:zT,setup(n){const e=n,t=a.inject(Iu),i=Ge("scrollbar");t||us(UT,"can not inject scrollbar context");const r=a.ref(),s=a.ref(),o=a.ref({}),l=a.ref(!1);let u=!1,c=!1,f=Rt?document.onselectstart:null;const h=a.computed(()=>VT[e.vertical?"vertical":"horizontal"]),p=a.computed(()=>kT({size:e.size,move:e.move,bar:h.value})),v=a.computed(()=>r.value[h.value.offset]**2/t.wrapElement[h.value.scrollSize]/e.ratio/s.value[h.value.offset]),m=M=>{var F;if(M.stopPropagation(),M.ctrlKey||[1,2].includes(M.button))return;(F=window.getSelection())==null||F.removeAllRanges(),b(M);const R=M.currentTarget;R&&(o.value[h.value.axis]=R[h.value.offset]-(M[h.value.client]-R.getBoundingClientRect()[h.value.direction]))},d=M=>{if(!s.value||!r.value||!t.wrapElement)return;const F=Math.abs(M.target.getBoundingClientRect()[h.value.direction]-M[h.value.client]),R=s.value[h.value.offset]/2,T=(F-R)*100*v.value/r.value[h.value.offset];t.wrapElement[h.value.scroll]=T*t.wrapElement[h.value.scrollSize]/100},b=M=>{M.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",y),document.addEventListener("mouseup",g),f=document.onselectstart,document.onselectstart=()=>!1},y=M=>{if(!r.value||!s.value||u===!1)return;const F=o.value[h.value.axis];if(!F)return;const R=(r.value.getBoundingClientRect()[h.value.direction]-M[h.value.client])*-1,T=s.value[h.value.offset]-F,P=(R-T)*100*v.value/r.value[h.value.offset];t.wrapElement[h.value.scroll]=P*t.wrapElement[h.value.scrollSize]/100},g=()=>{u=!1,o.value[h.value.axis]=0,document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",g),S(),c&&(l.value=!1)},w=()=>{c=!1,l.value=!!e.size},A=()=>{c=!0,l.value=u};a.onBeforeUnmount(()=>{S(),document.removeEventListener("mouseup",g)});const S=()=>{document.onselectstart!==f&&(document.onselectstart=f)};return kt(a.toRef(t,"scrollbarElement"),"mousemove",w),kt(a.toRef(t,"scrollbarElement"),"mouseleave",A),(M,F)=>(a.openBlock(),a.createBlock(a.Transition,{name:a.unref(i).b("fade"),persisted:""},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{ref_key:"instance",ref:r,class:a.normalizeClass([a.unref(i).e("bar"),a.unref(i).is(a.unref(h).key)]),onMousedown:d},[a.createElementVNode("div",{ref_key:"thumb",ref:s,class:a.normalizeClass(a.unref(i).e("thumb")),style:a.normalizeStyle(a.unref(p)),onMousedown:m},null,38)],34),[[a.vShow,M.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const GT=$e({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var HT=We(a.defineComponent({__name:"bar",props:GT,setup(n,{expose:e}){const t=n,i=a.inject(Iu),r=a.ref(0),s=a.ref(0),o=a.ref(""),l=a.ref(""),u=a.ref(1),c=a.ref(1);return e({handleScroll:p=>{if(p){const v=p.offsetHeight-bs,m=p.offsetWidth-bs;s.value=p.scrollTop*100/v*u.value,r.value=p.scrollLeft*100/m*c.value}},update:()=>{const p=i==null?void 0:i.wrapElement;if(!p)return;const v=p.offsetHeight-bs,m=p.offsetWidth-bs,d=v**2/p.scrollHeight,b=m**2/p.scrollWidth,y=Math.max(d,t.minSize),g=Math.max(b,t.minSize);u.value=d/(v-d)/(y/(v-y)),c.value=b/(m-b)/(g/(m-g)),l.value=y+bs<v?`${y}px`:"",o.value=g+bs<m?`${g}px`:""}}),(p,v)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createVNode(Om,{move:r.value,ratio:c.value,size:o.value,always:p.always},null,8,["move","ratio","size","always"]),a.createVNode(Om,{move:s.value,ratio:u.value,size:l.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const WT=$e({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Ve([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...Wi(["ariaLabel","ariaOrientation"])}),jT={scroll:({scrollTop:n,scrollLeft:e})=>[n,e].every(tt)},Ou="ElScrollbar",$T=a.defineComponent({name:Ou}),ZT=a.defineComponent({...$T,props:WT,emits:jT,setup(n,{expose:e,emit:t}){const i=n,r=Ge("scrollbar");let s,o,l=0,u=0;const c=a.ref(),f=a.ref(),h=a.ref(),p=a.ref(),v=a.computed(()=>{const S={};return i.height&&(S.height=el(i.height)),i.maxHeight&&(S.maxHeight=el(i.maxHeight)),[i.wrapStyle,S]}),m=a.computed(()=>[i.wrapClass,r.e("wrap"),{[r.em("wrap","hidden-default")]:!i.native}]),d=a.computed(()=>[r.e("view"),i.viewClass]),b=()=>{var S;f.value&&((S=p.value)==null||S.handleScroll(f.value),l=f.value.scrollTop,u=f.value.scrollLeft,t("scroll",{scrollTop:f.value.scrollTop,scrollLeft:f.value.scrollLeft}))};function y(S,M){en(S)?f.value.scrollTo(S):tt(S)&&tt(M)&&f.value.scrollTo(S,M)}const g=S=>{if(!tt(S)){gt(Ou,"value must be a number");return}f.value.scrollTop=S},w=S=>{if(!tt(S)){gt(Ou,"value must be a number");return}f.value.scrollLeft=S},A=()=>{var S;(S=p.value)==null||S.update()};return a.watch(()=>i.noresize,S=>{S?(s==null||s(),o==null||o()):({stop:s}=bn(h,A),o=kt("resize",A))},{immediate:!0}),a.watch(()=>[i.maxHeight,i.height],()=>{i.native||a.nextTick(()=>{var S;A(),f.value&&((S=p.value)==null||S.handleScroll(f.value))})}),a.provide(Iu,a.reactive({scrollbarElement:c,wrapElement:f})),a.onActivated(()=>{f.value&&(f.value.scrollTop=l,f.value.scrollLeft=u)}),a.onMounted(()=>{i.native||a.nextTick(()=>{A()})}),a.onUpdated(()=>A()),e({wrapRef:f,update:A,scrollTo:y,setScrollTop:g,setScrollLeft:w,handleScroll:b}),(S,M)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"scrollbarRef",ref:c,class:a.normalizeClass(a.unref(r).b())},[a.createElementVNode("div",{ref_key:"wrapRef",ref:f,class:a.normalizeClass(a.unref(m)),style:a.normalizeStyle(a.unref(v)),tabindex:S.tabindex,onScroll:b},[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(S.tag),{id:S.id,ref_key:"resizeRef",ref:h,class:a.normalizeClass(a.unref(d)),style:a.normalizeStyle(S.viewStyle),role:S.role,"aria-label":S.ariaLabel,"aria-orientation":S.ariaOrientation},{default:a.withCtx(()=>[a.renderSlot(S.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),S.native?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(HT,{key:0,ref_key:"barRef",ref:p,always:S.always,"min-size":S.minSize},null,8,["always","min-size"]))],2))}});var XT=We(ZT,[["__file","scrollbar.vue"]]);const YT=Nt(XT),Nu=Symbol("popper"),Nm=Symbol("popperContent"),Bm=$e({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),JT=a.defineComponent({name:"ElPopper",inheritAttrs:!1}),KT=a.defineComponent({...JT,props:Bm,setup(n,{expose:e}){const t=n,i=a.ref(),r=a.ref(),s=a.ref(),o=a.ref(),l=a.computed(()=>t.role),u={triggerRef:i,popperInstanceRef:r,contentRef:s,referenceRef:o,role:l};return e(u),a.provide(Nu,u),(c,f)=>a.renderSlot(c.$slots,"default")}});var qT=We(KT,[["__file","popper.vue"]]);const Dm=$e({arrowOffset:{type:Number,default:5}}),QT=a.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),eE=a.defineComponent({...QT,props:Dm,setup(n,{expose:e}){const t=n,i=Ge("popper"),{arrowOffset:r,arrowRef:s,arrowStyle:o}=a.inject(Nm,void 0);return a.watch(()=>t.arrowOffset,l=>{r.value=l}),a.onBeforeUnmount(()=>{s.value=void 0}),e({arrowRef:s}),(l,u)=>(a.openBlock(),a.createElementBlock("span",{ref_key:"arrowRef",ref:s,class:a.normalizeClass(a.unref(i).e("arrow")),style:a.normalizeStyle(a.unref(o)),"data-popper-arrow":""},null,6))}});var tE=We(eE,[["__file","arrow.vue"]]);const Bu="ElOnlyChild",nE=a.defineComponent({name:Bu,setup(n,{slots:e,attrs:t}){var i;const r=a.inject(wm),s=dT((i=r==null?void 0:r.setForwardRef)!=null?i:To);return()=>{var o;const l=(o=e.default)==null?void 0:o.call(e,t);if(!l)return null;if(l.length>1)return gt(Bu,"requires exact only one valid child."),null;const u=Vm(l);return u?a.withDirectives(a.cloneVNode(u,t),[[s]]):(gt(Bu,"no valid child node found"),null)}}});function Vm(n){if(!n)return null;const e=n;for(const t of e){if(en(t))switch(t.type){case a.Comment:continue;case a.Text:case"svg":return km(t);case a.Fragment:return Vm(t.children);default:return t}return km(t)}return null}function km(n){const e=Ge("only-child");return a.createVNode("span",{class:e.e("content")},[n])}const zm=$e({virtualRef:{type:Ve(Object)},virtualTriggering:Boolean,onMouseenter:{type:Ve(Function)},onMouseleave:{type:Ve(Function)},onClick:{type:Ve(Function)},onKeydown:{type:Ve(Function)},onFocus:{type:Ve(Function)},onBlur:{type:Ve(Function)},onContextmenu:{type:Ve(Function)},id:String,open:Boolean}),iE=a.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),rE=a.defineComponent({...iE,props:zm,setup(n,{expose:e}){const t=n,{role:i,triggerRef:r}=a.inject(Nu,void 0);uT(r);const s=a.computed(()=>l.value?t.id:void 0),o=a.computed(()=>{if(i&&i.value==="tooltip")return t.open&&t.id?t.id:void 0}),l=a.computed(()=>{if(i&&i.value!=="tooltip")return i.value}),u=a.computed(()=>l.value?`${t.open}`:void 0);let c;const f=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return a.onMounted(()=>{a.watch(()=>t.virtualRef,h=>{h&&(r.value=li(h))},{immediate:!0}),a.watch(r,(h,p)=>{c==null||c(),c=void 0,Ar(h)&&(f.forEach(v=>{var m;const d=t[v];d&&(h.addEventListener(v.slice(2).toLowerCase(),d),(m=p==null?void 0:p.removeEventListener)==null||m.call(p,v.slice(2).toLowerCase(),d))}),c=a.watch([s,o,l,u],v=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((m,d)=>{jn(v[d])?h.removeAttribute(m):h.setAttribute(m,v[d])})},{immediate:!0})),Ar(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(v=>p.removeAttribute(v))},{immediate:!0})}),a.onBeforeUnmount(()=>{if(c==null||c(),c=void 0,r.value&&Ar(r.value)){const h=r.value;f.forEach(p=>{const v=t[p];v&&h.removeEventListener(p.slice(2).toLowerCase(),v)}),r.value=void 0}}),e({triggerRef:r}),(h,p)=>h.virtualTriggering?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createBlock(a.unref(nE),a.mergeProps({key:0},h.$attrs,{"aria-controls":a.unref(s),"aria-describedby":a.unref(o),"aria-expanded":a.unref(u),"aria-haspopup":a.unref(l)}),{default:a.withCtx(()=>[a.renderSlot(h.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var sE=We(rE,[["__file","trigger.vue"]]);const Du="focus-trap.focus-after-trapped",Vu="focus-trap.focus-after-released",oE="focus-trap.focusout-prevented",Um={cancelable:!0,bubbles:!1},aE={cancelable:!0,bubbles:!1},Gm="focusAfterTrapped",Hm="focusAfterReleased",lE=Symbol("elFocusTrap"),ku=a.ref(),pl=a.ref(0),zu=a.ref(0);let ml=0;const Wm=n=>{const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const r=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||r?NodeFilter.FILTER_SKIP:i.tabIndex>=0||i===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e},jm=(n,e)=>{for(const t of n)if(!cE(t,e))return t},cE=(n,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1},uE=n=>{const e=Wm(n),t=jm(e,n),i=jm(e.reverse(),n);return[t,i]},dE=n=>n instanceof HTMLInputElement&&"select"in n,ji=(n,e)=>{if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),zu.value=window.performance.now(),n!==t&&dE(n)&&e&&n.select()}};function $m(n,e){const t=[...n],i=n.indexOf(e);return i!==-1&&t.splice(i,1),t}const hE=()=>{let n=[];return{push:i=>{const r=n[0];r&&i!==r&&r.pause(),n=$m(n,i),n.unshift(i)},remove:i=>{var r,s;n=$m(n,i),(s=(r=n[0])==null?void 0:r.resume)==null||s.call(r)}}},fE=(n,e=!1)=>{const t=document.activeElement;for(const i of n)if(ji(i,e),document.activeElement!==t)return},Zm=hE(),pE=()=>pl.value>zu.value,gl=()=>{ku.value="pointer",pl.value=window.performance.now()},Xm=()=>{ku.value="keyboard",pl.value=window.performance.now()},mE=()=>(a.onMounted(()=>{ml===0&&(document.addEventListener("mousedown",gl),document.addEventListener("touchstart",gl),document.addEventListener("keydown",Xm)),ml++}),a.onBeforeUnmount(()=>{ml--,ml<=0&&(document.removeEventListener("mousedown",gl),document.removeEventListener("touchstart",gl),document.removeEventListener("keydown",Xm))}),{focusReason:ku,lastUserFocusTimestamp:pl,lastAutomatedFocusTimestamp:zu}),vl=n=>new CustomEvent(oE,{...aE,detail:n}),gE=a.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Gm,Hm,"focusin","focusout","focusout-prevented","release-requested"],setup(n,{emit:e}){const t=a.ref();let i,r;const{focusReason:s}=mE();sT(m=>{n.trapped&&!o.paused&&e("release-requested",m)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=m=>{if(!n.loop&&!n.trapped||o.paused)return;const{key:d,altKey:b,ctrlKey:y,metaKey:g,currentTarget:w,shiftKey:A}=m,{loop:S}=n,M=d===$n.tab&&!b&&!y&&!g,F=document.activeElement;if(M&&F){const R=w,[T,P]=uE(R);if(T&&P){if(!A&&F===P){const E=vl({focusReason:s.value});e("focusout-prevented",E),E.defaultPrevented||(m.preventDefault(),S&&ji(T,!0))}else if(A&&[T,R].includes(F)){const E=vl({focusReason:s.value});e("focusout-prevented",E),E.defaultPrevented||(m.preventDefault(),S&&ji(P,!0))}}else if(F===R){const E=vl({focusReason:s.value});e("focusout-prevented",E),E.defaultPrevented||m.preventDefault()}}};a.provide(lE,{focusTrapRef:t,onKeydown:l}),a.watch(()=>n.focusTrapEl,m=>{m&&(t.value=m)},{immediate:!0}),a.watch([t],([m],[d])=>{m&&(m.addEventListener("keydown",l),m.addEventListener("focusin",f),m.addEventListener("focusout",h)),d&&(d.removeEventListener("keydown",l),d.removeEventListener("focusin",f),d.removeEventListener("focusout",h))});const u=m=>{e(Gm,m)},c=m=>e(Hm,m),f=m=>{const d=a.unref(t);if(!d)return;const b=m.target,y=m.relatedTarget,g=b&&d.contains(b);n.trapped||y&&d.contains(y)||(i=y),g&&e("focusin",m),!o.paused&&n.trapped&&(g?r=b:ji(r,!0))},h=m=>{const d=a.unref(t);if(!(o.paused||!d))if(n.trapped){const b=m.relatedTarget;!jn(b)&&!d.contains(b)&&setTimeout(()=>{if(!o.paused&&n.trapped){const y=vl({focusReason:s.value});e("focusout-prevented",y),y.defaultPrevented||ji(r,!0)}},0)}else{const b=m.target;b&&d.contains(b)||e("focusout",m)}};async function p(){await a.nextTick();const m=a.unref(t);if(m){Zm.push(o);const d=m.contains(document.activeElement)?i:document.activeElement;if(i=d,!m.contains(d)){const y=new Event(Du,Um);m.addEventListener(Du,u),m.dispatchEvent(y),y.defaultPrevented||a.nextTick(()=>{let g=n.focusStartEl;Ht(g)||(ji(g),document.activeElement!==g&&(g="first")),g==="first"&&fE(Wm(m),!0),(document.activeElement===d||g==="container")&&ji(m)})}}}function v(){const m=a.unref(t);if(m){m.removeEventListener(Du,u);const d=new CustomEvent(Vu,{...Um,detail:{focusReason:s.value}});m.addEventListener(Vu,c),m.dispatchEvent(d),!d.defaultPrevented&&(s.value=="keyboard"||!pE()||m.contains(document.activeElement))&&ji(i??document.body),m.removeEventListener(Vu,c),Zm.remove(o)}}return a.onMounted(()=>{n.trapped&&p(),a.watch(()=>n.trapped,m=>{m?p():v()})}),a.onBeforeUnmount(()=>{n.trapped&&v(),t.value&&(t.value.removeEventListener("keydown",l),t.value.removeEventListener("focusin",f),t.value.removeEventListener("focusout",h),t.value=void 0)}),{onKeydown:l}}});function vE(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default",{handleKeydown:n.onKeydown})}var yE=We(gE,[["render",vE],["__file","focus-trap.vue"]]);const bE=["fixed","absolute"],xE=$e({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Ve(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:hs,default:"bottom"},popperOptions:{type:Ve(Object),default:()=>({})},strategy:{type:String,values:bE,default:"absolute"}}),Ym=$e({...xE,id:String,style:{type:Ve([String,Array,Object])},className:{type:Ve([String,Array,Object])},effect:{type:Ve(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:Ve([String,Array,Object])},popperStyle:{type:Ve([String,Array,Object])},referenceEl:{type:Ve(Object)},triggerTargetEl:{type:Ve(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...Wi(["ariaLabel"])}),wE={mouseenter:n=>n instanceof MouseEvent,mouseleave:n=>n instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},ME=(n,e=[])=>{const{placement:t,strategy:i,popperOptions:r}=n,s={placement:t,strategy:i,...r,modifiers:[...SE(n),...e]};return _E(s,r==null?void 0:r.modifiers),s},AE=n=>{if(Rt)return li(n)};function SE(n){const{offset:e,gpuAcceleration:t,fallbackPlacements:i}=n;return[{name:"offset",options:{offset:[0,e??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:i}},{name:"computeStyles",options:{gpuAcceleration:t}}]}function _E(n,e){e&&(n.modifiers=[...n.modifiers,...e??[]])}const TE=0,EE=n=>{const{popperInstanceRef:e,contentRef:t,triggerRef:i,role:r}=a.inject(Nu,void 0),s=a.ref(),o=a.ref(),l=a.computed(()=>({name:"eventListeners",enabled:!!n.visible})),u=a.computed(()=>{var y;const g=a.unref(s),w=(y=a.unref(o))!=null?y:TE;return{name:"arrow",enabled:!hS(g),options:{element:g,padding:w}}}),c=a.computed(()=>({onFirstUpdate:()=>{m()},...ME(n,[a.unref(u),a.unref(l)])})),f=a.computed(()=>AE(n.referenceEl)||a.unref(i)),{attributes:h,state:p,styles:v,update:m,forceUpdate:d,instanceRef:b}=nT(f,t,c);return a.watch(b,y=>e.value=y),a.onMounted(()=>{a.watch(()=>{var y;return(y=a.unref(f))==null?void 0:y.getBoundingClientRect()},()=>{m()})}),{attributes:h,arrowRef:s,contentRef:t,instanceRef:b,state:p,styles:v,role:r,forceUpdate:d,update:m}},CE=(n,{attributes:e,styles:t,role:i})=>{const{nextZIndex:r}=Em(),s=Ge("popper"),o=a.computed(()=>a.unref(e).popper),l=a.ref(tt(n.zIndex)?n.zIndex:r()),u=a.computed(()=>[s.b(),s.is("pure",n.pure),s.is(n.effect),n.popperClass]),c=a.computed(()=>[{zIndex:a.unref(l)},a.unref(t).popper,n.popperStyle||{}]),f=a.computed(()=>i.value==="dialog"?"false":void 0),h=a.computed(()=>a.unref(t).arrow||{});return{ariaModal:f,arrowStyle:h,contentAttrs:o,contentClass:u,contentStyle:c,contentZIndex:l,updateZIndex:()=>{l.value=tt(n.zIndex)?n.zIndex:r()}}},LE=(n,e)=>{const t=a.ref(!1),i=a.ref();return{focusStartRef:i,trapped:t,onFocusAfterReleased:c=>{var f;((f=c.detail)==null?void 0:f.focusReason)!=="pointer"&&(i.value="first",e("blur"))},onFocusAfterTrapped:()=>{e("focus")},onFocusInTrap:c=>{n.visible&&!t.value&&(c.target&&(i.value=c.target),t.value=!0)},onFocusoutPrevented:c=>{n.trapping||(c.detail.focusReason==="pointer"&&c.preventDefault(),t.value=!1)},onReleaseRequested:()=>{t.value=!1,e("close")}}},RE=a.defineComponent({name:"ElPopperContent"}),FE=a.defineComponent({...RE,props:Ym,emits:wE,setup(n,{expose:e,emit:t}){const i=n,{focusStartRef:r,trapped:s,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:u,onFocusoutPrevented:c,onReleaseRequested:f}=LE(i,t),{attributes:h,arrowRef:p,contentRef:v,styles:m,instanceRef:d,role:b,update:y}=EE(i),{ariaModal:g,arrowStyle:w,contentAttrs:A,contentClass:S,contentStyle:M,updateZIndex:F}=CE(i,{styles:m,attributes:h,role:b}),R=a.inject(hl,void 0),T=a.ref();a.provide(Nm,{arrowStyle:w,arrowRef:p,arrowOffset:T}),R&&a.provide(hl,{...R,addInputId:To,removeInputId:To});let P;const _=(C=!0)=>{y(),C&&F()},E=()=>{_(!1),i.visible&&i.focusOnShow?s.value=!0:i.visible===!1&&(s.value=!1)};return a.onMounted(()=>{a.watch(()=>i.triggerTargetEl,(C,L)=>{P==null||P(),P=void 0;const I=a.unref(C||v.value),x=a.unref(L||v.value);Ar(I)&&(P=a.watch([b,()=>i.ariaLabel,g,()=>i.id],O=>{["role","aria-label","aria-modal","id"].forEach((B,D)=>{jn(O[D])?I.removeAttribute(B):I.setAttribute(B,O[D])})},{immediate:!0})),x!==I&&Ar(x)&&["role","aria-label","aria-modal","id"].forEach(O=>{x.removeAttribute(O)})},{immediate:!0}),a.watch(()=>i.visible,E,{immediate:!0})}),a.onBeforeUnmount(()=>{P==null||P(),P=void 0}),e({popperContentRef:v,popperInstanceRef:d,updatePopper:_,contentStyle:M}),(C,L)=>(a.openBlock(),a.createElementBlock("div",a.mergeProps({ref_key:"contentRef",ref:v},a.unref(A),{style:a.unref(M),class:a.unref(S),tabindex:"-1",onMouseenter:I=>C.$emit("mouseenter",I),onMouseleave:I=>C.$emit("mouseleave",I)}),[a.createVNode(a.unref(yE),{trapped:a.unref(s),"trap-on-focus-in":!0,"focus-trap-el":a.unref(v),"focus-start-el":a.unref(r),onFocusAfterTrapped:a.unref(l),onFocusAfterReleased:a.unref(o),onFocusin:a.unref(u),onFocusoutPrevented:a.unref(c),onReleaseRequested:a.unref(f)},{default:a.withCtx(()=>[a.renderSlot(C.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var PE=We(FE,[["__file","content.vue"]]);const IE=Nt(qT),Uu=Symbol("elTooltip"),un=$e({...lT,...Ym,appendTo:{type:Ve([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Ve(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...Wi(["ariaLabel"])}),Ho=$e({...zm,disabled:Boolean,trigger:{type:Ve([String,Array]),default:"hover"},triggerKeys:{type:Ve(Array),default:()=>[$n.enter,$n.space]}}),{useModelToggleProps:OE,useModelToggleEmits:NE,useModelToggle:BE}=QS("visible"),DE=$e({...Bm,...OE,...un,...Ho,...Dm,showArrow:{type:Boolean,default:!0}}),VE=[...NE,"before-show","before-hide","show","hide","open","close"],kE=(n,e)=>sn(n)?n.includes(e):n===e,xs=(n,e,t)=>i=>{kE(a.unref(n),e)&&t(i)},zE=a.defineComponent({name:"ElTooltipTrigger"}),UE=a.defineComponent({...zE,props:Ho,setup(n,{expose:e}){const t=n,i=Ge("tooltip"),{controlled:r,id:s,open:o,onOpen:l,onClose:u,onToggle:c}=a.inject(Uu,void 0),f=a.ref(null),h=()=>{if(a.unref(r)||t.disabled)return!0},p=a.toRef(t,"trigger"),v=ai(h,xs(p,"hover",l)),m=ai(h,xs(p,"hover",u)),d=ai(h,xs(p,"click",A=>{A.button===0&&c(A)})),b=ai(h,xs(p,"focus",l)),y=ai(h,xs(p,"focus",u)),g=ai(h,xs(p,"contextmenu",A=>{A.preventDefault(),c(A)})),w=ai(h,A=>{const{code:S}=A;t.triggerKeys.includes(S)&&(A.preventDefault(),c(A))});return e({triggerRef:f}),(A,S)=>(a.openBlock(),a.createBlock(a.unref(sE),{id:a.unref(s),"virtual-ref":A.virtualRef,open:a.unref(o),"virtual-triggering":A.virtualTriggering,class:a.normalizeClass(a.unref(i).e("trigger")),onBlur:a.unref(y),onClick:a.unref(d),onContextmenu:a.unref(g),onFocus:a.unref(b),onMouseenter:a.unref(v),onMouseleave:a.unref(m),onKeydown:a.unref(w)},{default:a.withCtx(()=>[a.renderSlot(A.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var GE=We(UE,[["__file","trigger.vue"]]);const HE=$e({to:{type:Ve([String,Object]),required:!0},disabled:Boolean});var WE=We(a.defineComponent({__name:"teleport",props:HE,setup(n){return(e,t)=>e.disabled?a.renderSlot(e.$slots,"default",{key:0}):(a.openBlock(),a.createBlock(a.Teleport,{key:1,to:e.to},[a.renderSlot(e.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const jE=Nt(WE),$E=a.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),ZE=a.defineComponent({...$E,props:un,setup(n,{expose:e}){const t=n,{selector:i}=xm(),r=Ge("tooltip"),s=a.ref(null);let o;const{controlled:l,id:u,open:c,trigger:f,onClose:h,onOpen:p,onShow:v,onHide:m,onBeforeShow:d,onBeforeHide:b}=a.inject(Uu,void 0),y=a.computed(()=>t.transition||`${r.namespace.value}-fade-in-linear`),g=a.computed(()=>process.env.NODE_ENV==="test"?!0:t.persistent);a.onBeforeUnmount(()=>{o==null||o()});const w=a.computed(()=>a.unref(g)?!0:a.unref(c)),A=a.computed(()=>t.disabled?!1:a.unref(c)),S=a.computed(()=>t.appendTo||i.value),M=a.computed(()=>{var x;return(x=t.style)!=null?x:{}}),F=a.ref(!0),R=()=>{m(),F.value=!0},T=()=>{if(a.unref(l))return!0},P=ai(T,()=>{t.enterable&&a.unref(f)==="hover"&&p()}),_=ai(T,()=>{a.unref(f)==="hover"&&h()}),E=()=>{var x,O;(O=(x=s.value)==null?void 0:x.updatePopper)==null||O.call(x),d==null||d()},C=()=>{b==null||b()},L=()=>{v(),o=iw(a.computed(()=>{var x;return(x=s.value)==null?void 0:x.popperContentRef}),()=>{if(a.unref(l))return;a.unref(f)!=="hover"&&h()})},I=()=>{t.virtualTriggering||h()};return a.watch(()=>a.unref(c),x=>{x?F.value=!1:o==null||o()},{flush:"post"}),a.watch(()=>t.content,()=>{var x,O;(O=(x=s.value)==null?void 0:x.updatePopper)==null||O.call(x)}),e({contentRef:s}),(x,O)=>(a.openBlock(),a.createBlock(a.unref(jE),{disabled:!x.teleported,to:a.unref(S)},{default:a.withCtx(()=>[a.createVNode(a.Transition,{name:a.unref(y),onAfterLeave:R,onBeforeEnter:E,onAfterEnter:L,onBeforeLeave:C},{default:a.withCtx(()=>[a.unref(w)?a.withDirectives((a.openBlock(),a.createBlock(a.unref(PE),a.mergeProps({key:0,id:a.unref(u),ref_key:"contentRef",ref:s},x.$attrs,{"aria-label":x.ariaLabel,"aria-hidden":F.value,"boundaries-padding":x.boundariesPadding,"fallback-placements":x.fallbackPlacements,"gpu-acceleration":x.gpuAcceleration,offset:x.offset,placement:x.placement,"popper-options":x.popperOptions,strategy:x.strategy,effect:x.effect,enterable:x.enterable,pure:x.pure,"popper-class":x.popperClass,"popper-style":[x.popperStyle,a.unref(M)],"reference-el":x.referenceEl,"trigger-target-el":x.triggerTargetEl,visible:a.unref(A),"z-index":x.zIndex,onMouseenter:a.unref(P),onMouseleave:a.unref(_),onBlur:I,onClose:a.unref(h)}),{default:a.withCtx(()=>[a.renderSlot(x.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[a.vShow,a.unref(A)]]):a.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var XE=We(ZE,[["__file","content.vue"]]);const YE=a.defineComponent({name:"ElTooltip"}),JE=a.defineComponent({...YE,props:DE,emits:VE,setup(n,{expose:e,emit:t}){const i=n;aT();const r=Uo(),s=a.ref(),o=a.ref(),l=()=>{var y;const g=a.unref(s);g&&((y=g.popperInstanceRef)==null||y.update())},u=a.ref(!1),c=a.ref(),{show:f,hide:h,hasUpdateHandler:p}=BE({indicator:u,toggleReason:c}),{onOpen:v,onClose:m}=cT({showAfter:a.toRef(i,"showAfter"),hideAfter:a.toRef(i,"hideAfter"),autoClose:a.toRef(i,"autoClose"),open:f,close:h}),d=a.computed(()=>Po(i.visible)&&!p.value);a.provide(Uu,{controlled:d,id:r,open:a.readonly(u),trigger:a.toRef(i,"trigger"),onOpen:y=>{v(y)},onClose:y=>{m(y)},onToggle:y=>{a.unref(u)?m(y):v(y)},onShow:()=>{t("show",c.value)},onHide:()=>{t("hide",c.value)},onBeforeShow:()=>{t("before-show",c.value)},onBeforeHide:()=>{t("before-hide",c.value)},updatePopper:l}),a.watch(()=>i.disabled,y=>{y&&u.value&&(u.value=!1)});const b=y=>{var g,w;const A=(w=(g=o.value)==null?void 0:g.contentRef)==null?void 0:w.popperContentRef,S=(y==null?void 0:y.relatedTarget)||document.activeElement;return A&&A.contains(S)};return a.onDeactivated(()=>u.value&&h()),e({popperRef:s,contentRef:o,isFocusInsideContent:b,updatePopper:l,onOpen:v,onClose:m,hide:h}),(y,g)=>(a.openBlock(),a.createBlock(a.unref(IE),{ref_key:"popperRef",ref:s,role:y.role},{default:a.withCtx(()=>[a.createVNode(GE,{disabled:y.disabled,trigger:y.trigger,"trigger-keys":y.triggerKeys,"virtual-ref":y.virtualRef,"virtual-triggering":y.virtualTriggering},{default:a.withCtx(()=>[y.$slots.default?a.renderSlot(y.$slots,"default",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),a.createVNode(XE,{ref_key:"contentRef",ref:o,"aria-label":y.ariaLabel,"boundaries-padding":y.boundariesPadding,content:y.content,disabled:y.disabled,effect:y.effect,enterable:y.enterable,"fallback-placements":y.fallbackPlacements,"hide-after":y.hideAfter,"gpu-acceleration":y.gpuAcceleration,offset:y.offset,persistent:y.persistent,"popper-class":y.popperClass,"popper-style":y.popperStyle,placement:y.placement,"popper-options":y.popperOptions,pure:y.pure,"raw-content":y.rawContent,"reference-el":y.referenceEl,"trigger-target-el":y.triggerTargetEl,"show-after":y.showAfter,strategy:y.strategy,teleported:y.teleported,transition:y.transition,"virtual-triggering":y.virtualTriggering,"z-index":y.zIndex,"append-to":y.appendTo},{default:a.withCtx(()=>[a.renderSlot(y.$slots,"content",{},()=>[y.rawContent?(a.openBlock(),a.createElementBlock("span",{key:0,innerHTML:y.content},null,8,["innerHTML"])):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(y.content),1))]),y.showArrow?(a.openBlock(),a.createBlock(a.unref(tE),{key:0,"arrow-offset":y.arrowOffset},null,8,["arrow-offset"])):a.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var KE=We(JE,[["__file","tooltip.vue"]]);const Gu=Nt(KE),Jm=Symbol("buttonGroupContextKey"),qE=(n,e)=>{Zp({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},a.computed(()=>n.type==="text"));const t=a.inject(Jm,void 0),i=Fu("button"),{form:r}=ys(),s=Er(a.computed(()=>t==null?void 0:t.size)),o=Go(),l=a.ref(),u=a.useSlots(),c=a.computed(()=>n.type||(t==null?void 0:t.type)||""),f=a.computed(()=>{var m,d,b;return(b=(d=n.autoInsertSpace)!=null?d:(m=i.value)==null?void 0:m.autoInsertSpace)!=null?b:!1}),h=a.computed(()=>n.tag==="button"?{ariaDisabled:o.value||n.loading,disabled:o.value||n.loading,autofocus:n.autofocus,type:n.nativeType}:{}),p=a.computed(()=>{var m;const d=(m=u.default)==null?void 0:m.call(u);if(f.value&&(d==null?void 0:d.length)===1){const b=d[0];if((b==null?void 0:b.type)===a.Text){const y=b.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(y.trim())}}return!1});return{_disabled:o,_size:s,_type:c,_ref:l,_props:h,shouldAddSpace:p,handleClick:m=>{if(o.value||n.loading){m.stopPropagation();return}n.nativeType==="reset"&&(r==null||r.resetFields()),e("click",m)}}},Hu=$e({size:Hi,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Ui},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Ui,default:()=>Gp},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:Ve([String,Object]),default:"button"}}),QE={click:n=>n instanceof MouseEvent};function Wt(n,e){eC(n)&&(n="100%");var t=tC(n);return n=e===360?n:Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(String(n*e),10)/100),Math.abs(n-e)<1e-6?1:(e===360?n=(n<0?n%e+e:n%e)/parseFloat(String(e)):n=n%e/parseFloat(String(e)),n)}function yl(n){return Math.min(1,Math.max(0,n))}function eC(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function tC(n){return typeof n=="string"&&n.indexOf("%")!==-1}function Km(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function bl(n){return n<=1?"".concat(Number(n)*100,"%"):n}function Cr(n){return n.length===1?"0"+n:String(n)}function nC(n,e,t){return{r:Wt(n,255)*255,g:Wt(e,255)*255,b:Wt(t,255)*255}}function qm(n,e,t){n=Wt(n,255),e=Wt(e,255),t=Wt(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=0,l=(i+r)/2;if(i===r)o=0,s=0;else{var u=i-r;switch(o=l>.5?u/(2-i-r):u/(i+r),i){case n:s=(e-t)/u+(e<t?6:0);break;case e:s=(t-n)/u+2;break;case t:s=(n-e)/u+4;break}s/=6}return{h:s,s:o,l}}function Wu(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 iC(n,e,t){var i,r,s;if(n=Wt(n,360),e=Wt(e,100),t=Wt(t,100),e===0)r=t,s=t,i=t;else{var o=t<.5?t*(1+e):t+e-t*e,l=2*t-o;i=Wu(l,o,n+1/3),r=Wu(l,o,n),s=Wu(l,o,n-1/3)}return{r:i*255,g:r*255,b:s*255}}function Qm(n,e,t){n=Wt(n,255),e=Wt(e,255),t=Wt(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),s=0,o=i,l=i-r,u=i===0?0:l/i;if(i===r)s=0;else{switch(i){case n:s=(e-t)/l+(e<t?6:0);break;case e:s=(t-n)/l+2;break;case t:s=(n-e)/l+4;break}s/=6}return{h:s,s:u,v:o}}function rC(n,e,t){n=Wt(n,360)*6,e=Wt(e,100),t=Wt(t,100);var i=Math.floor(n),r=n-i,s=t*(1-e),o=t*(1-r*e),l=t*(1-(1-r)*e),u=i%6,c=[t,o,s,s,l,t][u],f=[l,t,t,o,s,s][u],h=[s,s,l,t,t,o][u];return{r:c*255,g:f*255,b:h*255}}function eg(n,e,t,i){var r=[Cr(Math.round(n).toString(16)),Cr(Math.round(e).toString(16)),Cr(Math.round(t).toString(16))];return i&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function sC(n,e,t,i,r){var s=[Cr(Math.round(n).toString(16)),Cr(Math.round(e).toString(16)),Cr(Math.round(t).toString(16)),Cr(oC(i))];return r&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function oC(n){return Math.round(parseFloat(n)*255).toString(16)}function tg(n){return dn(n)/255}function dn(n){return parseInt(n,16)}function aC(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var ju={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function lC(n){var e={r:0,g:0,b:0},t=1,i=null,r=null,s=null,o=!1,l=!1;return typeof n=="string"&&(n=dC(n)),typeof n=="object"&&(gi(n.r)&&gi(n.g)&&gi(n.b)?(e=nC(n.r,n.g,n.b),o=!0,l=String(n.r).substr(-1)==="%"?"prgb":"rgb"):gi(n.h)&&gi(n.s)&&gi(n.v)?(i=bl(n.s),r=bl(n.v),e=rC(n.h,i,r),o=!0,l="hsv"):gi(n.h)&&gi(n.s)&&gi(n.l)&&(i=bl(n.s),s=bl(n.l),e=iC(n.h,i,s),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=Km(t),{ok:o,format:n.format||l,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var cC="[-\\+]?\\d+%?",uC="[-\\+]?\\d*\\.\\d+%?",$i="(?:".concat(uC,")|(?:").concat(cC,")"),$u="[\\s|\\(]+(".concat($i,")[,|\\s]+(").concat($i,")[,|\\s]+(").concat($i,")\\s*\\)?"),Zu="[\\s|\\(]+(".concat($i,")[,|\\s]+(").concat($i,")[,|\\s]+(").concat($i,")[,|\\s]+(").concat($i,")\\s*\\)?"),Rn={CSS_UNIT:new RegExp($i),rgb:new RegExp("rgb"+$u),rgba:new RegExp("rgba"+Zu),hsl:new RegExp("hsl"+$u),hsla:new RegExp("hsla"+Zu),hsv:new RegExp("hsv"+$u),hsva:new RegExp("hsva"+Zu),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function dC(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(ju[n])n=ju[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Rn.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=Rn.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Rn.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=Rn.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Rn.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=Rn.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Rn.hex8.exec(n),t?{r:dn(t[1]),g:dn(t[2]),b:dn(t[3]),a:tg(t[4]),format:e?"name":"hex8"}:(t=Rn.hex6.exec(n),t?{r:dn(t[1]),g:dn(t[2]),b:dn(t[3]),format:e?"name":"hex"}:(t=Rn.hex4.exec(n),t?{r:dn(t[1]+t[1]),g:dn(t[2]+t[2]),b:dn(t[3]+t[3]),a:tg(t[4]+t[4]),format:e?"name":"hex8"}:(t=Rn.hex3.exec(n),t?{r:dn(t[1]+t[1]),g:dn(t[2]+t[2]),b:dn(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function gi(n){return!!Rn.CSS_UNIT.exec(String(n))}var hC=function(){function n(e,t){e===void 0&&(e=""),t===void 0&&(t={});var i;if(e instanceof n)return e;typeof e=="number"&&(e=aC(e)),this.originalInput=e;var r=lC(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(i=t.format)!==null&&i!==void 0?i:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return n.prototype.isDark=function(){return this.getBrightness()<128},n.prototype.isLight=function(){return!this.isDark()},n.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},n.prototype.getLuminance=function(){var e=this.toRgb(),t,i,r,s=e.r/255,o=e.g/255,l=e.b/255;return s<=.03928?t=s/12.92:t=Math.pow((s+.055)/1.055,2.4),o<=.03928?i=o/12.92:i=Math.pow((o+.055)/1.055,2.4),l<=.03928?r=l/12.92:r=Math.pow((l+.055)/1.055,2.4),.2126*t+.7152*i+.0722*r},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(e){return this.a=Km(e),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},n.prototype.toHsv=function(){var e=Qm(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},n.prototype.toHsvString=function(){var e=Qm(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var e=qm(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},n.prototype.toHslString=function(){var e=qm(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(e){return e===void 0&&(e=!1),eg(this.r,this.g,this.b,e)},n.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},n.prototype.toHex8=function(e){return e===void 0&&(e=!1),sC(this.r,this.g,this.b,this.a,e)},n.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},n.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},n.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},n.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),i=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(i,")"):"rgba(".concat(e,", ").concat(t,", ").concat(i,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(Wt(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(Wt(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+eg(this.r,this.g,this.b,!1),t=0,i=Object.entries(ju);t<i.length;t++){var r=i[t],s=r[0],o=r[1];if(e===o)return s}return!1},n.prototype.toString=function(e){var t=!!e;e=e??this.format;var i=!1,r=this.a<1&&this.a>=0,s=!t&&r&&(e.startsWith("hex")||e==="name");return s?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},n.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},n.prototype.clone=function(){return new n(this.toString())},n.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=yl(t.l),new n(t)},n.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new n(t)},n.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=yl(t.l),new n(t)},n.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},n.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},n.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=yl(t.s),new n(t)},n.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=yl(t.s),new n(t)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(e){var t=this.toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,new n(t)},n.prototype.mix=function(e,t){t===void 0&&(t=50);var i=this.toRgb(),r=new n(e).toRgb(),s=t/100,o={r:(r.r-i.r)*s+i.r,g:(r.g-i.g)*s+i.g,b:(r.b-i.b)*s+i.b,a:(r.a-i.a)*s+i.a};return new n(o)},n.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var i=this.toHsl(),r=360/t,s=[this];for(i.h=(i.h-(r*e>>1)+720)%360;--e;)i.h=(i.h+r)%360,s.push(new n(i));return s},n.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new n(e)},n.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),i=t.h,r=t.s,s=t.v,o=[],l=1/e;e--;)o.push(new n({h:i,s:r,v:s})),s=(s+l)%1;return o},n.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new n({h:(t+72)%360,s:e.s,l:e.l}),new n({h:(t+216)%360,s:e.s,l:e.l})]},n.prototype.onBackground=function(e){var t=this.toRgb(),i=new n(e).toRgb(),r=t.a+i.a*(1-t.a);return new n({r:(t.r*t.a+i.r*i.a*(1-t.a))/r,g:(t.g*t.a+i.g*i.a*(1-t.a))/r,b:(t.b*t.a+i.b*i.a*(1-t.a))/r,a:r})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(e){for(var t=this.toHsl(),i=t.h,r=[this],s=360/e,o=1;o<e;o++)r.push(new n({h:(i+o*s)%360,s:t.s,l:t.l}));return r},n.prototype.equals=function(e){return this.toRgbString()===new n(e).toRgbString()},n}();function Zi(n,e=20){return n.mix("#141414",e).toString()}function fC(n){const e=Go(),t=Ge("button");return a.computed(()=>{let i={},r=n.color;if(r){const s=r.match(/var\((.*?)\)/);s&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1]));const o=new hC(r),l=n.dark?o.tint(20).toString():Zi(o,20);if(n.plain)i=t.cssVarBlock({"bg-color":n.dark?Zi(o,90):o.tint(90).toString(),"text-color":r,"border-color":n.dark?Zi(o,50):o.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":l,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":l}),e.value&&(i[t.cssVarBlockName("disabled-bg-color")]=n.dark?Zi(o,90):o.tint(90).toString(),i[t.cssVarBlockName("disabled-text-color")]=n.dark?Zi(o,50):o.tint(50).toString(),i[t.cssVarBlockName("disabled-border-color")]=n.dark?Zi(o,80):o.tint(80).toString());else{const u=n.dark?Zi(o,30):o.tint(30).toString(),c=o.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(i=t.cssVarBlock({"bg-color":r,"text-color":c,"border-color":r,"hover-bg-color":u,"hover-text-color":c,"hover-border-color":u,"active-bg-color":l,"active-border-color":l}),e.value){const f=n.dark?Zi(o,50):o.tint(50).toString();i[t.cssVarBlockName("disabled-bg-color")]=f,i[t.cssVarBlockName("disabled-text-color")]=n.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,i[t.cssVarBlockName("disabled-border-color")]=f}}}return i})}const pC=a.defineComponent({name:"ElButton"}),mC=a.defineComponent({...pC,props:Hu,emits:QE,setup(n,{expose:e,emit:t}){const i=n,r=fC(i),s=Ge("button"),{_ref:o,_size:l,_type:u,_disabled:c,_props:f,shouldAddSpace:h,handleClick:p}=qE(i,t),v=a.computed(()=>[s.b(),s.m(u.value),s.m(l.value),s.is("disabled",c.value),s.is("loading",i.loading),s.is("plain",i.plain),s.is("round",i.round),s.is("circle",i.circle),s.is("text",i.text),s.is("link",i.link),s.is("has-bg",i.bg)]);return e({ref:o,size:l,type:u,disabled:c,shouldAddSpace:h}),(m,d)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.tag),a.mergeProps({ref_key:"_ref",ref:o},a.unref(f),{class:a.unref(v),style:a.unref(r),onClick:a.unref(p)}),{default:a.withCtx(()=>[m.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[m.$slots.loading?a.renderSlot(m.$slots,"loading",{key:0}):(a.openBlock(),a.createBlock(a.unref(ht),{key:1,class:a.normalizeClass(a.unref(s).is("loading"))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.loadingIcon)))]),_:1},8,["class"]))],64)):m.icon||m.$slots.icon?(a.openBlock(),a.createBlock(a.unref(ht),{key:1},{default:a.withCtx(()=>[m.icon?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(m.icon),{key:0})):a.renderSlot(m.$slots,"icon",{key:1})]),_:3})):a.createCommentVNode("v-if",!0),m.$slots.default?(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass({[a.unref(s).em("text","expand")]:a.unref(h)})},[a.renderSlot(m.$slots,"default")],2)):a.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var gC=We(mC,[["__file","button.vue"]]);const vC={size:Hu.size,type:Hu.type},yC=a.defineComponent({name:"ElButtonGroup"}),bC=a.defineComponent({...yC,props:vC,setup(n){const e=n;a.provide(Jm,a.reactive({size:a.toRef(e,"size"),type:a.toRef(e,"type")}));const t=Ge("button");return(i,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(t).b("group"))},[a.renderSlot(i.$slots,"default")],2))}});var ng=We(bC,[["__file","button-group.vue"]]);const ws=Nt(gC,{ButtonGroup:ng});En(ng);var Xi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function xl(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}const Yi=new Map;if(Rt){let n;document.addEventListener("mousedown",e=>n=e),document.addEventListener("mouseup",e=>{if(n){for(const t of Yi.values())for(const{documentHandler:i}of t)i(e,n);n=void 0}})}function ig(n,e){let t=[];return Array.isArray(e.arg)?t=e.arg:Ar(e.arg)&&t.push(e.arg),function(i,r){const s=e.instance.popperRef,o=i.target,l=r==null?void 0:r.target,u=!e||!e.instance,c=!o||!l,f=n.contains(o)||n.contains(l),h=n===o,p=t.length&&t.some(m=>m==null?void 0:m.contains(o))||t.length&&t.includes(l),v=s&&(s.contains(o)||s.contains(l));u||c||f||h||p||v||e.value(i,r)}}const wC={beforeMount(n,e){Yi.has(n)||Yi.set(n,[]),Yi.get(n).push({documentHandler:ig(n,e),bindingFn:e.value})},updated(n,e){Yi.has(n)||Yi.set(n,[]);const t=Yi.get(n),i=t.findIndex(s=>s.bindingFn===e.oldValue),r={documentHandler:ig(n,e),bindingFn:e.value};i>=0?t.splice(i,1,r):t.push(r)},unmounted(n){Yi.delete(n)}},MC=100,AC=600,rg={beforeMount(n,e){const t=e.value,{interval:i=MC,delay:r=AC}=Jt(t)?{}:t;let s,o;const l=()=>Jt(t)?t():t.handler(),u=()=>{o&&(clearTimeout(o),o=void 0),s&&(clearInterval(s),s=void 0)};n.addEventListener("mousedown",c=>{c.button===0&&(u(),l(),document.addEventListener("mouseup",()=>u(),{once:!0}),o=setTimeout(()=>{s=setInterval(()=>{l()},i)},r))})}},sg=$e({modelValue:{type:[String,Number,Boolean],default:void 0},size:Hi,disabled:Boolean,label:{type:[String,Number,Boolean],default:void 0},value:{type:[String,Number,Boolean],default:void 0},name:{type:String,default:void 0}}),SC=$e({...sg,border:Boolean}),og={[ot]:n=>Ht(n)||tt(n)||Po(n),[fi]:n=>Ht(n)||tt(n)||Po(n)},ag=Symbol("radioGroupKey"),lg=(n,e)=>{const t=a.ref(),i=a.inject(ag,void 0),r=a.computed(()=>!!i),s=a.computed(()=>Dp(n.value)?n.label:n.value),o=a.computed({get(){return r.value?i.modelValue:n.modelValue},set(h){r.value?i.changeEvent(h):e&&e(ot,h),t.value.checked=n.modelValue===s.value}}),l=Er(a.computed(()=>i==null?void 0:i.size)),u=Go(a.computed(()=>i==null?void 0:i.disabled)),c=a.ref(!1),f=a.computed(()=>u.value||r.value&&o.value!==s.value?-1:0);return Zp({from:"label act as value",replacement:"value",version:"3.0.0",scope:"el-radio",ref:"https://element-plus.org/en-US/component/radio.html"},a.computed(()=>r.value&&Dp(n.value))),{radioRef:t,isGroup:r,radioGroup:i,focus:c,size:l,disabled:u,tabIndex:f,modelValue:o,actualValue:s}},_C=a.defineComponent({name:"ElRadio"}),TC=a.defineComponent({..._C,props:SC,emits:og,setup(n,{emit:e}){const t=n,i=Ge("radio"),{radioRef:r,radioGroup:s,focus:o,size:l,disabled:u,modelValue:c,actualValue:f}=lg(t,e);function h(){a.nextTick(()=>e("change",c.value))}return(p,v)=>{var m;return a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass([a.unref(i).b(),a.unref(i).is("disabled",a.unref(u)),a.unref(i).is("focus",a.unref(o)),a.unref(i).is("bordered",p.border),a.unref(i).is("checked",a.unref(c)===a.unref(f)),a.unref(i).m(a.unref(l))])},[a.createElementVNode("span",{class:a.normalizeClass([a.unref(i).e("input"),a.unref(i).is("disabled",a.unref(u)),a.unref(i).is("checked",a.unref(c)===a.unref(f))])},[a.withDirectives(a.createElementVNode("input",{ref_key:"radioRef",ref:r,"onUpdate:modelValue":d=>a.isRef(c)?c.value=d:null,class:a.normalizeClass(a.unref(i).e("original")),value:a.unref(f),name:p.name||((m=a.unref(s))==null?void 0:m.name),disabled:a.unref(u),checked:a.unref(c)===a.unref(f),type:"radio",onFocus:d=>o.value=!0,onBlur:d=>o.value=!1,onChange:h,onClick:a.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","checked","onFocus","onBlur","onClick"]),[[a.vModelRadio,a.unref(c)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(i).e("inner"))},null,2)],2),a.createElementVNode("span",{class:a.normalizeClass(a.unref(i).e("label")),onKeydown:a.withModifiers(()=>{},["stop"])},[a.renderSlot(p.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(p.label),1)])],42,["onKeydown"])],2)}}});var EC=We(TC,[["__file","radio.vue"]]);const CC=$e({...sg}),LC=a.defineComponent({name:"ElRadioButton"}),RC=a.defineComponent({...LC,props:CC,setup(n){const e=n,t=Ge("radio"),{radioRef:i,focus:r,size:s,disabled:o,modelValue:l,radioGroup:u,actualValue:c}=lg(e),f=a.computed(()=>({backgroundColor:(u==null?void 0:u.fill)||"",borderColor:(u==null?void 0:u.fill)||"",boxShadow:u!=null&&u.fill?`-1px 0 0 0 ${u.fill}`:"",color:(u==null?void 0:u.textColor)||""}));return(h,p)=>{var v;return a.openBlock(),a.createElementBlock("label",{class:a.normalizeClass([a.unref(t).b("button"),a.unref(t).is("active",a.unref(l)===a.unref(c)),a.unref(t).is("disabled",a.unref(o)),a.unref(t).is("focus",a.unref(r)),a.unref(t).bm("button",a.unref(s))])},[a.withDirectives(a.createElementVNode("input",{ref_key:"radioRef",ref:i,"onUpdate:modelValue":m=>a.isRef(l)?l.value=m:null,class:a.normalizeClass(a.unref(t).be("button","original-radio")),value:a.unref(c),type:"radio",name:h.name||((v=a.unref(u))==null?void 0:v.name),disabled:a.unref(o),onFocus:m=>r.value=!0,onBlur:m=>r.value=!1,onClick:a.withModifiers(()=>{},["stop"])},null,42,["onUpdate:modelValue","value","name","disabled","onFocus","onBlur","onClick"]),[[a.vModelRadio,a.unref(l)]]),a.createElementVNode("span",{class:a.normalizeClass(a.unref(t).be("button","inner")),style:a.normalizeStyle(a.unref(l)===a.unref(c)?a.unref(f):{}),onKeydown:a.withModifiers(()=>{},["stop"])},[a.renderSlot(h.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(h.label),1)])],46,["onKeydown"])],2)}}});var cg=We(RC,[["__file","radio-button.vue"]]);const FC=$e({id:{type:String,default:void 0},size:Hi,disabled:Boolean,modelValue:{type:[String,Number,Boolean],default:void 0},fill:{type:String,default:""},textColor:{type:String,default:""},name:{type:String,default:void 0},validateEvent:{type:Boolean,default:!0},...Wi(["ariaLabel"])}),PC=og,IC=a.defineComponent({name:"ElRadioGroup"}),OC=a.defineComponent({...IC,props:FC,emits:PC,setup(n,{emit:e}){const t=n,i=Ge("radio"),r=Uo(),s=a.ref(),{formItem:o}=ys(),{inputId:l,isLabeledByFormItem:u}=fl(t,{formItemContext:o}),c=h=>{e(ot,h),a.nextTick(()=>e("change",h))};a.onMounted(()=>{const h=s.value.querySelectorAll("[type=radio]"),p=h[0];!Array.from(h).some(v=>v.checked)&&p&&(p.tabIndex=0)});const f=a.computed(()=>t.name||r.value);return a.provide(ag,a.reactive({...a.toRefs(t),changeEvent:c,name:f})),a.watch(()=>t.modelValue,()=>{t.validateEvent&&(o==null||o.validate("change").catch(h=>gt(h)))}),(h,p)=>(a.openBlock(),a.createElementBlock("div",{id:a.unref(l),ref_key:"radioGroupRef",ref:s,class:a.normalizeClass(a.unref(i).b("group")),role:"radiogroup","aria-label":a.unref(u)?void 0:h.ariaLabel||"radio-group","aria-labelledby":a.unref(u)?a.unref(o).labelId:void 0},[a.renderSlot(h.$slots,"default")],10,["id","aria-label","aria-labelledby"]))}});var ug=We(OC,[["__file","radio-group.vue"]]);const dg=Nt(EC,{RadioButton:cg,RadioGroup:ug}),hg=En(ug);En(cg);const Xu=$e({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:$p},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),NC={close:n=>n instanceof MouseEvent,click:n=>n instanceof MouseEvent},BC=a.defineComponent({name:"ElTag"}),DC=a.defineComponent({...BC,props:Xu,emits:NC,setup(n,{emit:e}){const t=n,i=Er(),r=Ge("tag"),s=a.computed(()=>{const{type:c,hit:f,effect:h,closable:p,round:v}=t;return[r.b(),r.is("closable",p),r.m(c||"primary"),r.m(i.value),r.m(h),r.is("hit",f),r.is("round",v)]}),o=c=>{e("close",c)},l=c=>{e("click",c)},u=c=>{c.component.subTree.component.bum=null};return(c,f)=>c.disableTransitions?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(ht),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(yu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)):(a.openBlock(),a.createBlock(a.Transition,{key:1,name:`${a.unref(r).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:u},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle({backgroundColor:c.color}),onClick:l},[a.createElementVNode("span",{class:a.normalizeClass(a.unref(r).e("content"))},[a.renderSlot(c.$slots,"default")],2),c.closable?(a.openBlock(),a.createBlock(a.unref(ht),{key:0,class:a.normalizeClass(a.unref(r).e("close")),onClick:a.withModifiers(o,["stop"])},{default:a.withCtx(()=>[a.createVNode(a.unref(yu))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var VC=We(DC,[["__file","tag.vue"]]);const kC=Nt(VC),fg=Symbol("rowContextKey"),zC=$e({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:["start","center","end","space-around","space-between","space-evenly"],default:"start"},align:{type:String,values:["top","middle","bottom"]}}),UC=a.defineComponent({name:"ElRow"}),GC=a.defineComponent({...UC,props:zC,setup(n){const e=n,t=Ge("row"),i=a.computed(()=>e.gutter);a.provide(fg,{gutter:i});const r=a.computed(()=>{const o={};return e.gutter&&(o.marginRight=o.marginLeft=`-${e.gutter/2}px`),o}),s=a.computed(()=>[t.b(),t.is(`justify-${e.justify}`,e.justify!=="start"),t.is(`align-${e.align}`,!!e.align)]);return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var HC=We(GC,[["__file","row.vue"]]);const Yn=Nt(HC),WC=$e({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:Ve([Number,Object]),default:()=>pi({})},sm:{type:Ve([Number,Object]),default:()=>pi({})},md:{type:Ve([Number,Object]),default:()=>pi({})},lg:{type:Ve([Number,Object]),default:()=>pi({})},xl:{type:Ve([Number,Object]),default:()=>pi({})}}),jC=a.defineComponent({name:"ElCol"}),$C=a.defineComponent({...jC,props:WC,setup(n){const e=n,{gutter:t}=a.inject(fg,{gutter:a.computed(()=>0)}),i=Ge("col"),r=a.computed(()=>{const o={};return t.value&&(o.paddingLeft=o.paddingRight=`${t.value/2}px`),o}),s=a.computed(()=>{const o=[];return["span","offset","pull","push"].forEach(c=>{const f=e[c];tt(f)&&(c==="span"?o.push(i.b(`${e[c]}`)):f>0&&o.push(i.b(`${c}-${e[c]}`)))}),["xs","sm","md","lg","xl"].forEach(c=>{tt(e[c])?o.push(i.b(`${c}-${e[c]}`)):en(e[c])&&Object.entries(e[c]).forEach(([f,h])=>{o.push(f!=="span"?i.b(`${c}-${f}-${h}`):i.b(`${c}-${h}`))})}),t.value&&o.push(i.is("guttered")),[i.b(),o]});return(o,l)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.tag),{class:a.normalizeClass(a.unref(s)),style:a.normalizeStyle(a.unref(r))},{default:a.withCtx(()=>[a.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});var ZC=We($C,[["__file","col.vue"]]);const Fn=Nt(ZC),pg=n=>tt(n)||Ht(n)||sn(n),XC=$e({accordion:Boolean,modelValue:{type:Ve([Array,String,Number]),default:()=>pi([])}}),YC={[ot]:pg,[fi]:pg},mg=Symbol("collapseContextKey"),JC=(n,e)=>{const t=a.ref(Wn(n.modelValue)),i=s=>{t.value=s;const o=n.accordion?t.value[0]:t.value;e(ot,o),e(fi,o)},r=s=>{if(n.accordion)i([t.value[0]===s?"":s]);else{const o=[...t.value],l=o.indexOf(s);l>-1?o.splice(l,1):o.push(s),i(o)}};return a.watch(()=>n.modelValue,()=>t.value=Wn(n.modelValue),{deep:!0}),a.provide(mg,{activeNames:t,handleItemClick:r}),{activeNames:t,setActiveNames:i}},KC=()=>{const n=Ge("collapse");return{rootKls:a.computed(()=>n.b())}},qC=a.defineComponent({name:"ElCollapse"}),QC=a.defineComponent({...qC,props:XC,emits:YC,setup(n,{expose:e,emit:t}){const i=n,{activeNames:r,setActiveNames:s}=JC(i,t),{rootKls:o}=KC();return e({activeNames:r,setActiveNames:s}),(l,u)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(o))},[a.renderSlot(l.$slots,"default")],2))}});var e2=We(QC,[["__file","collapse.vue"]]);const t2=a.defineComponent({name:"ElCollapseTransition"}),n2=a.defineComponent({...t2,setup(n){const e=Ge("collapse-transition"),t=r=>{r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom},i={beforeEnter(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.style.height&&(r.dataset.elExistsHeight=r.style.height),r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0},enter(r){requestAnimationFrame(()=>{r.dataset.oldOverflow=r.style.overflow,r.dataset.elExistsHeight?r.style.maxHeight=r.dataset.elExistsHeight:r.scrollHeight!==0?r.style.maxHeight=`${r.scrollHeight}px`:r.style.maxHeight=0,r.style.paddingTop=r.dataset.oldPaddingTop,r.style.paddingBottom=r.dataset.oldPaddingBottom,r.style.overflow="hidden"})},afterEnter(r){r.style.maxHeight="",r.style.overflow=r.dataset.oldOverflow},enterCancelled(r){t(r)},beforeLeave(r){r.dataset||(r.dataset={}),r.dataset.oldPaddingTop=r.style.paddingTop,r.dataset.oldPaddingBottom=r.style.paddingBottom,r.dataset.oldOverflow=r.style.overflow,r.style.maxHeight=`${r.scrollHeight}px`,r.style.overflow="hidden"},leave(r){r.scrollHeight!==0&&(r.style.maxHeight=0,r.style.paddingTop=0,r.style.paddingBottom=0)},afterLeave(r){t(r)},leaveCancelled(r){t(r)}};return(r,s)=>(a.openBlock(),a.createBlock(a.Transition,a.mergeProps({name:a.unref(e).b()},a.toHandlers(i)),{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default")]),_:3},16,["name"]))}});var i2=We(n2,[["__file","collapse-transition.vue"]]);const r2=Nt(i2),s2=$e({title:{type:String,default:""},name:{type:Ve([String,Number]),default:void 0},icon:{type:Ui,default:zi},disabled:Boolean}),o2=n=>{const e=a.inject(mg),{namespace:t}=Ge("collapse"),i=a.ref(!1),r=a.ref(!1),s=Ru(),o=a.computed(()=>s.current++),l=a.computed(()=>{var p;return(p=n.name)!=null?p:`${t.value}-id-${s.prefix}-${a.unref(o)}`}),u=a.computed(()=>e==null?void 0:e.activeNames.value.includes(a.unref(l)));return{focusing:i,id:o,isActive:u,handleFocus:()=>{setTimeout(()=>{r.value?r.value=!1:i.value=!0},50)},handleHeaderClick:()=>{n.disabled||(e==null||e.handleItemClick(a.unref(l)),i.value=!1,r.value=!0)},handleEnterClick:()=>{e==null||e.handleItemClick(a.unref(l))}}},a2=(n,{focusing:e,isActive:t,id:i})=>{const r=Ge("collapse"),s=a.computed(()=>[r.b("item"),r.is("active",a.unref(t)),r.is("disabled",n.disabled)]),o=a.computed(()=>[r.be("item","header"),r.is("active",a.unref(t)),{focusing:a.unref(e)&&!n.disabled}]),l=a.computed(()=>[r.be("item","arrow"),r.is("active",a.unref(t))]),u=a.computed(()=>r.be("item","wrap")),c=a.computed(()=>r.be("item","content")),f=a.computed(()=>r.b(`content-${a.unref(i)}`)),h=a.computed(()=>r.b(`head-${a.unref(i)}`));return{arrowKls:l,headKls:o,rootKls:s,itemWrapperKls:u,itemContentKls:c,scopedContentId:f,scopedHeadId:h}},l2=a.defineComponent({name:"ElCollapseItem"}),c2=a.defineComponent({...l2,props:s2,setup(n,{expose:e}){const t=n,{focusing:i,id:r,isActive:s,handleFocus:o,handleHeaderClick:l,handleEnterClick:u}=o2(t),{arrowKls:c,headKls:f,rootKls:h,itemWrapperKls:p,itemContentKls:v,scopedContentId:m,scopedHeadId:d}=a2(t,{focusing:i,isActive:s,id:r});return e({isActive:s}),(b,y)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(h))},[a.createElementVNode("button",{id:a.unref(d),class:a.normalizeClass(a.unref(f)),"aria-expanded":a.unref(s),"aria-controls":a.unref(m),"aria-describedby":a.unref(m),tabindex:b.disabled?-1:0,type:"button",onClick:a.unref(l),onKeydown:a.withKeys(a.withModifiers(a.unref(u),["stop","prevent"]),["space","enter"]),onFocus:a.unref(o),onBlur:g=>i.value=!1},[a.renderSlot(b.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(b.title),1)]),a.renderSlot(b.$slots,"icon",{isActive:a.unref(s)},()=>[a.createVNode(a.unref(ht),{class:a.normalizeClass(a.unref(c))},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(b.icon)))]),_:1},8,["class"])])],42,["id","aria-expanded","aria-controls","aria-describedby","tabindex","onClick","onKeydown","onFocus","onBlur"]),a.createVNode(a.unref(r2),null,{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",{id:a.unref(m),role:"region",class:a.normalizeClass(a.unref(p)),"aria-hidden":!a.unref(s),"aria-labelledby":a.unref(d)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(v))},[a.renderSlot(b.$slots,"default")],2)],10,["id","aria-hidden","aria-labelledby"]),[[a.vShow,a.unref(s)]])]),_:3})],2))}});var gg=We(c2,[["__file","collapse-item.vue"]]);const vg=Nt(e2,{CollapseItem:gg}),yg=En(gg),u2=a.defineComponent({name:"ElContainer"}),d2=a.defineComponent({...u2,props:{direction:{type:String}},setup(n){const e=n,t=a.useSlots(),i=Ge("container"),r=a.computed(()=>e.direction==="vertical"?!0:e.direction==="horizontal"?!1:t&&t.default?t.default().some(o=>{const l=o.type.name;return l==="ElHeader"||l==="ElFooter"}):!1);return(s,o)=>(a.openBlock(),a.createElementBlock("section",{class:a.normalizeClass([a.unref(i).b(),a.unref(i).is("vertical",a.unref(r))])},[a.renderSlot(s.$slots,"default")],2))}});var h2=We(d2,[["__file","container.vue"]]);const f2=a.defineComponent({name:"ElAside"}),p2=a.defineComponent({...f2,props:{width:{type:String,default:null}},setup(n){const e=n,t=Ge("aside"),i=a.computed(()=>e.width?t.cssVarBlock({width:e.width}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("aside",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var bg=We(p2,[["__file","aside.vue"]]);const m2=a.defineComponent({name:"ElFooter"}),g2=a.defineComponent({...m2,props:{height:{type:String,default:null}},setup(n){const e=n,t=Ge("footer"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("footer",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var xg=We(g2,[["__file","footer.vue"]]);const v2=a.defineComponent({name:"ElHeader"}),y2=a.defineComponent({...v2,props:{height:{type:String,default:null}},setup(n){const e=n,t=Ge("header"),i=a.computed(()=>e.height?t.cssVarBlock({height:e.height}):{});return(r,s)=>(a.openBlock(),a.createElementBlock("header",{class:a.normalizeClass(a.unref(t).b()),style:a.normalizeStyle(a.unref(i))},[a.renderSlot(r.$slots,"default")],6))}});var wg=We(y2,[["__file","header.vue"]]);const b2=a.defineComponent({name:"ElMain"}),x2=a.defineComponent({...b2,setup(n){const e=Ge("main");return(t,i)=>(a.openBlock(),a.createElementBlock("main",{class:a.normalizeClass(a.unref(e).b())},[a.renderSlot(t.$slots,"default")],2))}});var Mg=We(x2,[["__file","main.vue"]]);const Jn=Nt(h2,{Aside:bg,Footer:xg,Header:wg,Main:Mg});En(bg);const Ag=En(xg),w2=En(wg),vi=En(Mg),M2=a.defineComponent({inheritAttrs:!1});function A2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var S2=We(M2,[["render",A2],["__file","collection.vue"]]);const _2=a.defineComponent({name:"ElCollectionItem",inheritAttrs:!1});function T2(n,e,t,i,r,s){return a.renderSlot(n.$slots,"default")}var E2=We(_2,[["render",T2],["__file","collection-item.vue"]]);const C2="data-el-collection-item",L2=n=>{const e=`El${n}Collection`,t=`${e}Item`,i=Symbol(e),r=Symbol(t),s={...S2,name:e,setup(){const l=a.ref(null),u=new Map,c=()=>{const f=a.unref(l);if(!f)return[];const h=Array.from(f.querySelectorAll(`[${C2}]`));return[...u.values()].sort((v,m)=>h.indexOf(v.ref)-h.indexOf(m.ref))};a.provide(i,{itemMap:u,getItems:c,collectionRef:l})}},o={...E2,name:t,setup(l,{attrs:u}){const c=a.ref(null),f=a.inject(i,void 0);a.provide(r,{collectionItemRef:c}),a.onMounted(()=>{const h=a.unref(c);h&&f.itemMap.set(h,{ref:h,...u})}),a.onBeforeUnmount(()=>{const h=a.unref(c);f.itemMap.delete(h)})}};return{COLLECTION_INJECTION_KEY:i,COLLECTION_ITEM_INJECTION_KEY:r,ElCollection:s,ElCollectionItem:o}},Yu=$e({trigger:Ho.trigger,effect:{...un.effect,default:"light"},type:{type:Ve(String)},placement:{type:Ve(String),default:"bottom"},popperOptions:{type:Ve(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:Ve([Number,String]),default:0},maxHeight:{type:Ve([Number,String]),default:""},popperClass:{type:String,default:""},disabled:Boolean,role:{type:String,default:"menu"},buttonProps:{type:Ve(Object)},teleported:un.teleported});$e({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:Ui}}),$e({onKeydown:{type:Ve(Function)}}),L2("Dropdown");const R2=$e({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:Hi,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:n=>n===null||tt(n)||["min","max"].includes(n),default:null},name:String,placeholder:String,precision:{type:Number,validator:n=>n>=0&&n===Number.parseInt(`${n}`,10)},validateEvent:{type:Boolean,default:!0},...Wi(["ariaLabel"])}),F2={[fi]:(n,e)=>e!==n,blur:n=>n instanceof FocusEvent,focus:n=>n instanceof FocusEvent,[Sr]:n=>tt(n)||jn(n),[ot]:n=>tt(n)||jn(n)},P2=a.defineComponent({name:"ElInputNumber"}),I2=a.defineComponent({...P2,props:R2,emits:F2,setup(n,{expose:e,emit:t}){const i=n,{t:r}=sl(),s=Ge("input-number"),o=a.ref(),l=a.reactive({currentValue:i.modelValue,userInput:null}),{formItem:u}=ys(),c=a.computed(()=>tt(i.modelValue)&&i.modelValue<=i.min),f=a.computed(()=>tt(i.modelValue)&&i.modelValue>=i.max),h=a.computed(()=>{const I=y(i.step);return Tn(i.precision)?Math.max(y(i.modelValue),I):(I>i.precision&>("InputNumber","precision should not be less than the decimal places of step"),i.precision)}),p=a.computed(()=>i.controls&&i.controlsPosition==="right"),v=Er(),m=Go(),d=a.computed(()=>{if(l.userInput!==null)return l.userInput;let I=l.currentValue;if(jn(I))return"";if(tt(I)){if(Number.isNaN(I))return"";Tn(i.precision)||(I=I.toFixed(i.precision))}return I}),b=(I,x)=>{if(Tn(x)&&(x=h.value),x===0)return Math.round(I);let O=String(I);const B=O.indexOf(".");if(B===-1||!O.replace(".","").split("")[B+x])return I;const V=O.length;return O.charAt(V-1)==="5"&&(O=`${O.slice(0,Math.max(0,V-1))}6`),Number.parseFloat(Number(O).toFixed(x))},y=I=>{if(jn(I))return 0;const x=I.toString(),O=x.indexOf(".");let B=0;return O!==-1&&(B=x.length-O-1),B},g=(I,x=1)=>tt(I)?b(I+i.step*x):l.currentValue,w=()=>{if(i.readonly||m.value||f.value)return;const I=Number(d.value)||0,x=g(I);M(x),t(Sr,l.currentValue),C()},A=()=>{if(i.readonly||m.value||c.value)return;const I=Number(d.value)||0,x=g(I,-1);M(x),t(Sr,l.currentValue),C()},S=(I,x)=>{const{max:O,min:B,step:D,precision:k,stepStrictly:V,valueOnClear:G}=i;O<B&&us("InputNumber","min should not be greater than max.");let J=Number(I);if(jn(I)||Number.isNaN(J))return null;if(I===""){if(G===null)return null;J=Ht(G)?{min:B,max:O}[G]:G}return V&&(J=b(Math.round(J/D)*D,k),J!==I&&x&&t(ot,J)),Tn(k)||(J=b(J,k)),(J>O||J<B)&&(J=J>O?O:B,x&&t(ot,J)),J},M=(I,x=!0)=>{var O;const B=l.currentValue,D=S(I);if(!x){t(ot,D);return}B===D&&I||(l.userInput=null,t(ot,D),B!==D&&t(fi,D,B),i.validateEvent&&((O=u==null?void 0:u.validate)==null||O.call(u,"change").catch(k=>gt(k))),l.currentValue=D)},F=I=>{l.userInput=I;const x=I===""?null:Number(I);t(Sr,x),M(x,!1)},R=I=>{const x=I!==""?Number(I):"";(tt(x)&&!Number.isNaN(x)||I==="")&&M(x),C(),l.userInput=null},T=()=>{var I,x;(x=(I=o.value)==null?void 0:I.focus)==null||x.call(I)},P=()=>{var I,x;(x=(I=o.value)==null?void 0:I.blur)==null||x.call(I)},_=I=>{t("focus",I)},E=I=>{var x;l.userInput=null,t("blur",I),i.validateEvent&&((x=u==null?void 0:u.validate)==null||x.call(u,"blur").catch(O=>gt(O)))},C=()=>{l.currentValue!==i.modelValue&&(l.currentValue=i.modelValue)},L=I=>{document.activeElement===I.target&&I.preventDefault()};return a.watch(()=>i.modelValue,(I,x)=>{const O=S(I,!0);l.userInput===null&&O!==x&&(l.currentValue=O)},{immediate:!0}),a.onMounted(()=>{var I;const{min:x,max:O,modelValue:B}=i,D=(I=o.value)==null?void 0:I.input;if(D.setAttribute("role","spinbutton"),Number.isFinite(O)?D.setAttribute("aria-valuemax",String(O)):D.removeAttribute("aria-valuemax"),Number.isFinite(x)?D.setAttribute("aria-valuemin",String(x)):D.removeAttribute("aria-valuemin"),D.setAttribute("aria-valuenow",l.currentValue||l.currentValue===0?String(l.currentValue):""),D.setAttribute("aria-disabled",String(m.value)),!tt(B)&&B!=null){let k=Number(B);Number.isNaN(k)&&(k=null),t(ot,k)}D.addEventListener("wheel",L,{passive:!1})}),a.onUpdated(()=>{var I,x;const O=(I=o.value)==null?void 0:I.input;O==null||O.setAttribute("aria-valuenow",`${(x=l.currentValue)!=null?x:""}`)}),e({focus:T,blur:P}),(I,x)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([a.unref(s).b(),a.unref(s).m(a.unref(v)),a.unref(s).is("disabled",a.unref(m)),a.unref(s).is("without-controls",!I.controls),a.unref(s).is("controls-right",a.unref(p))]),onDragstart:a.withModifiers(()=>{},["prevent"])},[I.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:0,role:"button","aria-label":a.unref(r)("el.inputNumber.decrease"),class:a.normalizeClass([a.unref(s).e("decrease"),a.unref(s).is("disabled",a.unref(c))]),onKeydown:a.withKeys(A,["enter"])},[a.renderSlot(I.$slots,"decrease-icon",{},()=>[a.createVNode(a.unref(ht),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(gu),{key:0})):(a.openBlock(),a.createBlock(a.unref(NS),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(rg),A]]):a.createCommentVNode("v-if",!0),I.controls?a.withDirectives((a.openBlock(),a.createElementBlock("span",{key:1,role:"button","aria-label":a.unref(r)("el.inputNumber.increase"),class:a.normalizeClass([a.unref(s).e("increase"),a.unref(s).is("disabled",a.unref(f))]),onKeydown:a.withKeys(w,["enter"])},[a.renderSlot(I.$slots,"increase-icon",{},()=>[a.createVNode(a.unref(ht),null,{default:a.withCtx(()=>[a.unref(p)?(a.openBlock(),a.createBlock(a.unref(_S),{key:0})):(a.openBlock(),a.createBlock(a.unref(nl),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[a.unref(rg),w]]):a.createCommentVNode("v-if",!0),a.createVNode(a.unref(DT),{id:I.id,ref_key:"input",ref:o,type:"number",step:I.step,"model-value":a.unref(d),placeholder:I.placeholder,readonly:I.readonly,disabled:a.unref(m),size:a.unref(v),max:I.max,min:I.min,name:I.name,"aria-label":I.ariaLabel,"validate-event":!1,onKeydown:[a.withKeys(a.withModifiers(w,["prevent"]),["up"]),a.withKeys(a.withModifiers(A,["prevent"]),["down"])],onBlur:E,onFocus:_,onInput:F,onChange:R},a.createSlots({_:2},[I.$slots.prefix?{name:"prefix",fn:a.withCtx(()=>[a.renderSlot(I.$slots,"prefix")])}:void 0,I.$slots.suffix?{name:"suffix",fn:a.withCtx(()=>[a.renderSlot(I.$slots,"suffix")])}:void 0]),1032,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","onKeydown"])],42,["onDragstart"]))}});var O2=We(I2,[["__file","input-number.vue"]]);const yi=Nt(O2),Sg=Symbol("ElSelectGroup"),wl=Symbol("ElSelect");function N2(n,e){const t=a.inject(wl),i=a.inject(Sg,{disabled:!1}),r=a.computed(()=>f(Wn(t.props.modelValue),n.value)),s=a.computed(()=>{var v;if(t.props.multiple){const m=Wn((v=t.props.modelValue)!=null?v:[]);return!r.value&&m.length>=t.props.multipleLimit&&t.props.multipleLimit>0}else return!1}),o=a.computed(()=>n.label||(en(n.value)?"":n.value)),l=a.computed(()=>n.value||n.label||""),u=a.computed(()=>n.disabled||e.groupDisabled||s.value),c=a.getCurrentInstance(),f=(v=[],m)=>{if(en(n.value)){const d=t.props.valueKey;return v&&v.some(b=>a.toRaw(di(b,d))===di(m,d))}else return v&&v.includes(m)},h=()=>{!n.disabled&&!i.disabled&&(t.states.hoveringIndex=t.optionsArray.indexOf(c.proxy))},p=v=>{const m=new RegExp(yS(v),"i");e.visible=m.test(o.value)||n.created};return a.watch(()=>o.value,()=>{!n.created&&!t.props.remote&&t.setSelected()}),a.watch(()=>n.value,(v,m)=>{const{remote:d,valueKey:b}=t.props;if(v!==m&&(t.onOptionDestroy(m,c.proxy),t.onOptionCreate(c.proxy)),!n.created&&!d){if(b&&en(v)&&en(m)&&v[b]===m[b])return;t.setSelected()}}),a.watch(()=>i.disabled,()=>{e.groupDisabled=i.disabled},{immediate:!0}),{select:t,currentLabel:o,currentValue:l,itemSelected:r,isDisabled:u,hoverItem:h,updateOption:p}}const B2=a.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(n){const e=Ge("select"),t=Uo(),i=a.computed(()=>[e.be("dropdown","item"),e.is("disabled",a.unref(l)),e.is("selected",a.unref(o)),e.is("hovering",a.unref(p))]),r=a.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f}=N2(n,r),{visible:h,hover:p}=a.toRefs(r),v=a.getCurrentInstance().proxy;u.onOptionCreate(v),a.onBeforeUnmount(()=>{const d=v.value,{selected:b}=u.states,g=(u.props.multiple?b:[b]).some(w=>w.value===v.value);a.nextTick(()=>{u.states.cachedOptions.get(d)===v&&!g&&u.states.cachedOptions.delete(d)}),u.onOptionDestroy(d,v)});function m(){l.value||u.handleOptionSelect(v)}return{ns:e,id:t,containerKls:i,currentLabel:s,itemSelected:o,isDisabled:l,select:u,hoverItem:c,updateOption:f,visible:h,hover:p,selectOptionClick:m,states:r}}});function D2(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("li",{id:n.id,class:a.normalizeClass(n.containerKls),role:"option","aria-disabled":n.isDisabled||void 0,"aria-selected":n.itemSelected,onMouseenter:n.hoverItem,onClick:a.withModifiers(n.selectOptionClick,["stop"])},[a.renderSlot(n.$slots,"default",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[a.vShow,n.visible]])}var Ju=We(B2,[["render",D2],["__file","option.vue"]]);const V2=a.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const n=a.inject(wl),e=Ge("select"),t=a.computed(()=>n.props.popperClass),i=a.computed(()=>n.props.multiple),r=a.computed(()=>n.props.fitInputWidth),s=a.ref("");function o(){var l;s.value=`${(l=n.selectRef)==null?void 0:l.offsetWidth}px`}return a.onMounted(()=>{o(),bn(n.selectRef,o)}),{ns:e,minWidth:s,popperClass:t,isMultiple:i,isFitInputWidth:r}}});function k2(n,e,t,i,r,s){return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([n.ns.b("dropdown"),n.ns.is("multiple",n.isMultiple),n.popperClass]),style:a.normalizeStyle({[n.isFitInputWidth?"width":"minWidth"]:n.minWidth})},[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.ns.be("dropdown","header"))},[a.renderSlot(n.$slots,"header")],2)):a.createCommentVNode("v-if",!0),a.renderSlot(n.$slots,"default"),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.ns.be("dropdown","footer"))},[a.renderSlot(n.$slots,"footer")],2)):a.createCommentVNode("v-if",!0)],6)}var z2=We(V2,[["render",k2],["__file","select-dropdown.vue"]]);const U2=11,G2=(n,e)=>{const{t}=sl(),i=Uo(),r=Ge("select"),s=Ge("input"),o=a.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=a.ref(null),u=a.ref(null),c=a.ref(null),f=a.ref(null),h=a.ref(null),p=a.ref(null),v=a.ref(null),m=a.ref(null),d=a.ref(null),b=a.ref(null),y=a.ref(null),g=a.ref(null),{isComposing:w,handleCompositionStart:A,handleCompositionUpdate:S,handleCompositionEnd:M}=Rm({afterComposition:fe=>re(fe)}),{wrapperRef:F,isFocused:R}=Lm(h,{beforeFocus(){return x.value},afterFocus(){n.automaticDropdown&&!T.value&&(T.value=!0,o.menuVisibleOnFocus=!0)},beforeBlur(fe){var xe,Se;return((xe=c.value)==null?void 0:xe.isFocusInsideContent(fe))||((Se=f.value)==null?void 0:Se.isFocusInsideContent(fe))},afterBlur(){T.value=!1,o.menuVisibleOnFocus=!1}}),T=a.ref(!1),P=a.ref(),{form:_,formItem:E}=ys(),{inputId:C}=fl(n,{formItemContext:E}),{valueOnClear:L,isEmptyValue:I}=xT(n),x=a.computed(()=>n.disabled||(_==null?void 0:_.disabled)),O=a.computed(()=>sn(n.modelValue)?n.modelValue.length>0:!I(n.modelValue)),B=a.computed(()=>n.clearable&&!x.value&&o.inputHovering&&O.value),D=a.computed(()=>n.remote&&n.filterable&&!n.remoteShowSuffix?"":n.suffixIcon),k=a.computed(()=>r.is("reverse",D.value&&T.value)),V=a.computed(()=>(E==null?void 0:E.validateState)||""),G=a.computed(()=>jp[V.value]),J=a.computed(()=>n.remote?300:0),j=a.computed(()=>n.loading?n.loadingText||t("el.select.loading"):n.remote&&!o.inputValue&&o.options.size===0?!1:n.filterable&&o.inputValue&&o.options.size>0&&te.value===0?n.noMatchText||t("el.select.noMatch"):o.options.size===0?n.noDataText||t("el.select.noData"):null),te=a.computed(()=>ee.value.filter(fe=>fe.visible).length),ee=a.computed(()=>{const fe=Array.from(o.options.values()),xe=[];return o.optionValues.forEach(Se=>{const Fe=fe.findIndex(Ie=>Ie.value===Se);Fe>-1&&xe.push(fe[Fe])}),xe.length>=fe.length?xe:fe}),ae=a.computed(()=>Array.from(o.cachedOptions.values())),H=a.computed(()=>{const fe=ee.value.filter(xe=>!xe.created).some(xe=>xe.currentLabel===o.inputValue);return n.filterable&&n.allowCreate&&o.inputValue!==""&&!fe}),Z=()=>{n.filterable&&Jt(n.filterMethod)||n.filterable&&n.remote&&Jt(n.remoteMethod)||ee.value.forEach(fe=>{var xe;(xe=fe.updateOption)==null||xe.call(fe,o.inputValue)})},$=Er(),se=a.computed(()=>["small"].includes($.value)?"small":"default"),z=a.computed({get(){return T.value&&j.value!==!1},set(fe){T.value=fe}}),W=a.computed(()=>{if(n.multiple&&!Tn(n.modelValue))return Wn(n.modelValue).length===0&&!o.inputValue;const fe=sn(n.modelValue)?n.modelValue[0]:n.modelValue;return n.filterable||Tn(fe)?!o.inputValue:!0}),q=a.computed(()=>{var fe;const xe=(fe=n.placeholder)!=null?fe:t("el.select.placeholder");return n.multiple||!O.value?xe:o.selectedLabel}),le=a.computed(()=>Yc?null:"mouseenter");a.watch(()=>n.modelValue,(fe,xe)=>{n.multiple&&n.filterable&&!n.reserveKeyword&&(o.inputValue="",oe("")),N(),!mu(fe,xe)&&n.validateEvent&&(E==null||E.validate("change").catch(Se=>gt(Se)))},{flush:"post",deep:!0}),a.watch(()=>T.value,fe=>{fe?oe(o.inputValue):(o.inputValue="",o.previousQuery=null,o.isBeforeHide=!0),e("visible-change",fe)}),a.watch(()=>o.options.entries(),()=>{var fe;if(!Rt)return;const xe=((fe=l.value)==null?void 0:fe.querySelectorAll("input"))||[];(!n.filterable&&!n.defaultFirstOption&&!Tn(n.modelValue)||!Array.from(xe).includes(document.activeElement))&&N(),n.defaultFirstOption&&(n.filterable||n.remote)&&te.value&&U()},{flush:"post"}),a.watch(()=>o.hoveringIndex,fe=>{tt(fe)&&fe>-1?P.value=ee.value[fe]||{}:P.value={},ee.value.forEach(xe=>{xe.hover=P.value===xe})}),a.watchEffect(()=>{o.isBeforeHide||Z()});const oe=fe=>{o.previousQuery===fe||w.value||(o.previousQuery=fe,n.filterable&&Jt(n.filterMethod)?n.filterMethod(fe):n.filterable&&n.remote&&Jt(n.remoteMethod)&&n.remoteMethod(fe),n.defaultFirstOption&&(n.filterable||n.remote)&&te.value?a.nextTick(U):a.nextTick(Y))},U=()=>{const fe=ee.value.filter(Fe=>Fe.visible&&!Fe.disabled&&!Fe.states.groupDisabled),xe=fe.find(Fe=>Fe.created),Se=fe[0];o.hoveringIndex=st(ee.value,xe||Se)},N=()=>{if(n.multiple)o.selectedLabel="";else{const xe=sn(n.modelValue)?n.modelValue[0]:n.modelValue,Se=X(xe);o.selectedLabel=Se.currentLabel,o.selected=[Se];return}const fe=[];Tn(n.modelValue)||Wn(n.modelValue).forEach(xe=>{fe.push(X(xe))}),o.selected=fe},X=fe=>{let xe;const Se=Jc(fe).toLowerCase()==="object",Fe=Jc(fe).toLowerCase()==="null",Ie=Jc(fe).toLowerCase()==="undefined";for(let Qe=o.cachedOptions.size-1;Qe>=0;Qe--){const Lt=ae.value[Qe];if(Se?di(Lt.value,n.valueKey)===di(fe,n.valueKey):Lt.value===fe){xe={value:fe,currentLabel:Lt.currentLabel,get isDisabled(){return Lt.isDisabled}};break}}if(xe)return xe;const Ue=Se?fe.label:!Fe&&!Ie?fe:"";return{value:fe,currentLabel:Ue}},Y=()=>{o.hoveringIndex=ee.value.findIndex(fe=>o.selected.some(xe=>we(xe)===we(fe)))},ie=()=>{o.selectionWidth=u.value.getBoundingClientRect().width},ue=()=>{o.calculatorWidth=p.value.getBoundingClientRect().width},me=()=>{o.collapseItemWidth=y.value.getBoundingClientRect().width},be=()=>{var fe,xe;(xe=(fe=c.value)==null?void 0:fe.updatePopper)==null||xe.call(fe)},ce=()=>{var fe,xe;(xe=(fe=f.value)==null?void 0:fe.updatePopper)==null||xe.call(fe)},ge=()=>{o.inputValue.length>0&&!T.value&&(T.value=!0),oe(o.inputValue)},re=fe=>{if(o.inputValue=fe.target.value,n.remote)he();else return ge()},he=pu(()=>{ge()},J.value),ve=fe=>{mu(n.modelValue,fe)||e(fi,fe)},Ee=fe=>dS(fe,xe=>!o.disabledOptions.has(xe)),_e=fe=>{if(n.multiple&&fe.code!==$n.delete&&fe.target.value.length<=0){const xe=Wn(n.modelValue).slice(),Se=Ee(xe);if(Se<0)return;const Fe=xe[Se];xe.splice(Se,1),e(ot,xe),ve(xe),e("remove-tag",Fe)}},Ne=(fe,xe)=>{const Se=o.selected.indexOf(xe);if(Se>-1&&!x.value){const Fe=Wn(n.modelValue).slice();Fe.splice(Se,1),e(ot,Fe),ve(Fe),e("remove-tag",xe.value)}fe.stopPropagation(),mt()},Je=fe=>{fe.stopPropagation();const xe=n.multiple?[]:L.value;if(n.multiple)for(const Se of o.selected)Se.isDisabled&&xe.push(Se.value);e(ot,xe),ve(xe),o.hoveringIndex=-1,T.value=!1,e("clear"),mt()},ze=fe=>{var xe;if(n.multiple){const Se=Wn((xe=n.modelValue)!=null?xe:[]).slice(),Fe=st(Se,fe.value);Fe>-1?Se.splice(Fe,1):(n.multipleLimit<=0||Se.length<n.multipleLimit)&&Se.push(fe.value),e(ot,Se),ve(Se),fe.created&&oe(""),n.filterable&&!n.reserveKeyword&&(o.inputValue="")}else e(ot,fe.value),ve(fe.value),T.value=!1;mt(),!T.value&&a.nextTick(()=>{Ce(fe)})},st=(fe=[],xe)=>{if(!en(xe))return fe.indexOf(xe);const Se=n.valueKey;let Fe=-1;return fe.some((Ie,Ue)=>a.toRaw(di(Ie,Se))===di(xe,Se)?(Fe=Ue,!0):!1),Fe},Ce=fe=>{var xe,Se,Fe,Ie,Ue;const De=sn(fe)?fe[0]:fe;let Qe=null;if(De!=null&&De.value){const Lt=ee.value.filter(Gt=>Gt.value===De.value);Lt.length>0&&(Qe=Lt[0].$el)}if(c.value&&Qe){const Lt=(Ie=(Fe=(Se=(xe=c.value)==null?void 0:xe.popperRef)==null?void 0:Se.contentRef)==null?void 0:Fe.querySelector)==null?void 0:Ie.call(Fe,`.${r.be("dropdown","wrap")}`);Lt&&xS(Lt,Qe)}(Ue=g.value)==null||Ue.handleScroll()},je=fe=>{o.options.set(fe.value,fe),o.cachedOptions.set(fe.value,fe),fe.disabled&&o.disabledOptions.set(fe.value,fe)},He=(fe,xe)=>{o.options.get(fe)===xe&&o.options.delete(fe)},Pt=a.computed(()=>{var fe,xe;return(xe=(fe=c.value)==null?void 0:fe.popperRef)==null?void 0:xe.contentRef}),It=()=>{o.isBeforeHide=!1,a.nextTick(()=>Ce(o.selected))},mt=()=>{var fe;(fe=h.value)==null||fe.focus()},bt=()=>{var fe;(fe=h.value)==null||fe.blur()},Oi=fe=>{Je(fe)},Ni=()=>{T.value=!1,R.value&&bt()},Un=()=>{o.inputValue.length>0?o.inputValue="":T.value=!1},ss=()=>{x.value||(Yc&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:T.value=!T.value)},ne=()=>{T.value?ee.value[o.hoveringIndex]&&ze(ee.value[o.hoveringIndex]):ss()},we=fe=>en(fe.value)?di(fe.value,n.valueKey):fe.value,Te=a.computed(()=>ee.value.filter(fe=>fe.visible).every(fe=>fe.disabled)),Be=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(0,n.maxCollapseTags):o.selected:[]),qe=a.computed(()=>n.multiple?n.collapseTags?o.selected.slice(n.maxCollapseTags):[]:[]),K=fe=>{if(!T.value){T.value=!0;return}if(!(o.options.size===0||o.filteredOptionsCount===0||w.value)&&!Te.value){fe==="next"?(o.hoveringIndex++,o.hoveringIndex===o.options.size&&(o.hoveringIndex=0)):fe==="prev"&&(o.hoveringIndex--,o.hoveringIndex<0&&(o.hoveringIndex=o.options.size-1));const xe=ee.value[o.hoveringIndex];(xe.disabled===!0||xe.states.groupDisabled===!0||!xe.visible)&&K(fe),a.nextTick(()=>Ce(P.value))}},pe=()=>{if(!u.value)return 0;const fe=window.getComputedStyle(u.value);return Number.parseFloat(fe.gap||"6px")},de=a.computed(()=>{const fe=pe();return{maxWidth:`${y.value&&n.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-fe:o.selectionWidth}px`}}),ye=a.computed(()=>({maxWidth:`${o.selectionWidth}px`})),Me=a.computed(()=>({width:`${Math.max(o.calculatorWidth,U2)}px`}));return bn(u,ie),bn(p,ue),bn(d,be),bn(F,be),bn(b,ce),bn(y,me),a.onMounted(()=>{N()}),{inputId:C,contentId:i,nsSelect:r,nsInput:s,states:o,isFocused:R,expanded:T,optionsArray:ee,hoverOption:P,selectSize:$,filteredOptionsCount:te,resetCalculatorWidth:ue,updateTooltip:be,updateTagTooltip:ce,debouncedOnInputChange:he,onInput:re,deletePrevTag:_e,deleteTag:Ne,deleteSelected:Je,handleOptionSelect:ze,scrollToOption:Ce,hasModelValue:O,shouldShowPlaceholder:W,currentPlaceholder:q,mouseEnterEventName:le,showClose:B,iconComponent:D,iconReverse:k,validateState:V,validateIcon:G,showNewOption:H,updateOptions:Z,collapseTagSize:se,setSelected:N,selectDisabled:x,emptyText:j,handleCompositionStart:A,handleCompositionUpdate:S,handleCompositionEnd:M,onOptionCreate:je,onOptionDestroy:He,handleMenuEnter:It,focus:mt,blur:bt,handleClearClick:Oi,handleClickOutside:Ni,handleEsc:Un,toggleMenu:ss,selectOption:ne,getValueKey:we,navigateOptions:K,dropdownMenuVisible:z,showTagList:Be,collapseTagList:qe,tagStyle:de,collapseTagStyle:ye,inputStyle:Me,popperRef:Pt,inputRef:h,tooltipRef:c,tagTooltipRef:f,calculatorRef:p,prefixRef:v,suffixRef:m,selectRef:l,wrapperRef:F,selectionRef:u,scrollbarRef:g,menuRef:d,tagMenuRef:b,collapseItemRef:y}};var H2=a.defineComponent({name:"ElOptions",setup(n,{slots:e}){const t=a.inject(wl);let i=[];return()=>{var r,s;const o=(r=e.default)==null?void 0:r.call(e),l=[];function u(c){sn(c)&&c.forEach(f=>{var h,p,v,m;const d=(h=(f==null?void 0:f.type)||{})==null?void 0:h.name;d==="ElOptionGroup"?u(!Ht(f.children)&&!sn(f.children)&&Jt((p=f.children)==null?void 0:p.default)?(v=f.children)==null?void 0:v.default():f.children):d==="ElOption"?l.push((m=f.props)==null?void 0:m.value):sn(f.children)&&u(f.children)})}return o.length&&u((s=o[0])==null?void 0:s.children),mu(l,i)||(i=l,t&&(t.states.optionValues=l)),o}}});const W2=$e({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:Hi,effect:{type:Ve(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Ve(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:un.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:Ui,default:vu},fitInputWidth:Boolean,suffixIcon:{type:Ui,default:gu},tagType:{...Xu.type,default:"info"},tagEffect:{...Xu.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:Ve(String),values:hs,default:"bottom-start"},fallbackPlacements:{type:Ve(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...bT,...Wi(["ariaLabel"])}),_g="ElSelect",j2=a.defineComponent({name:_g,componentName:_g,components:{ElSelectMenu:z2,ElOption:Ju,ElOptions:H2,ElTag:kC,ElScrollbar:YT,ElTooltip:Gu,ElIcon:ht},directives:{ClickOutside:wC},props:W2,emits:[ot,fi,"remove-tag","clear","visible-change","focus","blur"],setup(n,{emit:e}){const t=a.computed(()=>{const{modelValue:s,multiple:o}=n,l=o?[]:void 0;return sn(s)?o?s:l:o?l:s}),i=a.reactive({...a.toRefs(n),modelValue:t}),r=G2(i,e);return a.provide(wl,a.reactive({props:i,states:r.states,optionsArray:r.optionsArray,handleOptionSelect:r.handleOptionSelect,onOptionCreate:r.onOptionCreate,onOptionDestroy:r.onOptionDestroy,selectRef:r.selectRef,setSelected:r.setSelected})),{...r,modelValue:t}}});function $2(n,e,t,i,r,s){const o=a.resolveComponent("el-tag"),l=a.resolveComponent("el-tooltip"),u=a.resolveComponent("el-icon"),c=a.resolveComponent("el-option"),f=a.resolveComponent("el-options"),h=a.resolveComponent("el-scrollbar"),p=a.resolveComponent("el-select-menu"),v=a.resolveDirective("click-outside");return a.withDirectives((a.openBlock(),a.createElementBlock("div",{ref:"selectRef",class:a.normalizeClass([n.nsSelect.b(),n.nsSelect.m(n.selectSize)]),[a.toHandlerKey(n.mouseEnterEventName)]:m=>n.states.inputHovering=!0,onMouseleave:m=>n.states.inputHovering=!1},[a.createVNode(l,{ref:"tooltipRef",visible:n.dropdownMenuVisible,placement:n.placement,teleported:n.teleported,"popper-class":[n.nsSelect.e("popper"),n.popperClass],"popper-options":n.popperOptions,"fallback-placements":n.fallbackPlacements,effect:n.effect,pure:"",trigger:"click",transition:`${n.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:n.persistent,"append-to":n.appendTo,onBeforeShow:n.handleMenuEnter,onHide:m=>n.states.isBeforeHide=!1},{default:a.withCtx(()=>{var m;return[a.createElementVNode("div",{ref:"wrapperRef",class:a.normalizeClass([n.nsSelect.e("wrapper"),n.nsSelect.is("focused",n.isFocused),n.nsSelect.is("hovering",n.states.inputHovering),n.nsSelect.is("filterable",n.filterable),n.nsSelect.is("disabled",n.selectDisabled)]),onClick:a.withModifiers(n.toggleMenu,["prevent"])},[n.$slots.prefix?(a.openBlock(),a.createElementBlock("div",{key:0,ref:"prefixRef",class:a.normalizeClass(n.nsSelect.e("prefix"))},[a.renderSlot(n.$slots,"prefix")],2)):a.createCommentVNode("v-if",!0),a.createElementVNode("div",{ref:"selectionRef",class:a.normalizeClass([n.nsSelect.e("selection"),n.nsSelect.is("near",n.multiple&&!n.$slots.prefix&&!!n.states.selected.length)])},[n.multiple?a.renderSlot(n.$slots,"tag",{key:0},()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.showTagList,d=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(d),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!n.selectDisabled&&!d.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.tagStyle),onClose:b=>n.deleteTag(b,d)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:d.currentLabel,value:d.value},()=>[a.createTextVNode(a.toDisplayString(d.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),n.collapseTags&&n.states.selected.length>n.maxCollapseTags?(a.openBlock(),a.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:n.dropdownMenuVisible||!n.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:n.effect,placement:"bottom",teleported:n.teleported},{default:a.withCtx(()=>[a.createElementVNode("div",{ref:"collapseItemRef",class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{closable:!1,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",style:a.normalizeStyle(n.collapseTagStyle)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))}," + "+a.toDisplayString(n.states.selected.length-n.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:a.withCtx(()=>[a.createElementVNode("div",{ref:"tagMenuRef",class:a.normalizeClass(n.nsSelect.e("selection"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.collapseTagList,d=>(a.openBlock(),a.createElementBlock("div",{key:n.getValueKey(d),class:a.normalizeClass(n.nsSelect.e("selected-item"))},[a.createVNode(o,{class:"in-tooltip",closable:!n.selectDisabled&&!d.isDisabled,size:n.collapseTagSize,type:n.tagType,effect:n.tagEffect,"disable-transitions":"",onClose:b=>n.deleteTag(b,d)},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(n.nsSelect.e("tags-text"))},[a.renderSlot(n.$slots,"label",{label:d.currentLabel,value:d.value},()=>[a.createTextVNode(a.toDisplayString(d.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):a.createCommentVNode("v-if",!0)]):a.createCommentVNode("v-if",!0),n.selectDisabled?a.createCommentVNode("v-if",!0):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("input-wrapper"),n.nsSelect.is("hidden",!n.filterable)])},[a.withDirectives(a.createElementVNode("input",{id:n.inputId,ref:"inputRef","onUpdate:modelValue":d=>n.states.inputValue=d,type:"text",name:n.name,class:a.normalizeClass([n.nsSelect.e("input"),n.nsSelect.is(n.selectSize)]),disabled:n.selectDisabled,autocomplete:n.autocomplete,style:a.normalizeStyle(n.inputStyle),role:"combobox",readonly:!n.filterable,spellcheck:"false","aria-activedescendant":((m=n.hoverOption)==null?void 0:m.id)||"","aria-controls":n.contentId,"aria-expanded":n.dropdownMenuVisible,"aria-label":n.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[a.withKeys(a.withModifiers(d=>n.navigateOptions("next"),["stop","prevent"]),["down"]),a.withKeys(a.withModifiers(d=>n.navigateOptions("prev"),["stop","prevent"]),["up"]),a.withKeys(a.withModifiers(n.handleEsc,["stop","prevent"]),["esc"]),a.withKeys(a.withModifiers(n.selectOption,["stop","prevent"]),["enter"]),a.withKeys(a.withModifiers(n.deletePrevTag,["stop"]),["delete"])],onCompositionstart:n.handleCompositionStart,onCompositionupdate:n.handleCompositionUpdate,onCompositionend:n.handleCompositionEnd,onInput:n.onInput,onClick:a.withModifiers(n.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[a.vModelText,n.states.inputValue]]),n.filterable?(a.openBlock(),a.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:a.normalizeClass(n.nsSelect.e("input-calculator")),textContent:a.toDisplayString(n.states.inputValue)},null,10,["textContent"])):a.createCommentVNode("v-if",!0)],2)),n.shouldShowPlaceholder?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass([n.nsSelect.e("selected-item"),n.nsSelect.e("placeholder"),n.nsSelect.is("transparent",!n.hasModelValue||n.expanded&&!n.states.inputValue)])},[n.hasModelValue?a.renderSlot(n.$slots,"label",{key:0,label:n.currentPlaceholder,value:n.modelValue},()=>[a.createElementVNode("span",null,a.toDisplayString(n.currentPlaceholder),1)]):(a.openBlock(),a.createElementBlock("span",{key:1},a.toDisplayString(n.currentPlaceholder),1))],2)):a.createCommentVNode("v-if",!0)],2),a.createElementVNode("div",{ref:"suffixRef",class:a.normalizeClass(n.nsSelect.e("suffix"))},[n.iconComponent&&!n.showClose?(a.openBlock(),a.createBlock(u,{key:0,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.iconReverse])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.iconComponent)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0),n.showClose&&n.clearIcon?(a.openBlock(),a.createBlock(u,{key:1,class:a.normalizeClass([n.nsSelect.e("caret"),n.nsSelect.e("icon"),n.nsSelect.e("clear")]),onClick:n.handleClearClick},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.clearIcon)))]),_:1},8,["class","onClick"])):a.createCommentVNode("v-if",!0),n.validateState&&n.validateIcon?(a.openBlock(),a.createBlock(u,{key:2,class:a.normalizeClass([n.nsInput.e("icon"),n.nsInput.e("validateIcon")])},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(n.validateIcon)))]),_:1},8,["class"])):a.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:a.withCtx(()=>[a.createVNode(p,{ref:"menuRef"},{default:a.withCtx(()=>[n.$slots.header?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(n.nsSelect.be("dropdown","header")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"header")],10,["onClick"])):a.createCommentVNode("v-if",!0),a.withDirectives(a.createVNode(h,{id:n.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":n.nsSelect.be("dropdown","wrap"),"view-class":n.nsSelect.be("dropdown","list"),class:a.normalizeClass([n.nsSelect.is("empty",n.filteredOptionsCount===0)]),role:"listbox","aria-label":n.ariaLabel,"aria-orientation":"vertical"},{default:a.withCtx(()=>[n.showNewOption?(a.openBlock(),a.createBlock(c,{key:0,value:n.states.inputValue,created:!0},null,8,["value"])):a.createCommentVNode("v-if",!0),a.createVNode(f,null,{default:a.withCtx(()=>[a.renderSlot(n.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[a.vShow,n.states.options.size>0&&!n.loading]]),n.$slots.loading&&n.loading?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(n.nsSelect.be("dropdown","loading"))},[a.renderSlot(n.$slots,"loading")],2)):n.loading||n.filteredOptionsCount===0?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(n.nsSelect.be("dropdown","empty"))},[a.renderSlot(n.$slots,"empty",{},()=>[a.createElementVNode("span",null,a.toDisplayString(n.emptyText),1)])],2)):a.createCommentVNode("v-if",!0),n.$slots.footer?(a.openBlock(),a.createElementBlock("div",{key:3,class:a.normalizeClass(n.nsSelect.be("dropdown","footer")),onClick:a.withModifiers(()=>{},["stop"])},[a.renderSlot(n.$slots,"footer")],10,["onClick"])):a.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[v,n.handleClickOutside,n.popperRef]])}var Z2=We(j2,[["render",$2],["__file","select.vue"]]);const X2=a.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(n){const e=Ge("select"),t=a.ref(null),i=a.getCurrentInstance(),r=a.ref([]);a.provide(Sg,a.reactive({...a.toRefs(n)}));const s=a.computed(()=>r.value.some(c=>c.visible===!0)),o=c=>{var f,h;return((f=c.type)==null?void 0:f.name)==="ElOption"&&!!((h=c.component)!=null&&h.proxy)},l=c=>{const f=Wn(c),h=[];return f.forEach(p=>{var v,m;o(p)?h.push(p.component.proxy):(v=p.children)!=null&&v.length?h.push(...l(p.children)):(m=p.component)!=null&&m.subTree&&h.push(...l(p.component.subTree))}),h},u=()=>{r.value=l(i.subTree)};return a.onMounted(()=>{u()}),dw(t,u,{attributes:!0,subtree:!0,childList:!0}),{groupRef:t,visible:s,ns:e}}});function Y2(n,e,t,i,r,s){return a.withDirectives((a.openBlock(),a.createElementBlock("ul",{ref:"groupRef",class:a.normalizeClass(n.ns.be("group","wrap"))},[a.createElementVNode("li",{class:a.normalizeClass(n.ns.be("group","title"))},a.toDisplayString(n.label),3),a.createElementVNode("li",null,[a.createElementVNode("ul",{class:a.normalizeClass(n.ns.b("group"))},[a.renderSlot(n.$slots,"default")],2)])],2)),[[a.vShow,n.visible]])}var Tg=We(X2,[["render",Y2],["__file","option-group.vue"]]);const Ms=Nt(Z2,{Option:Ju,OptionGroup:Tg}),As=En(Ju);En(Tg);const J2=$e({trigger:Ho.trigger,placement:Yu.placement,disabled:Ho.disabled,visible:un.visible,transition:un.transition,popperOptions:Yu.popperOptions,tabindex:Yu.tabindex,content:un.content,popperStyle:un.popperStyle,popperClass:un.popperClass,enterable:{...un.enterable,default:!0},effect:{...un.effect,default:"light"},teleported:un.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),K2={"update:visible":n=>Po(n),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},q2="onUpdate:visible",Q2=a.defineComponent({name:"ElPopover"}),eL=a.defineComponent({...Q2,props:J2,emits:K2,setup(n,{expose:e,emit:t}){const i=n,r=a.computed(()=>i[q2]),s=Ge("popover"),o=a.ref(),l=a.computed(()=>{var b;return(b=a.unref(o))==null?void 0:b.popperRef}),u=a.computed(()=>[{width:el(i.width)},i.popperStyle]),c=a.computed(()=>[s.b(),i.popperClass,{[s.m("plain")]:!!i.content}]),f=a.computed(()=>i.transition===`${s.namespace.value}-fade-in-linear`),h=()=>{var b;(b=o.value)==null||b.hide()},p=()=>{t("before-enter")},v=()=>{t("before-leave")},m=()=>{t("after-enter")},d=()=>{t("update:visible",!1),t("after-leave")};return e({popperRef:l,hide:h}),(b,y)=>(a.openBlock(),a.createBlock(a.unref(Gu),a.mergeProps({ref_key:"tooltipRef",ref:o},b.$attrs,{trigger:b.trigger,placement:b.placement,disabled:b.disabled,visible:b.visible,transition:b.transition,"popper-options":b.popperOptions,tabindex:b.tabindex,content:b.content,offset:b.offset,"show-after":b.showAfter,"hide-after":b.hideAfter,"auto-close":b.autoClose,"show-arrow":b.showArrow,"aria-label":b.title,effect:b.effect,enterable:b.enterable,"popper-class":a.unref(c),"popper-style":a.unref(u),teleported:b.teleported,persistent:b.persistent,"gpu-acceleration":a.unref(f),"onUpdate:visible":a.unref(r),onBeforeShow:p,onBeforeHide:v,onShow:m,onHide:d}),{content:a.withCtx(()=>[b.title?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(a.unref(s).e("title")),role:"title"},a.toDisplayString(b.title),3)):a.createCommentVNode("v-if",!0),a.renderSlot(b.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(b.content),1)])]),default:a.withCtx(()=>[b.$slots.reference?a.renderSlot(b.$slots,"reference",{key:0}):a.createCommentVNode("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var tL=We(eL,[["__file","popover.vue"]]);const Eg=(n,e)=>{const t=e.arg||e.value,i=t==null?void 0:t.popperRef;i&&(i.triggerRef=n)};var nL={mounted(n,e){Eg(n,e)},updated(n,e){Eg(n,e)}};const iL=US(nL,"popover"),Ml=Nt(tL,{directive:iL}),Cg=Symbol("sliderContextKey"),rL=$e({modelValue:{type:Ve([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:Hi,inputSize:Hi,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:Ve(Function),default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:Ve(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:hs,default:"top"},marks:{type:Ve(Object)},validateEvent:{type:Boolean,default:!0},...Wi(["ariaLabel"])}),Ku=n=>tt(n)||sn(n)&&n.every(tt),sL={[ot]:Ku,[Sr]:Ku,[fi]:Ku},oL=(n,e,t)=>{const i=a.ref();return a.onMounted(async()=>{n.range?(Array.isArray(n.modelValue)?(e.firstValue=Math.max(n.min,n.modelValue[0]),e.secondValue=Math.min(n.max,n.modelValue[1])):(e.firstValue=n.min,e.secondValue=n.max),e.oldValue=[e.firstValue,e.secondValue]):(typeof n.modelValue!="number"||Number.isNaN(n.modelValue)?e.firstValue=n.min:e.firstValue=Math.min(n.max,Math.max(n.min,n.modelValue)),e.oldValue=e.firstValue),kt(window,"resize",t),await a.nextTick(),t()}),{sliderWrapper:i}},aL=n=>a.computed(()=>n.marks?Object.keys(n.marks).map(Number.parseFloat).sort((t,i)=>t-i).filter(t=>t<=n.max&&t>=n.min).map(t=>({point:t,position:(t-n.min)*100/(n.max-n.min),mark:n.marks[t]})):[]),lL=(n,e,t)=>{const{form:i,formItem:r}=ys(),s=a.shallowRef(),o=a.ref(),l=a.ref(),u={firstButton:o,secondButton:l},c=a.computed(()=>n.disabled||(i==null?void 0:i.disabled)||!1),f=a.computed(()=>Math.min(e.firstValue,e.secondValue)),h=a.computed(()=>Math.max(e.firstValue,e.secondValue)),p=a.computed(()=>n.range?`${100*(h.value-f.value)/(n.max-n.min)}%`:`${100*(e.firstValue-n.min)/(n.max-n.min)}%`),v=a.computed(()=>n.range?`${100*(f.value-n.min)/(n.max-n.min)}%`:"0%"),m=a.computed(()=>n.vertical?{height:n.height}:{}),d=a.computed(()=>n.vertical?{height:p.value,bottom:v.value}:{width:p.value,left:v.value}),b=()=>{s.value&&(e.sliderSize=s.value[`client${n.vertical?"Height":"Width"}`])},y=E=>{const C=n.min+E*(n.max-n.min)/100;if(!n.range)return o;let L;return Math.abs(f.value-C)<Math.abs(h.value-C)?L=e.firstValue<e.secondValue?"firstButton":"secondButton":L=e.firstValue>e.secondValue?"firstButton":"secondButton",u[L]},g=E=>{const C=y(E);return C.value.setPosition(E),C},w=E=>{e.firstValue=E??n.min,S(n.range?[f.value,h.value]:E??n.min)},A=E=>{e.secondValue=E,n.range&&S([f.value,h.value])},S=E=>{t(ot,E),t(Sr,E)},M=async()=>{await a.nextTick(),t(fi,n.range?[f.value,h.value]:n.modelValue)},F=E=>{var C,L,I,x,O,B;if(c.value||e.dragging)return;b();let D=0;if(n.vertical){const k=(I=(L=(C=E.touches)==null?void 0:C.item(0))==null?void 0:L.clientY)!=null?I:E.clientY;D=(s.value.getBoundingClientRect().bottom-k)/e.sliderSize*100}else{const k=(B=(O=(x=E.touches)==null?void 0:x.item(0))==null?void 0:O.clientX)!=null?B:E.clientX,V=s.value.getBoundingClientRect().left;D=(k-V)/e.sliderSize*100}if(!(D<0||D>100))return g(D)};return{elFormItem:r,slider:s,firstButton:o,secondButton:l,sliderDisabled:c,minValue:f,maxValue:h,runwayStyle:m,barStyle:d,resetSize:b,setPosition:g,emitChange:M,onSliderWrapperPrevent:E=>{var C,L;((C=u.firstButton.value)!=null&&C.dragging||(L=u.secondButton.value)!=null&&L.dragging)&&E.preventDefault()},onSliderClick:E=>{F(E)&&M()},onSliderDown:async E=>{const C=F(E);C&&(await a.nextTick(),C.value.onButtonDown(E))},onSliderMarkerDown:E=>{c.value||e.dragging||g(E)},setFirstValue:w,setSecondValue:A}},{left:cL,down:uL,right:dL,up:hL,home:fL,end:pL,pageUp:mL,pageDown:gL}=$n,vL=(n,e,t)=>{const i=a.ref(),r=a.ref(!1),s=a.computed(()=>e.value instanceof Function),o=a.computed(()=>s.value&&e.value(n.modelValue)||n.modelValue),l=pu(()=>{t.value&&(r.value=!0)},50),u=pu(()=>{t.value&&(r.value=!1)},50);return{tooltip:i,tooltipVisible:r,formatValue:o,displayTooltip:l,hideTooltip:u}},yL=(n,e,t)=>{const{disabled:i,min:r,max:s,step:o,showTooltip:l,precision:u,sliderSize:c,formatTooltip:f,emitChange:h,resetSize:p,updateDragging:v}=a.inject(Cg),{tooltip:m,tooltipVisible:d,formatValue:b,displayTooltip:y,hideTooltip:g}=vL(n,f,l),w=a.ref(),A=a.computed(()=>`${(n.modelValue-r.value)/(s.value-r.value)*100}%`),S=a.computed(()=>n.vertical?{bottom:A.value}:{left:A.value}),M=()=>{e.hovering=!0,y()},F=()=>{e.hovering=!1,e.dragging||g()},R=G=>{i.value||(G.preventDefault(),B(G),window.addEventListener("mousemove",D),window.addEventListener("touchmove",D),window.addEventListener("mouseup",k),window.addEventListener("touchend",k),window.addEventListener("contextmenu",k),w.value.focus())},T=G=>{i.value||(e.newPosition=Number.parseFloat(A.value)+G/(s.value-r.value)*100,V(e.newPosition),h())},P=()=>{T(-o.value)},_=()=>{T(o.value)},E=()=>{T(-o.value*4)},C=()=>{T(o.value*4)},L=()=>{i.value||(V(0),h())},I=()=>{i.value||(V(100),h())},x=G=>{let J=!0;[cL,uL].includes(G.key)?P():[dL,hL].includes(G.key)?_():G.key===fL?L():G.key===pL?I():G.key===gL?E():G.key===mL?C():J=!1,J&&G.preventDefault()},O=G=>{let J,j;return G.type.startsWith("touch")?(j=G.touches[0].clientY,J=G.touches[0].clientX):(j=G.clientY,J=G.clientX),{clientX:J,clientY:j}},B=G=>{e.dragging=!0,e.isClick=!0;const{clientX:J,clientY:j}=O(G);n.vertical?e.startY=j:e.startX=J,e.startPosition=Number.parseFloat(A.value),e.newPosition=e.startPosition},D=G=>{if(e.dragging){e.isClick=!1,y(),p();let J;const{clientX:j,clientY:te}=O(G);n.vertical?(e.currentY=te,J=(e.startY-e.currentY)/c.value*100):(e.currentX=j,J=(e.currentX-e.startX)/c.value*100),e.newPosition=e.startPosition+J,V(e.newPosition)}},k=()=>{e.dragging&&(setTimeout(()=>{e.dragging=!1,e.hovering||g(),e.isClick||V(e.newPosition),h()},0),window.removeEventListener("mousemove",D),window.removeEventListener("touchmove",D),window.removeEventListener("mouseup",k),window.removeEventListener("touchend",k),window.removeEventListener("contextmenu",k))},V=async G=>{if(G===null||Number.isNaN(+G))return;G<0?G=0:G>100&&(G=100);const J=100/((s.value-r.value)/o.value);let te=Math.round(G/J)*J*(s.value-r.value)*.01+r.value;te=Number.parseFloat(te.toFixed(u.value)),te!==n.modelValue&&t(ot,te),!e.dragging&&n.modelValue!==e.oldValue&&(e.oldValue=n.modelValue),await a.nextTick(),e.dragging&&y(),m.value.updatePopper()};return a.watch(()=>e.dragging,G=>{v(G)}),kt(w,"touchstart",R,{passive:!1}),{disabled:i,button:w,tooltip:m,tooltipVisible:d,showTooltip:l,wrapperStyle:S,formatValue:b,handleMouseEnter:M,handleMouseLeave:F,onButtonDown:R,onKeyDown:x,setPosition:V}},bL=(n,e,t,i)=>({stops:a.computed(()=>{if(!n.showStops||n.min>n.max)return[];if(n.step===0)return gt("ElSlider","step should not be 0."),[];const o=(n.max-n.min)/n.step,l=100*n.step/(n.max-n.min),u=Array.from({length:o-1}).map((c,f)=>(f+1)*l);return n.range?u.filter(c=>c<100*(t.value-n.min)/(n.max-n.min)||c>100*(i.value-n.min)/(n.max-n.min)):u.filter(c=>c>100*(e.firstValue-n.min)/(n.max-n.min))}),getStopStyle:o=>n.vertical?{bottom:`${o}%`}:{left:`${o}%`}}),xL=(n,e,t,i,r,s)=>{const o=c=>{r(ot,c),r(Sr,c)},l=()=>n.range?![t.value,i.value].every((c,f)=>c===e.oldValue[f]):n.modelValue!==e.oldValue,u=()=>{var c,f;n.min>n.max&&us("Slider","min should not be greater than max.");const h=n.modelValue;n.range&&Array.isArray(h)?h[1]<n.min?o([n.min,n.min]):h[0]>n.max?o([n.max,n.max]):h[0]<n.min?o([n.min,h[1]]):h[1]>n.max?o([h[0],n.max]):(e.firstValue=h[0],e.secondValue=h[1],l()&&(n.validateEvent&&((c=s==null?void 0:s.validate)==null||c.call(s,"change").catch(p=>gt(p))),e.oldValue=h.slice())):!n.range&&typeof h=="number"&&!Number.isNaN(h)&&(h<n.min?o(n.min):h>n.max?o(n.max):(e.firstValue=h,l()&&(n.validateEvent&&((f=s==null?void 0:s.validate)==null||f.call(s,"change").catch(p=>gt(p))),e.oldValue=h)))};u(),a.watch(()=>e.dragging,c=>{c||u()}),a.watch(()=>n.modelValue,(c,f)=>{e.dragging||Array.isArray(c)&&Array.isArray(f)&&c.every((h,p)=>h===f[p])&&e.firstValue===c[0]&&e.secondValue===c[1]||u()},{deep:!0}),a.watch(()=>[n.min,n.max],()=>{u()})},wL=$e({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:hs,default:"top"}}),ML={[ot]:n=>tt(n)},AL=a.defineComponent({name:"ElSliderButton"}),SL=a.defineComponent({...AL,props:wL,emits:ML,setup(n,{expose:e,emit:t}){const i=n,r=Ge("slider"),s=a.reactive({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:i.modelValue}),{disabled:o,button:l,tooltip:u,showTooltip:c,tooltipVisible:f,wrapperStyle:h,formatValue:p,handleMouseEnter:v,handleMouseLeave:m,onButtonDown:d,onKeyDown:b,setPosition:y}=yL(i,s,t),{hovering:g,dragging:w}=a.toRefs(s);return e({onButtonDown:d,onKeyDown:b,setPosition:y,hovering:g,dragging:w}),(A,S)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"button",ref:l,class:a.normalizeClass([a.unref(r).e("button-wrapper"),{hover:a.unref(g),dragging:a.unref(w)}]),style:a.normalizeStyle(a.unref(h)),tabindex:a.unref(o)?-1:0,onMouseenter:a.unref(v),onMouseleave:a.unref(m),onMousedown:a.unref(d),onFocus:a.unref(v),onBlur:a.unref(m),onKeydown:a.unref(b)},[a.createVNode(a.unref(Gu),{ref_key:"tooltip",ref:u,visible:a.unref(f),placement:A.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":A.tooltipClass,disabled:!a.unref(c),persistent:""},{content:a.withCtx(()=>[a.createElementVNode("span",null,a.toDisplayString(a.unref(p)),1)]),default:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass([a.unref(r).e("button"),{hover:a.unref(g),dragging:a.unref(w)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,["tabindex","onMouseenter","onMouseleave","onMousedown","onFocus","onBlur","onKeydown"]))}});var Lg=We(SL,[["__file","button.vue"]]);const _L=$e({mark:{type:Ve([String,Object]),default:void 0}});var TL=a.defineComponent({name:"ElSliderMarker",props:_L,setup(n){const e=Ge("slider"),t=a.computed(()=>Ht(n.mark)?n.mark:n.mark.label),i=a.computed(()=>Ht(n.mark)?void 0:n.mark.style);return()=>a.h("div",{class:e.e("marks-text"),style:i.value},t.value)}});const EL=a.defineComponent({name:"ElSlider"}),CL=a.defineComponent({...EL,props:rL,emits:sL,setup(n,{expose:e,emit:t}){const i=n,r=Ge("slider"),{t:s}=sl(),o=a.reactive({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:l,slider:u,firstButton:c,secondButton:f,sliderDisabled:h,minValue:p,maxValue:v,runwayStyle:m,barStyle:d,resetSize:b,emitChange:y,onSliderWrapperPrevent:g,onSliderClick:w,onSliderDown:A,onSliderMarkerDown:S,setFirstValue:M,setSecondValue:F}=lL(i,o,t),{stops:R,getStopStyle:T}=bL(i,o,p,v),{inputId:P,isLabeledByFormItem:_}=fl(i,{formItemContext:l}),E=Er(),C=a.computed(()=>i.inputSize||E.value),L=a.computed(()=>i.ariaLabel||s("el.slider.defaultLabel",{min:i.min,max:i.max})),I=a.computed(()=>i.range?i.rangeStartLabel||s("el.slider.defaultRangeStartLabel"):L.value),x=a.computed(()=>i.formatValueText?i.formatValueText(J.value):`${J.value}`),O=a.computed(()=>i.rangeEndLabel||s("el.slider.defaultRangeEndLabel")),B=a.computed(()=>i.formatValueText?i.formatValueText(j.value):`${j.value}`),D=a.computed(()=>[r.b(),r.m(E.value),r.is("vertical",i.vertical),{[r.m("with-input")]:i.showInput}]),k=aL(i);xL(i,o,p,v,t,l);const V=a.computed(()=>{const ae=[i.min,i.max,i.step].map(H=>{const Z=`${H}`.split(".")[1];return Z?Z.length:0});return Math.max.apply(null,ae)}),{sliderWrapper:G}=oL(i,o,b),{firstValue:J,secondValue:j,sliderSize:te}=a.toRefs(o),ee=ae=>{o.dragging=ae};return kt(G,"touchstart",g,{passive:!1}),kt(G,"touchmove",g,{passive:!1}),a.provide(Cg,{...a.toRefs(i),sliderSize:te,disabled:h,precision:V,emitChange:y,resetSize:b,updateDragging:ee}),e({onSliderClick:w}),(ae,H)=>{var Z,$;return a.openBlock(),a.createElementBlock("div",{id:ae.range?a.unref(P):void 0,ref_key:"sliderWrapper",ref:G,class:a.normalizeClass(a.unref(D)),role:ae.range?"group":void 0,"aria-label":ae.range&&!a.unref(_)?a.unref(L):void 0,"aria-labelledby":ae.range&&a.unref(_)?(Z=a.unref(l))==null?void 0:Z.labelId:void 0},[a.createElementVNode("div",{ref_key:"slider",ref:u,class:a.normalizeClass([a.unref(r).e("runway"),{"show-input":ae.showInput&&!ae.range},a.unref(r).is("disabled",a.unref(h))]),style:a.normalizeStyle(a.unref(m)),onMousedown:a.unref(A),onTouchstartPassive:a.unref(A)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("bar")),style:a.normalizeStyle(a.unref(d))},null,6),a.createVNode(Lg,{id:ae.range?void 0:a.unref(P),ref_key:"firstButton",ref:c,"model-value":a.unref(J),vertical:ae.vertical,"tooltip-class":ae.tooltipClass,placement:ae.placement,role:"slider","aria-label":ae.range||!a.unref(_)?a.unref(I):void 0,"aria-labelledby":!ae.range&&a.unref(_)?($=a.unref(l))==null?void 0:$.labelId:void 0,"aria-valuemin":ae.min,"aria-valuemax":ae.range?a.unref(j):ae.max,"aria-valuenow":a.unref(J),"aria-valuetext":a.unref(x),"aria-orientation":ae.vertical?"vertical":"horizontal","aria-disabled":a.unref(h),"onUpdate:modelValue":a.unref(M)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),ae.range?(a.openBlock(),a.createBlock(Lg,{key:0,ref_key:"secondButton",ref:f,"model-value":a.unref(j),vertical:ae.vertical,"tooltip-class":ae.tooltipClass,placement:ae.placement,role:"slider","aria-label":a.unref(O),"aria-valuemin":a.unref(J),"aria-valuemax":ae.max,"aria-valuenow":a.unref(j),"aria-valuetext":a.unref(B),"aria-orientation":ae.vertical?"vertical":"horizontal","aria-disabled":a.unref(h),"onUpdate:modelValue":a.unref(F)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):a.createCommentVNode("v-if",!0),ae.showStops?(a.openBlock(),a.createElementBlock("div",{key:1},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(R),(se,z)=>(a.openBlock(),a.createElementBlock("div",{key:z,class:a.normalizeClass(a.unref(r).e("stop")),style:a.normalizeStyle(a.unref(T)(se))},null,6))),128))])):a.createCommentVNode("v-if",!0),a.unref(k).length>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createElementVNode("div",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(k),(se,z)=>(a.openBlock(),a.createElementBlock("div",{key:z,style:a.normalizeStyle(a.unref(T)(se.position)),class:a.normalizeClass([a.unref(r).e("stop"),a.unref(r).e("marks-stop")])},null,6))),128))]),a.createElementVNode("div",{class:a.normalizeClass(a.unref(r).e("marks"))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(k),(se,z)=>(a.openBlock(),a.createBlock(a.unref(TL),{key:z,mark:se.mark,style:a.normalizeStyle(a.unref(T)(se.position)),onMousedown:a.withModifiers(W=>a.unref(S)(se.position),["stop"])},null,8,["mark","style","onMousedown"]))),128))],2)],64)):a.createCommentVNode("v-if",!0)],46,["onMousedown","onTouchstartPassive"]),ae.showInput&&!ae.range?(a.openBlock(),a.createBlock(a.unref(yi),{key:0,ref:"input","model-value":a.unref(J),class:a.normalizeClass(a.unref(r).e("input")),step:ae.step,disabled:a.unref(h),controls:ae.showInputControls,min:ae.min,max:ae.max,precision:a.unref(V),debounce:ae.debounce,size:a.unref(C),"onUpdate:modelValue":a.unref(M),onChange:a.unref(y)},null,8,["model-value","class","step","disabled","controls","min","max","precision","debounce","size","onUpdate:modelValue","onChange"])):a.createCommentVNode("v-if",!0)],10,["id","role","aria-label","aria-labelledby"])}}});var LL=We(CL,[["__file","slider.vue"]]);const An=Nt(LL),Al=Symbol("tabsRootContextKey"),RL=$e({tabs:{type:Ve(Array),default:()=>pi([])}}),Rg="ElTabBar",FL=a.defineComponent({name:Rg}),PL=a.defineComponent({...FL,props:RL,setup(n,{expose:e}){const t=n,i=a.getCurrentInstance(),r=a.inject(Al);r||us(Rg,"<el-tabs><el-tab-bar /></el-tabs>");const s=Ge("tabs"),o=a.ref(),l=a.ref(),u=()=>{let v=0,m=0;const d=["top","bottom"].includes(r.props.tabPosition)?"width":"height",b=d==="width"?"x":"y",y=b==="x"?"left":"top";return t.tabs.every(g=>{var w,A;const S=(A=(w=i.parent)==null?void 0:w.refs)==null?void 0:A[`tab-${g.uid}`];if(!S)return!1;if(!g.active)return!0;v=S[`offset${Vi(y)}`],m=S[`client${Vi(d)}`];const M=window.getComputedStyle(S);return d==="width"&&(m-=Number.parseFloat(M.paddingLeft)+Number.parseFloat(M.paddingRight),v+=Number.parseFloat(M.paddingLeft)),!1}),{[d]:`${m}px`,transform:`translate${Vi(b)}(${v}px)`}},c=()=>l.value=u(),f=[],h=()=>{var v;f.forEach(d=>d.stop()),f.length=0;const m=(v=i.parent)==null?void 0:v.refs;if(m){for(const d in m)if(d.startsWith("tab-")){const b=m[d];b&&f.push(bn(b,c))}}};a.watch(()=>t.tabs,async()=>{await a.nextTick(),c(),h()},{immediate:!0});const p=bn(o,()=>c());return a.onBeforeUnmount(()=>{f.forEach(v=>v.stop()),f.length=0,p.stop()}),e({ref:o,update:c}),(v,m)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"barRef",ref:o,class:a.normalizeClass([a.unref(s).e("active-bar"),a.unref(s).is(a.unref(r).props.tabPosition)]),style:a.normalizeStyle(l.value)},null,6))}});var IL=We(PL,[["__file","tab-bar.vue"]]);const OL=$e({panes:{type:Ve(Array),default:()=>pi([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),NL={tabClick:(n,e,t)=>t instanceof Event,tabRemove:(n,e)=>e instanceof Event},Fg="ElTabNav",BL=a.defineComponent({name:Fg,props:OL,emits:NL,setup(n,{expose:e,emit:t}){const i=a.inject(Al);i||us(Fg,"<el-tabs><tab-nav /></el-tabs>");const r=Ge("tabs"),s=rw(),o=gw(),l=a.ref(),u=a.ref(),c=a.ref(),f=a.ref(),h=a.ref(!1),p=a.ref(0),v=a.ref(!1),m=a.ref(!0),d=a.computed(()=>["top","bottom"].includes(i.props.tabPosition)?"width":"height"),b=a.computed(()=>({transform:`translate${d.value==="width"?"X":"Y"}(-${p.value}px)`})),y=()=>{if(!l.value)return;const R=l.value[`offset${Vi(d.value)}`],T=p.value;if(!T)return;const P=T>R?T-R:0;p.value=P},g=()=>{if(!l.value||!u.value)return;const R=u.value[`offset${Vi(d.value)}`],T=l.value[`offset${Vi(d.value)}`],P=p.value;if(R-P<=T)return;const _=R-P>T*2?P+T:R-T;p.value=_},w=async()=>{const R=u.value;if(!h.value||!c.value||!l.value||!R)return;await a.nextTick();const T=c.value.querySelector(".is-active");if(!T)return;const P=l.value,_=["top","bottom"].includes(i.props.tabPosition),E=T.getBoundingClientRect(),C=P.getBoundingClientRect(),L=_?R.offsetWidth-C.width:R.offsetHeight-C.height,I=p.value;let x=I;_?(E.left<C.left&&(x=I-(C.left-E.left)),E.right>C.right&&(x=I+E.right-C.right)):(E.top<C.top&&(x=I-(C.top-E.top)),E.bottom>C.bottom&&(x=I+(E.bottom-C.bottom))),x=Math.max(x,0),p.value=Math.min(x,L)},A=()=>{var R;if(!u.value||!l.value)return;n.stretch&&((R=f.value)==null||R.update());const T=u.value[`offset${Vi(d.value)}`],P=l.value[`offset${Vi(d.value)}`],_=p.value;P<T?(h.value=h.value||{},h.value.prev=_,h.value.next=_+P<T,T-_<P&&(p.value=T-P)):(h.value=!1,_>0&&(p.value=0))},S=R=>{const T=R.code,{up:P,down:_,left:E,right:C}=$n;if(![P,_,E,C].includes(T))return;const L=Array.from(R.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),I=L.indexOf(R.target);let x;T===E||T===P?I===0?x=L.length-1:x=I-1:I<L.length-1?x=I+1:x=0,L[x].focus({preventScroll:!0}),L[x].click(),M()},M=()=>{m.value&&(v.value=!0)},F=()=>v.value=!1;return a.watch(s,R=>{R==="hidden"?m.value=!1:R==="visible"&&setTimeout(()=>m.value=!0,50)}),a.watch(o,R=>{R?setTimeout(()=>m.value=!0,50):m.value=!1}),bn(c,A),a.onMounted(()=>setTimeout(()=>w(),0)),a.onUpdated(()=>A()),e({scrollToActiveTab:w,removeFocus:F}),()=>{const R=h.value?[a.createVNode("span",{class:[r.e("nav-prev"),r.is("disabled",!h.value.prev)],onClick:y},[a.createVNode(ht,null,{default:()=>[a.createVNode(ki,null,null)]})]),a.createVNode("span",{class:[r.e("nav-next"),r.is("disabled",!h.value.next)],onClick:g},[a.createVNode(ht,null,{default:()=>[a.createVNode(zi,null,null)]})])]:null,T=n.panes.map((P,_)=>{var E,C,L,I;const x=P.uid,O=P.props.disabled,B=(C=(E=P.props.name)!=null?E:P.index)!=null?C:`${_}`,D=!O&&(P.isClosable||n.editable);P.index=`${_}`;const k=D?a.createVNode(ht,{class:"is-icon-close",onClick:J=>t("tabRemove",P,J)},{default:()=>[a.createVNode(yu,null,null)]}):null,V=((I=(L=P.slots).label)==null?void 0:I.call(L))||P.props.label,G=!O&&P.active?0:-1;return a.createVNode("div",{ref:`tab-${x}`,class:[r.e("item"),r.is(i.props.tabPosition),r.is("active",P.active),r.is("disabled",O),r.is("closable",D),r.is("focus",v.value)],id:`tab-${B}`,key:`tab-${x}`,"aria-controls":`pane-${B}`,role:"tab","aria-selected":P.active,tabindex:G,onFocus:()=>M(),onBlur:()=>F(),onClick:J=>{F(),t("tabClick",P,B,J)},onKeydown:J=>{D&&(J.code===$n.delete||J.code===$n.backspace)&&t("tabRemove",P,J)}},[V,k])});return a.createVNode("div",{ref:c,class:[r.e("nav-wrap"),r.is("scrollable",!!h.value),r.is(i.props.tabPosition)]},[R,a.createVNode("div",{class:r.e("nav-scroll"),ref:l},[a.createVNode("div",{class:[r.e("nav"),r.is(i.props.tabPosition),r.is("stretch",n.stretch&&["top","bottom"].includes(i.props.tabPosition))],ref:u,style:b.value,role:"tablist",onKeydown:S},[n.type?null:a.createVNode(IL,{ref:f,tabs:[...n.panes]},null),T])])])}}}),DL=$e({type:{type:String,values:["card","border-card",""],default:""},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:Ve(Function),default:()=>!0},stretch:Boolean}),qu=n=>Ht(n)||tt(n),VL={[ot]:n=>qu(n),tabClick:(n,e)=>e instanceof Event,tabChange:n=>qu(n),edit:(n,e)=>["remove","add"].includes(e),tabRemove:n=>qu(n),tabAdd:()=>!0},kL=a.defineComponent({name:"ElTabs",props:DL,emits:VL,setup(n,{emit:e,slots:t,expose:i}){var r;const s=Ge("tabs"),o=a.computed(()=>["left","right"].includes(n.tabPosition)),{children:l,addChild:u,removeChild:c}=pT(a.getCurrentInstance(),"ElTabPane"),f=a.ref(),h=a.ref((r=n.modelValue)!=null?r:"0"),p=async(y,g=!1)=>{var w,A,S;if(!(h.value===y||Tn(y)))try{await((w=n.beforeLeave)==null?void 0:w.call(n,y,h.value))!==!1&&(h.value=y,g&&(e(ot,y),e("tabChange",y)),(S=(A=f.value)==null?void 0:A.removeFocus)==null||S.call(A))}catch{}},v=(y,g,w)=>{y.props.disabled||(p(g,!0),e("tabClick",y,w))},m=(y,g)=>{y.props.disabled||Tn(y.props.name)||(g.stopPropagation(),e("edit",y.props.name,"remove"),e("tabRemove",y.props.name))},d=()=>{e("edit",void 0,"add"),e("tabAdd")};a.watch(()=>n.modelValue,y=>p(y)),a.watch(h,async()=>{var y;await a.nextTick(),(y=f.value)==null||y.scrollToActiveTab()}),a.provide(Al,{props:n,currentName:h,registerPane:y=>{l.value.push(y)},sortPane:u,unregisterPane:c}),i({currentName:h});const b=({render:y})=>y();return()=>{const y=t["add-icon"],g=n.editable||n.addable?a.createVNode("div",{class:[s.e("new-tab"),o.value&&s.e("new-tab-vertical")],tabindex:"0",onClick:d,onKeydown:S=>{S.code===$n.enter&&d()}},[y?a.renderSlot(t,"add-icon"):a.createVNode(ht,{class:s.is("icon-plus")},{default:()=>[a.createVNode(nl,null,null)]})]):null,w=a.createVNode("div",{class:[s.e("header"),o.value&&s.e("header-vertical"),s.is(n.tabPosition)]},[a.createVNode(b,{render:()=>{const S=l.value.some(M=>M.slots.label);return a.createVNode(BL,{ref:f,currentName:h.value,editable:n.editable,type:n.type,panes:l.value,stretch:n.stretch,onTabClick:v,onTabRemove:m},{$stable:!S})}},null),g]),A=a.createVNode("div",{class:s.e("content")},[a.renderSlot(t,"default")]);return a.createVNode("div",{class:[s.b(),s.m(n.tabPosition),{[s.m("card")]:n.type==="card",[s.m("border-card")]:n.type==="border-card"}]},[A,w])}}}),zL=$e({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),Pg="ElTabPane",UL=a.defineComponent({name:Pg}),GL=a.defineComponent({...UL,props:zL,setup(n){const e=n,t=a.getCurrentInstance(),i=a.useSlots(),r=a.inject(Al);r||us(Pg,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const s=Ge("tab-pane"),o=a.ref(),l=a.computed(()=>e.closable||r.props.closable),u=Df(()=>{var v;return r.currentName.value===((v=e.name)!=null?v:o.value)}),c=a.ref(u.value),f=a.computed(()=>{var v;return(v=e.name)!=null?v:o.value}),h=Df(()=>!e.lazy||c.value||u.value);a.watch(u,v=>{v&&(c.value=!0)});const p=a.reactive({uid:t.uid,slots:i,props:e,paneName:f,active:u,index:o,isClosable:l});return r.registerPane(p),a.onMounted(()=>{r.sortPane(p)}),a.onUnmounted(()=>{r.unregisterPane(p.uid)}),(v,m)=>a.unref(h)?a.withDirectives((a.openBlock(),a.createElementBlock("div",{key:0,id:`pane-${a.unref(f)}`,class:a.normalizeClass(a.unref(s).b()),role:"tabpanel","aria-hidden":!a.unref(u),"aria-labelledby":`tab-${a.unref(f)}`},[a.renderSlot(v.$slots,"default")],10,["id","aria-hidden","aria-labelledby"])),[[a.vShow,a.unref(u)]]):a.createCommentVNode("v-if",!0)}});var Ig=We(GL,[["__file","tab-pane.vue"]]);const Og=Nt(kL,{TabPane:Ig}),Ng=En(Ig);function HL(n){let e;const t=a.ref(!1),i=a.reactive({...n,originalPosition:"",originalOverflow:"",visible:!1});function r(p){i.text=p}function s(){const p=i.parent,v=h.ns;if(!p.vLoadingAddClassList){let m=p.getAttribute("loading-number");m=Number.parseInt(m)-1,m?p.setAttribute("loading-number",m.toString()):(Qa(p,v.bm("parent","relative")),p.removeAttribute("loading-number")),Qa(p,v.bm("parent","hidden"))}o(),f.unmount()}function o(){var p,v;(v=(p=h.$el)==null?void 0:p.parentNode)==null||v.removeChild(h.$el)}function l(){var p;n.beforeClose&&!n.beforeClose()||(t.value=!0,clearTimeout(e),e=setTimeout(u,400),i.visible=!1,(p=n.closed)==null||p.call(n))}function u(){if(!t.value)return;const p=i.parent;t.value=!1,p.vLoadingAddClassList=void 0,s()}const c=a.defineComponent({name:"ElLoading",setup(p,{expose:v}){const{ns:m,zIndex:d}=MT("loading");return v({ns:m,zIndex:d}),()=>{const b=i.spinner||i.svg,y=a.h("svg",{class:"circular",viewBox:i.svgViewBox?i.svgViewBox:"0 0 50 50",...b?{innerHTML:b}:{}},[a.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),g=i.text?a.h("p",{class:m.b("text")},[i.text]):void 0;return a.h(a.Transition,{name:m.b("fade"),onAfterLeave:u},{default:a.withCtx(()=>[a.withDirectives(a.createVNode("div",{style:{backgroundColor:i.background||""},class:[m.b("mask"),i.customClass,i.fullscreen?"is-fullscreen":""]},[a.h("div",{class:m.b("spinner")},[y,g])]),[[a.vShow,i.visible]])])})}}}),f=a.createApp(c),h=f.mount(document.createElement("div"));return{...a.toRefs(i),setText:r,removeElLoadingChild:o,close:l,handleAfterLeave:u,vm:h,get $el(){return h.$el}}}let Sl;const Qu=function(n={}){if(!Rt)return;const e=WL(n);if(e.fullscreen&&Sl)return Sl;const t=HL({...e,closed:()=>{var r;(r=e.closed)==null||r.call(e),e.fullscreen&&(Sl=void 0)}});jL(e,e.parent,t),Bg(e,e.parent,t),e.parent.vLoadingAddClassList=()=>Bg(e,e.parent,t);let i=e.parent.getAttribute("loading-number");return i?i=`${Number.parseInt(i)+1}`:i="1",e.parent.setAttribute("loading-number",i),e.parent.appendChild(t.$el),a.nextTick(()=>t.visible.value=e.visible),e.fullscreen&&(Sl=t),t},WL=n=>{var e,t,i,r;let s;return Ht(n.target)?s=(e=document.querySelector(n.target))!=null?e:document.body:s=n.target||document.body,{parent:s===document.body||n.body?document.body:s,background:n.background||"",svg:n.svg||"",svgViewBox:n.svgViewBox||"",spinner:n.spinner||!1,text:n.text||"",fullscreen:s===document.body&&((t=n.fullscreen)!=null?t:!0),lock:(i=n.lock)!=null?i:!1,customClass:n.customClass||"",visible:(r=n.visible)!=null?r:!0,beforeClose:n.beforeClose,closed:n.closed,target:s}},jL=async(n,e,t)=>{const{nextZIndex:i}=t.vm.zIndex||t.vm._.exposed.zIndex,r={};if(n.fullscreen)t.originalPosition.value=Io(document.body,"position"),t.originalOverflow.value=Io(document.body,"overflow"),r.zIndex=i();else if(n.parent===document.body){t.originalPosition.value=Io(document.body,"position"),await a.nextTick();for(const s of["top","left"]){const o=s==="top"?"scrollTop":"scrollLeft";r[s]=`${n.target.getBoundingClientRect()[s]+document.body[o]+document.documentElement[o]-Number.parseInt(Io(document.body,`margin-${s}`),10)}px`}for(const s of["height","width"])r[s]=`${n.target.getBoundingClientRect()[s]}px`}else t.originalPosition.value=Io(e,"position");for(const[s,o]of Object.entries(r))t.$el.style[s]=o},Bg=(n,e,t)=>{const i=t.vm.ns||t.vm._.exposed.ns;["absolute","fixed","sticky"].includes(t.originalPosition.value)?Qa(e,i.bm("parent","relative")):Up(e,i.bm("parent","relative")),n.fullscreen&&n.lock?Up(e,i.bm("parent","hidden")):Qa(e,i.bm("parent","hidden"))},_l=Symbol("ElLoading"),Dg=(n,e)=>{var t,i,r,s;const o=e.instance,l=p=>en(e.value)?e.value[p]:void 0,u=p=>{const v=Ht(p)&&(o==null?void 0:o[p])||p;return v&&a.ref(v)},c=p=>u(l(p)||n.getAttribute(`element-loading-${Sw(p)}`)),f=(t=l("fullscreen"))!=null?t:e.modifiers.fullscreen,h={text:c("text"),svg:c("svg"),svgViewBox:c("svgViewBox"),spinner:c("spinner"),background:c("background"),customClass:c("customClass"),fullscreen:f,target:(i=l("target"))!=null?i:f?void 0:n,body:(r=l("body"))!=null?r:e.modifiers.body,lock:(s=l("lock"))!=null?s:e.modifiers.lock};n[_l]={options:h,instance:Qu(h)}},$L=(n,e)=>{for(const t of Object.keys(e))a.isRef(e[t])&&(e[t].value=n[t])},ed={mounted(n,e){e.value&&Dg(n,e)},updated(n,e){const t=n[_l];e.oldValue!==e.value&&(e.value&&!e.oldValue?Dg(n,e):e.value&&e.oldValue?en(e.value)&&$L(e.value,t.options):t==null||t.instance.close())},unmounted(n){var e;(e=n[_l])==null||e.instance.close(),n[_l]=null}},ZL={install(n){n.directive("loading",ed),n.config.globalProperties.$loading=Qu},directive:ed,service:Qu},Kn=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t},XL=[{position:"top",mode:"vertical",text:"Begin interaction here to rotate on the x-axis"},{position:"bottom",mode:"vertical",text:"Begin interaction here to rotate on the x-axis"},{position:"left",mode:"horizontal",text:"Begin interaction here to rotate on the y-axis"},{position:"right",mode:"horizontal",text:"Begin interaction here to rotate on the y-axis"}],YL={name:"ScaffoldOverlay",data:function(){return{lockRotationMode:!1,touchActive:!1,rotationOverlays:XL}},props:{positionalRotation:{type:Boolean,default:!1}},methods:{contentMouseActive:function(n,e){if(this.positionalRotation){const t=this.$refs.topLayer;t&&(e?(this.lockRotationMode=!0,t.style.pointerEvents="none",n.type==="touchstart"&&(this.touchActive=!0)):(this.lockRotationMode=!1,this.setRotationMode(void 0,"free"),t.style.pointerEvents="auto",n.type==="touchend"&&(this.touchActive=!1)))}},setRotationMode:function(n,e){this.lockRotationMode||this.$emit("onRotationModeChange",e),n&&(n.preventDefault(),n.stopPropagation())},skipWhenInBound:function(n){if(this.positionalRotation){const e=this.$refs.topLayer,t=this.$refs.contentLayer;if(e&&t){const i=e.style.pointerEvents;e.style.pointerEvents="none";const r=document.elementFromPoint(n.clientX,n.clientY);e.style.pointerEvents=i,t.contains(r)&&n.stopPropagation()}}},forwardEvent:function(n){const e=this.$refs.topLayer;if(!e)return;const t=e.style.pointerEvents;e.style.pointerEvents="none";const i=document.elementFromPoint(n.clientX,n.clientY);if(e.style.pointerEvents=t,i){const r=new MouseEvent(n.type,{bubbles:n.bubbles,cancelable:n.cancelable,view:n.view,clientX:n.clientX,clientY:n.clientY,button:n.button});i.dispatchEvent(r),n.stopPropagation()}n.preventDefault()},forwardTouchEvent:function(n){const e=this.$refs.topLayer;if(!e)return;const t=e.style.pointerEvents;e.style.pointerEvents="none";const i=n.changedTouches[0],r=i.clientX,s=i.clientY,o=document.elementFromPoint(r,s);if(e.style.pointerEvents=t,o){const l=new Touch({identifier:i.identifier,target:o,clientX:i.clientX,clientY:i.clientY,pageX:i.pageX,pageY:i.pageY,screenX:i.screenX,screenY:i.screenY,radiusX:i.radiusX,radiusY:i.radiusY,rotationAngle:i.rotationAngle,force:i.force}),u=new TouchEvent(n.type,{bubbles:n.bubbles,cancelable:n.cancelable,composed:!0,view:n.view,touches:[l],targetTouches:[l],changedTouches:[l]});o.dispatchEvent(u),n.stopPropagation()}n.preventDefault()}}},JL={ref:"overlay"},KL=["onMousedown","onTouchstart"];function qL(n,e,t,i,r,s){return a.openBlock(),a.createElementBlock("div",JL,[a.createElementVNode("div",{class:"content-layer",ref:"contentLayer",onMouseleaveCapture:e[0]||(e[0]=(...o)=>s.skipWhenInBound&&s.skipWhenInBound(...o)),onMousedownCapture:e[1]||(e[1]=o=>s.contentMouseActive(o,!0)),onMouseupCapture:e[2]||(e[2]=o=>s.contentMouseActive(o,!1)),onTouchstartCapture:e[3]||(e[3]=o=>s.contentMouseActive(o,!0)),onTouchendCapture:e[4]||(e[4]=o=>s.contentMouseActive(o,!1))},[a.renderSlot(n.$slots,"default",{},void 0,!0)],544),t.positionalRotation?(a.openBlock(),a.createElementBlock("div",{key:0,ref:"topLayer",onMousemoveCapture:e[7]||(e[7]=(...o)=>s.forwardEvent&&s.forwardEvent(...o)),onMouseoverCapture:e[8]||(e[8]=(...o)=>s.forwardEvent&&s.forwardEvent(...o)),onTouchmoveCapture:e[9]||(e[9]=(...o)=>s.forwardTouchEvent&&s.forwardTouchEvent(...o)),onClickCapture:e[10]||(e[10]=(...o)=>s.forwardEvent&&s.forwardEvent(...o))},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.rotationOverlays,o=>(a.openBlock(),a.createElementBlock("div",{key:o.position,class:a.normalizeClass(["rotation-overlay",o.position,n.touchActive?"touch-active":""]),onMousedown:l=>{s.setRotationMode(l,o.mode),s.forwardEvent(l)},onMouseup:e[5]||(e[5]=(...l)=>s.forwardEvent&&s.forwardEvent(...l)),onTouchstart:l=>{s.setRotationMode(l,o.mode),s.forwardTouchEvent(l)},onTouchend:e[6]||(e[6]=(...l)=>s.forwardTouchEvent&&s.forwardTouchEvent(...l))},[a.createElementVNode("span",null,a.toDisplayString(o.text),1)],42,KL))),128))],544)):a.createCommentVNode("",!0)],512)}const Vg=Kn(YL,[["render",qL],["__scopeId","data-v-f06acb4f"]]);var kg={exports:{}},zg={},Ug;function QL(){return Ug||(Ug=1,function(n){var e=function(){try{return!!Symbol.iterator}catch{return!1}},t=e(),i=function(c){var f={next:function(){var h=c.shift();return{done:h===void 0,value:h}}};return t&&(f[Symbol.iterator]=function(){return f}),f},r=function(c){return encodeURIComponent(c).replace(/%20/g,"+")},s=function(c){return decodeURIComponent(String(c).replace(/\+/g," "))},o=function(){var c=function(h){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var p=typeof h;if(p!=="undefined")if(p==="string")h!==""&&this._fromString(h);else if(h instanceof c){var v=this;h.forEach(function(y,g){v.append(g,y)})}else if(h!==null&&p==="object")if(Object.prototype.toString.call(h)==="[object Array]")for(var m=0;m<h.length;m++){var d=h[m];if(Object.prototype.toString.call(d)==="[object Array]"||d.length!==2)this.append(d[0],d[1]);else throw new TypeError("Expected [string, any] as entry at index "+m+" of URLSearchParams's input")}else for(var b in h)h.hasOwnProperty(b)&&this.append(b,h[b]);else throw new TypeError("Unsupported input's type for URLSearchParams")},f=c.prototype;f.append=function(h,p){h in this._entries?this._entries[h].push(String(p)):this._entries[h]=[String(p)]},f.delete=function(h){delete this._entries[h]},f.get=function(h){return h in this._entries?this._entries[h][0]:null},f.getAll=function(h){return h in this._entries?this._entries[h].slice(0):[]},f.has=function(h){return h in this._entries},f.set=function(h,p){this._entries[h]=[String(p)]},f.forEach=function(h,p){var v;for(var m in this._entries)if(this._entries.hasOwnProperty(m)){v=this._entries[m];for(var d=0;d<v.length;d++)h.call(p,v[d],m,this)}},f.keys=function(){var h=[];return this.forEach(function(p,v){h.push(v)}),i(h)},f.values=function(){var h=[];return this.forEach(function(p){h.push(p)}),i(h)},f.entries=function(){var h=[];return this.forEach(function(p,v){h.push([v,p])}),i(h)},t&&(f[Symbol.iterator]=f.entries),f.toString=function(){var h=[];return this.forEach(function(p,v){h.push(r(v)+"="+r(p))}),h.join("&")},n.URLSearchParams=c},l=function(){try{var c=n.URLSearchParams;return new c("?a=1").toString()==="a=1"&&typeof c.prototype.set=="function"&&typeof c.prototype.entries=="function"}catch{return!1}};l()||o();var u=n.URLSearchParams.prototype;typeof u.sort!="function"&&(u.sort=function(){var c=this,f=[];this.forEach(function(p,v){f.push([v,p]),c._entries||c.delete(v)}),f.sort(function(p,v){return p[0]<v[0]?-1:p[0]>v[0]?1:0}),c._entries&&(c._entries={});for(var h=0;h<f.length;h++)this.append(f[h][0],f[h][1])}),typeof u._fromString!="function"&&Object.defineProperty(u,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(c){if(this._entries)this._entries={};else{var f=[];this.forEach(function(m,d){f.push(d)});for(var h=0;h<f.length;h++)this.delete(f[h])}c=c.replace(/^\?/,"");for(var p=c.split("&"),v,h=0;h<p.length;h++)v=p[h].split("="),this.append(s(v[0]),v.length>1?s(v[1]):"")}})}(typeof Xi<"u"?Xi:typeof window<"u"?window:typeof self<"u"?self:Xi),function(n){var e=function(){try{var r=new n.URL("b","http://a");return r.pathname="c d",r.href==="http://a/c%20d"&&r.searchParams}catch{return!1}},t=function(){var r=n.URL,s=function(u,c){typeof u!="string"&&(u=String(u)),c&&typeof c!="string"&&(c=String(c));var f=document,h;if(c&&(n.location===void 0||c!==n.location.href)){c=c.toLowerCase(),f=document.implementation.createHTMLDocument(""),h=f.createElement("base"),h.href=c,f.head.appendChild(h);try{if(h.href.indexOf(c)!==0)throw new Error(h.href)}catch(w){throw new Error("URL unable to set base "+c+" due to "+w)}}var p=f.createElement("a");p.href=u,h&&(f.body.appendChild(p),p.href=p.href);var v=f.createElement("input");if(v.type="url",v.value=u,p.protocol===":"||!/:/.test(p.href)||!v.checkValidity()&&!c)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:p});var m=new n.URLSearchParams(this.search),d=!0,b=!0,y=this;["append","delete","set"].forEach(function(w){var A=m[w];m[w]=function(){A.apply(m,arguments),d&&(b=!1,y.search=m.toString(),b=!0)}}),Object.defineProperty(this,"searchParams",{value:m,enumerable:!0});var g=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==g&&(g=this.search,b&&(d=!1,this.searchParams._fromString(this.search),d=!0))}})},o=s.prototype,l=function(u){Object.defineProperty(o,u,{get:function(){return this._anchorElement[u]},set:function(c){this._anchorElement[u]=c},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(u){l(u)}),Object.defineProperty(o,"search",{get:function(){return this._anchorElement.search},set:function(u){this._anchorElement.search=u,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(o,{toString:{get:function(){var u=this;return function(){return u.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(u){this._anchorElement.href=u,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(u){this._anchorElement.pathname=u},enumerable:!0},origin:{get:function(){var u={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],c=this._anchorElement.port!=u&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(c?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(u){},enumerable:!0},username:{get:function(){return""},set:function(u){},enumerable:!0}}),s.createObjectURL=function(u){return r.createObjectURL.apply(r,arguments)},s.revokeObjectURL=function(u){return r.revokeObjectURL.apply(r,arguments)},n.URL=s};if(e()||t(),n.location!==void 0&&!("origin"in n.location)){var i=function(){return n.location.protocol+"//"+n.location.hostname+(n.location.port?":"+n.location.port:"")};try{Object.defineProperty(n.location,"origin",{get:i,enumerable:!0})}catch{setInterval(function(){n.location.origin=i()},100)}}}(typeof Xi<"u"?Xi:typeof window<"u"?window:typeof self<"u"?self:Xi)),zg}/**
|
|
21
21
|
* @license
|
|
22
22
|
* Copyright 2010-2021 Three.js Authors
|
|
23
23
|
* SPDX-License-Identifier: MIT
|
|
@@ -2912,7 +2912,7 @@ void main() {
|
|
|
2912
2912
|
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
|
|
2913
2913
|
}`,rO=`void main() {
|
|
2914
2914
|
gl_Position = vec4( position, 1.0 );
|
|
2915
|
-
}`;function hy(n,e,t){let i=new oa;const r=new Ae,s=new Ae,o=new it,l=[],u=[],c={},f=t.maxTextureSize,h={0:xt,1:Ji,2:Ki},p=new Ri({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ae},radius:{value:4}},vertexShader:rO,fragmentShader:iO}),v=p.clone();v.defines.HORIZONTAL_PASS=1;const m=new ke;m.setAttribute("position",new Ze(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const d=new St(m,p),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=id,this.render=function(M,F,R){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||M.length===0)return;const T=n.getRenderTarget(),P=n.getActiveCubeFace(),_=n.getActiveMipmapLevel(),E=n.state;E.setBlending(bi),E.buffers.color.setClear(1,1,1,1),E.buffers.depth.setTest(!0),E.setScissorTest(!1);for(let C=0,L=M.length;C<L;C++){const I=M[C],x=I.shadow;if(x===void 0){console.warn("THREE.WebGLShadowMap:",I,"has no shadow.");continue}if(x.autoUpdate===!1&&x.needsUpdate===!1)continue;r.copy(x.mapSize);const O=x.getFrameExtents();if(r.multiply(O),s.copy(x.mapSize),(r.x>f||r.y>f)&&(r.x>f&&(s.x=Math.floor(f/O.x),r.x=s.x*O.x,x.mapSize.x=s.x),r.y>f&&(s.y=Math.floor(f/O.y),r.y=s.y*O.y,x.mapSize.y=s.y)),x.map===null&&!x.isPointLightShadow&&this.type===Ss){const D={minFilter:vt,magFilter:vt,format:hn};x.map=new Pn(r.x,r.y,D),x.map.texture.name=I.name+".shadowMap",x.mapPass=new Pn(r.x,r.y,D),x.camera.updateProjectionMatrix()}if(x.map===null){const D={minFilter:wt,magFilter:wt,format:hn};x.map=new Pn(r.x,r.y,D),x.map.texture.name=I.name+".shadowMap",x.camera.updateProjectionMatrix()}n.setRenderTarget(x.map),n.clear();const B=x.getViewportCount();for(let D=0;D<B;D++){const k=x.getViewport(D);o.set(s.x*k.x,s.y*k.y,s.x*k.z,s.y*k.w),E.viewport(o),x.updateMatrices(I,D),i=x.getFrustum(),S(F,R,x.camera,I,this.type)}!x.isPointLightShadow&&this.type===Ss&&y(x,R),x.needsUpdate=!1}b.needsUpdate=!1,n.setRenderTarget(T,P,_)};function y(M,F){const R=e.update(d);p.uniforms.shadow_pass.value=M.map.texture,p.uniforms.resolution.value=M.mapSize,p.uniforms.radius.value=M.radius,n.setRenderTarget(M.mapPass),n.clear(),n.renderBufferDirect(F,null,R,p,d,null),v.uniforms.shadow_pass.value=M.mapPass.texture,v.uniforms.resolution.value=M.mapSize,v.uniforms.radius.value=M.radius,n.setRenderTarget(M.map),n.clear(),n.renderBufferDirect(F,null,R,v,d,null)}function g(M){const F=M<<0;let R=l[F];return R===void 0&&(R=new rc({depthPacking:gv,morphTargets:M}),l[F]=R),R}function w(M){const F=M<<0;let R=u[F];return R===void 0&&(R=new sc({morphTargets:M}),u[F]=R),R}function A(M,F,R,T,P,_,E){let C=null,L=g,I=M.customDepthMaterial;if(T.isPointLight===!0&&(L=w,I=M.customDistanceMaterial),I===void 0){let x=!1;R.morphTargets===!0&&(x=F.morphAttributes&&F.morphAttributes.position&&F.morphAttributes.position.length>0),C=L(x)}else C=I;if(n.localClippingEnabled&&R.clipShadows===!0&&R.clippingPlanes.length!==0){const x=C.uuid,O=R.uuid;let B=c[x];B===void 0&&(B={},c[x]=B);let D=B[O];D===void 0&&(D=C.clone(),B[O]=D),C=D}return C.visible=R.visible,C.wireframe=R.wireframe,E===Ss?C.side=R.shadowSide!==null?R.shadowSide:R.side:C.side=R.shadowSide!==null?R.shadowSide:h[R.side],C.clipShadows=R.clipShadows,C.clippingPlanes=R.clippingPlanes,C.clipIntersection=R.clipIntersection,C.wireframeLinewidth=R.wireframeLinewidth,C.linewidth=R.linewidth,T.isPointLight===!0&&C.isMeshDistanceMaterial===!0&&(C.referencePosition.setFromMatrixPosition(T.matrixWorld),C.nearDistance=P,C.farDistance=_),C}function S(M,F,R,T,P){if(M.visible===!1)return;if(M.layers.test(F.layers)&&(M.isMesh||M.isLine||M.isPoints)&&(M.castShadow||M.receiveShadow&&P===Ss)&&(!M.frustumCulled||i.intersectsObject(M))){M.modelViewMatrix.multiplyMatrices(R.matrixWorldInverse,M.matrixWorld);const C=e.update(M),L=M.material;if(Array.isArray(L)){const I=C.groups;for(let x=0,O=I.length;x<O;x++){const B=I[x],D=L[B.materialIndex];if(D&&D.visible){const k=A(M,C,D,T,R.near,R.far,P);n.renderBufferDirect(R,null,C,k,M,B)}}}else if(L.visible){const I=A(M,C,L,T,R.near,R.far,P);n.renderBufferDirect(R,null,C,I,M,null)}}const E=M.children;for(let C=0,L=E.length;C<L;C++)S(E[C],F,R,T,P)}}function sO(n,e,t){const i=t.isWebGL2;function r(){let re=!1;const he=new it;let ve=null;const Ee=new it(0,0,0,0);return{setMask:function(_e){ve!==_e&&!re&&(n.colorMask(_e,_e,_e,_e),ve=_e)},setLocked:function(_e){re=_e},setClear:function(_e,Ne,Je,ze,st){st===!0&&(_e*=ze,Ne*=ze,Je*=ze),he.set(_e,Ne,Je,ze),Ee.equals(he)===!1&&(n.clearColor(_e,Ne,Je,ze),Ee.copy(he))},reset:function(){re=!1,ve=null,Ee.set(-1,0,0,0)}}}function s(){let re=!1,he=null,ve=null,Ee=null;return{setTest:function(_e){_e?j(2929):te(2929)},setMask:function(_e){he!==_e&&!re&&(n.depthMask(_e),he=_e)},setFunc:function(_e){if(ve!==_e){if(_e)switch(_e){case i0:n.depthFunc(512);break;case r0:n.depthFunc(519);break;case s0:n.depthFunc(513);break;case Tl:n.depthFunc(515);break;case o0:n.depthFunc(514);break;case a0:n.depthFunc(518);break;case l0:n.depthFunc(516);break;case c0:n.depthFunc(517);break;default:n.depthFunc(515)}else n.depthFunc(515);ve=_e}},setLocked:function(_e){re=_e},setClear:function(_e){Ee!==_e&&(n.clearDepth(_e),Ee=_e)},reset:function(){re=!1,he=null,ve=null,Ee=null}}}function o(){let re=!1,he=null,ve=null,Ee=null,_e=null,Ne=null,Je=null,ze=null,st=null;return{setTest:function(Ce){re||(Ce?j(2960):te(2960))},setMask:function(Ce){he!==Ce&&!re&&(n.stencilMask(Ce),he=Ce)},setFunc:function(Ce,je,He){(ve!==Ce||Ee!==je||_e!==He)&&(n.stencilFunc(Ce,je,He),ve=Ce,Ee=je,_e=He)},setOp:function(Ce,je,He){(Ne!==Ce||Je!==je||ze!==He)&&(n.stencilOp(Ce,je,He),Ne=Ce,Je=je,ze=He)},setLocked:function(Ce){re=Ce},setClear:function(Ce){st!==Ce&&(n.clearStencil(Ce),st=Ce)},reset:function(){re=!1,he=null,ve=null,Ee=null,_e=null,Ne=null,Je=null,ze=null,st=null}}}const l=new r,u=new s,c=new o;let f={},h=null,p={},v=null,m=!1,d=null,b=null,y=null,g=null,w=null,A=null,S=null,M=!1,F=null,R=null,T=null,P=null,_=null;const E=n.getParameter(35661);let C=!1,L=0;const I=n.getParameter(7938);I.indexOf("WebGL")!==-1?(L=parseFloat(/^WebGL (\d)/.exec(I)[1]),C=L>=1):I.indexOf("OpenGL ES")!==-1&&(L=parseFloat(/^OpenGL ES (\d)/.exec(I)[1]),C=L>=2);let x=null,O={};const B=n.getParameter(3088),D=n.getParameter(2978),k=new it().fromArray(B),V=new it().fromArray(D);function G(re,he,ve){const Ee=new Uint8Array(4),_e=n.createTexture();n.bindTexture(re,_e),n.texParameteri(re,10241,9728),n.texParameteri(re,10240,9728);for(let Ne=0;Ne<ve;Ne++)n.texImage2D(he+Ne,0,6408,1,1,0,6408,5121,Ee);return _e}const J={};J[3553]=G(3553,3553,1),J[34067]=G(34067,34069,6),l.setClear(0,0,0,1),u.setClear(1),c.setClear(0),j(2929),u.setFunc(Tl),W(!1),q(nd),j(2884),se(bi);function j(re){f[re]!==!0&&(n.enable(re),f[re]=!0)}function te(re){f[re]!==!1&&(n.disable(re),f[re]=!1)}function ee(re){re!==h&&(n.bindFramebuffer(36160,re),h=re)}function ae(re,he){return he===null&&h!==null&&(he=h),p[re]!==he?(n.bindFramebuffer(re,he),p[re]=he,i&&(re===36009&&(p[36160]=he),re===36160&&(p[36009]=he)),!0):!1}function H(re){return v!==re?(n.useProgram(re),v=re,!0):!1}const Z={[Lr]:32774,[$g]:32778,[Zg]:32779};if(i)Z[ld]=32775,Z[cd]=32776;else{const re=e.get("EXT_blend_minmax");re!==null&&(Z[ld]=re.MIN_EXT,Z[cd]=re.MAX_EXT)}const $={[Xg]:0,[Yg]:1,[Jg]:768,[ud]:770,[n0]:776,[e0]:774,[qg]:772,[Kg]:769,[dd]:771,[t0]:775,[Qg]:773};function se(re,he,ve,Ee,_e,Ne,Je,ze){if(re===bi){m===!0&&(te(3042),m=!1);return}if(m===!1&&(j(3042),m=!0),re!==jg){if(re!==d||ze!==M){if((b!==Lr||w!==Lr)&&(n.blendEquation(32774),b=Lr,w=Lr),ze)switch(re){case _s:n.blendFuncSeparate(1,771,1,771);break;case sd:n.blendFunc(1,1);break;case od:n.blendFuncSeparate(0,0,769,771);break;case ad:n.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",re);break}else switch(re){case _s:n.blendFuncSeparate(770,771,1,771);break;case sd:n.blendFunc(770,1);break;case od:n.blendFunc(0,769);break;case ad:n.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",re);break}y=null,g=null,A=null,S=null,d=re,M=ze}return}_e=_e||he,Ne=Ne||ve,Je=Je||Ee,(he!==b||_e!==w)&&(n.blendEquationSeparate(Z[he],Z[_e]),b=he,w=_e),(ve!==y||Ee!==g||Ne!==A||Je!==S)&&(n.blendFuncSeparate($[ve],$[Ee],$[Ne],$[Je]),y=ve,g=Ee,A=Ne,S=Je),d=re,M=null}function z(re,he){re.side===Ki?te(2884):j(2884);let ve=re.side===xt;he&&(ve=!ve),W(ve),re.blending===_s&&re.transparent===!1?se(bi):se(re.blending,re.blendEquation,re.blendSrc,re.blendDst,re.blendEquationAlpha,re.blendSrcAlpha,re.blendDstAlpha,re.premultipliedAlpha),u.setFunc(re.depthFunc),u.setTest(re.depthTest),u.setMask(re.depthWrite),l.setMask(re.colorWrite);const Ee=re.stencilWrite;c.setTest(Ee),Ee&&(c.setMask(re.stencilWriteMask),c.setFunc(re.stencilFunc,re.stencilRef,re.stencilFuncMask),c.setOp(re.stencilFail,re.stencilZFail,re.stencilZPass)),oe(re.polygonOffset,re.polygonOffsetFactor,re.polygonOffsetUnits),re.alphaToCoverage===!0?j(32926):te(32926)}function W(re){F!==re&&(re?n.frontFace(2304):n.frontFace(2305),F=re)}function q(re){re!==Gg?(j(2884),re!==R&&(re===nd?n.cullFace(1029):re===Hg?n.cullFace(1028):n.cullFace(1032))):te(2884),R=re}function le(re){re!==T&&(C&&n.lineWidth(re),T=re)}function oe(re,he,ve){re?(j(32823),(P!==he||_!==ve)&&(n.polygonOffset(he,ve),P=he,_=ve)):te(32823)}function U(re){re?j(3089):te(3089)}function N(re){re===void 0&&(re=33984+E-1),x!==re&&(n.activeTexture(re),x=re)}function X(re,he){x===null&&N();let ve=O[x];ve===void 0&&(ve={type:void 0,texture:void 0},O[x]=ve),(ve.type!==re||ve.texture!==he)&&(n.bindTexture(re,he||J[re]),ve.type=re,ve.texture=he)}function Y(){const re=O[x];re!==void 0&&re.type!==void 0&&(n.bindTexture(re.type,null),re.type=void 0,re.texture=void 0)}function ie(){try{n.compressedTexImage2D.apply(n,arguments)}catch(re){console.error("THREE.WebGLState:",re)}}function ue(){try{n.texImage2D.apply(n,arguments)}catch(re){console.error("THREE.WebGLState:",re)}}function me(){try{n.texImage3D.apply(n,arguments)}catch(re){console.error("THREE.WebGLState:",re)}}function be(re){k.equals(re)===!1&&(n.scissor(re.x,re.y,re.z,re.w),k.copy(re))}function ce(re){V.equals(re)===!1&&(n.viewport(re.x,re.y,re.z,re.w),V.copy(re))}function ge(){n.disable(3042),n.disable(2884),n.disable(2929),n.disable(32823),n.disable(3089),n.disable(2960),n.disable(32926),n.blendEquation(32774),n.blendFunc(1,0),n.blendFuncSeparate(1,0,1,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(513),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(519,0,4294967295),n.stencilOp(7680,7680,7680),n.clearStencil(0),n.cullFace(1029),n.frontFace(2305),n.polygonOffset(0,0),n.activeTexture(33984),n.bindFramebuffer(36160,null),i===!0&&(n.bindFramebuffer(36009,null),n.bindFramebuffer(36008,null)),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),f={},x=null,O={},h=null,p={},v=null,m=!1,d=null,b=null,y=null,g=null,w=null,A=null,S=null,M=!1,F=null,R=null,T=null,P=null,_=null,k.set(0,0,n.canvas.width,n.canvas.height),V.set(0,0,n.canvas.width,n.canvas.height),l.reset(),u.reset(),c.reset()}return{buffers:{color:l,depth:u,stencil:c},enable:j,disable:te,bindFramebuffer:ae,bindXRFramebuffer:ee,useProgram:H,setBlending:se,setMaterial:z,setFlipSided:W,setCullFace:q,setLineWidth:le,setPolygonOffset:oe,setScissorTest:U,activeTexture:N,bindTexture:X,unbindTexture:Y,compressedTexImage2D:ie,texImage2D:ue,texImage3D:me,scissor:be,viewport:ce,reset:ge}}function oO(n,e,t,i,r,s,o){const l=r.isWebGL2,u=r.maxTextures,c=r.maxCubemapSize,f=r.maxTextureSize,h=r.maxSamples,p=new WeakMap;let v,m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function d(U,N){return m?new OffscreenCanvas(U,N):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function b(U,N,X,Y){let ie=1;if((U.width>Y||U.height>Y)&&(ie=Y/Math.max(U.width,U.height)),ie<1||N===!0)if(typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&U instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&U instanceof ImageBitmap){const ue=N?xv:Math.floor,me=ue(ie*U.width),be=ue(ie*U.height);v===void 0&&(v=d(me,be));const ce=X?d(me,be):v;return ce.width=me,ce.height=be,ce.getContext("2d").drawImage(U,0,0,me,be),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+U.width+"x"+U.height+") to ("+me+"x"+be+")."),ce}else return"data"in U&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+U.width+"x"+U.height+")."),U;return U}function y(U){return Ld(U.width)&&Ld(U.height)}function g(U){return l?!1:U.wrapS!==zt||U.wrapT!==zt||U.minFilter!==wt&&U.minFilter!==vt}function w(U,N){return U.generateMipmaps&&N&&U.minFilter!==wt&&U.minFilter!==vt}function A(U,N,X,Y,ie=1){n.generateMipmap(U);const ue=i.get(N);ue.__maxMipLevel=Math.log2(Math.max(X,Y,ie))}function S(U,N,X){if(l===!1)return N;if(U!==null){if(n[U]!==void 0)return n[U];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+U+"'")}let Y=N;return N===6403&&(X===5126&&(Y=33326),X===5131&&(Y=33325),X===5121&&(Y=33321)),N===6407&&(X===5126&&(Y=34837),X===5131&&(Y=34843),X===5121&&(Y=32849)),N===6408&&(X===5126&&(Y=34836),X===5131&&(Y=34842),X===5121&&(Y=32856)),(Y===33325||Y===33326||Y===34842||Y===34836)&&e.get("EXT_color_buffer_float"),Y}function M(U){return U===wt||U===Xo||U===Yo?9728:9729}function F(U){const N=U.target;N.removeEventListener("dispose",F),T(N),N.isVideoTexture&&p.delete(N),o.memory.textures--}function R(U){const N=U.target;N.removeEventListener("dispose",R),P(N)}function T(U){const N=i.get(U);N.__webglInit!==void 0&&(n.deleteTexture(N.__webglTexture),i.remove(U))}function P(U){const N=U.texture,X=i.get(U),Y=i.get(N);if(U){if(Y.__webglTexture!==void 0&&(n.deleteTexture(Y.__webglTexture),o.memory.textures--),U.depthTexture&&U.depthTexture.dispose(),U.isWebGLCubeRenderTarget)for(let ie=0;ie<6;ie++)n.deleteFramebuffer(X.__webglFramebuffer[ie]),X.__webglDepthbuffer&&n.deleteRenderbuffer(X.__webglDepthbuffer[ie]);else n.deleteFramebuffer(X.__webglFramebuffer),X.__webglDepthbuffer&&n.deleteRenderbuffer(X.__webglDepthbuffer),X.__webglMultisampledFramebuffer&&n.deleteFramebuffer(X.__webglMultisampledFramebuffer),X.__webglColorRenderbuffer&&n.deleteRenderbuffer(X.__webglColorRenderbuffer),X.__webglDepthRenderbuffer&&n.deleteRenderbuffer(X.__webglDepthRenderbuffer);if(U.isWebGLMultipleRenderTargets)for(let ie=0,ue=N.length;ie<ue;ie++){const me=i.get(N[ie]);me.__webglTexture&&(n.deleteTexture(me.__webglTexture),o.memory.textures--),i.remove(N[ie])}i.remove(N),i.remove(U)}}let _=0;function E(){_=0}function C(){const U=_;return U>=u&&console.warn("THREE.WebGLTextures: Trying to use "+U+" texture units while this GPU supports only "+u),_+=1,U}function L(U,N){const X=i.get(U);if(U.isVideoTexture&&z(U),U.version>0&&X.__version!==U.version){const Y=U.image;if(Y===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(Y.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{G(X,U,N);return}}t.activeTexture(33984+N),t.bindTexture(3553,X.__webglTexture)}function I(U,N){const X=i.get(U);if(U.version>0&&X.__version!==U.version){G(X,U,N);return}t.activeTexture(33984+N),t.bindTexture(35866,X.__webglTexture)}function x(U,N){const X=i.get(U);if(U.version>0&&X.__version!==U.version){G(X,U,N);return}t.activeTexture(33984+N),t.bindTexture(32879,X.__webglTexture)}function O(U,N){const X=i.get(U);if(U.version>0&&X.__version!==U.version){J(X,U,N);return}t.activeTexture(33984+N),t.bindTexture(34067,X.__webglTexture)}const B={[Qi]:10497,[zt]:33071,[Es]:33648},D={[wt]:9728,[Xo]:9984,[Yo]:9986,[vt]:9729,[Rl]:9985,[xi]:9987};function k(U,N,X){if(X?(n.texParameteri(U,10242,B[N.wrapS]),n.texParameteri(U,10243,B[N.wrapT]),(U===32879||U===35866)&&n.texParameteri(U,32882,B[N.wrapR]),n.texParameteri(U,10240,D[N.magFilter]),n.texParameteri(U,10241,D[N.minFilter])):(n.texParameteri(U,10242,33071),n.texParameteri(U,10243,33071),(U===32879||U===35866)&&n.texParameteri(U,32882,33071),(N.wrapS!==zt||N.wrapT!==zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(U,10240,M(N.magFilter)),n.texParameteri(U,10241,M(N.minFilter)),N.minFilter!==wt&&N.minFilter!==vt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const Y=e.get("EXT_texture_filter_anisotropic");if(N.type===wi&&e.has("OES_texture_float_linear")===!1||l===!1&&N.type===Fr&&e.has("OES_texture_half_float_linear")===!1)return;(N.anisotropy>1||i.get(N).__currentAnisotropy)&&(n.texParameterf(U,Y.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(N.anisotropy,r.getMaxAnisotropy())),i.get(N).__currentAnisotropy=N.anisotropy)}}function V(U,N){U.__webglInit===void 0&&(U.__webglInit=!0,N.addEventListener("dispose",F),U.__webglTexture=n.createTexture(),o.memory.textures++)}function G(U,N,X){let Y=3553;N.isDataTexture2DArray&&(Y=35866),N.isDataTexture3D&&(Y=32879),V(U,N),t.activeTexture(33984+X),t.bindTexture(Y,U.__webglTexture),n.pixelStorei(37440,N.flipY),n.pixelStorei(37441,N.premultiplyAlpha),n.pixelStorei(3317,N.unpackAlignment),n.pixelStorei(37443,0);const ie=g(N)&&y(N.image)===!1,ue=b(N.image,ie,!1,f),me=y(ue)||l,be=s.convert(N.format);let ce=s.convert(N.type),ge=S(N.internalFormat,be,ce);k(Y,N,me);let re;const he=N.mipmaps;if(N.isDepthTexture)ge=6402,l?N.type===wi?ge=36012:N.type===Ko?ge=33190:N.type===Cs?ge=35056:ge=33189:N.type===wi&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),N.format===Pr&&ge===6402&&N.type!==Jo&&N.type!==Ko&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),N.type=Jo,ce=s.convert(N.type)),N.format===Ls&&ge===6402&&(ge=34041,N.type!==Cs&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),N.type=Cs,ce=s.convert(N.type))),t.texImage2D(3553,0,ge,ue.width,ue.height,0,be,ce,null);else if(N.isDataTexture)if(he.length>0&&me){for(let ve=0,Ee=he.length;ve<Ee;ve++)re=he[ve],t.texImage2D(3553,ve,ge,re.width,re.height,0,be,ce,re.data);N.generateMipmaps=!1,U.__maxMipLevel=he.length-1}else t.texImage2D(3553,0,ge,ue.width,ue.height,0,be,ce,ue.data),U.__maxMipLevel=0;else if(N.isCompressedTexture){for(let ve=0,Ee=he.length;ve<Ee;ve++)re=he[ve],N.format!==hn&&N.format!==Mi?be!==null?t.compressedTexImage2D(3553,ve,ge,re.width,re.height,0,re.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(3553,ve,ge,re.width,re.height,0,be,ce,re.data);U.__maxMipLevel=he.length-1}else if(N.isDataTexture2DArray)t.texImage3D(35866,0,ge,ue.width,ue.height,ue.depth,0,be,ce,ue.data),U.__maxMipLevel=0;else if(N.isDataTexture3D)t.texImage3D(32879,0,ge,ue.width,ue.height,ue.depth,0,be,ce,ue.data),U.__maxMipLevel=0;else if(he.length>0&&me){for(let ve=0,Ee=he.length;ve<Ee;ve++)re=he[ve],t.texImage2D(3553,ve,ge,be,ce,re);N.generateMipmaps=!1,U.__maxMipLevel=he.length-1}else t.texImage2D(3553,0,ge,be,ce,ue),U.__maxMipLevel=0;w(N,me)&&A(Y,N,ue.width,ue.height),U.__version=N.version,N.onUpdate&&N.onUpdate(N)}function J(U,N,X){if(N.image.length!==6)return;V(U,N),t.activeTexture(33984+X),t.bindTexture(34067,U.__webglTexture),n.pixelStorei(37440,N.flipY),n.pixelStorei(37441,N.premultiplyAlpha),n.pixelStorei(3317,N.unpackAlignment),n.pixelStorei(37443,0);const Y=N&&(N.isCompressedTexture||N.image[0].isCompressedTexture),ie=N.image[0]&&N.image[0].isDataTexture,ue=[];for(let ve=0;ve<6;ve++)!Y&&!ie?ue[ve]=b(N.image[ve],!1,!0,c):ue[ve]=ie?N.image[ve].image:N.image[ve];const me=ue[0],be=y(me)||l,ce=s.convert(N.format),ge=s.convert(N.type),re=S(N.internalFormat,ce,ge);k(34067,N,be);let he;if(Y){for(let ve=0;ve<6;ve++){he=ue[ve].mipmaps;for(let Ee=0;Ee<he.length;Ee++){const _e=he[Ee];N.format!==hn&&N.format!==Mi?ce!==null?t.compressedTexImage2D(34069+ve,Ee,re,_e.width,_e.height,0,_e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(34069+ve,Ee,re,_e.width,_e.height,0,ce,ge,_e.data)}}U.__maxMipLevel=he.length-1}else{he=N.mipmaps;for(let ve=0;ve<6;ve++)if(ie){t.texImage2D(34069+ve,0,re,ue[ve].width,ue[ve].height,0,ce,ge,ue[ve].data);for(let Ee=0;Ee<he.length;Ee++){const Ne=he[Ee].image[ve].image;t.texImage2D(34069+ve,Ee+1,re,Ne.width,Ne.height,0,ce,ge,Ne.data)}}else{t.texImage2D(34069+ve,0,re,ce,ge,ue[ve]);for(let Ee=0;Ee<he.length;Ee++){const _e=he[Ee];t.texImage2D(34069+ve,Ee+1,re,ce,ge,_e.image[ve])}}U.__maxMipLevel=he.length}w(N,be)&&A(34067,N,me.width,me.height),U.__version=N.version,N.onUpdate&&N.onUpdate(N)}function j(U,N,X,Y,ie){const ue=s.convert(X.format),me=s.convert(X.type),be=S(X.internalFormat,ue,me);ie===32879||ie===35866?t.texImage3D(ie,0,be,N.width,N.height,N.depth,0,ue,me,null):t.texImage2D(ie,0,be,N.width,N.height,0,ue,me,null),t.bindFramebuffer(36160,U),n.framebufferTexture2D(36160,Y,ie,i.get(X).__webglTexture,0),t.bindFramebuffer(36160,null)}function te(U,N,X){if(n.bindRenderbuffer(36161,U),N.depthBuffer&&!N.stencilBuffer){let Y=33189;if(X){const ie=N.depthTexture;ie&&ie.isDepthTexture&&(ie.type===wi?Y=36012:ie.type===Ko&&(Y=33190));const ue=se(N);n.renderbufferStorageMultisample(36161,ue,Y,N.width,N.height)}else n.renderbufferStorage(36161,Y,N.width,N.height);n.framebufferRenderbuffer(36160,36096,36161,U)}else if(N.depthBuffer&&N.stencilBuffer){if(X){const Y=se(N);n.renderbufferStorageMultisample(36161,Y,35056,N.width,N.height)}else n.renderbufferStorage(36161,34041,N.width,N.height);n.framebufferRenderbuffer(36160,33306,36161,U)}else{const Y=N.isWebGLMultipleRenderTargets===!0?N.texture[0]:N.texture,ie=s.convert(Y.format),ue=s.convert(Y.type),me=S(Y.internalFormat,ie,ue);if(X){const be=se(N);n.renderbufferStorageMultisample(36161,be,me,N.width,N.height)}else n.renderbufferStorage(36161,me,N.width,N.height)}n.bindRenderbuffer(36161,null)}function ee(U,N){if(N&&N.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,U),!(N.depthTexture&&N.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(N.depthTexture).__webglTexture||N.depthTexture.image.width!==N.width||N.depthTexture.image.height!==N.height)&&(N.depthTexture.image.width=N.width,N.depthTexture.image.height=N.height,N.depthTexture.needsUpdate=!0),L(N.depthTexture,0);const Y=i.get(N.depthTexture).__webglTexture;if(N.depthTexture.format===Pr)n.framebufferTexture2D(36160,36096,3553,Y,0);else if(N.depthTexture.format===Ls)n.framebufferTexture2D(36160,33306,3553,Y,0);else throw new Error("Unknown depthTexture format")}function ae(U){const N=i.get(U),X=U.isWebGLCubeRenderTarget===!0;if(U.depthTexture){if(X)throw new Error("target.depthTexture not supported in Cube render targets");ee(N.__webglFramebuffer,U)}else if(X){N.__webglDepthbuffer=[];for(let Y=0;Y<6;Y++)t.bindFramebuffer(36160,N.__webglFramebuffer[Y]),N.__webglDepthbuffer[Y]=n.createRenderbuffer(),te(N.__webglDepthbuffer[Y],U,!1)}else t.bindFramebuffer(36160,N.__webglFramebuffer),N.__webglDepthbuffer=n.createRenderbuffer(),te(N.__webglDepthbuffer,U,!1);t.bindFramebuffer(36160,null)}function H(U){const N=U.texture,X=i.get(U),Y=i.get(N);U.addEventListener("dispose",R),U.isWebGLMultipleRenderTargets!==!0&&(Y.__webglTexture=n.createTexture(),Y.__version=N.version,o.memory.textures++);const ie=U.isWebGLCubeRenderTarget===!0,ue=U.isWebGLMultipleRenderTargets===!0,me=U.isWebGLMultisampleRenderTarget===!0,be=N.isDataTexture3D||N.isDataTexture2DArray,ce=y(U)||l;if(l&&N.format===Mi&&(N.type===wi||N.type===Fr)&&(N.format=hn,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),ie){X.__webglFramebuffer=[];for(let ge=0;ge<6;ge++)X.__webglFramebuffer[ge]=n.createFramebuffer()}else if(X.__webglFramebuffer=n.createFramebuffer(),ue)if(r.drawBuffers){const ge=U.texture;for(let re=0,he=ge.length;re<he;re++){const ve=i.get(ge[re]);ve.__webglTexture===void 0&&(ve.__webglTexture=n.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(me)if(l){X.__webglMultisampledFramebuffer=n.createFramebuffer(),X.__webglColorRenderbuffer=n.createRenderbuffer(),n.bindRenderbuffer(36161,X.__webglColorRenderbuffer);const ge=s.convert(N.format),re=s.convert(N.type),he=S(N.internalFormat,ge,re),ve=se(U);n.renderbufferStorageMultisample(36161,ve,he,U.width,U.height),t.bindFramebuffer(36160,X.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064,36161,X.__webglColorRenderbuffer),n.bindRenderbuffer(36161,null),U.depthBuffer&&(X.__webglDepthRenderbuffer=n.createRenderbuffer(),te(X.__webglDepthRenderbuffer,U,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(ie){t.bindTexture(34067,Y.__webglTexture),k(34067,N,ce);for(let ge=0;ge<6;ge++)j(X.__webglFramebuffer[ge],U,N,36064,34069+ge);w(N,ce)&&A(34067,N,U.width,U.height),t.bindTexture(34067,null)}else if(ue){const ge=U.texture;for(let re=0,he=ge.length;re<he;re++){const ve=ge[re],Ee=i.get(ve);t.bindTexture(3553,Ee.__webglTexture),k(3553,ve,ce),j(X.__webglFramebuffer,U,ve,36064+re,3553),w(ve,ce)&&A(3553,ve,U.width,U.height)}t.bindTexture(3553,null)}else{let ge=3553;be&&(l?ge=N.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),t.bindTexture(ge,Y.__webglTexture),k(ge,N,ce),j(X.__webglFramebuffer,U,N,36064,ge),w(N,ce)&&A(ge,N,U.width,U.height,U.depth),t.bindTexture(ge,null)}U.depthBuffer&&ae(U)}function Z(U){const N=y(U)||l,X=U.isWebGLMultipleRenderTargets===!0?U.texture:[U.texture];for(let Y=0,ie=X.length;Y<ie;Y++){const ue=X[Y];if(w(ue,N)){const me=U.isWebGLCubeRenderTarget?34067:3553,be=i.get(ue).__webglTexture;t.bindTexture(me,be),A(me,ue,U.width,U.height),t.bindTexture(me,null)}}}function $(U){if(U.isWebGLMultisampleRenderTarget)if(l){const N=U.width,X=U.height;let Y=16384;U.depthBuffer&&(Y|=256),U.stencilBuffer&&(Y|=1024);const ie=i.get(U);t.bindFramebuffer(36008,ie.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,ie.__webglFramebuffer),n.blitFramebuffer(0,0,N,X,0,0,N,X,Y,9728),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,ie.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function se(U){return l&&U.isWebGLMultisampleRenderTarget?Math.min(h,U.samples):0}function z(U){const N=o.render.frame;p.get(U)!==N&&(p.set(U,N),U.update())}let W=!1,q=!1;function le(U,N){U&&U.isWebGLRenderTarget&&(W===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),W=!0),U=U.texture),L(U,N)}function oe(U,N){U&&U.isWebGLCubeRenderTarget&&(q===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),q=!0),U=U.texture),O(U,N)}this.allocateTextureUnit=C,this.resetTextureUnits=E,this.setTexture2D=L,this.setTexture2DArray=I,this.setTexture3D=x,this.setTextureCube=O,this.setupRenderTarget=H,this.updateRenderTargetMipmap=Z,this.updateMultisampleRenderTarget=$,this.safeSetTexture2D=le,this.safeSetTextureCube=oe}function fy(n,e,t){const i=t.isWebGL2;function r(s){let o;if(s===Rr)return 5121;if(s===x0)return 32819;if(s===w0)return 32820;if(s===M0)return 33635;if(s===v0)return 5120;if(s===y0)return 5122;if(s===Jo)return 5123;if(s===b0)return 5124;if(s===Ko)return 5125;if(s===wi)return 5126;if(s===Fr)return i?5131:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(s===A0)return 6406;if(s===Mi)return 6407;if(s===hn)return 6408;if(s===S0)return 6409;if(s===_0)return 6410;if(s===Pr)return 6402;if(s===Ls)return 34041;if(s===E0)return 6403;if(s===C0)return 36244;if(s===L0)return 33319;if(s===R0)return 33320;if(s===F0)return 36248;if(s===P0)return 36249;if(s===hd||s===fd||s===pd||s===md)if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(s===hd)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===fd)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===pd)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===md)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===gd||s===vd||s===yd||s===bd)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(s===gd)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===vd)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===yd)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===bd)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===I0)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((s===xd||s===wd)&&(o=e.get("WEBGL_compressed_texture_etc"),o!==null)){if(s===xd)return o.COMPRESSED_RGB8_ETC2;if(s===wd)return o.COMPRESSED_RGBA8_ETC2_EAC}if(s===O0||s===N0||s===B0||s===D0||s===V0||s===k0||s===z0||s===U0||s===G0||s===H0||s===W0||s===j0||s===$0||s===Z0||s===Y0||s===J0||s===K0||s===q0||s===Q0||s===ev||s===tv||s===nv||s===iv||s===rv||s===sv||s===ov||s===av||s===lv)return o=e.get("WEBGL_compressed_texture_astc"),o!==null?s:null;if(s===X0)return o=e.get("EXT_texture_compression_bptc"),o!==null?s:null;if(s===Cs)return i?34042:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:r}}class oh extends Dt{constructor(e=[]){super(),this.cameras=e}}oh.prototype.isArrayCamera=!0;class Qn extends Xe{constructor(){super(),this.type="Group"}}Qn.prototype.isGroup=!0;const aO={type:"move"};class ah{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Qn,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 Qn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Q,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Q),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Qn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Q,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Q),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}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 r=null,s=null,o=null;const l=this._targetRay,u=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(l!==null&&(r=t.getPose(e.targetRaySpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),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,this.dispatchEvent(aO))),c&&e.hand){o=!0;for(const d of e.hand.values()){const b=t.getJointPose(d,i);if(c.joints[d.jointName]===void 0){const g=new Qn;g.matrixAutoUpdate=!1,g.visible=!1,c.joints[d.jointName]=g,c.add(g)}const y=c.joints[d.jointName];b!==null&&(y.matrix.fromArray(b.transform.matrix),y.matrix.decompose(y.position,y.rotation,y.scale),y.jointRadius=b.radius),y.visible=b!==null}const f=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],p=f.position.distanceTo(h.position),v=.02,m=.005;c.inputState.pinching&&p>v+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&p<=v-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));return l!==null&&(l.visible=r!==null),u!==null&&(u.visible=s!==null),c!==null&&(c.visible=o!==null),this}}class lO extends tr{constructor(e,t){super();const i=this,r=e.state;let s=null,o=1,l=null,u="local-floor",c=null,f=null,h=null,p=null;const v=[],m=new Map,d=new Dt;d.layers.enable(1),d.viewport=new it;const b=new Dt;b.layers.enable(2),b.viewport=new it;const y=[d,b],g=new oh;g.layers.enable(1),g.layers.enable(2);let w=null,A=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(I){let x=v[I];return x===void 0&&(x=new ah,v[I]=x),x.getTargetRaySpace()},this.getControllerGrip=function(I){let x=v[I];return x===void 0&&(x=new ah,v[I]=x),x.getGripSpace()},this.getHand=function(I){let x=v[I];return x===void 0&&(x=new ah,v[I]=x),x.getHandSpace()};function S(I){const x=m.get(I.inputSource);x&&x.dispatchEvent({type:I.type,data:I.inputSource})}function M(){m.forEach(function(I,x){I.disconnect(x)}),m.clear(),w=null,A=null,r.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),L.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(I){o=I,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(I){u=I,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l},this.getSession=function(){return s},this.setSession=async function(I){if(s=I,s!==null){s.addEventListener("select",S),s.addEventListener("selectstart",S),s.addEventListener("selectend",S),s.addEventListener("squeeze",S),s.addEventListener("squeezestart",S),s.addEventListener("squeezeend",S),s.addEventListener("end",M),s.addEventListener("inputsourceschange",F);const x=t.getContextAttributes();if(x.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){const O={antialias:x.antialias,alpha:x.alpha,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:o},B=new XRWebGLLayer(s,t,O);s.updateRenderState({baseLayer:B})}else{let O=0;x.depth&&(O=x.stencil?34041:6402);const B={colorFormat:x.alpha?6408:6407,depthFormat:O,scaleFactor:o};f=new XRWebGLBinding(s,t),p=f.createProjectionLayer(B),h=t.createFramebuffer(),s.updateRenderState({layers:[p]})}l=await s.requestReferenceSpace(u),L.setContext(s),L.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function F(I){const x=s.inputSources;for(let O=0;O<v.length;O++)m.set(x[O],v[O]);for(let O=0;O<I.removed.length;O++){const B=I.removed[O],D=m.get(B);D&&(D.dispatchEvent({type:"disconnected",data:B}),m.delete(B))}for(let O=0;O<I.added.length;O++){const B=I.added[O],D=m.get(B);D&&D.dispatchEvent({type:"connected",data:B})}}const R=new Q,T=new Q;function P(I,x,O){R.setFromMatrixPosition(x.matrixWorld),T.setFromMatrixPosition(O.matrixWorld);const B=R.distanceTo(T),D=x.projectionMatrix.elements,k=O.projectionMatrix.elements,V=D[14]/(D[10]-1),G=D[14]/(D[10]+1),J=(D[9]+1)/D[5],j=(D[9]-1)/D[5],te=(D[8]-1)/D[0],ee=(k[8]+1)/k[0],ae=V*te,H=V*ee,Z=B/(-te+ee),$=Z*-te;x.matrixWorld.decompose(I.position,I.quaternion,I.scale),I.translateX($),I.translateZ(Z),I.matrixWorld.compose(I.position,I.quaternion,I.scale),I.matrixWorldInverse.copy(I.matrixWorld).invert();const se=V+Z,z=G+Z,W=ae-$,q=H+(B-$),le=J*G/z*se,oe=j*G/z*se;I.projectionMatrix.makePerspective(W,q,le,oe,se,z)}function _(I,x){x===null?I.matrixWorld.copy(I.matrix):I.matrixWorld.multiplyMatrices(x.matrixWorld,I.matrix),I.matrixWorldInverse.copy(I.matrixWorld).invert()}this.updateCamera=function(I){if(s===null)return;g.near=b.near=d.near=I.near,g.far=b.far=d.far=I.far,(w!==g.near||A!==g.far)&&(s.updateRenderState({depthNear:g.near,depthFar:g.far}),w=g.near,A=g.far);const x=I.parent,O=g.cameras;_(g,x);for(let D=0;D<O.length;D++)_(O[D],x);g.matrixWorld.decompose(g.position,g.quaternion,g.scale),I.position.copy(g.position),I.quaternion.copy(g.quaternion),I.scale.copy(g.scale),I.matrix.copy(g.matrix),I.matrixWorld.copy(g.matrixWorld);const B=I.children;for(let D=0,k=B.length;D<k;D++)B[D].updateMatrixWorld(!0);O.length===2?P(g,d,b):g.projectionMatrix.copy(d.projectionMatrix)},this.getCamera=function(){return g};let E=null;function C(I,x){if(c=x.getViewerPose(l),c!==null){const B=c.views,D=s.renderState.baseLayer;s.renderState.layers===void 0&&r.bindXRFramebuffer(D.framebuffer);let k=!1;B.length!==g.cameras.length&&(g.cameras.length=0,k=!0);for(let V=0;V<B.length;V++){const G=B[V];let J=null;if(s.renderState.layers===void 0)J=D.getViewport(G);else{const te=f.getViewSubImage(p,G);r.bindXRFramebuffer(h),t.framebufferTexture2D(36160,36064,3553,te.colorTexture,0),te.depthStencilTexture!==void 0&&t.framebufferTexture2D(36160,36096,3553,te.depthStencilTexture,0),J=te.viewport}const j=y[V];j.matrix.fromArray(G.transform.matrix),j.projectionMatrix.fromArray(G.projectionMatrix),j.viewport.set(J.x,J.y,J.width,J.height),V===0&&g.matrix.copy(j.matrix),k===!0&&g.cameras.push(j)}}const O=s.inputSources;for(let B=0;B<v.length;B++){const D=v[B],k=O[B];D.update(k,x,l)}E&&E(I,x)}const L=new Hv;L.setAnimationLoop(C),this.setAnimationLoop=function(I){E=I},this.dispose=function(){}}}function cO(n){function e(y,g){y.fogColor.value.copy(g.color),g.isFog?(y.fogNear.value=g.near,y.fogFar.value=g.far):g.isFogExp2&&(y.fogDensity.value=g.density)}function t(y,g,w,A,S){g.isMeshBasicMaterial?i(y,g):g.isMeshLambertMaterial?(i(y,g),u(y,g)):g.isMeshToonMaterial?(i(y,g),f(y,g)):g.isMeshPhongMaterial?(i(y,g),c(y,g)):g.isMeshStandardMaterial?(i(y,g),g.isMeshPhysicalMaterial?p(y,g,S):h(y,g)):g.isMeshMatcapMaterial?(i(y,g),v(y,g)):g.isMeshDepthMaterial?(i(y,g),m(y,g)):g.isMeshDistanceMaterial?(i(y,g),d(y,g)):g.isMeshNormalMaterial?(i(y,g),b(y,g)):g.isLineBasicMaterial?(r(y,g),g.isLineDashedMaterial&&s(y,g)):g.isPointsMaterial?o(y,g,w,A):g.isSpriteMaterial?l(y,g):g.isShadowMaterial?(y.color.value.copy(g.color),y.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function i(y,g){y.opacity.value=g.opacity,g.color&&y.diffuse.value.copy(g.color),g.emissive&&y.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(y.map.value=g.map),g.alphaMap&&(y.alphaMap.value=g.alphaMap),g.specularMap&&(y.specularMap.value=g.specularMap);const w=n.get(g).envMap;if(w){y.envMap.value=w,y.flipEnvMap.value=w.isCubeTexture&&w._needsFlipEnvMap?-1:1,y.reflectivity.value=g.reflectivity,y.refractionRatio.value=g.refractionRatio;const M=n.get(w).__maxMipLevel;M!==void 0&&(y.maxMipLevel.value=M)}g.lightMap&&(y.lightMap.value=g.lightMap,y.lightMapIntensity.value=g.lightMapIntensity),g.aoMap&&(y.aoMap.value=g.aoMap,y.aoMapIntensity.value=g.aoMapIntensity);let A;g.map?A=g.map:g.specularMap?A=g.specularMap:g.displacementMap?A=g.displacementMap:g.normalMap?A=g.normalMap:g.bumpMap?A=g.bumpMap:g.roughnessMap?A=g.roughnessMap:g.metalnessMap?A=g.metalnessMap:g.alphaMap?A=g.alphaMap:g.emissiveMap?A=g.emissiveMap:g.clearcoatMap?A=g.clearcoatMap:g.clearcoatNormalMap?A=g.clearcoatNormalMap:g.clearcoatRoughnessMap&&(A=g.clearcoatRoughnessMap),A!==void 0&&(A.isWebGLRenderTarget&&(A=A.texture),A.matrixAutoUpdate===!0&&A.updateMatrix(),y.uvTransform.value.copy(A.matrix));let S;g.aoMap?S=g.aoMap:g.lightMap&&(S=g.lightMap),S!==void 0&&(S.isWebGLRenderTarget&&(S=S.texture),S.matrixAutoUpdate===!0&&S.updateMatrix(),y.uv2Transform.value.copy(S.matrix))}function r(y,g){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity}function s(y,g){y.dashSize.value=g.dashSize,y.totalSize.value=g.dashSize+g.gapSize,y.scale.value=g.scale}function o(y,g,w,A){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,y.size.value=g.size*w,y.scale.value=A*.5,g.map&&(y.map.value=g.map),g.alphaMap&&(y.alphaMap.value=g.alphaMap);let S;g.map?S=g.map:g.alphaMap&&(S=g.alphaMap),S!==void 0&&(S.matrixAutoUpdate===!0&&S.updateMatrix(),y.uvTransform.value.copy(S.matrix))}function l(y,g){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,y.rotation.value=g.rotation,g.map&&(y.map.value=g.map),g.alphaMap&&(y.alphaMap.value=g.alphaMap);let w;g.map?w=g.map:g.alphaMap&&(w=g.alphaMap),w!==void 0&&(w.matrixAutoUpdate===!0&&w.updateMatrix(),y.uvTransform.value.copy(w.matrix))}function u(y,g){g.emissiveMap&&(y.emissiveMap.value=g.emissiveMap)}function c(y,g){y.specular.value.copy(g.specular),y.shininess.value=Math.max(g.shininess,1e-4),g.emissiveMap&&(y.emissiveMap.value=g.emissiveMap),g.bumpMap&&(y.bumpMap.value=g.bumpMap,y.bumpScale.value=g.bumpScale,g.side===xt&&(y.bumpScale.value*=-1)),g.normalMap&&(y.normalMap.value=g.normalMap,y.normalScale.value.copy(g.normalScale),g.side===xt&&y.normalScale.value.negate()),g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias)}function f(y,g){g.gradientMap&&(y.gradientMap.value=g.gradientMap),g.emissiveMap&&(y.emissiveMap.value=g.emissiveMap),g.bumpMap&&(y.bumpMap.value=g.bumpMap,y.bumpScale.value=g.bumpScale,g.side===xt&&(y.bumpScale.value*=-1)),g.normalMap&&(y.normalMap.value=g.normalMap,y.normalScale.value.copy(g.normalScale),g.side===xt&&y.normalScale.value.negate()),g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias)}function h(y,g){y.roughness.value=g.roughness,y.metalness.value=g.metalness,g.roughnessMap&&(y.roughnessMap.value=g.roughnessMap),g.metalnessMap&&(y.metalnessMap.value=g.metalnessMap),g.emissiveMap&&(y.emissiveMap.value=g.emissiveMap),g.bumpMap&&(y.bumpMap.value=g.bumpMap,y.bumpScale.value=g.bumpScale,g.side===xt&&(y.bumpScale.value*=-1)),g.normalMap&&(y.normalMap.value=g.normalMap,y.normalScale.value.copy(g.normalScale),g.side===xt&&y.normalScale.value.negate()),g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias),n.get(g).envMap&&(y.envMapIntensity.value=g.envMapIntensity)}function p(y,g,w){h(y,g),y.reflectivity.value=g.reflectivity,y.clearcoat.value=g.clearcoat,y.clearcoatRoughness.value=g.clearcoatRoughness,g.sheen&&y.sheen.value.copy(g.sheen),g.clearcoatMap&&(y.clearcoatMap.value=g.clearcoatMap),g.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap),g.clearcoatNormalMap&&(y.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),y.clearcoatNormalMap.value=g.clearcoatNormalMap,g.side===xt&&y.clearcoatNormalScale.value.negate()),y.transmission.value=g.transmission,g.transmissionMap&&(y.transmissionMap.value=g.transmissionMap),g.transmission>0&&(y.transmissionSamplerMap.value=w.texture,y.transmissionSamplerSize.value.set(w.width,w.height)),y.thickness.value=g.thickness,g.thicknessMap&&(y.thicknessMap.value=g.thicknessMap),y.attenuationDistance.value=g.attenuationDistance,y.attenuationColor.value.copy(g.attenuationColor)}function v(y,g){g.matcap&&(y.matcap.value=g.matcap),g.bumpMap&&(y.bumpMap.value=g.bumpMap,y.bumpScale.value=g.bumpScale,g.side===xt&&(y.bumpScale.value*=-1)),g.normalMap&&(y.normalMap.value=g.normalMap,y.normalScale.value.copy(g.normalScale),g.side===xt&&y.normalScale.value.negate()),g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias)}function m(y,g){g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias)}function d(y,g){g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias),y.referencePosition.value.copy(g.referencePosition),y.nearDistance.value=g.nearDistance,y.farDistance.value=g.farDistance}function b(y,g){g.bumpMap&&(y.bumpMap.value=g.bumpMap,y.bumpScale.value=g.bumpScale,g.side===xt&&(y.bumpScale.value*=-1)),g.normalMap&&(y.normalMap.value=g.normalMap,y.normalScale.value.copy(g.normalScale),g.side===xt&&y.normalScale.value.negate()),g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function uO(){const n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.style.display="block",n}function rt(n={}){const e=n.canvas!==void 0?n.canvas:uO(),t=n.context!==void 0?n.context:null,i=n.alpha!==void 0?n.alpha:!1,r=n.depth!==void 0?n.depth:!0,s=n.stencil!==void 0?n.stencil:!0,o=n.antialias!==void 0?n.antialias:!1,l=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,u=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,c=n.powerPreference!==void 0?n.powerPreference:"default",f=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1;let h=null,p=null;const v=[],m=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=tn,this.physicallyCorrectLights=!1,this.toneMapping=qi,this.toneMappingExposure=1;const d=this;let b=!1,y=0,g=0,w=null,A=-1,S=null;const M=new it,F=new it;let R=null,T=e.width,P=e.height,_=1,E=null,C=null;const L=new it(0,0,T,P),I=new it(0,0,T,P);let x=!1;const O=[],B=new oa;let D=!1,k=!1,V=null;const G=new Oe,J=new Q,j={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function te(){return w===null?_:1}let ee=t;function ae(K,pe){for(let de=0;de<K.length;de++){const ye=K[de],Me=e.getContext(ye,pe);if(Me!==null)return Me}return null}try{const K={alpha:i,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:f};if(e.addEventListener("webglcontextlost",Ne,!1),e.addEventListener("webglcontextrestored",Je,!1),ee===null){const pe=["webgl2","webgl","experimental-webgl"];if(d.isWebGL1Renderer===!0&&pe.shift(),ee=ae(pe,K),ee===null)throw ae(pe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}ee.getShaderPrecisionFormat===void 0&&(ee.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(K){throw console.error("THREE.WebGLRenderer: "+K.message),K}let H,Z,$,se,z,W,q,le,oe,U,N,X,Y,ie,ue,me,be,ce,ge,re,he,ve;function Ee(){H=new OP(ee),Z=new FP(ee,H,n),H.init(Z),he=new fy(ee,H,Z),$=new sO(ee,H,Z),O[0]=1029,se=new DP,z=new XI,W=new oO(ee,H,$,z,Z,he,se),q=new IP(d),le=new o3(ee,Z),ve=new LP(ee,H,le,Z),oe=new NP(ee,le,se,ve),U=new UP(ee,oe,le,se),ce=new zP(ee),ue=new PP(z),N=new ZI(d,q,H,Z,ve,ue),X=new cO(z),Y=new JI(z),ie=new nO(H,Z),be=new CP(d,q,$,U,l),me=new hy(d,U,Z),ge=new RP(ee,H,se,Z),re=new BP(ee,H,se,Z),se.programs=N.programs,d.capabilities=Z,d.extensions=H,d.properties=z,d.renderLists=Y,d.shadowMap=me,d.state=$,d.info=se}Ee();const _e=new lO(d,ee);this.xr=_e,this.getContext=function(){return ee},this.getContextAttributes=function(){return ee.getContextAttributes()},this.forceContextLoss=function(){const K=H.get("WEBGL_lose_context");K&&K.loseContext()},this.forceContextRestore=function(){const K=H.get("WEBGL_lose_context");K&&K.restoreContext()},this.getPixelRatio=function(){return _},this.setPixelRatio=function(K){K!==void 0&&(_=K,this.setSize(T,P,!1))},this.getSize=function(K){return K.set(T,P)},this.setSize=function(K,pe,de){if(_e.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}T=K,P=pe,e.width=Math.floor(K*_),e.height=Math.floor(pe*_),de!==!1&&(e.style.width=K+"px",e.style.height=pe+"px"),this.setViewport(0,0,K,pe)},this.getDrawingBufferSize=function(K){return K.set(T*_,P*_).floor()},this.setDrawingBufferSize=function(K,pe,de){T=K,P=pe,_=de,e.width=Math.floor(K*de),e.height=Math.floor(pe*de),this.setViewport(0,0,K,pe)},this.getCurrentViewport=function(K){return K.copy(M)},this.getViewport=function(K){return K.copy(L)},this.setViewport=function(K,pe,de,ye){K.isVector4?L.set(K.x,K.y,K.z,K.w):L.set(K,pe,de,ye),$.viewport(M.copy(L).multiplyScalar(_).floor())},this.getScissor=function(K){return K.copy(I)},this.setScissor=function(K,pe,de,ye){K.isVector4?I.set(K.x,K.y,K.z,K.w):I.set(K,pe,de,ye),$.scissor(F.copy(I).multiplyScalar(_).floor())},this.getScissorTest=function(){return x},this.setScissorTest=function(K){$.setScissorTest(x=K)},this.setOpaqueSort=function(K){E=K},this.setTransparentSort=function(K){C=K},this.getClearColor=function(K){return K.copy(be.getClearColor())},this.setClearColor=function(){be.setClearColor.apply(be,arguments)},this.getClearAlpha=function(){return be.getClearAlpha()},this.setClearAlpha=function(){be.setClearAlpha.apply(be,arguments)},this.clear=function(K,pe,de){let ye=0;(K===void 0||K)&&(ye|=16384),(pe===void 0||pe)&&(ye|=256),(de===void 0||de)&&(ye|=1024),ee.clear(ye)},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(){e.removeEventListener("webglcontextlost",Ne,!1),e.removeEventListener("webglcontextrestored",Je,!1),Y.dispose(),ie.dispose(),z.dispose(),q.dispose(),U.dispose(),ve.dispose(),_e.dispose(),_e.removeEventListener("sessionstart",It),_e.removeEventListener("sessionend",mt),V&&(V.dispose(),V=null),bt.stop()};function Ne(K){K.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function Je(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const K=se.autoReset,pe=me.enabled,de=me.autoUpdate,ye=me.needsUpdate,Me=me.type;Ee(),se.autoReset=K,me.enabled=pe,me.autoUpdate=de,me.needsUpdate=ye,me.type=Me}function ze(K){const pe=K.target;pe.removeEventListener("dispose",ze),st(pe)}function st(K){Ce(K),z.remove(K)}function Ce(K){const pe=z.get(K).programs;pe!==void 0&&pe.forEach(function(de){N.releaseProgram(de)})}function je(K,pe){K.render(function(de){d.renderBufferImmediate(de,pe)})}this.renderBufferImmediate=function(K,pe){ve.initAttributes();const de=z.get(K);K.hasPositions&&!de.position&&(de.position=ee.createBuffer()),K.hasNormals&&!de.normal&&(de.normal=ee.createBuffer()),K.hasUvs&&!de.uv&&(de.uv=ee.createBuffer()),K.hasColors&&!de.color&&(de.color=ee.createBuffer());const ye=pe.getAttributes();K.hasPositions&&(ee.bindBuffer(34962,de.position),ee.bufferData(34962,K.positionArray,35048),ve.enableAttribute(ye.position),ee.vertexAttribPointer(ye.position,3,5126,!1,0,0)),K.hasNormals&&(ee.bindBuffer(34962,de.normal),ee.bufferData(34962,K.normalArray,35048),ve.enableAttribute(ye.normal),ee.vertexAttribPointer(ye.normal,3,5126,!1,0,0)),K.hasUvs&&(ee.bindBuffer(34962,de.uv),ee.bufferData(34962,K.uvArray,35048),ve.enableAttribute(ye.uv),ee.vertexAttribPointer(ye.uv,2,5126,!1,0,0)),K.hasColors&&(ee.bindBuffer(34962,de.color),ee.bufferData(34962,K.colorArray,35048),ve.enableAttribute(ye.color),ee.vertexAttribPointer(ye.color,3,5126,!1,0,0)),ve.disableUnusedAttributes(),ee.drawArrays(4,0,K.count),K.count=0},this.renderBufferDirect=function(K,pe,de,ye,Me,fe){pe===null&&(pe=j);const xe=Me.isMesh&&Me.matrixWorld.determinant()<0,Se=Te(K,pe,ye,Me);$.setMaterial(ye,xe);let Fe=de.index;const Ie=de.attributes.position;if(Fe===null){if(Ie===void 0||Ie.count===0)return}else if(Fe.count===0)return;let Ue=1;ye.wireframe===!0&&(Fe=oe.getWireframeAttribute(de),Ue=2),(ye.morphTargets||ye.morphNormals)&&ce.update(Me,de,ye,Se),ve.setup(Me,ye,Se,de,Fe);let De,Qe=ge;Fe!==null&&(De=le.get(Fe),Qe=re,Qe.setIndex(De));const Lt=Fe!==null?Fe.count:Ie.count,Gt=de.drawRange.start*Ue,os=de.drawRange.count*Ue,dt=fe!==null?fe.start*Ue:0,as=fe!==null?fe.count*Ue:1/0,Qt=Math.max(Gt,dt),_4=Math.min(Lt,Gt+os,dt+as)-1,Xc=Math.max(0,_4-Qt+1);if(Xc!==0){if(Me.isMesh)ye.wireframe===!0?($.setLineWidth(ye.wireframeLinewidth*te()),Qe.setMode(1)):Qe.setMode(4);else if(Me.isLine){let za=ye.linewidth;za===void 0&&(za=1),$.setLineWidth(za*te()),Me.isLineSegments?Qe.setMode(1):Me.isLineLoop?Qe.setMode(2):Qe.setMode(3)}else Me.isPoints?Qe.setMode(0):Me.isSprite&&Qe.setMode(4);if(Me.isInstancedMesh)Qe.renderInstances(Qt,Xc,Me.count);else if(de.isInstancedBufferGeometry){const za=Math.min(de.instanceCount,de._maxInstanceCount);Qe.renderInstances(Qt,Xc,za)}else Qe.render(Qt,Xc)}},this.compile=function(K,pe){p=ie.get(K),p.init(),K.traverseVisible(function(de){de.isLight&&de.layers.test(pe.layers)&&(p.pushLight(de),de.castShadow&&p.pushShadow(de))}),p.setupLights(),K.traverse(function(de){const ye=de.material;if(ye)if(Array.isArray(ye))for(let Me=0;Me<ye.length;Me++){const fe=ye[Me];ne(fe,K,de)}else ne(ye,K,de)})};let He=null;function Pt(K){He&&He(K)}function It(){bt.stop()}function mt(){bt.start()}const bt=new Hv;bt.setAnimationLoop(Pt),typeof window<"u"&&bt.setContext(window),this.setAnimationLoop=function(K){He=K,_e.setAnimationLoop(K),K===null?bt.stop():bt.start()},_e.addEventListener("sessionstart",It),_e.addEventListener("sessionend",mt),this.render=function(K,pe){if(pe!==void 0&&pe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(b===!0)return;K.autoUpdate===!0&&K.updateMatrixWorld(),pe.parent===null&&pe.updateMatrixWorld(),_e.enabled===!0&&_e.isPresenting===!0&&(_e.cameraAutoUpdate===!0&&_e.updateCamera(pe),pe=_e.getCamera()),K.isScene===!0&&K.onBeforeRender(d,K,pe,w),p=ie.get(K,m.length),p.init(),m.push(p),G.multiplyMatrices(pe.projectionMatrix,pe.matrixWorldInverse),B.setFromProjectionMatrix(G),k=this.localClippingEnabled,D=ue.init(this.clippingPlanes,k,pe),h=Y.get(K,v.length),h.init(),v.push(h),Oi(K,pe,0,d.sortObjects),h.finish(),d.sortObjects===!0&&h.sort(E,C),D===!0&&ue.beginShadows();const de=p.state.shadowsArray;me.render(de,K,pe),p.setupLights(),p.setupLightsView(pe),D===!0&&ue.endShadows(),this.info.autoReset===!0&&this.info.reset(),be.render(h,K);const ye=h.opaque,Me=h.transmissive,fe=h.transparent;ye.length>0&&Un(ye,K,pe),Me.length>0&&Ni(ye,Me,K,pe),fe.length>0&&Un(fe,K,pe),w!==null&&(W.updateMultisampleRenderTarget(w),W.updateRenderTargetMipmap(w)),K.isScene===!0&&K.onAfterRender(d,K,pe),$.buffers.depth.setTest(!0),$.buffers.depth.setMask(!0),$.buffers.color.setMask(!0),$.setPolygonOffset(!1),ve.resetDefaultState(),A=-1,S=null,m.pop(),m.length>0?p=m[m.length-1]:p=null,v.pop(),v.length>0?h=v[v.length-1]:h=null};function Oi(K,pe,de,ye){if(K.visible===!1)return;if(K.layers.test(pe.layers)){if(K.isGroup)de=K.renderOrder;else if(K.isLOD)K.autoUpdate===!0&&K.update(pe);else if(K.isLight)p.pushLight(K),K.castShadow&&p.pushShadow(K);else if(K.isSprite){if(!K.frustumCulled||B.intersectsSprite(K)){ye&&J.setFromMatrixPosition(K.matrixWorld).applyMatrix4(G);const xe=U.update(K),Se=K.material;Se.visible&&h.push(K,xe,Se,de,J.z,null)}}else if(K.isImmediateRenderObject)ye&&J.setFromMatrixPosition(K.matrixWorld).applyMatrix4(G),h.push(K,null,K.material,de,J.z,null);else if((K.isMesh||K.isLine||K.isPoints)&&(K.isSkinnedMesh&&K.skeleton.frame!==se.render.frame&&(K.skeleton.update(),K.skeleton.frame=se.render.frame),!K.frustumCulled||B.intersectsObject(K))){ye&&J.setFromMatrixPosition(K.matrixWorld).applyMatrix4(G);const xe=U.update(K),Se=K.material;if(Array.isArray(Se)){const Fe=xe.groups;for(let Ie=0,Ue=Fe.length;Ie<Ue;Ie++){const De=Fe[Ie],Qe=Se[De.materialIndex];Qe&&Qe.visible&&h.push(K,xe,Qe,de,J.z,De)}}else Se.visible&&h.push(K,xe,Se,de,J.z,null)}}const fe=K.children;for(let xe=0,Se=fe.length;xe<Se;xe++)Oi(fe[xe],pe,de,ye)}function Ni(K,pe,de,ye){if(V===null){const Se=o===!0&&Z.isWebGL2===!0?Pd:Pn;V=new Se(1024,1024,{generateMipmaps:!0,type:he.convert(Fr)!==null?Fr:Rr,minFilter:xi,magFilter:wt,wrapS:zt,wrapT:zt})}const Me=d.getRenderTarget();d.setRenderTarget(V),d.clear();const fe=d.toneMapping;d.toneMapping=qi,Un(K,de,ye),d.toneMapping=fe,W.updateMultisampleRenderTarget(V),W.updateRenderTargetMipmap(V),d.setRenderTarget(Me),Un(pe,de,ye)}function Un(K,pe,de){const ye=pe.isScene===!0?pe.overrideMaterial:null;for(let Me=0,fe=K.length;Me<fe;Me++){const xe=K[Me],Se=xe.object,Fe=xe.geometry,Ie=ye===null?xe.material:ye,Ue=xe.group;if(de.isArrayCamera){const De=de.cameras;for(let Qe=0,Lt=De.length;Qe<Lt;Qe++){const Gt=De[Qe];Se.layers.test(Gt.layers)&&($.viewport(M.copy(Gt.viewport)),p.setupLightsView(Gt),ss(Se,pe,Gt,Fe,Ie,Ue))}}else ss(Se,pe,de,Fe,Ie,Ue)}}function ss(K,pe,de,ye,Me,fe){if(K.onBeforeRender(d,pe,de,ye,Me,fe),K.modelViewMatrix.multiplyMatrices(de.matrixWorldInverse,K.matrixWorld),K.normalMatrix.getNormalMatrix(K.modelViewMatrix),K.isImmediateRenderObject){const xe=Te(de,pe,Me,K);$.setMaterial(Me),ve.reset(),je(K,xe)}else Me.transparent===!0&&Me.side===Ki?(Me.side=xt,Me.needsUpdate=!0,d.renderBufferDirect(de,pe,ye,Me,K,fe),Me.side=Ji,Me.needsUpdate=!0,d.renderBufferDirect(de,pe,ye,Me,K,fe),Me.side=Ki):d.renderBufferDirect(de,pe,ye,Me,K,fe);K.onAfterRender(d,pe,de,ye,Me,fe)}function ne(K,pe,de){pe.isScene!==!0&&(pe=j);const ye=z.get(K),Me=p.state.lights,fe=p.state.shadowsArray,xe=Me.state.version,Se=N.getParameters(K,Me.state,fe,pe,de),Fe=N.getProgramCacheKey(Se);let Ie=ye.programs;ye.environment=K.isMeshStandardMaterial?pe.environment:null,ye.fog=pe.fog,ye.envMap=q.get(K.envMap||ye.environment),Ie===void 0&&(K.addEventListener("dispose",ze),Ie=new Map,ye.programs=Ie);let Ue=Ie.get(Fe);if(Ue!==void 0){if(ye.currentProgram===Ue&&ye.lightsStateVersion===xe)return we(K,Se),Ue}else Se.uniforms=N.getUniforms(K),K.onBuild(Se,d),K.onBeforeCompile(Se,d),Ue=N.acquireProgram(Se,Fe),Ie.set(Fe,Ue),ye.uniforms=Se.uniforms;const De=ye.uniforms;(!K.isShaderMaterial&&!K.isRawShaderMaterial||K.clipping===!0)&&(De.clippingPlanes=ue.uniform),we(K,Se),ye.needsLights=qe(K),ye.lightsStateVersion=xe,ye.needsLights&&(De.ambientLightColor.value=Me.state.ambient,De.lightProbe.value=Me.state.probe,De.directionalLights.value=Me.state.directional,De.directionalLightShadows.value=Me.state.directionalShadow,De.spotLights.value=Me.state.spot,De.spotLightShadows.value=Me.state.spotShadow,De.rectAreaLights.value=Me.state.rectArea,De.ltc_1.value=Me.state.rectAreaLTC1,De.ltc_2.value=Me.state.rectAreaLTC2,De.pointLights.value=Me.state.point,De.pointLightShadows.value=Me.state.pointShadow,De.hemisphereLights.value=Me.state.hemi,De.directionalShadowMap.value=Me.state.directionalShadowMap,De.directionalShadowMatrix.value=Me.state.directionalShadowMatrix,De.spotShadowMap.value=Me.state.spotShadowMap,De.spotShadowMatrix.value=Me.state.spotShadowMatrix,De.pointShadowMap.value=Me.state.pointShadowMap,De.pointShadowMatrix.value=Me.state.pointShadowMatrix);const Qe=Ue.getUniforms(),Lt=ur.seqWithValue(Qe.seq,De);return ye.currentProgram=Ue,ye.uniformsList=Lt,Ue}function we(K,pe){const de=z.get(K);de.outputEncoding=pe.outputEncoding,de.instancing=pe.instancing,de.skinning=pe.skinning,de.numClippingPlanes=pe.numClippingPlanes,de.numIntersection=pe.numClipIntersection,de.vertexAlphas=pe.vertexAlphas}function Te(K,pe,de,ye){pe.isScene!==!0&&(pe=j),W.resetTextureUnits();const Me=pe.fog,fe=de.isMeshStandardMaterial?pe.environment:null,xe=w===null?d.outputEncoding:w.texture.encoding,Se=q.get(de.envMap||fe),Fe=de.vertexColors===!0&&ye.geometry&&ye.geometry.attributes.color&&ye.geometry.attributes.color.itemSize===4,Ie=z.get(de),Ue=p.state.lights;if(D===!0&&(k===!0||K!==S)){const Qt=K===S&&de.id===A;ue.setState(de,K,Qt)}let De=!1;de.version===Ie.__version?(Ie.needsLights&&Ie.lightsStateVersion!==Ue.state.version||Ie.outputEncoding!==xe||ye.isInstancedMesh&&Ie.instancing===!1||!ye.isInstancedMesh&&Ie.instancing===!0||ye.isSkinnedMesh&&Ie.skinning===!1||!ye.isSkinnedMesh&&Ie.skinning===!0||Ie.envMap!==Se||de.fog&&Ie.fog!==Me||Ie.numClippingPlanes!==void 0&&(Ie.numClippingPlanes!==ue.numPlanes||Ie.numIntersection!==ue.numIntersection)||Ie.vertexAlphas!==Fe)&&(De=!0):(De=!0,Ie.__version=de.version);let Qe=Ie.currentProgram;De===!0&&(Qe=ne(de,pe,ye));let Lt=!1,Gt=!1,os=!1;const dt=Qe.getUniforms(),as=Ie.uniforms;if($.useProgram(Qe.program)&&(Lt=!0,Gt=!0,os=!0),de.id!==A&&(A=de.id,Gt=!0),Lt||S!==K){if(dt.setValue(ee,"projectionMatrix",K.projectionMatrix),Z.logarithmicDepthBuffer&&dt.setValue(ee,"logDepthBufFC",2/(Math.log(K.far+1)/Math.LN2)),S!==K&&(S=K,Gt=!0,os=!0),de.isShaderMaterial||de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshStandardMaterial||de.envMap){const Qt=dt.map.cameraPosition;Qt!==void 0&&Qt.setValue(ee,J.setFromMatrixPosition(K.matrixWorld))}(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&dt.setValue(ee,"isOrthographic",K.isOrthographicCamera===!0),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial||de.isShadowMaterial||ye.isSkinnedMesh)&&dt.setValue(ee,"viewMatrix",K.matrixWorldInverse)}if(ye.isSkinnedMesh){dt.setOptional(ee,ye,"bindMatrix"),dt.setOptional(ee,ye,"bindMatrixInverse");const Qt=ye.skeleton;Qt&&(Z.floatVertexTextures?(Qt.boneTexture===null&&Qt.computeBoneTexture(),dt.setValue(ee,"boneTexture",Qt.boneTexture,W),dt.setValue(ee,"boneTextureSize",Qt.boneTextureSize)):dt.setOptional(ee,Qt,"boneMatrices"))}return(Gt||Ie.receiveShadow!==ye.receiveShadow)&&(Ie.receiveShadow=ye.receiveShadow,dt.setValue(ee,"receiveShadow",ye.receiveShadow)),Gt&&(dt.setValue(ee,"toneMappingExposure",d.toneMappingExposure),Ie.needsLights&&Be(as,os),Me&&de.fog&&X.refreshFogUniforms(as,Me),X.refreshMaterialUniforms(as,de,_,P,V),ur.upload(ee,Ie.uniformsList,as,W)),de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&(ur.upload(ee,Ie.uniformsList,as,W),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&dt.setValue(ee,"center",ye.center),dt.setValue(ee,"modelViewMatrix",ye.modelViewMatrix),dt.setValue(ee,"normalMatrix",ye.normalMatrix),dt.setValue(ee,"modelMatrix",ye.matrixWorld),Qe}function Be(K,pe){K.ambientLightColor.needsUpdate=pe,K.lightProbe.needsUpdate=pe,K.directionalLights.needsUpdate=pe,K.directionalLightShadows.needsUpdate=pe,K.pointLights.needsUpdate=pe,K.pointLightShadows.needsUpdate=pe,K.spotLights.needsUpdate=pe,K.spotLightShadows.needsUpdate=pe,K.rectAreaLights.needsUpdate=pe,K.hemisphereLights.needsUpdate=pe}function qe(K){return K.isMeshLambertMaterial||K.isMeshToonMaterial||K.isMeshPhongMaterial||K.isMeshStandardMaterial||K.isShadowMaterial||K.isShaderMaterial&&K.lights===!0}this.getActiveCubeFace=function(){return y},this.getActiveMipmapLevel=function(){return g},this.getRenderTarget=function(){return w},this.setRenderTarget=function(K,pe=0,de=0){w=K,y=pe,g=de,K&&z.get(K).__webglFramebuffer===void 0&&W.setupRenderTarget(K);let ye=null,Me=!1,fe=!1;if(K){const Se=K.texture;(Se.isDataTexture3D||Se.isDataTexture2DArray)&&(fe=!0);const Fe=z.get(K).__webglFramebuffer;K.isWebGLCubeRenderTarget?(ye=Fe[pe],Me=!0):K.isWebGLMultisampleRenderTarget?ye=z.get(K).__webglMultisampledFramebuffer:ye=Fe,M.copy(K.viewport),F.copy(K.scissor),R=K.scissorTest}else M.copy(L).multiplyScalar(_).floor(),F.copy(I).multiplyScalar(_).floor(),R=x;if($.bindFramebuffer(36160,ye)&&Z.drawBuffers){let Se=!1;if(K)if(K.isWebGLMultipleRenderTargets){const Fe=K.texture;if(O.length!==Fe.length||O[0]!==36064){for(let Ie=0,Ue=Fe.length;Ie<Ue;Ie++)O[Ie]=36064+Ie;O.length=Fe.length,Se=!0}}else(O.length!==1||O[0]!==36064)&&(O[0]=36064,O.length=1,Se=!0);else(O.length!==1||O[0]!==1029)&&(O[0]=1029,O.length=1,Se=!0);Se&&(Z.isWebGL2?ee.drawBuffers(O):H.get("WEBGL_draw_buffers").drawBuffersWEBGL(O))}if($.viewport(M),$.scissor(F),$.setScissorTest(R),Me){const Se=z.get(K.texture);ee.framebufferTexture2D(36160,36064,34069+pe,Se.__webglTexture,de)}else if(fe){const Se=z.get(K.texture),Fe=pe||0;ee.framebufferTextureLayer(36160,36064,Se.__webglTexture,de||0,Fe)}},this.readRenderTargetPixels=function(K,pe,de,ye,Me,fe,xe){if(!(K&&K.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Se=z.get(K).__webglFramebuffer;if(K.isWebGLCubeRenderTarget&&xe!==void 0&&(Se=Se[xe]),Se){$.bindFramebuffer(36160,Se);try{const Fe=K.texture,Ie=Fe.format,Ue=Fe.type;if(Ie!==hn&&he.convert(Ie)!==ee.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const De=Ue===Fr&&(H.has("EXT_color_buffer_half_float")||Z.isWebGL2&&H.has("EXT_color_buffer_float"));if(Ue!==Rr&&he.convert(Ue)!==ee.getParameter(35738)&&!(Ue===wi&&(Z.isWebGL2||H.has("OES_texture_float")||H.has("WEBGL_color_buffer_float")))&&!De){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ee.checkFramebufferStatus(36160)===36053?pe>=0&&pe<=K.width-ye&&de>=0&&de<=K.height-Me&&ee.readPixels(pe,de,ye,Me,he.convert(Ie),he.convert(Ue),fe):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Fe=w!==null?z.get(w).__webglFramebuffer:null;$.bindFramebuffer(36160,Fe)}}},this.copyFramebufferToTexture=function(K,pe,de=0){const ye=Math.pow(2,-de),Me=Math.floor(pe.image.width*ye),fe=Math.floor(pe.image.height*ye);let xe=he.convert(pe.format);Z.isWebGL2&&(xe===6407&&(xe=32849),xe===6408&&(xe=32856)),W.setTexture2D(pe,0),ee.copyTexImage2D(3553,de,xe,K.x,K.y,Me,fe,0),$.unbindTexture()},this.copyTextureToTexture=function(K,pe,de,ye=0){const Me=pe.image.width,fe=pe.image.height,xe=he.convert(de.format),Se=he.convert(de.type);W.setTexture2D(de,0),ee.pixelStorei(37440,de.flipY),ee.pixelStorei(37441,de.premultiplyAlpha),ee.pixelStorei(3317,de.unpackAlignment),pe.isDataTexture?ee.texSubImage2D(3553,ye,K.x,K.y,Me,fe,xe,Se,pe.image.data):pe.isCompressedTexture?ee.compressedTexSubImage2D(3553,ye,K.x,K.y,pe.mipmaps[0].width,pe.mipmaps[0].height,xe,pe.mipmaps[0].data):ee.texSubImage2D(3553,ye,K.x,K.y,xe,Se,pe.image),ye===0&&de.generateMipmaps&&ee.generateMipmap(3553),$.unbindTexture()},this.copyTextureToTexture3D=function(K,pe,de,ye,Me=0){if(d.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const fe=K.max.x-K.min.x+1,xe=K.max.y-K.min.y+1,Se=K.max.z-K.min.z+1,Fe=he.convert(ye.format),Ie=he.convert(ye.type);let Ue;if(ye.isDataTexture3D)W.setTexture3D(ye,0),Ue=32879;else if(ye.isDataTexture2DArray)W.setTexture2DArray(ye,0),Ue=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ee.pixelStorei(37440,ye.flipY),ee.pixelStorei(37441,ye.premultiplyAlpha),ee.pixelStorei(3317,ye.unpackAlignment);const De=ee.getParameter(3314),Qe=ee.getParameter(32878),Lt=ee.getParameter(3316),Gt=ee.getParameter(3315),os=ee.getParameter(32877),dt=de.isCompressedTexture?de.mipmaps[0]:de.image;ee.pixelStorei(3314,dt.width),ee.pixelStorei(32878,dt.height),ee.pixelStorei(3316,K.min.x),ee.pixelStorei(3315,K.min.y),ee.pixelStorei(32877,K.min.z),de.isDataTexture||de.isDataTexture3D?ee.texSubImage3D(Ue,Me,pe.x,pe.y,pe.z,fe,xe,Se,Fe,Ie,dt.data):de.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ee.compressedTexSubImage3D(Ue,Me,pe.x,pe.y,pe.z,fe,xe,Se,Fe,dt.data)):ee.texSubImage3D(Ue,Me,pe.x,pe.y,pe.z,fe,xe,Se,Fe,Ie,dt),ee.pixelStorei(3314,De),ee.pixelStorei(32878,Qe),ee.pixelStorei(3316,Lt),ee.pixelStorei(3315,Gt),ee.pixelStorei(32877,os),Me===0&&ye.generateMipmaps&&ee.generateMipmap(Ue),$.unbindTexture()},this.initTexture=function(K){W.setTexture2D(K,0),$.unbindTexture()},this.resetState=function(){y=0,g=0,w=null,$.reset(),ve.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class py extends rt{}py.prototype.isWebGL1Renderer=!0;class ca{constructor(e,t=25e-5){this.name="",this.color=new Le(e),this.density=t}clone(){return new ca(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}ca.prototype.isFogExp2=!0;class ua{constructor(e,t=1,i=1e3){this.name="",this.color=new Le(e),this.near=t,this.far=i}clone(){return new ua(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}ua.prototype.isFog=!0;class oc extends Xe{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,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()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}oc.prototype.isScene=!0;class dr{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Fs,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}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 r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=fn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=fn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}dr.prototype.isInterleavedBuffer=!0;const _t=new Q;class Fi{constructor(e,t,i,r=!1){this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)_t.x=this.getX(t),_t.y=this.getY(t),_t.z=this.getZ(t),_t.applyMatrix4(e),this.setXYZ(t,_t.x,_t.y,_t.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)_t.x=this.getX(t),_t.y=this.getY(t),_t.z=this.getZ(t),_t.applyNormalMatrix(e),this.setXYZ(t,_t.x,_t.y,_t.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)_t.x=this.getX(t),_t.y=this.getY(t),_t.z=this.getZ(t),_t.transformDirection(e),this.setXYZ(t,_t.x,_t.y,_t.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new Ze(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Fi(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}Fi.prototype.isInterleavedBufferAttribute=!0;class da extends Ft{constructor(e){super(),this.type="SpriteMaterial",this.color=new Le(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}da.prototype.isSpriteMaterial=!0;let Js;const ha=new Q,Ks=new Q,qs=new Q,Qs=new Ae,fa=new Ae,my=new Oe,ac=new Q,pa=new Q,lc=new Q,gy=new Ae,lh=new Ae,vy=new Ae;class ma extends Xe{constructor(e){if(super(),this.type="Sprite",Js===void 0){Js=new ke;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new dr(t,5);Js.setIndex([0,1,2,0,2,3]),Js.setAttribute("position",new Fi(i,3,0,!1)),Js.setAttribute("uv",new Fi(i,2,3,!1))}this.geometry=Js,this.material=e!==void 0?e:new da,this.center=new Ae(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Ks.setFromMatrixScale(this.matrixWorld),my.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),qs.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Ks.multiplyScalar(-qs.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const o=this.center;cc(ac.set(-.5,-.5,0),qs,o,Ks,r,s),cc(pa.set(.5,-.5,0),qs,o,Ks,r,s),cc(lc.set(.5,.5,0),qs,o,Ks,r,s),gy.set(0,0),lh.set(1,0),vy.set(1,1);let l=e.ray.intersectTriangle(ac,pa,lc,!1,ha);if(l===null&&(cc(pa.set(-.5,.5,0),qs,o,Ks,r,s),lh.set(0,1),l=e.ray.intersectTriangle(ac,lc,pa,!1,ha),l===null))return;const u=e.ray.origin.distanceTo(ha);u<e.near||u>e.far||t.push({distance:u,point:ha.clone(),uv:At.getUV(ha,ac,pa,lc,gy,lh,vy,new Ae),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}ma.prototype.isSprite=!0;function cc(n,e,t,i,r,s){Qs.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(fa.x=s*Qs.x-r*Qs.y,fa.y=r*Qs.x+s*Qs.y):fa.copy(Qs),n.copy(e),n.x+=fa.x,n.y+=fa.y,n.applyMatrix4(my)}const uc=new Q,yy=new Q;class by extends Xe{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i<r;i++){const s=t[i];this.addLevel(s.object.clone(),s.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const i=this.levels;let r;for(r=0;r<i.length&&!(t<i[r].distance);r++);return i.splice(r,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let i,r;for(i=1,r=t.length;i<r&&!(e<t[i].distance);i++);return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){uc.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(uc);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){uc.setFromMatrixPosition(e.matrixWorld),yy.setFromMatrixPosition(this.matrixWorld);const i=uc.distanceTo(yy)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r<s&&i>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<s;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const i=this.levels;for(let r=0,s=i.length;r<s;r++){const o=i[r];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t}}const xy=new Q,wy=new it,My=new it,dO=new Q,Ay=new Oe;class ga extends St{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Oe,this.bindMatrixInverse=new Oe}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new it,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.w=t.getW(i);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const i=this.skeleton,r=this.geometry;wy.fromBufferAttribute(r.attributes.skinIndex,e),My.fromBufferAttribute(r.attributes.skinWeight,e),xy.fromBufferAttribute(r.attributes.position,e).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=My.getComponent(s);if(o!==0){const l=wy.getComponent(s);Ay.multiplyMatrices(i.bones[l].matrixWorld,i.boneInverses[l]),t.addScaledVector(dO.copy(xy).applyMatrix4(Ay),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}ga.prototype.isSkinnedMesh=!0;class va extends Xe{constructor(){super(),this.type="Bone"}}va.prototype.isBone=!0;class Hr extends Mt{constructor(e=null,t=1,i=1,r,s,o,l,u,c=wt,f=wt,h,p){super(null,o,l,u,c,f,r,s,h,p),this.image={data:e,width:t,height:i},this.magFilter=c,this.minFilter=f,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Hr.prototype.isDataTexture=!0;const Sy=new Oe,hO=new Oe;class ya{constructor(e=[],t=[]){this.uuid=fn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new Oe)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new Oe;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,t=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const l=e[s]?e[s].matrixWorld:hO;Sy.multiplyMatrices(l,t[s]),Sy.toArray(i,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new ya(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=bv(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new Hr(t,e,e,hn,wi);return this.boneMatrices=t,this.boneTexture=i,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,r=e.bones.length;i<r;i++){const s=e.bones[i];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new va),this.bones.push(o),this.boneInverses.push(new Oe().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,i=this.boneInverses;for(let r=0,s=t.length;r<s;r++){const o=t[r];e.bones.push(o.uuid);const l=i[r];e.boneInverses.push(l.toArray())}return e}}const _y=new Oe,Ty=new Oe,dc=[],ba=new St;class ch extends St{constructor(e,t,i){super(e,t),this.instanceMatrix=new Ze(new Float32Array(i*16),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const i=this.matrixWorld,r=this.count;if(ba.geometry=this.geometry,ba.material=this.material,ba.material!==void 0)for(let s=0;s<r;s++){this.getMatrixAt(s,_y),Ty.multiplyMatrices(i,_y),ba.matrixWorld=Ty,ba.raycast(e,dc);for(let o=0,l=dc.length;o<l;o++){const u=dc[o];u.instanceId=s,u.object=this,t.push(u)}dc.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Ze(new Float32Array(this.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}ch.prototype.isInstancedMesh=!0;class Vt extends Ft{constructor(e){super(),this.type="LineBasicMaterial",this.color=new Le(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this}}Vt.prototype.isLineBasicMaterial=!0;const Ey=new Q,Cy=new Q,Ly=new Oe,uh=new sr,hc=new Si;class ei extends Xe{constructor(e=new ke,t=new Vt){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[0];for(let r=1,s=t.count;r<s;r++)Ey.fromBufferAttribute(t,r-1),Cy.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=Ey.distanceTo(Cy);e.setAttribute("lineDistance",new Pe(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),hc.copy(i.boundingSphere),hc.applyMatrix4(r),hc.radius+=s,e.ray.intersectsSphere(hc)===!1)return;Ly.copy(r).invert(),uh.copy(e.ray).applyMatrix4(Ly);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,c=new Q,f=new Q,h=new Q,p=new Q,v=this.isLineSegments?2:1;if(i.isBufferGeometry){const m=i.index,b=i.attributes.position;if(m!==null){const y=Math.max(0,o.start),g=Math.min(m.count,o.start+o.count);for(let w=y,A=g-1;w<A;w+=v){const S=m.getX(w),M=m.getX(w+1);if(c.fromBufferAttribute(b,S),f.fromBufferAttribute(b,M),uh.distanceSqToSegment(c,f,p,h)>u)continue;p.applyMatrix4(this.matrixWorld);const R=e.ray.origin.distanceTo(p);R<e.near||R>e.far||t.push({distance:R,point:h.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const y=Math.max(0,o.start),g=Math.min(b.count,o.start+o.count);for(let w=y,A=g-1;w<A;w+=v){if(c.fromBufferAttribute(b,w),f.fromBufferAttribute(b,w+1),uh.distanceSqToSegment(c,f,p,h)>u)continue;p.applyMatrix4(this.matrixWorld);const M=e.ray.origin.distanceTo(p);M<e.near||M>e.far||t.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const l=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}ei.prototype.isLine=!0;const Ry=new Q,Fy=new Q;class rn extends ei{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r<s;r+=2)Ry.fromBufferAttribute(t,r),Fy.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+Ry.distanceTo(Fy);e.setAttribute("lineDistance",new Pe(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}rn.prototype.isLineSegments=!0;class fc extends ei{constructor(e,t){super(e,t),this.type="LineLoop"}}fc.prototype.isLineLoop=!0;class hr extends Ft{constructor(e){super(),this.type="PointsMaterial",this.color=new Le(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this}}hr.prototype.isPointsMaterial=!0;const Py=new Oe,dh=new sr,pc=new Si,mc=new Q;class eo extends Xe{constructor(e=new ke,t=new hr){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),pc.copy(i.boundingSphere),pc.applyMatrix4(r),pc.radius+=s,e.ray.intersectsSphere(pc)===!1)return;Py.copy(r).invert(),dh.copy(e.ray).applyMatrix4(Py);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l;if(i.isBufferGeometry){const c=i.index,h=i.attributes.position;if(c!==null){const p=Math.max(0,o.start),v=Math.min(c.count,o.start+o.count);for(let m=p,d=v;m<d;m++){const b=c.getX(m);mc.fromBufferAttribute(h,b),Iy(mc,b,u,r,e,t,this)}}else{const p=Math.max(0,o.start),v=Math.min(h.count,o.start+o.count);for(let m=p,d=v;m<d;m++)mc.fromBufferAttribute(h,m),Iy(mc,m,u,r,e,t,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const l=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}eo.prototype.isPoints=!0;function Iy(n,e,t,i,r,s,o){const l=dh.distanceSqToPoint(n);if(l<t){const u=new Q;dh.closestPointToPoint(n,u),u.applyMatrix4(i);const c=r.ray.origin.distanceTo(u);if(c<r.near||c>r.far)return;s.push({distance:c,distanceToRay:Math.sqrt(l),point:u,index:e,face:null,object:o})}}class Oy extends Mt{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.format=l!==void 0?l:Mi,this.minFilter=o!==void 0?o:vt,this.magFilter=s!==void 0?s:vt,this.generateMipmaps=!1;const f=this;function h(){f.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}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)}}Oy.prototype.isVideoTexture=!0;class hh extends Mt{constructor(e,t,i,r,s,o,l,u,c,f,h,p){super(null,o,l,u,c,f,r,s,h,p),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}hh.prototype.isCompressedTexture=!0;class Ny extends Mt{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.needsUpdate=!0}}Ny.prototype.isCanvasTexture=!0;class By extends Mt{constructor(e,t,i,r,s,o,l,u,c,f){if(f=f!==void 0?f:Pr,f!==Pr&&f!==Ls)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&f===Pr&&(i=Jo),i===void 0&&f===Ls&&(i=Cs),super(null,r,s,o,l,u,f,i,c),this.image={width:e,height:t},this.magFilter=l!==void 0?l:wt,this.minFilter=u!==void 0?u:wt,this.flipY=!1,this.generateMipmaps=!1}}By.prototype.isDepthTexture=!0;class to extends ke{constructor(e=1,t=8,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);const s=[],o=[],l=[],u=[],c=new Q,f=new Ae;o.push(0,0,0),l.push(0,0,1),u.push(.5,.5);for(let h=0,p=3;h<=t;h++,p+=3){const v=i+h/t*r;c.x=e*Math.cos(v),c.y=e*Math.sin(v),o.push(c.x,c.y,c.z),l.push(0,0,1),f.x=(o[p]/e+1)/2,f.y=(o[p+1]/e+1)/2,u.push(f.x,f.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new Pe(o,3)),this.setAttribute("normal",new Pe(l,3)),this.setAttribute("uv",new Pe(u,2))}static fromJSON(e){return new to(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class fr extends ke{constructor(e=1,t=1,i=1,r=8,s=1,o=!1,l=0,u=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:l,thetaLength:u};const c=this;r=Math.floor(r),s=Math.floor(s);const f=[],h=[],p=[],v=[];let m=0;const d=[],b=i/2;let y=0;g(),o===!1&&(e>0&&w(!0),t>0&&w(!1)),this.setIndex(f),this.setAttribute("position",new Pe(h,3)),this.setAttribute("normal",new Pe(p,3)),this.setAttribute("uv",new Pe(v,2));function g(){const A=new Q,S=new Q;let M=0;const F=(t-e)/i;for(let R=0;R<=s;R++){const T=[],P=R/s,_=P*(t-e)+e;for(let E=0;E<=r;E++){const C=E/r,L=C*u+l,I=Math.sin(L),x=Math.cos(L);S.x=_*I,S.y=-P*i+b,S.z=_*x,h.push(S.x,S.y,S.z),A.set(I,F,x).normalize(),p.push(A.x,A.y,A.z),v.push(C,1-P),T.push(m++)}d.push(T)}for(let R=0;R<r;R++)for(let T=0;T<s;T++){const P=d[T][R],_=d[T+1][R],E=d[T+1][R+1],C=d[T][R+1];f.push(P,_,C),f.push(_,E,C),M+=6}c.addGroup(y,M,0),y+=M}function w(A){const S=m,M=new Ae,F=new Q;let R=0;const T=A===!0?e:t,P=A===!0?1:-1;for(let E=1;E<=r;E++)h.push(0,b*P,0),p.push(0,P,0),v.push(.5,.5),m++;const _=m;for(let E=0;E<=r;E++){const L=E/r*u+l,I=Math.cos(L),x=Math.sin(L);F.x=T*x,F.y=b*P,F.z=T*I,h.push(F.x,F.y,F.z),p.push(0,P,0),M.x=I*.5+.5,M.y=x*.5*P+.5,v.push(M.x,M.y),m++}for(let E=0;E<r;E++){const C=S+E,L=_+E;A===!0?f.push(L,L+1,C):f.push(L+1,L,C),R+=3}c.addGroup(y,R,A===!0?1:2),y+=R}}static fromJSON(e){return new fr(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class no extends fr{constructor(e=1,t=1,i=8,r=1,s=!1,o=0,l=Math.PI*2){super(0,e,t,i,r,s,o,l),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:l}}static fromJSON(e){return new no(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class ti extends ke{constructor(e,t,i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r};const s=[],o=[];l(r),c(i),f(),this.setAttribute("position",new Pe(s,3)),this.setAttribute("normal",new Pe(s.slice(),3)),this.setAttribute("uv",new Pe(o,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function l(g){const w=new Q,A=new Q,S=new Q;for(let M=0;M<t.length;M+=3)v(t[M+0],w),v(t[M+1],A),v(t[M+2],S),u(w,A,S,g)}function u(g,w,A,S){const M=S+1,F=[];for(let R=0;R<=M;R++){F[R]=[];const T=g.clone().lerp(A,R/M),P=w.clone().lerp(A,R/M),_=M-R;for(let E=0;E<=_;E++)E===0&&R===M?F[R][E]=T:F[R][E]=T.clone().lerp(P,E/_)}for(let R=0;R<M;R++)for(let T=0;T<2*(M-R)-1;T++){const P=Math.floor(T/2);T%2===0?(p(F[R][P+1]),p(F[R+1][P]),p(F[R][P])):(p(F[R][P+1]),p(F[R+1][P+1]),p(F[R+1][P]))}}function c(g){const w=new Q;for(let A=0;A<s.length;A+=3)w.x=s[A+0],w.y=s[A+1],w.z=s[A+2],w.normalize().multiplyScalar(g),s[A+0]=w.x,s[A+1]=w.y,s[A+2]=w.z}function f(){const g=new Q;for(let w=0;w<s.length;w+=3){g.x=s[w+0],g.y=s[w+1],g.z=s[w+2];const A=b(g)/2/Math.PI+.5,S=y(g)/Math.PI+.5;o.push(A,1-S)}m(),h()}function h(){for(let g=0;g<o.length;g+=6){const w=o[g+0],A=o[g+2],S=o[g+4],M=Math.max(w,A,S),F=Math.min(w,A,S);M>.9&&F<.1&&(w<.2&&(o[g+0]+=1),A<.2&&(o[g+2]+=1),S<.2&&(o[g+4]+=1))}}function p(g){s.push(g.x,g.y,g.z)}function v(g,w){const A=g*3;w.x=e[A+0],w.y=e[A+1],w.z=e[A+2]}function m(){const g=new Q,w=new Q,A=new Q,S=new Q,M=new Ae,F=new Ae,R=new Ae;for(let T=0,P=0;T<s.length;T+=9,P+=6){g.set(s[T+0],s[T+1],s[T+2]),w.set(s[T+3],s[T+4],s[T+5]),A.set(s[T+6],s[T+7],s[T+8]),M.set(o[P+0],o[P+1]),F.set(o[P+2],o[P+3]),R.set(o[P+4],o[P+5]),S.copy(g).add(w).add(A).divideScalar(3);const _=b(S);d(M,P+0,g,_),d(F,P+2,w,_),d(R,P+4,A,_)}}function d(g,w,A,S){S<0&&g.x===1&&(o[w]=g.x-1),A.x===0&&A.z===0&&(o[w]=S/2/Math.PI+.5)}function b(g){return Math.atan2(g.z,-g.x)}function y(g){return Math.atan2(-g.y,Math.sqrt(g.x*g.x+g.z*g.z))}}static fromJSON(e){return new ti(e.vertices,e.indices,e.radius,e.details)}}class io extends ti{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=1/i,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new io(e.radius,e.detail)}}const gc=new Q,vc=new Q,fh=new Q,yc=new At;class ph extends ke{constructor(e,t){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=t!==void 0?t:1,e.isGeometry===!0){console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return}const r=Math.pow(10,4),s=Math.cos(Dr*t),o=e.getIndex(),l=e.getAttribute("position"),u=o?o.count:l.count,c=[0,0,0],f=["a","b","c"],h=new Array(3),p={},v=[];for(let m=0;m<u;m+=3){o?(c[0]=o.getX(m),c[1]=o.getX(m+1),c[2]=o.getX(m+2)):(c[0]=m,c[1]=m+1,c[2]=m+2);const{a:d,b,c:y}=yc;if(d.fromBufferAttribute(l,c[0]),b.fromBufferAttribute(l,c[1]),y.fromBufferAttribute(l,c[2]),yc.getNormal(fh),h[0]=`${Math.round(d.x*r)},${Math.round(d.y*r)},${Math.round(d.z*r)}`,h[1]=`${Math.round(b.x*r)},${Math.round(b.y*r)},${Math.round(b.z*r)}`,h[2]=`${Math.round(y.x*r)},${Math.round(y.y*r)},${Math.round(y.z*r)}`,!(h[0]===h[1]||h[1]===h[2]||h[2]===h[0]))for(let g=0;g<3;g++){const w=(g+1)%3,A=h[g],S=h[w],M=yc[f[g]],F=yc[f[w]],R=`${A}_${S}`,T=`${S}_${A}`;T in p&&p[T]?(fh.dot(p[T].normal)<=s&&(v.push(M.x,M.y,M.z),v.push(F.x,F.y,F.z)),p[T]=null):R in p||(p[R]={index0:c[g],index1:c[w],normal:fh.clone()})}}for(const m in p)if(p[m]){const{index0:d,index1:b}=p[m];gc.fromBufferAttribute(l,d),vc.fromBufferAttribute(l,b),v.push(gc.x,gc.y,gc.z),v.push(vc.x,vc.y,vc.z)}this.setAttribute("position",new Pe(v,3))}}class gn{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let l=0,u=s-1,c;for(;l<=u;)if(r=Math.floor(l+(u-l)/2),c=i[r]-o,c<0)l=r+1;else if(c>0)u=r-1;else{u=r;break}if(r=u,i[r]===o)return r/(s-1);const f=i[r],p=i[r+1]-f,v=(o-f)/p;return(r+v)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),l=this.getPoint(s),u=t||(o.isVector2?new Ae:new Q);return u.copy(l).sub(o).normalize(),u}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new Q,r=[],s=[],o=[],l=new Q,u=new Oe;for(let v=0;v<=e;v++){const m=v/e;r[v]=this.getTangentAt(m,new Q),r[v].normalize()}s[0]=new Q,o[0]=new Q;let c=Number.MAX_VALUE;const f=Math.abs(r[0].x),h=Math.abs(r[0].y),p=Math.abs(r[0].z);f<=c&&(c=f,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),p<=c&&i.set(0,0,1),l.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],l),o[0].crossVectors(r[0],s[0]);for(let v=1;v<=e;v++){if(s[v]=s[v-1].clone(),o[v]=o[v-1].clone(),l.crossVectors(r[v-1],r[v]),l.length()>Number.EPSILON){l.normalize();const m=Math.acos($t(r[v-1].dot(r[v]),-1,1));s[v].applyMatrix4(u.makeRotationAxis(l,m))}o[v].crossVectors(r[v],s[v])}if(t===!0){let v=Math.acos($t(s[0].dot(s[e]),-1,1));v/=e,r[0].dot(l.crossVectors(s[0],s[e]))>0&&(v=-v);for(let m=1;m<=e;m++)s[m].applyMatrix4(u.makeRotationAxis(r[m],v*m)),o[m].crossVectors(r[m],s[m])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class xa extends gn{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,l=!1,u=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=l,this.aRotation=u}getPoint(e,t){const i=t||new Ae,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(o?s=0:s=r),this.aClockwise===!0&&!o&&(s===r?s=-r:s=s-r);const l=this.aStartAngle+e*s;let u=this.aX+this.xRadius*Math.cos(l),c=this.aY+this.yRadius*Math.sin(l);if(this.aRotation!==0){const f=Math.cos(this.aRotation),h=Math.sin(this.aRotation),p=u-this.aX,v=c-this.aY;u=p*f-v*h+this.aX,c=p*h+v*f+this.aY}return i.set(u,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(){const 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}}xa.prototype.isEllipseCurve=!0;class mh extends xa{constructor(e,t,i,r,s,o){super(e,t,i,i,r,s,o),this.type="ArcCurve"}}mh.prototype.isArcCurve=!0;function gh(){let n=0,e=0,t=0,i=0;function r(s,o,l,u){n=s,e=l,t=-3*s+3*o-2*l-u,i=2*s-2*o+l+u}return{initCatmullRom:function(s,o,l,u,c){r(o,l,c*(l-s),c*(u-o))},initNonuniformCatmullRom:function(s,o,l,u,c,f,h){let p=(o-s)/c-(l-s)/(c+f)+(l-o)/f,v=(l-o)/f-(u-o)/(f+h)+(u-l)/h;p*=f,v*=f,r(o,l,p,v)},calc:function(s){const o=s*s,l=o*s;return n+e*s+t*o+i*l}}}const bc=new Q,vh=new gh,yh=new gh,bh=new gh;class xh extends gn{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new Q){const i=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e;let l=Math.floor(o),u=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/s)+1)*s:u===0&&l===s-1&&(l=s-2,u=1);let c,f;this.closed||l>0?c=r[(l-1)%s]:(bc.subVectors(r[0],r[1]).add(r[0]),c=bc);const h=r[l%s],p=r[(l+1)%s];if(this.closed||l+2<s?f=r[(l+2)%s]:(bc.subVectors(r[s-1],r[s-2]).add(r[s-1]),f=bc),this.curveType==="centripetal"||this.curveType==="chordal"){const v=this.curveType==="chordal"?.5:.25;let m=Math.pow(c.distanceToSquared(h),v),d=Math.pow(h.distanceToSquared(p),v),b=Math.pow(p.distanceToSquared(f),v);d<1e-4&&(d=1),m<1e-4&&(m=d),b<1e-4&&(b=d),vh.initNonuniformCatmullRom(c.x,h.x,p.x,f.x,m,d,b),yh.initNonuniformCatmullRom(c.y,h.y,p.y,f.y,m,d,b),bh.initNonuniformCatmullRom(c.z,h.z,p.z,f.z,m,d,b)}else this.curveType==="catmullrom"&&(vh.initCatmullRom(c.x,h.x,p.x,f.x,this.tension),yh.initCatmullRom(c.y,h.y,p.y,f.y,this.tension),bh.initCatmullRom(c.z,h.z,p.z,f.z,this.tension));return i.set(vh.calc(u),yh.calc(u),bh.calc(u)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new Q().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}xh.prototype.isCatmullRomCurve3=!0;function Dy(n,e,t,i,r){const s=(i-e)*.5,o=(r-t)*.5,l=n*n,u=n*l;return(2*t-2*i+s+o)*u+(-3*t+3*i-2*s-o)*l+s*n+t}function fO(n,e){const t=1-n;return t*t*e}function pO(n,e){return 2*(1-n)*n*e}function mO(n,e){return n*n*e}function wa(n,e,t,i){return fO(n,e)+pO(n,t)+mO(n,i)}function gO(n,e){const t=1-n;return t*t*t*e}function vO(n,e){const t=1-n;return 3*t*t*n*e}function yO(n,e){return 3*(1-n)*n*n*e}function bO(n,e){return n*n*n*e}function Ma(n,e,t,i,r){return gO(n,e)+vO(n,t)+yO(n,i)+bO(n,r)}class xc extends gn{constructor(e=new Ae,t=new Ae,i=new Ae,r=new Ae){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new Ae){const i=t,r=this.v0,s=this.v1,o=this.v2,l=this.v3;return i.set(Ma(e,r.x,s.x,o.x,l.x),Ma(e,r.y,s.y,o.y,l.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}xc.prototype.isCubicBezierCurve=!0;class wh extends gn{constructor(e=new Q,t=new Q,i=new Q,r=new Q){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new Q){const i=t,r=this.v0,s=this.v1,o=this.v2,l=this.v3;return i.set(Ma(e,r.x,s.x,o.x,l.x),Ma(e,r.y,s.y,o.y,l.y),Ma(e,r.z,s.z,o.z,l.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}wh.prototype.isCubicBezierCurve3=!0;class Aa extends gn{constructor(e=new Ae,t=new Ae){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Ae){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const i=t||new Ae;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Aa.prototype.isLineCurve=!0;class Vy extends gn{constructor(e=new Q,t=new Q){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new Q){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class wc extends gn{constructor(e=new Ae,t=new Ae,i=new Ae){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new Ae){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(wa(e,r.x,s.x,o.x),wa(e,r.y,s.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}wc.prototype.isQuadraticBezierCurve=!0;class Mh extends gn{constructor(e=new Q,t=new Q,i=new Q){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new Q){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(wa(e,r.x,s.x,o.x),wa(e,r.y,s.y,o.y),wa(e,r.z,s.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Mh.prototype.isQuadraticBezierCurve3=!0;class Mc extends gn{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new Ae){const i=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),l=s-o,u=r[o===0?o:o-1],c=r[o],f=r[o>r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set(Dy(l,u.x,c.x,f.x,h.x),Dy(l,u.y,c.y,f.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new Ae().fromArray(r))}return this}}Mc.prototype.isSplineCurve=!0;var Ah=Object.freeze({__proto__:null,ArcCurve:mh,CatmullRomCurve3:xh,CubicBezierCurve:xc,CubicBezierCurve3:wh,EllipseCurve:xa,LineCurve:Aa,LineCurve3:Vy,QuadraticBezierCurve:wc,QuadraticBezierCurve3:Mh,SplineCurve:Mc});const xO={triangulate:function(n,e,t=2){const i=e&&e.length,r=i?e[0]*t:n.length;let s=ky(n,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let l,u,c,f,h,p,v;if(i&&(s=_O(n,e,s,t)),n.length>80*t){l=c=n[0],u=f=n[1];for(let m=t;m<r;m+=t)h=n[m],p=n[m+1],h<l&&(l=h),p<u&&(u=p),h>c&&(c=h),p>f&&(f=p);v=Math.max(c-l,f-u),v=v!==0?1/v:0}return Sa(s,o,t,l,u,v),o}};function ky(n,e,t,i,r){let s,o;if(r===BO(n,e,t,i)>0)for(s=e;s<t;s+=i)o=Gy(s,n[s],n[s+1],o);else for(s=t-i;s>=e;s-=i)o=Gy(s,n[s],n[s+1],o);return o&&Ac(o,o.next)&&(Ta(o),o=o.next),o}function pr(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Ac(t,t.next)||ft(t.prev,t,t.next)===0)){if(Ta(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Sa(n,e,t,i,r,s,o){if(!n)return;!o&&s&&RO(n,i,r,s);let l=n,u,c;for(;n.prev!==n.next;){if(u=n.prev,c=n.next,s?MO(n,i,r,s):wO(n)){e.push(u.i/t),e.push(n.i/t),e.push(c.i/t),Ta(n),n=c.next,l=c.next;continue}if(n=c,n===l){o?o===1?(n=AO(pr(n),e,t),Sa(n,e,t,i,r,s,2)):o===2&&SO(n,e,t,i,r,s):Sa(pr(n),e,t,i,r,s,1);break}}}function wO(n){const e=n.prev,t=n,i=n.next;if(ft(e,t,i)>=0)return!1;let r=n.next.next;for(;r!==n.prev;){if(ro(e.x,e.y,t.x,t.y,i.x,i.y,r.x,r.y)&&ft(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function MO(n,e,t,i){const r=n.prev,s=n,o=n.next;if(ft(r,s,o)>=0)return!1;const l=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,u=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,c=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,f=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,h=Sh(l,u,e,t,i),p=Sh(c,f,e,t,i);let v=n.prevZ,m=n.nextZ;for(;v&&v.z>=h&&m&&m.z<=p;){if(v!==n.prev&&v!==n.next&&ro(r.x,r.y,s.x,s.y,o.x,o.y,v.x,v.y)&&ft(v.prev,v,v.next)>=0||(v=v.prevZ,m!==n.prev&&m!==n.next&&ro(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&ft(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;v&&v.z>=h;){if(v!==n.prev&&v!==n.next&&ro(r.x,r.y,s.x,s.y,o.x,o.y,v.x,v.y)&&ft(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;m&&m.z<=p;){if(m!==n.prev&&m!==n.next&&ro(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&ft(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function AO(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Ac(r,s)&&zy(r,i,i.next,s)&&_a(r,s)&&_a(s,r)&&(e.push(r.i/t),e.push(i.i/t),e.push(s.i/t),Ta(i),Ta(i.next),i=n=s),i=i.next}while(i!==n);return pr(i)}function SO(n,e,t,i,r,s){let o=n;do{let l=o.next.next;for(;l!==o.prev;){if(o.i!==l.i&&IO(o,l)){let u=Uy(o,l);o=pr(o,o.next),u=pr(u,u.next),Sa(o,e,t,i,r,s),Sa(u,e,t,i,r,s);return}l=l.next}o=o.next}while(o!==n)}function _O(n,e,t,i){const r=[];let s,o,l,u,c;for(s=0,o=e.length;s<o;s++)l=e[s]*i,u=s<o-1?e[s+1]*i:n.length,c=ky(n,l,u,i,!1),c===c.next&&(c.steiner=!0),r.push(PO(c));for(r.sort(TO),s=0;s<r.length;s++)EO(r[s],t),t=pr(t,t.next);return t}function TO(n,e){return n.x-e.x}function EO(n,e){if(e=CO(n,e),e){const t=Uy(e,n);pr(e,e.next),pr(t,t.next)}}function CO(n,e){let t=e;const i=n.x,r=n.y;let s=-1/0,o;do{if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const p=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=i&&p>s){if(s=p,p===i){if(r===t.y)return t;if(r===t.next.y)return t.next}o=t.x<t.next.x?t:t.next}}t=t.next}while(t!==e);if(!o)return null;if(i===s)return o;const l=o,u=o.x,c=o.y;let f=1/0,h;t=o;do i>=t.x&&t.x>=u&&i!==t.x&&ro(r<c?i:s,r,u,c,r<c?s:i,r,t.x,t.y)&&(h=Math.abs(r-t.y)/(i-t.x),_a(t,n)&&(h<f||h===f&&(t.x>o.x||t.x===o.x&&LO(o,t)))&&(o=t,f=h)),t=t.next;while(t!==l);return o}function LO(n,e){return ft(n.prev,n,e.prev)<0&&ft(e.next,n,n.next)<0}function RO(n,e,t,i){let r=n;do r.z===null&&(r.z=Sh(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,FO(r)}function FO(n){let e,t,i,r,s,o,l,u,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,l=0,e=0;e<c&&(l++,i=i.nextZ,!!i);e++);for(u=c;l>0||u>0&&i;)l!==0&&(u===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,l--):(r=i,i=i.nextZ,u--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function Sh(n,e,t,i,r){return n=32767*(n-t)*r,e=32767*(e-i)*r,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 PO(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function ro(n,e,t,i,r,s,o,l){return(r-o)*(e-l)-(n-o)*(s-l)>=0&&(n-o)*(i-l)-(t-o)*(e-l)>=0&&(t-o)*(s-l)-(r-o)*(i-l)>=0}function IO(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!OO(n,e)&&(_a(n,e)&&_a(e,n)&&NO(n,e)&&(ft(n.prev,n,e.prev)||ft(n,e.prev,e))||Ac(n,e)&&ft(n.prev,n,n.next)>0&&ft(e.prev,e,e.next)>0)}function ft(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Ac(n,e){return n.x===e.x&&n.y===e.y}function zy(n,e,t,i){const r=_c(ft(n,e,t)),s=_c(ft(n,e,i)),o=_c(ft(t,i,n)),l=_c(ft(t,i,e));return!!(r!==s&&o!==l||r===0&&Sc(n,t,e)||s===0&&Sc(n,i,e)||o===0&&Sc(t,n,i)||l===0&&Sc(t,e,i))}function Sc(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 _c(n){return n>0?1:n<0?-1:0}function OO(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&&zy(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function _a(n,e){return ft(n.prev,n,n.next)<0?ft(n,e,n.next)>=0&&ft(n,n.prev,e)>=0:ft(n,e,n.prev)<0||ft(n,n.next,e)<0}function NO(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function Uy(n,e){const t=new _h(n.i,n.x,n.y),i=new _h(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function Gy(n,e,t,i){const r=new _h(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Ta(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 _h(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function BO(n,e,t,i){let r=0;for(let s=e,o=t-i;s<t;s+=i)r+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return r}class ni{static area(e){const t=e.length;let i=0;for(let r=t-1,s=0;s<t;r=s++)i+=e[r].x*e[s].y-e[s].x*e[r].y;return i*.5}static isClockWise(e){return ni.area(e)<0}static triangulateShape(e,t){const i=[],r=[],s=[];Hy(e),Wy(i,e);let o=e.length;t.forEach(Hy);for(let u=0;u<t.length;u++)r.push(o),o+=t[u].length,Wy(i,t[u]);const l=xO.triangulate(i,r);for(let u=0;u<l.length;u+=3)s.push(l.slice(u,u+3));return s}}function Hy(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function Wy(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class Dn extends ke{constructor(e,t){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,r=[],s=[];for(let l=0,u=e.length;l<u;l++){const c=e[l];o(c)}this.setAttribute("position",new Pe(r,3)),this.setAttribute("uv",new Pe(s,2)),this.computeVertexNormals();function o(l){const u=[],c=t.curveSegments!==void 0?t.curveSegments:12,f=t.steps!==void 0?t.steps:1;let h=t.depth!==void 0?t.depth:100,p=t.bevelEnabled!==void 0?t.bevelEnabled:!0,v=t.bevelThickness!==void 0?t.bevelThickness:6,m=t.bevelSize!==void 0?t.bevelSize:v-2,d=t.bevelOffset!==void 0?t.bevelOffset:0,b=t.bevelSegments!==void 0?t.bevelSegments:3;const y=t.extrudePath,g=t.UVGenerator!==void 0?t.UVGenerator:DO;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),h=t.amount);let w,A=!1,S,M,F,R;y&&(w=y.getSpacedPoints(f),A=!0,p=!1,S=y.computeFrenetFrames(f,!1),M=new Q,F=new Q,R=new Q),p||(b=0,v=0,m=0,d=0);const T=l.extractPoints(c);let P=T.shape;const _=T.holes;if(!ni.isClockWise(P)){P=P.reverse();for(let z=0,W=_.length;z<W;z++){const q=_[z];ni.isClockWise(q)&&(_[z]=q.reverse())}}const C=ni.triangulateShape(P,_),L=P;for(let z=0,W=_.length;z<W;z++){const q=_[z];P=P.concat(q)}function I(z,W,q){return W||console.error("THREE.ExtrudeGeometry: vec does not exist"),W.clone().multiplyScalar(q).add(z)}const x=P.length,O=C.length;function B(z,W,q){let le,oe,U;const N=z.x-W.x,X=z.y-W.y,Y=q.x-z.x,ie=q.y-z.y,ue=N*N+X*X,me=N*ie-X*Y;if(Math.abs(me)>Number.EPSILON){const be=Math.sqrt(ue),ce=Math.sqrt(Y*Y+ie*ie),ge=W.x-X/be,re=W.y+N/be,he=q.x-ie/ce,ve=q.y+Y/ce,Ee=((he-ge)*ie-(ve-re)*Y)/(N*ie-X*Y);le=ge+N*Ee-z.x,oe=re+X*Ee-z.y;const _e=le*le+oe*oe;if(_e<=2)return new Ae(le,oe);U=Math.sqrt(_e/2)}else{let be=!1;N>Number.EPSILON?Y>Number.EPSILON&&(be=!0):N<-Number.EPSILON?Y<-Number.EPSILON&&(be=!0):Math.sign(X)===Math.sign(ie)&&(be=!0),be?(le=-X,oe=N,U=Math.sqrt(ue)):(le=N,oe=X,U=Math.sqrt(ue/2))}return new Ae(le/U,oe/U)}const D=[];for(let z=0,W=L.length,q=W-1,le=z+1;z<W;z++,q++,le++)q===W&&(q=0),le===W&&(le=0),D[z]=B(L[z],L[q],L[le]);const k=[];let V,G=D.concat();for(let z=0,W=_.length;z<W;z++){const q=_[z];V=[];for(let le=0,oe=q.length,U=oe-1,N=le+1;le<oe;le++,U++,N++)U===oe&&(U=0),N===oe&&(N=0),V[le]=B(q[le],q[U],q[N]);k.push(V),G=G.concat(V)}for(let z=0;z<b;z++){const W=z/b,q=v*Math.cos(W*Math.PI/2),le=m*Math.sin(W*Math.PI/2)+d;for(let oe=0,U=L.length;oe<U;oe++){const N=I(L[oe],D[oe],le);ae(N.x,N.y,-q)}for(let oe=0,U=_.length;oe<U;oe++){const N=_[oe];V=k[oe];for(let X=0,Y=N.length;X<Y;X++){const ie=I(N[X],V[X],le);ae(ie.x,ie.y,-q)}}}const J=m+d;for(let z=0;z<x;z++){const W=p?I(P[z],G[z],J):P[z];A?(F.copy(S.normals[0]).multiplyScalar(W.x),M.copy(S.binormals[0]).multiplyScalar(W.y),R.copy(w[0]).add(F).add(M),ae(R.x,R.y,R.z)):ae(W.x,W.y,0)}for(let z=1;z<=f;z++)for(let W=0;W<x;W++){const q=p?I(P[W],G[W],J):P[W];A?(F.copy(S.normals[z]).multiplyScalar(q.x),M.copy(S.binormals[z]).multiplyScalar(q.y),R.copy(w[z]).add(F).add(M),ae(R.x,R.y,R.z)):ae(q.x,q.y,h/f*z)}for(let z=b-1;z>=0;z--){const W=z/b,q=v*Math.cos(W*Math.PI/2),le=m*Math.sin(W*Math.PI/2)+d;for(let oe=0,U=L.length;oe<U;oe++){const N=I(L[oe],D[oe],le);ae(N.x,N.y,h+q)}for(let oe=0,U=_.length;oe<U;oe++){const N=_[oe];V=k[oe];for(let X=0,Y=N.length;X<Y;X++){const ie=I(N[X],V[X],le);A?ae(ie.x,ie.y+w[f-1].y,w[f-1].x+q):ae(ie.x,ie.y,h+q)}}}j(),te();function j(){const z=r.length/3;if(p){let W=0,q=x*W;for(let le=0;le<O;le++){const oe=C[le];H(oe[2]+q,oe[1]+q,oe[0]+q)}W=f+b*2,q=x*W;for(let le=0;le<O;le++){const oe=C[le];H(oe[0]+q,oe[1]+q,oe[2]+q)}}else{for(let W=0;W<O;W++){const q=C[W];H(q[2],q[1],q[0])}for(let W=0;W<O;W++){const q=C[W];H(q[0]+x*f,q[1]+x*f,q[2]+x*f)}}i.addGroup(z,r.length/3-z,0)}function te(){const z=r.length/3;let W=0;ee(L,W),W+=L.length;for(let q=0,le=_.length;q<le;q++){const oe=_[q];ee(oe,W),W+=oe.length}i.addGroup(z,r.length/3-z,1)}function ee(z,W){let q=z.length;for(;--q>=0;){const le=q;let oe=q-1;oe<0&&(oe=z.length-1);for(let U=0,N=f+b*2;U<N;U++){const X=x*U,Y=x*(U+1),ie=W+le+X,ue=W+oe+X,me=W+oe+Y,be=W+le+Y;Z(ie,ue,me,be)}}}function ae(z,W,q){u.push(z),u.push(W),u.push(q)}function H(z,W,q){$(z),$(W),$(q);const le=r.length/3,oe=g.generateTopUV(i,r,le-3,le-2,le-1);se(oe[0]),se(oe[1]),se(oe[2])}function Z(z,W,q,le){$(z),$(W),$(le),$(W),$(q),$(le);const oe=r.length/3,U=g.generateSideWallUV(i,r,oe-6,oe-3,oe-2,oe-1);se(U[0]),se(U[1]),se(U[3]),se(U[1]),se(U[2]),se(U[3])}function $(z){r.push(u[z*3+0]),r.push(u[z*3+1]),r.push(u[z*3+2])}function se(z){s.push(z.x),s.push(z.y)}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return VO(t,i,e)}static fromJSON(e,t){const i=[];for(let s=0,o=e.shapes.length;s<o;s++){const l=t[e.shapes[s]];i.push(l)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new Ah[r.type]().fromJSON(r)),new Dn(i,e.options)}}const DO={generateTopUV:function(n,e,t,i,r){const s=e[t*3],o=e[t*3+1],l=e[i*3],u=e[i*3+1],c=e[r*3],f=e[r*3+1];return[new Ae(s,o),new Ae(l,u),new Ae(c,f)]},generateSideWallUV:function(n,e,t,i,r,s){const o=e[t*3],l=e[t*3+1],u=e[t*3+2],c=e[i*3],f=e[i*3+1],h=e[i*3+2],p=e[r*3],v=e[r*3+1],m=e[r*3+2],d=e[s*3],b=e[s*3+1],y=e[s*3+2];return Math.abs(l-f)<Math.abs(o-c)?[new Ae(o,1-u),new Ae(c,1-h),new Ae(p,1-m),new Ae(d,1-y)]:[new Ae(l,1-u),new Ae(f,1-h),new Ae(v,1-m),new Ae(b,1-y)]}};function VO(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,r=n.length;i<r;i++){const s=n[i];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class so extends ti{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new so(e.radius,e.detail)}}class oo extends ke{constructor(e,t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=$t(r,0,Math.PI*2);const s=[],o=[],l=[],u=1/t,c=new Q,f=new Ae;for(let h=0;h<=t;h++){const p=i+h*u*r,v=Math.sin(p),m=Math.cos(p);for(let d=0;d<=e.length-1;d++)c.x=e[d].x*v,c.y=e[d].y,c.z=e[d].x*m,o.push(c.x,c.y,c.z),f.x=h/t,f.y=d/(e.length-1),l.push(f.x,f.y)}for(let h=0;h<t;h++)for(let p=0;p<e.length-1;p++){const v=p+h*e.length,m=v,d=v+e.length,b=v+e.length+1,y=v+1;s.push(m,d,y),s.push(d,b,y)}if(this.setIndex(s),this.setAttribute("position",new Pe(o,3)),this.setAttribute("uv",new Pe(l,2)),this.computeVertexNormals(),r===Math.PI*2){const h=this.attributes.normal.array,p=new Q,v=new Q,m=new Q,d=t*e.length*3;for(let b=0,y=0;b<e.length;b++,y+=3)p.x=h[y+0],p.y=h[y+1],p.z=h[y+2],v.x=h[d+y+0],v.y=h[d+y+1],v.z=h[d+y+2],m.addVectors(p,v).normalize(),h[y+0]=h[d+y+0]=m.x,h[y+1]=h[d+y+1]=m.y,h[y+2]=h[d+y+2]=m.z}}static fromJSON(e){return new oo(e.points,e.segments,e.phiStart,e.phiLength)}}class Wr extends ti{constructor(e=1,t=0){const i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(i,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Wr(e.radius,e.detail)}}class Tc extends ke{constructor(e,t,i){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:i};const r=[],s=[],o=[],l=[],u=1e-5,c=new Q,f=new Q,h=new Q,p=new Q,v=new Q;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const m=t+1;for(let d=0;d<=i;d++){const b=d/i;for(let y=0;y<=t;y++){const g=y/t;e(g,b,f),s.push(f.x,f.y,f.z),g-u>=0?(e(g-u,b,h),p.subVectors(f,h)):(e(g+u,b,h),p.subVectors(h,f)),b-u>=0?(e(g,b-u,h),v.subVectors(f,h)):(e(g,b+u,h),v.subVectors(h,f)),c.crossVectors(p,v).normalize(),o.push(c.x,c.y,c.z),l.push(g,b)}}for(let d=0;d<i;d++)for(let b=0;b<t;b++){const y=d*m+b,g=d*m+b+1,w=(d+1)*m+b+1,A=(d+1)*m+b;r.push(y,g,A),r.push(g,w,A)}this.setIndex(r),this.setAttribute("position",new Pe(s,3)),this.setAttribute("normal",new Pe(o,3)),this.setAttribute("uv",new Pe(l,2))}}class ao extends ke{constructor(e=.5,t=1,i=8,r=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:s,thetaLength:o},i=Math.max(3,i),r=Math.max(1,r);const l=[],u=[],c=[],f=[];let h=e;const p=(t-e)/r,v=new Q,m=new Ae;for(let d=0;d<=r;d++){for(let b=0;b<=i;b++){const y=s+b/i*o;v.x=h*Math.cos(y),v.y=h*Math.sin(y),u.push(v.x,v.y,v.z),c.push(0,0,1),m.x=(v.x/t+1)/2,m.y=(v.y/t+1)/2,f.push(m.x,m.y)}h+=p}for(let d=0;d<r;d++){const b=d*(i+1);for(let y=0;y<i;y++){const g=y+b,w=g,A=g+i+1,S=g+i+2,M=g+1;l.push(w,A,M),l.push(A,S,M)}}this.setIndex(l),this.setAttribute("position",new Pe(u,3)),this.setAttribute("normal",new Pe(c,3)),this.setAttribute("uv",new Pe(f,2))}static fromJSON(e){return new ao(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class jr extends ke{constructor(e,t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],r=[],s=[],o=[];let l=0,u=0;if(Array.isArray(e)===!1)c(e);else for(let f=0;f<e.length;f++)c(e[f]),this.addGroup(l,u,f),l+=u,u=0;this.setIndex(i),this.setAttribute("position",new Pe(r,3)),this.setAttribute("normal",new Pe(s,3)),this.setAttribute("uv",new Pe(o,2));function c(f){const h=r.length/3,p=f.extractPoints(t);let v=p.shape;const m=p.holes;ni.isClockWise(v)===!1&&(v=v.reverse());for(let b=0,y=m.length;b<y;b++){const g=m[b];ni.isClockWise(g)===!0&&(m[b]=g.reverse())}const d=ni.triangulateShape(v,m);for(let b=0,y=m.length;b<y;b++){const g=m[b];v=v.concat(g)}for(let b=0,y=v.length;b<y;b++){const g=v[b];r.push(g.x,g.y,0),s.push(0,0,1),o.push(g.x,g.y)}for(let b=0,y=d.length;b<y;b++){const g=d[b],w=g[0]+h,A=g[1]+h,S=g[2]+h;i.push(w,A,S),u+=3}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return kO(t,e)}static fromJSON(e,t){const i=[];for(let r=0,s=e.shapes.length;r<s;r++){const o=t[e.shapes[r]];i.push(o)}return new jr(i,e.curveSegments)}}function kO(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const r=n[t];e.shapes.push(r.uuid)}else e.shapes.push(n.uuid);return e}class $r extends ke{constructor(e=1,t=8,i=6,r=0,s=Math.PI*2,o=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:s,thetaStart:o,thetaLength:l},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const u=Math.min(o+l,Math.PI);let c=0;const f=[],h=new Q,p=new Q,v=[],m=[],d=[],b=[];for(let y=0;y<=i;y++){const g=[],w=y/i;let A=0;y==0&&o==0?A=.5/t:y==i&&u==Math.PI&&(A=-.5/t);for(let S=0;S<=t;S++){const M=S/t;h.x=-e*Math.cos(r+M*s)*Math.sin(o+w*l),h.y=e*Math.cos(o+w*l),h.z=e*Math.sin(r+M*s)*Math.sin(o+w*l),m.push(h.x,h.y,h.z),p.copy(h).normalize(),d.push(p.x,p.y,p.z),b.push(M+A,1-w),g.push(c++)}f.push(g)}for(let y=0;y<i;y++)for(let g=0;g<t;g++){const w=f[y][g+1],A=f[y][g],S=f[y+1][g],M=f[y+1][g+1];(y!==0||o>0)&&v.push(w,A,M),(y!==i-1||u<Math.PI)&&v.push(A,S,M)}this.setIndex(v),this.setAttribute("position",new Pe(m,3)),this.setAttribute("normal",new Pe(d,3)),this.setAttribute("uv",new Pe(b,2))}static fromJSON(e){return new $r(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class lo extends ti{constructor(e=1,t=0){const i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(i,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new lo(e.radius,e.detail)}}class Ec extends Dn{constructor(e,t={}){const i=t.font;if(!(i&&i.isFont))return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ke;const r=i.generateShapes(e,t.size);t.depth=t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(r,t),this.type="TextGeometry"}}class co extends ke{constructor(e=1,t=.4,i=8,r=6,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:s},i=Math.floor(i),r=Math.floor(r);const o=[],l=[],u=[],c=[],f=new Q,h=new Q,p=new Q;for(let v=0;v<=i;v++)for(let m=0;m<=r;m++){const d=m/r*s,b=v/i*Math.PI*2;h.x=(e+t*Math.cos(b))*Math.cos(d),h.y=(e+t*Math.cos(b))*Math.sin(d),h.z=t*Math.sin(b),l.push(h.x,h.y,h.z),f.x=e*Math.cos(d),f.y=e*Math.sin(d),p.subVectors(h,f).normalize(),u.push(p.x,p.y,p.z),c.push(m/r),c.push(v/i)}for(let v=1;v<=i;v++)for(let m=1;m<=r;m++){const d=(r+1)*v+m-1,b=(r+1)*(v-1)+m-1,y=(r+1)*(v-1)+m,g=(r+1)*v+m;o.push(d,b,g),o.push(b,y,g)}this.setIndex(o),this.setAttribute("position",new Pe(l,3)),this.setAttribute("normal",new Pe(u,3)),this.setAttribute("uv",new Pe(c,2))}static fromJSON(e){return new co(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class uo extends ke{constructor(e=1,t=.4,i=64,r=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:s,q:o},i=Math.floor(i),r=Math.floor(r);const l=[],u=[],c=[],f=[],h=new Q,p=new Q,v=new Q,m=new Q,d=new Q,b=new Q,y=new Q;for(let w=0;w<=i;++w){const A=w/i*s*Math.PI*2;g(A,s,o,e,v),g(A+.01,s,o,e,m),b.subVectors(m,v),y.addVectors(m,v),d.crossVectors(b,y),y.crossVectors(d,b),d.normalize(),y.normalize();for(let S=0;S<=r;++S){const M=S/r*Math.PI*2,F=-t*Math.cos(M),R=t*Math.sin(M);h.x=v.x+(F*y.x+R*d.x),h.y=v.y+(F*y.y+R*d.y),h.z=v.z+(F*y.z+R*d.z),u.push(h.x,h.y,h.z),p.subVectors(h,v).normalize(),c.push(p.x,p.y,p.z),f.push(w/i),f.push(S/r)}}for(let w=1;w<=i;w++)for(let A=1;A<=r;A++){const S=(r+1)*(w-1)+(A-1),M=(r+1)*w+(A-1),F=(r+1)*w+A,R=(r+1)*(w-1)+A;l.push(S,M,R),l.push(M,F,R)}this.setIndex(l),this.setAttribute("position",new Pe(u,3)),this.setAttribute("normal",new Pe(c,3)),this.setAttribute("uv",new Pe(f,2));function g(w,A,S,M,F){const R=Math.cos(w),T=Math.sin(w),P=S/A*w,_=Math.cos(P);F.x=M*(2+_)*.5*R,F.y=M*(2+_)*T*.5,F.z=M*Math.sin(P)*.5}}static fromJSON(e){return new uo(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class ho extends ke{constructor(e,t=64,i=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const l=new Q,u=new Q,c=new Ae;let f=new Q;const h=[],p=[],v=[],m=[];d(),this.setIndex(m),this.setAttribute("position",new Pe(h,3)),this.setAttribute("normal",new Pe(p,3)),this.setAttribute("uv",new Pe(v,2));function d(){for(let w=0;w<t;w++)b(w);b(s===!1?t:0),g(),y()}function b(w){f=e.getPointAt(w/t,f);const A=o.normals[w],S=o.binormals[w];for(let M=0;M<=r;M++){const F=M/r*Math.PI*2,R=Math.sin(F),T=-Math.cos(F);u.x=T*A.x+R*S.x,u.y=T*A.y+R*S.y,u.z=T*A.z+R*S.z,u.normalize(),p.push(u.x,u.y,u.z),l.x=f.x+i*u.x,l.y=f.y+i*u.y,l.z=f.z+i*u.z,h.push(l.x,l.y,l.z)}}function y(){for(let w=1;w<=t;w++)for(let A=1;A<=r;A++){const S=(r+1)*(w-1)+(A-1),M=(r+1)*w+(A-1),F=(r+1)*w+A,R=(r+1)*(w-1)+A;m.push(S,M,R),m.push(M,F,R)}}function g(){for(let w=0;w<=t;w++)for(let A=0;A<=r;A++)c.x=w/t,c.y=A/r,v.push(c.x,c.y)}}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new ho(new Ah[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class Th extends ke{constructor(e){if(super(),this.type="WireframeGeometry",e.isGeometry===!0){console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return}const t=[],i=[0,0],r={},s=new Q;if(e.index!==null){const o=e.attributes.position,l=e.index;let u=e.groups;u.length===0&&(u=[{start:0,count:l.count,materialIndex:0}]);for(let c=0,f=u.length;c<f;++c){const h=u[c],p=h.start,v=h.count;for(let m=p,d=p+v;m<d;m+=3)for(let b=0;b<3;b++){const y=l.getX(m+b),g=l.getX(m+(b+1)%3);i[0]=Math.min(y,g),i[1]=Math.max(y,g);const w=i[0]+","+i[1];r[w]===void 0&&(r[w]={index1:i[0],index2:i[1]})}}for(const c in r){const f=r[c];s.fromBufferAttribute(o,f.index1),t.push(s.x,s.y,s.z),s.fromBufferAttribute(o,f.index2),t.push(s.x,s.y,s.z)}}else{const o=e.attributes.position;for(let l=0,u=o.count/3;l<u;l++)for(let c=0;c<3;c++){const f=3*l+c;s.fromBufferAttribute(o,f),t.push(s.x,s.y,s.z);const h=3*l+(c+1)%3;s.fromBufferAttribute(o,h),t.push(s.x,s.y,s.z)}}this.setAttribute("position",new Pe(t,3))}}var jy=Object.freeze({__proto__:null,BoxGeometry:Li,BoxBufferGeometry:Li,CircleGeometry:to,CircleBufferGeometry:to,ConeGeometry:no,ConeBufferGeometry:no,CylinderGeometry:fr,CylinderBufferGeometry:fr,DodecahedronGeometry:io,DodecahedronBufferGeometry:io,EdgesGeometry:ph,ExtrudeGeometry:Dn,ExtrudeBufferGeometry:Dn,IcosahedronGeometry:so,IcosahedronBufferGeometry:so,LatheGeometry:oo,LatheBufferGeometry:oo,OctahedronGeometry:Wr,OctahedronBufferGeometry:Wr,ParametricGeometry:Tc,ParametricBufferGeometry:Tc,PlaneGeometry:Gr,PlaneBufferGeometry:Gr,PolyhedronGeometry:ti,PolyhedronBufferGeometry:ti,RingGeometry:ao,RingBufferGeometry:ao,ShapeGeometry:jr,ShapeBufferGeometry:jr,SphereGeometry:$r,SphereBufferGeometry:$r,TetrahedronGeometry:lo,TetrahedronBufferGeometry:lo,TextGeometry:Ec,TextBufferGeometry:Ec,TorusGeometry:co,TorusBufferGeometry:co,TorusKnotGeometry:uo,TorusKnotBufferGeometry:uo,TubeGeometry:ho,TubeBufferGeometry:ho,WireframeGeometry:Th});class Eh extends Ft{constructor(e){super(),this.type="ShadowMaterial",this.color=new Le(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}Eh.prototype.isShadowMaterial=!0;class fo extends Ri{constructor(e){super(e),this.type="RawShaderMaterial"}}fo.prototype.isRawShaderMaterial=!0;class Zr extends Ft{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Le(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=er,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,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.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this}}Zr.prototype.isMeshStandardMaterial=!0;class Ea extends Zr{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ae(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(t){this.reflectivity=$t(2.5*(t-1)/(t+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new Le(1,1,1),this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},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.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new Le).copy(e.sheen):this.sheen=null,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}}Ea.prototype.isMeshPhysicalMaterial=!0;class Ch extends Ft{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new Le(16777215),this.specular=new Le(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=er,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Wo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,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.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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Ch.prototype.isMeshPhongMaterial=!0;class Lh extends Ft{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Le(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=er,this.normalScale=new Ae(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.morphTargets=!1,this.morphNormals=!1,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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}Lh.prototype.isMeshToonMaterial=!0;class Rh extends Ft{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=er,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.morphTargets=!1,this.morphNormals=!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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Rh.prototype.isMeshNormalMaterial=!0;class Fh extends Ft{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new Le(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Wo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}Fh.prototype.isMeshLambertMaterial=!0;class Ph extends Ft{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Le(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=er,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Ph.prototype.isMeshMatcapMaterial=!0;class Ih extends Vt{constructor(e){super(),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}}Ih.prototype.isLineDashedMaterial=!0;var zO=Object.freeze({__proto__:null,ShadowMaterial:Eh,SpriteMaterial:da,RawShaderMaterial:fo,ShaderMaterial:Ri,PointsMaterial:hr,MeshPhysicalMaterial:Ea,MeshStandardMaterial:Zr,MeshPhongMaterial:Ch,MeshToonMaterial:Lh,MeshNormalMaterial:Rh,MeshLambertMaterial:Fh,MeshDepthMaterial:rc,MeshDistanceMaterial:sc,MeshBasicMaterial:cn,MeshMatcapMaterial:Ph,LineDashedMaterial:Ih,LineBasicMaterial:Vt,Material:Ft});const ut={arraySlice:function(n,e,t){return ut.isTypedArray(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)},convertArray:function(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)},isTypedArray:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},getKeyframeOrder:function(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i},sortedArray:function(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const l=t[s]*e;for(let u=0;u!==e;++u)r[o++]=n[l+u]}return r},flattenJSON:function(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)},subclip:function(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let u=0;u<s.tracks.length;++u){const c=s.tracks[u],f=c.getValueSize(),h=[],p=[];for(let v=0;v<c.times.length;++v){const m=c.times[v]*r;if(!(m<t||m>=i)){h.push(c.times[v]);for(let d=0;d<f;++d)p.push(c.values[v*f+d])}}h.length!==0&&(c.times=ut.convertArray(h,c.times.constructor),c.values=ut.convertArray(p,c.values.constructor),o.push(c))}s.tracks=o;let l=1/0;for(let u=0;u<s.tracks.length;++u)l>s.tracks[u].times[0]&&(l=s.tracks[u].times[0]);for(let u=0;u<s.tracks.length;++u)s.tracks[u].shift(-1*l);return s.resetDuration(),s},makeClipAdditive:function(n,e=0,t=n,i=30){i<=0&&(i=30);const r=t.tracks.length,s=e/i;for(let o=0;o<r;++o){const l=t.tracks[o],u=l.ValueTypeName;if(u==="bool"||u==="string")continue;const c=n.tracks.find(function(y){return y.name===l.name&&y.ValueTypeName===u});if(c===void 0)continue;let f=0;const h=l.getValueSize();l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(f=h/3);let p=0;const v=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=v/3);const m=l.times.length-1;let d;if(s<=l.times[0]){const y=f,g=h-f;d=ut.arraySlice(l.values,y,g)}else if(s>=l.times[m]){const y=m*h+f,g=y+h-f;d=ut.arraySlice(l.values,y,g)}else{const y=l.createInterpolant(),g=f,w=h-f;y.evaluate(s),d=ut.arraySlice(y.resultBuffer,g,w)}u==="quaternion"&&new Zt().fromArray(d).normalize().conjugate().toArray(d);const b=c.times.length;for(let y=0;y<b;++y){const g=y*v+p;if(u==="quaternion")Zt.multiplyQuaternionsFlat(c.values,g,d,0,c.values,g);else{const w=v-p*2;for(let A=0;A<w;++A)c.values[g+A]-=d[A]}}}return n.blendMode=Md,n}};class ii{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,r=t[i],s=t[i-1];e:{t:{let o;n:{i:if(!(e<r)){for(let l=i+2;;){if(r===void 0){if(e<s)break i;return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,e,s)}if(i===l)break;if(s=r,r=t[++i],e<r)break t}o=t.length;break n}if(!(e>=s)){const l=t[1];e<l&&(i=2,s=l);for(let u=i-2;;){if(s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(i===u)break;if(r=s,s=t[--i-1],e>=s)break t}o=i,i=0;break n}break e}for(;i<o;){const l=i+o>>>1;e<t[l]?o=l:i=l+1}if(r=t[i],s=t[i-1],s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(r===void 0)return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,s,e)}this._cachedIndex=i,this.intervalChanged_(i,s,r)}return this.interpolate_(i,s,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r;for(let o=0;o!==r;++o)t[o]=i[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}ii.prototype.beforeStart_=ii.prototype.copySampleValue_,ii.prototype.afterEnd_=ii.prototype.copySampleValue_;class $y extends ii{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Or,endingEnd:Or}}intervalChanged_(e,t,i){const r=this.parameterPositions;let s=e-2,o=e+1,l=r[s],u=r[o];if(l===void 0)switch(this.getSettings_().endingStart){case Nr:s=e,l=2*t-i;break;case qo:s=r.length-2,l=t+r[s]-r[s+1];break;default:s=e,l=i}if(u===void 0)switch(this.getSettings_().endingEnd){case Nr:o=e,u=2*i-t;break;case qo:o=1,u=i+r[1]-r[0];break;default:o=e-1,u=t}const c=(i-t)*.5,f=this.valueSize;this._weightPrev=c/(t-l),this._weightNext=c/(u-i),this._offsetPrev=s*f,this._offsetNext=o*f}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,c=u-l,f=this._offsetPrev,h=this._offsetNext,p=this._weightPrev,v=this._weightNext,m=(i-t)/(r-t),d=m*m,b=d*m,y=-p*b+2*p*d-p*m,g=(1+p)*b+(-1.5-2*p)*d+(-.5+p)*m+1,w=(-1-v)*b+(1.5+v)*d+.5*m,A=v*b-v*d;for(let S=0;S!==l;++S)s[S]=y*o[f+S]+g*o[c+S]+w*o[u+S]+A*o[h+S];return s}}class Oh extends ii{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,c=u-l,f=(i-t)/(r-t),h=1-f;for(let p=0;p!==l;++p)s[p]=o[c+p]*h+o[u+p]*f;return s}}class Zy extends ii{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Vn{constructor(e,t,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=ut.convertArray(t,this.TimeBufferType),this.values=ut.convertArray(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:ut.convertArray(e.times,Array),values:ut.convertArray(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new Zy(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Oh(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new $y(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Rs:t=this.InterpolantFactoryMethodDiscrete;break;case Ir:t=this.InterpolantFactoryMethodLinear;break;case Fl:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Rs;case this.InterpolantFactoryMethodLinear:return Ir;case this.InterpolantFactoryMethodSmooth:return Fl}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){const i=this.times,r=i.length;let s=0,o=r-1;for(;s!==r&&i[s]<e;)++s;for(;o!==-1&&i[o]>t;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const l=this.getValueSize();this.times=ut.arraySlice(i,s,o),this.values=ut.arraySlice(this.values,s*l,o*l)}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,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let l=0;l!==s;l++){const u=i[l];if(typeof u=="number"&&isNaN(u)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,l,u),e=!1;break}if(o!==null&&o>u){console.error("THREE.KeyframeTrack: Out of order keys.",this,l,u,o),e=!1;break}o=u}if(r!==void 0&&ut.isTypedArray(r))for(let l=0,u=r.length;l!==u;++l){const c=r[l];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,c),e=!1;break}}return e}optimize(){const e=ut.arraySlice(this.times),t=ut.arraySlice(this.values),i=this.getValueSize(),r=this.getInterpolation()===Fl,s=e.length-1;let o=1;for(let l=1;l<s;++l){let u=!1;const c=e[l],f=e[l+1];if(c!==f&&(l!==1||c!==e[0]))if(r)u=!0;else{const h=l*i,p=h-i,v=h+i;for(let m=0;m!==i;++m){const d=t[h+m];if(d!==t[p+m]||d!==t[v+m]){u=!0;break}}}if(u){if(l!==o){e[o]=e[l];const h=l*i,p=o*i;for(let v=0;v!==i;++v)t[p+v]=t[h+v]}++o}}if(s>0){e[o]=e[s];for(let l=s*i,u=o*i,c=0;c!==i;++c)t[u+c]=t[l+c];++o}return o!==e.length?(this.times=ut.arraySlice(e,0,o),this.values=ut.arraySlice(t,0,o*i)):(this.times=e,this.values=t),this}clone(){const e=ut.arraySlice(this.times,0),t=ut.arraySlice(this.values,0),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Vn.prototype.TimeBufferType=Float32Array,Vn.prototype.ValueBufferType=Float32Array,Vn.prototype.DefaultInterpolation=Ir;class Xr extends Vn{}Xr.prototype.ValueTypeName="bool",Xr.prototype.ValueBufferType=Array,Xr.prototype.DefaultInterpolation=Rs,Xr.prototype.InterpolantFactoryMethodLinear=void 0,Xr.prototype.InterpolantFactoryMethodSmooth=void 0;class Nh extends Vn{}Nh.prototype.ValueTypeName="color";class po extends Vn{}po.prototype.ValueTypeName="number";class Xy extends ii{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=(i-t)/(r-t);let c=e*l;for(let f=c+l;c!==f;c+=4)Zt.slerpFlat(s,0,o,c-l,o,c,u);return s}}class Yr extends Vn{InterpolantFactoryMethodLinear(e){return new Xy(this.times,this.values,this.getValueSize(),e)}}Yr.prototype.ValueTypeName="quaternion",Yr.prototype.DefaultInterpolation=Ir,Yr.prototype.InterpolantFactoryMethodSmooth=void 0;class Jr extends Vn{}Jr.prototype.ValueTypeName="string",Jr.prototype.ValueBufferType=Array,Jr.prototype.DefaultInterpolation=Rs,Jr.prototype.InterpolantFactoryMethodLinear=void 0,Jr.prototype.InterpolantFactoryMethodSmooth=void 0;class mo extends Vn{}mo.prototype.ValueTypeName="vector";class go{constructor(e,t=-1,i,r=Pl){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=fn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,l=i.length;o!==l;++o)t.push(GO(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Vn.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let l=0;l<s;l++){let u=[],c=[];u.push((l+s-1)%s,l,(l+1)%s),c.push(0,1,0);const f=ut.getKeyframeOrder(u);u=ut.sortedArray(u,1,f),c=ut.sortedArray(c,1,f),!r&&u[0]===0&&(u.push(s),c.push(c[0])),o.push(new po(".morphTargetInfluences["+t[l].name+"]",u,c).scale(1/i))}return new this(e,-1,o)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const r={},s=/^([\w-]*?)([\d]+)$/;for(let l=0,u=e.length;l<u;l++){const c=e[l],f=c.name.match(s);if(f&&f.length>1){const h=f[1];let p=r[h];p||(r[h]=p=[]),p.push(c)}}const o=[];for(const l in r)o.push(this.CreateFromMorphTargetSequence(l,r[l],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,p,v,m,d){if(v.length!==0){const b=[],y=[];ut.flattenJSON(v,b,y,m),b.length!==0&&d.push(new h(p,b,y))}},r=[],s=e.name||"default",o=e.fps||30,l=e.blendMode;let u=e.length||-1;const c=e.hierarchy||[];for(let h=0;h<c.length;h++){const p=c[h].keys;if(!(!p||p.length===0))if(p[0].morphTargets){const v={};let m;for(m=0;m<p.length;m++)if(p[m].morphTargets)for(let d=0;d<p[m].morphTargets.length;d++)v[p[m].morphTargets[d]]=-1;for(const d in v){const b=[],y=[];for(let g=0;g!==p[m].morphTargets.length;++g){const w=p[m];b.push(w.time),y.push(w.morphTarget===d?1:0)}r.push(new po(".morphTargetInfluence["+d+"]",b,y))}u=v.length*(o||1)}else{const v=".bones["+t[h].name+"]";i(mo,v+".position",p,"pos",r),i(Yr,v+".quaternion",p,"rot",r),i(mo,v+".scale",p,"scl",r)}}return r.length===0?null:new this(s,u,r,l)}resetDuration(){const e=this.tracks;let t=0;for(let i=0,r=e.length;i!==r;++i){const s=this.tracks[i];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function UO(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return po;case"vector":case"vector2":case"vector3":case"vector4":return mo;case"color":return Nh;case"quaternion":return Yr;case"bool":case"boolean":return Xr;case"string":return Jr}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function GO(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=UO(n.type);if(n.times===void 0){const t=[],i=[];ut.flattenJSON(n.keys,t,i,"value"),n.times=t,n.values=i}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const Kr={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class Bh{constructor(e,t,i){const r=this;let s=!1,o=0,l=0,u;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(f){l++,s===!1&&r.onStart!==void 0&&r.onStart(f,o,l),s=!0},this.itemEnd=function(f){o++,r.onProgress!==void 0&&r.onProgress(f,o,l),o===l&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(f){r.onError!==void 0&&r.onError(f)},this.resolveURL=function(f){return u?u(f):f},this.setURLModifier=function(f){return u=f,this},this.addHandler=function(f,h){return c.push(f,h),this},this.removeHandler=function(f){const h=c.indexOf(f);return h!==-1&&c.splice(h,2),this},this.getHandler=function(f){for(let h=0,p=c.length;h<p;h+=2){const v=c[h],m=c[h+1];if(v.global&&(v.lastIndex=0),v.test(f))return m}return null}}}const Yy=new Bh;class Xt{constructor(e){this.manager=e!==void 0?e:Yy,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise(function(r,s){i.load(e,r,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const kn={};class vn extends Xt{constructor(e){super(e)}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Kr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;if(kn[e]!==void 0){kn[e].push({onLoad:t,onProgress:i,onError:r});return}const l=/^data:(.*?)(;base64)?,(.*)$/,u=e.match(l);let c;if(u){const f=u[1],h=!!u[2];let p=u[3];p=decodeURIComponent(p),h&&(p=atob(p));try{let v;const m=(this.responseType||"").toLowerCase();switch(m){case"arraybuffer":case"blob":const d=new Uint8Array(p.length);for(let y=0;y<p.length;y++)d[y]=p.charCodeAt(y);m==="blob"?v=new Blob([d.buffer],{type:f}):v=d.buffer;break;case"document":v=new DOMParser().parseFromString(p,f);break;case"json":v=JSON.parse(p);break;default:v=p;break}setTimeout(function(){t&&t(v),s.manager.itemEnd(e)},0)}catch(v){setTimeout(function(){r&&r(v),s.manager.itemError(e),s.manager.itemEnd(e)},0)}}else{kn[e]=[],kn[e].push({onLoad:t,onProgress:i,onError:r}),c=new XMLHttpRequest,c.open("GET",e,!0),c.addEventListener("load",function(f){const h=this.response,p=kn[e];if(delete kn[e],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Kr.add(e,h);for(let v=0,m=p.length;v<m;v++){const d=p[v];d.onLoad&&d.onLoad(h)}s.manager.itemEnd(e)}else{for(let v=0,m=p.length;v<m;v++){const d=p[v];d.onError&&d.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)}},!1),c.addEventListener("progress",function(f){const h=kn[e];for(let p=0,v=h.length;p<v;p++){const m=h[p];m.onProgress&&m.onProgress(f)}},!1),c.addEventListener("error",function(f){const h=kn[e];delete kn[e];for(let p=0,v=h.length;p<v;p++){const m=h[p];m.onError&&m.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)},!1),c.addEventListener("abort",function(f){const h=kn[e];delete kn[e];for(let p=0,v=h.length;p<v;p++){const m=h[p];m.onError&&m.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)},!1),this.responseType!==void 0&&(c.responseType=this.responseType),this.withCredentials!==void 0&&(c.withCredentials=this.withCredentials),c.overrideMimeType&&c.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain");for(const f in this.requestHeader)c.setRequestHeader(f,this.requestHeader[f]);c.send(null)}return s.manager.itemStart(e),c}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class HO extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new vn(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i<e.length;i++){const r=go.parse(e[i]);t.push(r)}return t}}class WO extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=[],l=new hh,u=new vn(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(s.withCredentials);let c=0;function f(h){u.load(e[h],function(p){const v=s.parse(p,!0);o[h]={width:v.width,height:v.height,format:v.format,mipmaps:v.mipmaps},c+=1,c===6&&(v.mipmapCount===1&&(l.minFilter=vt),l.image=o,l.format=v.format,l.needsUpdate=!0,t&&t(l))},i,r)}if(Array.isArray(e))for(let h=0,p=e.length;h<p;++h)f(h);else u.load(e,function(h){const p=s.parse(h,!0);if(p.isCubemap){const v=p.mipmaps.length/p.mipmapCount;for(let m=0;m<v;m++){o[m]={mipmaps:[]};for(let d=0;d<p.mipmapCount;d++)o[m].mipmaps.push(p.mipmaps[m*p.mipmapCount+d]),o[m].format=p.format,o[m].width=p.width,o[m].height=p.height}l.image=o}else l.image.width=p.width,l.image.height=p.height,l.mipmaps=p.mipmaps;p.mipmapCount===1&&(l.minFilter=vt),l.format=p.format,l.needsUpdate=!0,t&&t(l)},i,r);return l}}class Ca extends Xt{constructor(e){super(e)}load(e,t,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Kr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l=document.createElementNS("http://www.w3.org/1999/xhtml","img");function u(){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1),Kr.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(f){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1),r&&r(f),s.manager.itemError(e),s.manager.itemEnd(e)}return l.addEventListener("load",u,!1),l.addEventListener("error",c,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(l.crossOrigin=this.crossOrigin),s.manager.itemStart(e),l.src=e,l}}class Jy extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=new Zs,o=new Ca(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let l=0;function u(c){o.load(e[c],function(f){s.images[c]=f,l++,l===6&&(s.needsUpdate=!0,t&&t(s))},void 0,r)}for(let c=0;c<e.length;++c)u(c);return s}}class Ky extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Hr,l=new vn(this.manager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(s.withCredentials),l.load(e,function(u){const c=s.parse(u);c&&(c.image!==void 0?o.image=c.image:c.data!==void 0&&(o.image.width=c.width,o.image.height=c.height,o.image.data=c.data),o.wrapS=c.wrapS!==void 0?c.wrapS:zt,o.wrapT=c.wrapT!==void 0?c.wrapT:zt,o.magFilter=c.magFilter!==void 0?c.magFilter:vt,o.minFilter=c.minFilter!==void 0?c.minFilter:vt,o.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.encoding!==void 0&&(o.encoding=c.encoding),c.flipY!==void 0&&(o.flipY=c.flipY),c.format!==void 0&&(o.format=c.format),c.type!==void 0&&(o.type=c.type),c.mipmaps!==void 0&&(o.mipmaps=c.mipmaps,o.minFilter=xi),c.mipmapCount===1&&(o.minFilter=vt),c.generateMipmaps!==void 0&&(o.generateMipmaps=c.generateMipmaps),o.needsUpdate=!0,t&&t(o,c))},i,r),o}}class Dh extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=new Mt,o=new Ca(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(l){s.image=l;const u=e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0;s.format=u?Mi:hn,s.needsUpdate=!0,t!==void 0&&t(s)},i,r),s}}class qy extends gn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Aa(t,e))}getPoint(e){const t=e*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=t){const s=i[r]-t,o=this.curves[r],l=o.getLength(),u=l===0?0:1-s/l;return o.getPointAt(u)}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,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],l=o&&o.isEllipseCurve?e*2:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?e*o.points.length:e,u=o.getPoints(l);for(let c=0;c<u.length;c++){const f=u[c];i&&i.equals(f)||(t.push(f),i=f)}}return this.autoClose&&t.length>1&&!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;t<i;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(new Ah[r.type]().fromJSON(r))}return this}}class La extends qy{constructor(e){super(),this.type="Path",this.currentPoint=new Ae,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const i=new Aa(this.currentPoint.clone(),new Ae(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){const s=new wc(this.currentPoint.clone(),new Ae(e,t),new Ae(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,s,o){const l=new xc(this.currentPoint.clone(),new Ae(e,t),new Ae(i,r),new Ae(s,o));return this.curves.push(l),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new Mc(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,s,o){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absarc(e+l,t+u,i,r,s,o),this}absarc(e,t,i,r,s,o){return this.absellipse(e,t,i,i,r,s,o),this}ellipse(e,t,i,r,s,o,l,u){const c=this.currentPoint.x,f=this.currentPoint.y;return this.absellipse(e+c,t+f,i,r,s,o,l,u),this}absellipse(e,t,i,r,s,o,l,u){const c=new xa(e,t,i,r,s,o,l,u);if(this.curves.length>0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const f=c.getPoint(1);return this.currentPoint.copy(f),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 mr extends La{constructor(e){super(e),this.uuid=fn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(new La().fromJSON(r))}return this}}class zn extends Xe{constructor(e,t=1){super(),this.type="Light",this.color=new Le(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}zn.prototype.isLight=!0;class Vh extends zn{constructor(e,t,i){super(e,i),this.type="HemisphereLight",this.position.copy(Xe.DefaultUp),this.updateMatrix(),this.groundColor=new Le(t)}copy(e){return zn.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}Vh.prototype.isHemisphereLight=!0;const Qy=new Oe,eb=new Q,tb=new Q;class kh{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new Ae(512,512),this.map=null,this.mapPass=null,this.matrix=new Oe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new oa,this._frameExtents=new Ae(1,1),this._viewportCount=1,this._viewports=[new it(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;eb.setFromMatrixPosition(e.matrixWorld),t.position.copy(eb),tb.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(tb),t.updateMatrixWorld(),Qy.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Qy),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(t.projectionMatrix),i.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class nb extends kh{constructor(){super(new Dt(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,i=Qo*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(i!==t.fov||r!==t.aspect||s!==t.far)&&(t.fov=i,t.aspect=r,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}nb.prototype.isSpotLightShadow=!0;class Cc extends zn{constructor(e,t,i=0,r=Math.PI/3,s=0,o=1){super(e,t),this.type="SpotLight",this.position.copy(Xe.DefaultUp),this.updateMatrix(),this.target=new Xe,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.shadow=new nb}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Cc.prototype.isSpotLight=!0;const ib=new Oe,Ra=new Q,zh=new Q;class rb extends kh{constructor(){super(new Dt(90,1,.5,500)),this._frameExtents=new Ae(4,2),this._viewportCount=6,this._viewports=[new it(2,1,1,1),new it(0,1,1,1),new it(3,1,1,1),new it(1,1,1,1),new it(3,0,1,1),new it(1,0,1,1)],this._cubeDirections=[new Q(1,0,0),new Q(-1,0,0),new Q(0,0,1),new Q(0,0,-1),new Q(0,1,0),new Q(0,-1,0)],this._cubeUps=[new Q(0,1,0),new Q(0,1,0),new Q(0,1,0),new Q(0,1,0),new Q(0,0,1),new Q(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,r=this.matrix,s=e.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),Ra.setFromMatrixPosition(e.matrixWorld),i.position.copy(Ra),zh.copy(i.position),zh.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(zh),i.updateMatrixWorld(),r.makeTranslation(-Ra.x,-Ra.y,-Ra.z),ib.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ib)}}rb.prototype.isPointLightShadow=!0;class Lc extends zn{constructor(e,t,i=0,r=1){super(e,t),this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new rb}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}Lc.prototype.isPointLight=!0;class vo extends sa{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){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=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,l=r+t,u=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,f=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,l-=f*this.view.offsetY,u=l-f*this.view.height}this.projectionMatrix.makeOrthographic(s,o,l,u,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}vo.prototype.isOrthographicCamera=!0;class sb extends kh{constructor(){super(new vo(-5,5,5,-5,.5,500))}}sb.prototype.isDirectionalLightShadow=!0;class Rc extends zn{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(Xe.DefaultUp),this.updateMatrix(),this.target=new Xe,this.shadow=new sb}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Rc.prototype.isDirectionalLight=!0;class Uh extends zn{constructor(e,t){super(e,t),this.type="AmbientLight"}}Uh.prototype.isAmbientLight=!0;class Gh extends zn{constructor(e,t,i=10,r=10){super(e,t),this.type="RectAreaLight",this.width=i,this.height=r}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}Gh.prototype.isRectAreaLight=!0;class Hh{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new Q)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*i),t.addScaledVector(o[4],1.092548*(i*r)),t.addScaledVector(o[5],1.092548*(r*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(i*s)),t.addScaledVector(o[8],.546274*(i*i-r*r)),t}getIrradianceAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*r),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*i),t.addScaledVector(o[4],2*.429043*i*r),t.addScaledVector(o[5],2*.429043*r*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*i*s),t.addScaledVector(o[8],.429043*(i*i-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const i=e.x,r=e.y,s=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*s,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*i*s,t[8]=.546274*(i*i-r*r)}}Hh.prototype.isSphericalHarmonics3=!0;class Fa extends zn{constructor(e=new Hh,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}Fa.prototype.isLightProbe=!0;class ob extends Xt{constructor(e){super(e),this.textures={}}load(e,t,i,r){const s=this,o=new vn(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=this.textures;function i(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const r=new zO[e.type];if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=new Le().setHex(e.sheen)),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==1&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.morphTargets!==void 0&&(r.morphTargets=e.morphTargets),e.morphNormals!==void 0&&(r.morphNormals=e.morphNormals),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.vertexTangents!==void 0&&(r.vertexTangents=e.vertexTangents),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new Le().setHex(o.value);break;case"v2":r.uniforms[s].value=new Ae().fromArray(o.value);break;case"v3":r.uniforms[s].value=new Q().fromArray(o.value);break;case"v4":r.uniforms[s].value=new it().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Bt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new Oe().fromArray(o.value);break;default:r.uniforms[s].value=o.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.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(r.flatShading=e.shading===1),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new Ae().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),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=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Ae().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),r}setTextures(e){return this.textures=e,this}}class Pi{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i<r;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.substr(0,t+1)}}class Wh extends ke{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}Wh.prototype.isInstancedBufferGeometry=!0;class jh extends Ze{constructor(e,t,i,r=1){typeof i=="number"&&(r=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,i),this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}jh.prototype.isInstancedBufferAttribute=!0;class ab extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new vn(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t={},i={};function r(v,m){if(t[m]!==void 0)return t[m];const b=v.interleavedBuffers[m],y=s(v,b.buffer),g=Us(b.type,y),w=new dr(g,b.stride);return w.uuid=b.uuid,t[m]=w,w}function s(v,m){if(i[m]!==void 0)return i[m];const b=v.arrayBuffers[m],y=new Uint32Array(b).buffer;return i[m]=y,y}const o=e.isInstancedBufferGeometry?new Wh:new ke,l=e.data.index;if(l!==void 0){const v=Us(l.type,l.array);o.setIndex(new Ze(v,1))}const u=e.data.attributes;for(const v in u){const m=u[v];let d;if(m.isInterleavedBufferAttribute){const b=r(e.data,m.data);d=new Fi(b,m.itemSize,m.offset,m.normalized)}else{const b=Us(m.type,m.array),y=m.isInstancedBufferAttribute?jh:Ze;d=new y(b,m.itemSize,m.normalized)}m.name!==void 0&&(d.name=m.name),m.usage!==void 0&&d.setUsage(m.usage),m.updateRange!==void 0&&(d.updateRange.offset=m.updateRange.offset,d.updateRange.count=m.updateRange.count),o.setAttribute(v,d)}const c=e.data.morphAttributes;if(c)for(const v in c){const m=c[v],d=[];for(let b=0,y=m.length;b<y;b++){const g=m[b];let w;if(g.isInterleavedBufferAttribute){const A=r(e.data,g.data);w=new Fi(A,g.itemSize,g.offset,g.normalized)}else{const A=Us(g.type,g.array);w=new Ze(A,g.itemSize,g.normalized)}g.name!==void 0&&(w.name=g.name),d.push(w)}o.morphAttributes[v]=d}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const h=e.data.groups||e.data.drawcalls||e.data.offsets;if(h!==void 0)for(let v=0,m=h.length;v!==m;++v){const d=h[v];o.addGroup(d.start,d.count,d.materialIndex)}const p=e.data.boundingSphere;if(p!==void 0){const v=new Q;p.center!==void 0&&v.fromArray(p.center),o.boundingSphere=new Si(v,p.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class jO extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=this.path===""?Pi.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const l=new vn(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){let c=null;try{c=JSON.parse(u)}catch(h){r!==void 0&&r(h),console.error("THREE:ObjectLoader: Can't parse "+e+".",h.message);return}const f=c.metadata;if(f===void 0||f.type===void 0||f.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(c,t)},i,r)}async loadAsync(e,t){const i=this,r=this.path===""?Pi.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const s=new vn(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),l=JSON.parse(o),u=l.metadata;if(u===void 0||u.type===void 0||u.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(l)}parse(e,t){const i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,r),o=this.parseImages(e.images,function(){t!==void 0&&t(c)}),l=this.parseTextures(e.textures,o),u=this.parseMaterials(e.materials,l),c=this.parseObject(e.object,s,u,l,i),f=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,f),t!==void 0){let h=!1;for(const p in o)if(o[p]instanceof HTMLImageElement){h=!0;break}h===!1&&t(c)}return c}async parseAsync(e){const t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),s=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,s),l=this.parseMaterials(e.materials,o),u=this.parseObject(e.object,r,l,o,t),c=this.parseSkeletons(e.skeletons,u);return this.bindSkeletons(u,c),u}parseShapes(e){const t={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const s=new mr().fromJSON(e[i]);t[s.uuid]=s}return t}parseSkeletons(e,t){const i={},r={};if(t.traverse(function(s){s.isBone&&(r[s.uuid]=s)}),e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=new ya().fromJSON(e[s],r);i[l.uuid]=l}return i}parseGeometries(e,t){const i={};if(e!==void 0){const r=new ab;for(let s=0,o=e.length;s<o;s++){let l;const u=e[s];switch(u.type){case"BufferGeometry":case"InstancedBufferGeometry":l=r.parse(u);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:u.type in jy?l=jy[u.type].fromJSON(u,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${u.type}"`)}l.uuid=u.uuid,u.name!==void 0&&(l.name=u.name),l.isBufferGeometry===!0&&u.userData!==void 0&&(l.userData=u.userData),i[u.uuid]=l}}return i}parseMaterials(e,t){const i={},r={};if(e!==void 0){const s=new ob;s.setTextures(t);for(let o=0,l=e.length;o<l;o++){const u=e[o];if(u.type==="MultiMaterial"){const c=[];for(let f=0;f<u.materials.length;f++){const h=u.materials[f];i[h.uuid]===void 0&&(i[h.uuid]=s.parse(h)),c.push(i[h.uuid])}r[u.uuid]=c}else i[u.uuid]===void 0&&(i[u.uuid]=s.parse(u)),r[u.uuid]=i[u.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],s=go.parse(r);t[s.uuid]=s}return t}parseImages(e,t){const i=this,r={};let s;function o(u){return i.manager.itemStart(u),s.load(u,function(){i.manager.itemEnd(u)},void 0,function(){i.manager.itemError(u),i.manager.itemEnd(u)})}function l(u){if(typeof u=="string"){const c=u,f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:i.resourcePath+c;return o(f)}else return u.data?{data:Us(u.type,u.data),width:u.width,height:u.height}:null}if(e!==void 0&&e.length>0){const u=new Bh(t);s=new Ca(u),s.setCrossOrigin(this.crossOrigin);for(let c=0,f=e.length;c<f;c++){const h=e[c],p=h.url;if(Array.isArray(p)){r[h.uuid]=[];for(let v=0,m=p.length;v<m;v++){const d=p[v],b=l(d);b!==null&&(b instanceof HTMLImageElement?r[h.uuid].push(b):r[h.uuid].push(new Hr(b.data,b.width,b.height)))}}else{const v=l(h.url);v!==null&&(r[h.uuid]=v)}}}return r}async parseImagesAsync(e){const t=this,i={};let r;async function s(o){if(typeof o=="string"){const l=o,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l)?l:t.resourcePath+l;return await r.loadAsync(u)}else return o.data?{data:Us(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){r=new Ca(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,l=e.length;o<l;o++){const u=e[o],c=u.url;if(Array.isArray(c)){i[u.uuid]=[];for(let f=0,h=c.length;f<h;f++){const p=c[f],v=await s(p);v!==null&&(v instanceof HTMLImageElement?i[u.uuid].push(v):i[u.uuid].push(new Hr(v.data,v.width,v.height)))}}else{const f=await s(u.url);f!==null&&(i[u.uuid]=f)}}}return i}parseTextures(e,t){function i(s,o){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const r={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=e[s];l.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',l.uuid),t[l.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",l.image);let u;const c=t[l.image];Array.isArray(c)?(u=new Zs(c),c.length===6&&(u.needsUpdate=!0)):(c&&c.data?u=new Hr(c.data,c.width,c.height):u=new Mt(c),c&&(u.needsUpdate=!0)),u.uuid=l.uuid,l.name!==void 0&&(u.name=l.name),l.mapping!==void 0&&(u.mapping=i(l.mapping,$O)),l.offset!==void 0&&u.offset.fromArray(l.offset),l.repeat!==void 0&&u.repeat.fromArray(l.repeat),l.center!==void 0&&u.center.fromArray(l.center),l.rotation!==void 0&&(u.rotation=l.rotation),l.wrap!==void 0&&(u.wrapS=i(l.wrap[0],lb),u.wrapT=i(l.wrap[1],lb)),l.format!==void 0&&(u.format=l.format),l.type!==void 0&&(u.type=l.type),l.encoding!==void 0&&(u.encoding=l.encoding),l.minFilter!==void 0&&(u.minFilter=i(l.minFilter,cb)),l.magFilter!==void 0&&(u.magFilter=i(l.magFilter,cb)),l.anisotropy!==void 0&&(u.anisotropy=l.anisotropy),l.flipY!==void 0&&(u.flipY=l.flipY),l.premultiplyAlpha!==void 0&&(u.premultiplyAlpha=l.premultiplyAlpha),l.unpackAlignment!==void 0&&(u.unpackAlignment=l.unpackAlignment),r[l.uuid]=u}return r}parseObject(e,t,i,r,s){let o;function l(p){return t[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),t[p]}function u(p){if(p!==void 0){if(Array.isArray(p)){const v=[];for(let m=0,d=p.length;m<d;m++){const b=p[m];i[b]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",b),v.push(i[b])}return v}return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),i[p]}}function c(p){return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),r[p]}let f,h;switch(e.type){case"Scene":o=new oc,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new Le(e.background):o.background=c(e.background)),e.environment!==void 0&&(o.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new ua(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new ca(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":o=new Dt(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new vo(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new Uh(e.color,e.intensity);break;case"DirectionalLight":o=new Rc(e.color,e.intensity);break;case"PointLight":o=new Lc(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new Gh(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new Cc(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new Vh(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new Fa().fromJSON(e);break;case"SkinnedMesh":f=l(e.geometry),h=u(e.material),o=new ga(f,h),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":f=l(e.geometry),h=u(e.material),o=new St(f,h);break;case"InstancedMesh":f=l(e.geometry),h=u(e.material);const p=e.count,v=e.instanceMatrix,m=e.instanceColor;o=new ch(f,h,p),o.instanceMatrix=new Ze(new Float32Array(v.array),16),m!==void 0&&(o.instanceColor=new Ze(new Float32Array(m.array),m.itemSize));break;case"LOD":o=new by;break;case"Line":o=new ei(l(e.geometry),u(e.material));break;case"LineLoop":o=new fc(l(e.geometry),u(e.material));break;case"LineSegments":o=new rn(l(e.geometry),u(e.material));break;case"PointCloud":case"Points":o=new eo(l(e.geometry),u(e.material));break;case"Sprite":o=new ma(u(e.material));break;case"Group":o=new Qn;break;case"Bone":o=new va;break;default:o=new Xe}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.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(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 p=e.children;for(let v=0;v<p.length;v++)o.add(this.parseObject(p[v],t,i,r,s))}if(e.animations!==void 0){const p=e.animations;for(let v=0;v<p.length;v++){const m=p[v];o.animations.push(s[m])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const p=e.levels;for(let v=0;v<p.length;v++){const m=p[v],d=o.getObjectByProperty("uuid",m.object);d!==void 0&&o.addLevel(d,m.distance)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=t[i.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const $O={UVMapping:El,CubeReflectionMapping:jo,CubeRefractionMapping:$o,EquirectangularReflectionMapping:Cl,EquirectangularRefractionMapping:Ll,CubeUVReflectionMapping:Ts,CubeUVRefractionMapping:Zo},lb={RepeatWrapping:Qi,ClampToEdgeWrapping:zt,MirroredRepeatWrapping:Es},cb={NearestFilter:wt,NearestMipmapNearestFilter:Xo,NearestMipmapLinearFilter:Yo,LinearFilter:vt,LinearMipmapNearestFilter:Rl,LinearMipmapLinearFilter:xi};class $h extends Xt{constructor(e){super(e),typeof createImageBitmap>"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,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Kr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l={};l.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",l.headers=this.requestHeader,fetch(e,l).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){Kr.add(e,u),t&&t(u),s.manager.itemEnd(e)}).catch(function(u){r&&r(u),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}$h.prototype.isImageBitmapLoader=!0;class ub{constructor(){this.type="ShapePath",this.color=new Le,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new La,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,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function i(g){const w=[];for(let A=0,S=g.length;A<S;A++){const M=g[A],F=new mr;F.curves=M.curves,w.push(F)}return w}function r(g,w){const A=w.length;let S=!1;for(let M=A-1,F=0;F<A;M=F++){let R=w[M],T=w[F],P=T.x-R.x,_=T.y-R.y;if(Math.abs(_)>Number.EPSILON){if(_<0&&(R=w[F],P=-P,T=w[M],_=-_),g.y<R.y||g.y>T.y)continue;if(g.y===R.y){if(g.x===R.x)return!0}else{const E=_*(g.x-R.x)-P*(g.y-R.y);if(E===0)return!0;if(E<0)continue;S=!S}}else{if(g.y!==R.y)continue;if(T.x<=g.x&&g.x<=R.x||R.x<=g.x&&g.x<=T.x)return!0}}return S}const s=ni.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return i(o);let l,u,c;const f=[];if(o.length===1)return u=o[0],c=new mr,c.curves=u.curves,f.push(c),f;let h=!s(o[0].getPoints());h=e?!h:h;const p=[],v=[];let m=[],d=0,b;v[d]=void 0,m[d]=[];for(let g=0,w=o.length;g<w;g++)u=o[g],b=u.getPoints(),l=s(b),l=e?!l:l,l?(!h&&v[d]&&d++,v[d]={s:new mr,p:b},v[d].s.curves=u.curves,h&&d++,m[d]=[]):m[d].push({h:u,p:b[0]});if(!v[0])return i(o);if(v.length>1){let g=!1;const w=[];for(let A=0,S=v.length;A<S;A++)p[A]=[];for(let A=0,S=v.length;A<S;A++){const M=m[A];for(let F=0;F<M.length;F++){const R=M[F];let T=!0;for(let P=0;P<v.length;P++)r(R.p,v[P].p)&&(A!==P&&w.push({froms:A,tos:P,hole:F}),T?(T=!1,p[P].push(R)):g=!0);T&&p[A].push(R)}}w.length>0&&(g||(m=p))}let y;for(let g=0,w=v.length;g<w;g++){c=v[g].s,f.push(c),y=m[g];for(let A=0,S=y.length;A<S;A++)c.holes.push(y[A].h)}return f}}class Zh{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){const i=[],r=ZO(e,t,this.data);for(let s=0,o=r.length;s<o;s++)Array.prototype.push.apply(i,r[s].toShapes());return i}}function ZO(n,e,t){const i=Array.from(n),r=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*r,o=[];let l=0,u=0;for(let c=0;c<i.length;c++){const f=i[c];if(f===`
|
|
2915
|
+
}`;function hy(n,e,t){let i=new oa;const r=new Ae,s=new Ae,o=new it,l=[],u=[],c={},f=t.maxTextureSize,h={0:xt,1:Ji,2:Ki},p=new Ri({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ae},radius:{value:4}},vertexShader:rO,fragmentShader:iO}),v=p.clone();v.defines.HORIZONTAL_PASS=1;const m=new ke;m.setAttribute("position",new Ze(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const d=new St(m,p),b=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=id,this.render=function(M,F,R){if(b.enabled===!1||b.autoUpdate===!1&&b.needsUpdate===!1||M.length===0)return;const T=n.getRenderTarget(),P=n.getActiveCubeFace(),_=n.getActiveMipmapLevel(),E=n.state;E.setBlending(bi),E.buffers.color.setClear(1,1,1,1),E.buffers.depth.setTest(!0),E.setScissorTest(!1);for(let C=0,L=M.length;C<L;C++){const I=M[C],x=I.shadow;if(x===void 0){console.warn("THREE.WebGLShadowMap:",I,"has no shadow.");continue}if(x.autoUpdate===!1&&x.needsUpdate===!1)continue;r.copy(x.mapSize);const O=x.getFrameExtents();if(r.multiply(O),s.copy(x.mapSize),(r.x>f||r.y>f)&&(r.x>f&&(s.x=Math.floor(f/O.x),r.x=s.x*O.x,x.mapSize.x=s.x),r.y>f&&(s.y=Math.floor(f/O.y),r.y=s.y*O.y,x.mapSize.y=s.y)),x.map===null&&!x.isPointLightShadow&&this.type===Ss){const D={minFilter:vt,magFilter:vt,format:hn};x.map=new Pn(r.x,r.y,D),x.map.texture.name=I.name+".shadowMap",x.mapPass=new Pn(r.x,r.y,D),x.camera.updateProjectionMatrix()}if(x.map===null){const D={minFilter:wt,magFilter:wt,format:hn};x.map=new Pn(r.x,r.y,D),x.map.texture.name=I.name+".shadowMap",x.camera.updateProjectionMatrix()}n.setRenderTarget(x.map),n.clear();const B=x.getViewportCount();for(let D=0;D<B;D++){const k=x.getViewport(D);o.set(s.x*k.x,s.y*k.y,s.x*k.z,s.y*k.w),E.viewport(o),x.updateMatrices(I,D),i=x.getFrustum(),S(F,R,x.camera,I,this.type)}!x.isPointLightShadow&&this.type===Ss&&y(x,R),x.needsUpdate=!1}b.needsUpdate=!1,n.setRenderTarget(T,P,_)};function y(M,F){const R=e.update(d);p.uniforms.shadow_pass.value=M.map.texture,p.uniforms.resolution.value=M.mapSize,p.uniforms.radius.value=M.radius,n.setRenderTarget(M.mapPass),n.clear(),n.renderBufferDirect(F,null,R,p,d,null),v.uniforms.shadow_pass.value=M.mapPass.texture,v.uniforms.resolution.value=M.mapSize,v.uniforms.radius.value=M.radius,n.setRenderTarget(M.map),n.clear(),n.renderBufferDirect(F,null,R,v,d,null)}function g(M){const F=M<<0;let R=l[F];return R===void 0&&(R=new rc({depthPacking:gv,morphTargets:M}),l[F]=R),R}function w(M){const F=M<<0;let R=u[F];return R===void 0&&(R=new sc({morphTargets:M}),u[F]=R),R}function A(M,F,R,T,P,_,E){let C=null,L=g,I=M.customDepthMaterial;if(T.isPointLight===!0&&(L=w,I=M.customDistanceMaterial),I===void 0){let x=!1;R.morphTargets===!0&&(x=F.morphAttributes&&F.morphAttributes.position&&F.morphAttributes.position.length>0),C=L(x)}else C=I;if(n.localClippingEnabled&&R.clipShadows===!0&&R.clippingPlanes.length!==0){const x=C.uuid,O=R.uuid;let B=c[x];B===void 0&&(B={},c[x]=B);let D=B[O];D===void 0&&(D=C.clone(),B[O]=D),C=D}return C.visible=R.visible,C.wireframe=R.wireframe,E===Ss?C.side=R.shadowSide!==null?R.shadowSide:R.side:C.side=R.shadowSide!==null?R.shadowSide:h[R.side],C.clipShadows=R.clipShadows,C.clippingPlanes=R.clippingPlanes,C.clipIntersection=R.clipIntersection,C.wireframeLinewidth=R.wireframeLinewidth,C.linewidth=R.linewidth,T.isPointLight===!0&&C.isMeshDistanceMaterial===!0&&(C.referencePosition.setFromMatrixPosition(T.matrixWorld),C.nearDistance=P,C.farDistance=_),C}function S(M,F,R,T,P){if(M.visible===!1)return;if(M.layers.test(F.layers)&&(M.isMesh||M.isLine||M.isPoints)&&(M.castShadow||M.receiveShadow&&P===Ss)&&(!M.frustumCulled||i.intersectsObject(M))){M.modelViewMatrix.multiplyMatrices(R.matrixWorldInverse,M.matrixWorld);const C=e.update(M),L=M.material;if(Array.isArray(L)){const I=C.groups;for(let x=0,O=I.length;x<O;x++){const B=I[x],D=L[B.materialIndex];if(D&&D.visible){const k=A(M,C,D,T,R.near,R.far,P);n.renderBufferDirect(R,null,C,k,M,B)}}}else if(L.visible){const I=A(M,C,L,T,R.near,R.far,P);n.renderBufferDirect(R,null,C,I,M,null)}}const E=M.children;for(let C=0,L=E.length;C<L;C++)S(E[C],F,R,T,P)}}function sO(n,e,t){const i=t.isWebGL2;function r(){let re=!1;const he=new it;let ve=null;const Ee=new it(0,0,0,0);return{setMask:function(_e){ve!==_e&&!re&&(n.colorMask(_e,_e,_e,_e),ve=_e)},setLocked:function(_e){re=_e},setClear:function(_e,Ne,Je,ze,st){st===!0&&(_e*=ze,Ne*=ze,Je*=ze),he.set(_e,Ne,Je,ze),Ee.equals(he)===!1&&(n.clearColor(_e,Ne,Je,ze),Ee.copy(he))},reset:function(){re=!1,ve=null,Ee.set(-1,0,0,0)}}}function s(){let re=!1,he=null,ve=null,Ee=null;return{setTest:function(_e){_e?j(2929):te(2929)},setMask:function(_e){he!==_e&&!re&&(n.depthMask(_e),he=_e)},setFunc:function(_e){if(ve!==_e){if(_e)switch(_e){case i0:n.depthFunc(512);break;case r0:n.depthFunc(519);break;case s0:n.depthFunc(513);break;case Tl:n.depthFunc(515);break;case o0:n.depthFunc(514);break;case a0:n.depthFunc(518);break;case l0:n.depthFunc(516);break;case c0:n.depthFunc(517);break;default:n.depthFunc(515)}else n.depthFunc(515);ve=_e}},setLocked:function(_e){re=_e},setClear:function(_e){Ee!==_e&&(n.clearDepth(_e),Ee=_e)},reset:function(){re=!1,he=null,ve=null,Ee=null}}}function o(){let re=!1,he=null,ve=null,Ee=null,_e=null,Ne=null,Je=null,ze=null,st=null;return{setTest:function(Ce){re||(Ce?j(2960):te(2960))},setMask:function(Ce){he!==Ce&&!re&&(n.stencilMask(Ce),he=Ce)},setFunc:function(Ce,je,He){(ve!==Ce||Ee!==je||_e!==He)&&(n.stencilFunc(Ce,je,He),ve=Ce,Ee=je,_e=He)},setOp:function(Ce,je,He){(Ne!==Ce||Je!==je||ze!==He)&&(n.stencilOp(Ce,je,He),Ne=Ce,Je=je,ze=He)},setLocked:function(Ce){re=Ce},setClear:function(Ce){st!==Ce&&(n.clearStencil(Ce),st=Ce)},reset:function(){re=!1,he=null,ve=null,Ee=null,_e=null,Ne=null,Je=null,ze=null,st=null}}}const l=new r,u=new s,c=new o;let f={},h=null,p={},v=null,m=!1,d=null,b=null,y=null,g=null,w=null,A=null,S=null,M=!1,F=null,R=null,T=null,P=null,_=null;const E=n.getParameter(35661);let C=!1,L=0;const I=n.getParameter(7938);I.indexOf("WebGL")!==-1?(L=parseFloat(/^WebGL (\d)/.exec(I)[1]),C=L>=1):I.indexOf("OpenGL ES")!==-1&&(L=parseFloat(/^OpenGL ES (\d)/.exec(I)[1]),C=L>=2);let x=null,O={};const B=n.getParameter(3088),D=n.getParameter(2978),k=new it().fromArray(B),V=new it().fromArray(D);function G(re,he,ve){const Ee=new Uint8Array(4),_e=n.createTexture();n.bindTexture(re,_e),n.texParameteri(re,10241,9728),n.texParameteri(re,10240,9728);for(let Ne=0;Ne<ve;Ne++)n.texImage2D(he+Ne,0,6408,1,1,0,6408,5121,Ee);return _e}const J={};J[3553]=G(3553,3553,1),J[34067]=G(34067,34069,6),l.setClear(0,0,0,1),u.setClear(1),c.setClear(0),j(2929),u.setFunc(Tl),W(!1),q(nd),j(2884),se(bi);function j(re){f[re]!==!0&&(n.enable(re),f[re]=!0)}function te(re){f[re]!==!1&&(n.disable(re),f[re]=!1)}function ee(re){re!==h&&(n.bindFramebuffer(36160,re),h=re)}function ae(re,he){return he===null&&h!==null&&(he=h),p[re]!==he?(n.bindFramebuffer(re,he),p[re]=he,i&&(re===36009&&(p[36160]=he),re===36160&&(p[36009]=he)),!0):!1}function H(re){return v!==re?(n.useProgram(re),v=re,!0):!1}const Z={[Lr]:32774,[$g]:32778,[Zg]:32779};if(i)Z[ld]=32775,Z[cd]=32776;else{const re=e.get("EXT_blend_minmax");re!==null&&(Z[ld]=re.MIN_EXT,Z[cd]=re.MAX_EXT)}const $={[Xg]:0,[Yg]:1,[Jg]:768,[ud]:770,[n0]:776,[e0]:774,[qg]:772,[Kg]:769,[dd]:771,[t0]:775,[Qg]:773};function se(re,he,ve,Ee,_e,Ne,Je,ze){if(re===bi){m===!0&&(te(3042),m=!1);return}if(m===!1&&(j(3042),m=!0),re!==jg){if(re!==d||ze!==M){if((b!==Lr||w!==Lr)&&(n.blendEquation(32774),b=Lr,w=Lr),ze)switch(re){case _s:n.blendFuncSeparate(1,771,1,771);break;case sd:n.blendFunc(1,1);break;case od:n.blendFuncSeparate(0,0,769,771);break;case ad:n.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",re);break}else switch(re){case _s:n.blendFuncSeparate(770,771,1,771);break;case sd:n.blendFunc(770,1);break;case od:n.blendFunc(0,769);break;case ad:n.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",re);break}y=null,g=null,A=null,S=null,d=re,M=ze}return}_e=_e||he,Ne=Ne||ve,Je=Je||Ee,(he!==b||_e!==w)&&(n.blendEquationSeparate(Z[he],Z[_e]),b=he,w=_e),(ve!==y||Ee!==g||Ne!==A||Je!==S)&&(n.blendFuncSeparate($[ve],$[Ee],$[Ne],$[Je]),y=ve,g=Ee,A=Ne,S=Je),d=re,M=null}function z(re,he){re.side===Ki?te(2884):j(2884);let ve=re.side===xt;he&&(ve=!ve),W(ve),re.blending===_s&&re.transparent===!1?se(bi):se(re.blending,re.blendEquation,re.blendSrc,re.blendDst,re.blendEquationAlpha,re.blendSrcAlpha,re.blendDstAlpha,re.premultipliedAlpha),u.setFunc(re.depthFunc),u.setTest(re.depthTest),u.setMask(re.depthWrite),l.setMask(re.colorWrite);const Ee=re.stencilWrite;c.setTest(Ee),Ee&&(c.setMask(re.stencilWriteMask),c.setFunc(re.stencilFunc,re.stencilRef,re.stencilFuncMask),c.setOp(re.stencilFail,re.stencilZFail,re.stencilZPass)),oe(re.polygonOffset,re.polygonOffsetFactor,re.polygonOffsetUnits),re.alphaToCoverage===!0?j(32926):te(32926)}function W(re){F!==re&&(re?n.frontFace(2304):n.frontFace(2305),F=re)}function q(re){re!==Gg?(j(2884),re!==R&&(re===nd?n.cullFace(1029):re===Hg?n.cullFace(1028):n.cullFace(1032))):te(2884),R=re}function le(re){re!==T&&(C&&n.lineWidth(re),T=re)}function oe(re,he,ve){re?(j(32823),(P!==he||_!==ve)&&(n.polygonOffset(he,ve),P=he,_=ve)):te(32823)}function U(re){re?j(3089):te(3089)}function N(re){re===void 0&&(re=33984+E-1),x!==re&&(n.activeTexture(re),x=re)}function X(re,he){x===null&&N();let ve=O[x];ve===void 0&&(ve={type:void 0,texture:void 0},O[x]=ve),(ve.type!==re||ve.texture!==he)&&(n.bindTexture(re,he||J[re]),ve.type=re,ve.texture=he)}function Y(){const re=O[x];re!==void 0&&re.type!==void 0&&(n.bindTexture(re.type,null),re.type=void 0,re.texture=void 0)}function ie(){try{n.compressedTexImage2D.apply(n,arguments)}catch(re){console.error("THREE.WebGLState:",re)}}function ue(){try{n.texImage2D.apply(n,arguments)}catch(re){console.error("THREE.WebGLState:",re)}}function me(){try{n.texImage3D.apply(n,arguments)}catch(re){console.error("THREE.WebGLState:",re)}}function be(re){k.equals(re)===!1&&(n.scissor(re.x,re.y,re.z,re.w),k.copy(re))}function ce(re){V.equals(re)===!1&&(n.viewport(re.x,re.y,re.z,re.w),V.copy(re))}function ge(){n.disable(3042),n.disable(2884),n.disable(2929),n.disable(32823),n.disable(3089),n.disable(2960),n.disable(32926),n.blendEquation(32774),n.blendFunc(1,0),n.blendFuncSeparate(1,0,1,0),n.colorMask(!0,!0,!0,!0),n.clearColor(0,0,0,0),n.depthMask(!0),n.depthFunc(513),n.clearDepth(1),n.stencilMask(4294967295),n.stencilFunc(519,0,4294967295),n.stencilOp(7680,7680,7680),n.clearStencil(0),n.cullFace(1029),n.frontFace(2305),n.polygonOffset(0,0),n.activeTexture(33984),n.bindFramebuffer(36160,null),i===!0&&(n.bindFramebuffer(36009,null),n.bindFramebuffer(36008,null)),n.useProgram(null),n.lineWidth(1),n.scissor(0,0,n.canvas.width,n.canvas.height),n.viewport(0,0,n.canvas.width,n.canvas.height),f={},x=null,O={},h=null,p={},v=null,m=!1,d=null,b=null,y=null,g=null,w=null,A=null,S=null,M=!1,F=null,R=null,T=null,P=null,_=null,k.set(0,0,n.canvas.width,n.canvas.height),V.set(0,0,n.canvas.width,n.canvas.height),l.reset(),u.reset(),c.reset()}return{buffers:{color:l,depth:u,stencil:c},enable:j,disable:te,bindFramebuffer:ae,bindXRFramebuffer:ee,useProgram:H,setBlending:se,setMaterial:z,setFlipSided:W,setCullFace:q,setLineWidth:le,setPolygonOffset:oe,setScissorTest:U,activeTexture:N,bindTexture:X,unbindTexture:Y,compressedTexImage2D:ie,texImage2D:ue,texImage3D:me,scissor:be,viewport:ce,reset:ge}}function oO(n,e,t,i,r,s,o){const l=r.isWebGL2,u=r.maxTextures,c=r.maxCubemapSize,f=r.maxTextureSize,h=r.maxSamples,p=new WeakMap;let v,m=!1;try{m=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function d(U,N){return m?new OffscreenCanvas(U,N):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function b(U,N,X,Y){let ie=1;if((U.width>Y||U.height>Y)&&(ie=Y/Math.max(U.width,U.height)),ie<1||N===!0)if(typeof HTMLImageElement<"u"&&U instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&U instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&U instanceof ImageBitmap){const ue=N?xv:Math.floor,me=ue(ie*U.width),be=ue(ie*U.height);v===void 0&&(v=d(me,be));const ce=X?d(me,be):v;return ce.width=me,ce.height=be,ce.getContext("2d").drawImage(U,0,0,me,be),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+U.width+"x"+U.height+") to ("+me+"x"+be+")."),ce}else return"data"in U&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+U.width+"x"+U.height+")."),U;return U}function y(U){return Ld(U.width)&&Ld(U.height)}function g(U){return l?!1:U.wrapS!==zt||U.wrapT!==zt||U.minFilter!==wt&&U.minFilter!==vt}function w(U,N){return U.generateMipmaps&&N&&U.minFilter!==wt&&U.minFilter!==vt}function A(U,N,X,Y,ie=1){n.generateMipmap(U);const ue=i.get(N);ue.__maxMipLevel=Math.log2(Math.max(X,Y,ie))}function S(U,N,X){if(l===!1)return N;if(U!==null){if(n[U]!==void 0)return n[U];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+U+"'")}let Y=N;return N===6403&&(X===5126&&(Y=33326),X===5131&&(Y=33325),X===5121&&(Y=33321)),N===6407&&(X===5126&&(Y=34837),X===5131&&(Y=34843),X===5121&&(Y=32849)),N===6408&&(X===5126&&(Y=34836),X===5131&&(Y=34842),X===5121&&(Y=32856)),(Y===33325||Y===33326||Y===34842||Y===34836)&&e.get("EXT_color_buffer_float"),Y}function M(U){return U===wt||U===Xo||U===Yo?9728:9729}function F(U){const N=U.target;N.removeEventListener("dispose",F),T(N),N.isVideoTexture&&p.delete(N),o.memory.textures--}function R(U){const N=U.target;N.removeEventListener("dispose",R),P(N)}function T(U){const N=i.get(U);N.__webglInit!==void 0&&(n.deleteTexture(N.__webglTexture),i.remove(U))}function P(U){const N=U.texture,X=i.get(U),Y=i.get(N);if(U){if(Y.__webglTexture!==void 0&&(n.deleteTexture(Y.__webglTexture),o.memory.textures--),U.depthTexture&&U.depthTexture.dispose(),U.isWebGLCubeRenderTarget)for(let ie=0;ie<6;ie++)n.deleteFramebuffer(X.__webglFramebuffer[ie]),X.__webglDepthbuffer&&n.deleteRenderbuffer(X.__webglDepthbuffer[ie]);else n.deleteFramebuffer(X.__webglFramebuffer),X.__webglDepthbuffer&&n.deleteRenderbuffer(X.__webglDepthbuffer),X.__webglMultisampledFramebuffer&&n.deleteFramebuffer(X.__webglMultisampledFramebuffer),X.__webglColorRenderbuffer&&n.deleteRenderbuffer(X.__webglColorRenderbuffer),X.__webglDepthRenderbuffer&&n.deleteRenderbuffer(X.__webglDepthRenderbuffer);if(U.isWebGLMultipleRenderTargets)for(let ie=0,ue=N.length;ie<ue;ie++){const me=i.get(N[ie]);me.__webglTexture&&(n.deleteTexture(me.__webglTexture),o.memory.textures--),i.remove(N[ie])}i.remove(N),i.remove(U)}}let _=0;function E(){_=0}function C(){const U=_;return U>=u&&console.warn("THREE.WebGLTextures: Trying to use "+U+" texture units while this GPU supports only "+u),_+=1,U}function L(U,N){const X=i.get(U);if(U.isVideoTexture&&z(U),U.version>0&&X.__version!==U.version){const Y=U.image;if(Y===void 0)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(Y.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{G(X,U,N);return}}t.activeTexture(33984+N),t.bindTexture(3553,X.__webglTexture)}function I(U,N){const X=i.get(U);if(U.version>0&&X.__version!==U.version){G(X,U,N);return}t.activeTexture(33984+N),t.bindTexture(35866,X.__webglTexture)}function x(U,N){const X=i.get(U);if(U.version>0&&X.__version!==U.version){G(X,U,N);return}t.activeTexture(33984+N),t.bindTexture(32879,X.__webglTexture)}function O(U,N){const X=i.get(U);if(U.version>0&&X.__version!==U.version){J(X,U,N);return}t.activeTexture(33984+N),t.bindTexture(34067,X.__webglTexture)}const B={[Qi]:10497,[zt]:33071,[Es]:33648},D={[wt]:9728,[Xo]:9984,[Yo]:9986,[vt]:9729,[Rl]:9985,[xi]:9987};function k(U,N,X){if(X?(n.texParameteri(U,10242,B[N.wrapS]),n.texParameteri(U,10243,B[N.wrapT]),(U===32879||U===35866)&&n.texParameteri(U,32882,B[N.wrapR]),n.texParameteri(U,10240,D[N.magFilter]),n.texParameteri(U,10241,D[N.minFilter])):(n.texParameteri(U,10242,33071),n.texParameteri(U,10243,33071),(U===32879||U===35866)&&n.texParameteri(U,32882,33071),(N.wrapS!==zt||N.wrapT!==zt)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),n.texParameteri(U,10240,M(N.magFilter)),n.texParameteri(U,10241,M(N.minFilter)),N.minFilter!==wt&&N.minFilter!==vt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),e.has("EXT_texture_filter_anisotropic")===!0){const Y=e.get("EXT_texture_filter_anisotropic");if(N.type===wi&&e.has("OES_texture_float_linear")===!1||l===!1&&N.type===Fr&&e.has("OES_texture_half_float_linear")===!1)return;(N.anisotropy>1||i.get(N).__currentAnisotropy)&&(n.texParameterf(U,Y.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(N.anisotropy,r.getMaxAnisotropy())),i.get(N).__currentAnisotropy=N.anisotropy)}}function V(U,N){U.__webglInit===void 0&&(U.__webglInit=!0,N.addEventListener("dispose",F),U.__webglTexture=n.createTexture(),o.memory.textures++)}function G(U,N,X){let Y=3553;N.isDataTexture2DArray&&(Y=35866),N.isDataTexture3D&&(Y=32879),V(U,N),t.activeTexture(33984+X),t.bindTexture(Y,U.__webglTexture),n.pixelStorei(37440,N.flipY),n.pixelStorei(37441,N.premultiplyAlpha),n.pixelStorei(3317,N.unpackAlignment),n.pixelStorei(37443,0);const ie=g(N)&&y(N.image)===!1,ue=b(N.image,ie,!1,f),me=y(ue)||l,be=s.convert(N.format);let ce=s.convert(N.type),ge=S(N.internalFormat,be,ce);k(Y,N,me);let re;const he=N.mipmaps;if(N.isDepthTexture)ge=6402,l?N.type===wi?ge=36012:N.type===Ko?ge=33190:N.type===Cs?ge=35056:ge=33189:N.type===wi&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),N.format===Pr&&ge===6402&&N.type!==Jo&&N.type!==Ko&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),N.type=Jo,ce=s.convert(N.type)),N.format===Ls&&ge===6402&&(ge=34041,N.type!==Cs&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),N.type=Cs,ce=s.convert(N.type))),t.texImage2D(3553,0,ge,ue.width,ue.height,0,be,ce,null);else if(N.isDataTexture)if(he.length>0&&me){for(let ve=0,Ee=he.length;ve<Ee;ve++)re=he[ve],t.texImage2D(3553,ve,ge,re.width,re.height,0,be,ce,re.data);N.generateMipmaps=!1,U.__maxMipLevel=he.length-1}else t.texImage2D(3553,0,ge,ue.width,ue.height,0,be,ce,ue.data),U.__maxMipLevel=0;else if(N.isCompressedTexture){for(let ve=0,Ee=he.length;ve<Ee;ve++)re=he[ve],N.format!==hn&&N.format!==Mi?be!==null?t.compressedTexImage2D(3553,ve,ge,re.width,re.height,0,re.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):t.texImage2D(3553,ve,ge,re.width,re.height,0,be,ce,re.data);U.__maxMipLevel=he.length-1}else if(N.isDataTexture2DArray)t.texImage3D(35866,0,ge,ue.width,ue.height,ue.depth,0,be,ce,ue.data),U.__maxMipLevel=0;else if(N.isDataTexture3D)t.texImage3D(32879,0,ge,ue.width,ue.height,ue.depth,0,be,ce,ue.data),U.__maxMipLevel=0;else if(he.length>0&&me){for(let ve=0,Ee=he.length;ve<Ee;ve++)re=he[ve],t.texImage2D(3553,ve,ge,be,ce,re);N.generateMipmaps=!1,U.__maxMipLevel=he.length-1}else t.texImage2D(3553,0,ge,be,ce,ue),U.__maxMipLevel=0;w(N,me)&&A(Y,N,ue.width,ue.height),U.__version=N.version,N.onUpdate&&N.onUpdate(N)}function J(U,N,X){if(N.image.length!==6)return;V(U,N),t.activeTexture(33984+X),t.bindTexture(34067,U.__webglTexture),n.pixelStorei(37440,N.flipY),n.pixelStorei(37441,N.premultiplyAlpha),n.pixelStorei(3317,N.unpackAlignment),n.pixelStorei(37443,0);const Y=N&&(N.isCompressedTexture||N.image[0].isCompressedTexture),ie=N.image[0]&&N.image[0].isDataTexture,ue=[];for(let ve=0;ve<6;ve++)!Y&&!ie?ue[ve]=b(N.image[ve],!1,!0,c):ue[ve]=ie?N.image[ve].image:N.image[ve];const me=ue[0],be=y(me)||l,ce=s.convert(N.format),ge=s.convert(N.type),re=S(N.internalFormat,ce,ge);k(34067,N,be);let he;if(Y){for(let ve=0;ve<6;ve++){he=ue[ve].mipmaps;for(let Ee=0;Ee<he.length;Ee++){const _e=he[Ee];N.format!==hn&&N.format!==Mi?ce!==null?t.compressedTexImage2D(34069+ve,Ee,re,_e.width,_e.height,0,_e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):t.texImage2D(34069+ve,Ee,re,_e.width,_e.height,0,ce,ge,_e.data)}}U.__maxMipLevel=he.length-1}else{he=N.mipmaps;for(let ve=0;ve<6;ve++)if(ie){t.texImage2D(34069+ve,0,re,ue[ve].width,ue[ve].height,0,ce,ge,ue[ve].data);for(let Ee=0;Ee<he.length;Ee++){const Ne=he[Ee].image[ve].image;t.texImage2D(34069+ve,Ee+1,re,Ne.width,Ne.height,0,ce,ge,Ne.data)}}else{t.texImage2D(34069+ve,0,re,ce,ge,ue[ve]);for(let Ee=0;Ee<he.length;Ee++){const _e=he[Ee];t.texImage2D(34069+ve,Ee+1,re,ce,ge,_e.image[ve])}}U.__maxMipLevel=he.length}w(N,be)&&A(34067,N,me.width,me.height),U.__version=N.version,N.onUpdate&&N.onUpdate(N)}function j(U,N,X,Y,ie){const ue=s.convert(X.format),me=s.convert(X.type),be=S(X.internalFormat,ue,me);ie===32879||ie===35866?t.texImage3D(ie,0,be,N.width,N.height,N.depth,0,ue,me,null):t.texImage2D(ie,0,be,N.width,N.height,0,ue,me,null),t.bindFramebuffer(36160,U),n.framebufferTexture2D(36160,Y,ie,i.get(X).__webglTexture,0),t.bindFramebuffer(36160,null)}function te(U,N,X){if(n.bindRenderbuffer(36161,U),N.depthBuffer&&!N.stencilBuffer){let Y=33189;if(X){const ie=N.depthTexture;ie&&ie.isDepthTexture&&(ie.type===wi?Y=36012:ie.type===Ko&&(Y=33190));const ue=se(N);n.renderbufferStorageMultisample(36161,ue,Y,N.width,N.height)}else n.renderbufferStorage(36161,Y,N.width,N.height);n.framebufferRenderbuffer(36160,36096,36161,U)}else if(N.depthBuffer&&N.stencilBuffer){if(X){const Y=se(N);n.renderbufferStorageMultisample(36161,Y,35056,N.width,N.height)}else n.renderbufferStorage(36161,34041,N.width,N.height);n.framebufferRenderbuffer(36160,33306,36161,U)}else{const Y=N.isWebGLMultipleRenderTargets===!0?N.texture[0]:N.texture,ie=s.convert(Y.format),ue=s.convert(Y.type),me=S(Y.internalFormat,ie,ue);if(X){const be=se(N);n.renderbufferStorageMultisample(36161,be,me,N.width,N.height)}else n.renderbufferStorage(36161,me,N.width,N.height)}n.bindRenderbuffer(36161,null)}function ee(U,N){if(N&&N.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,U),!(N.depthTexture&&N.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!i.get(N.depthTexture).__webglTexture||N.depthTexture.image.width!==N.width||N.depthTexture.image.height!==N.height)&&(N.depthTexture.image.width=N.width,N.depthTexture.image.height=N.height,N.depthTexture.needsUpdate=!0),L(N.depthTexture,0);const Y=i.get(N.depthTexture).__webglTexture;if(N.depthTexture.format===Pr)n.framebufferTexture2D(36160,36096,3553,Y,0);else if(N.depthTexture.format===Ls)n.framebufferTexture2D(36160,33306,3553,Y,0);else throw new Error("Unknown depthTexture format")}function ae(U){const N=i.get(U),X=U.isWebGLCubeRenderTarget===!0;if(U.depthTexture){if(X)throw new Error("target.depthTexture not supported in Cube render targets");ee(N.__webglFramebuffer,U)}else if(X){N.__webglDepthbuffer=[];for(let Y=0;Y<6;Y++)t.bindFramebuffer(36160,N.__webglFramebuffer[Y]),N.__webglDepthbuffer[Y]=n.createRenderbuffer(),te(N.__webglDepthbuffer[Y],U,!1)}else t.bindFramebuffer(36160,N.__webglFramebuffer),N.__webglDepthbuffer=n.createRenderbuffer(),te(N.__webglDepthbuffer,U,!1);t.bindFramebuffer(36160,null)}function H(U){const N=U.texture,X=i.get(U),Y=i.get(N);U.addEventListener("dispose",R),U.isWebGLMultipleRenderTargets!==!0&&(Y.__webglTexture=n.createTexture(),Y.__version=N.version,o.memory.textures++);const ie=U.isWebGLCubeRenderTarget===!0,ue=U.isWebGLMultipleRenderTargets===!0,me=U.isWebGLMultisampleRenderTarget===!0,be=N.isDataTexture3D||N.isDataTexture2DArray,ce=y(U)||l;if(l&&N.format===Mi&&(N.type===wi||N.type===Fr)&&(N.format=hn,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),ie){X.__webglFramebuffer=[];for(let ge=0;ge<6;ge++)X.__webglFramebuffer[ge]=n.createFramebuffer()}else if(X.__webglFramebuffer=n.createFramebuffer(),ue)if(r.drawBuffers){const ge=U.texture;for(let re=0,he=ge.length;re<he;re++){const ve=i.get(ge[re]);ve.__webglTexture===void 0&&(ve.__webglTexture=n.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(me)if(l){X.__webglMultisampledFramebuffer=n.createFramebuffer(),X.__webglColorRenderbuffer=n.createRenderbuffer(),n.bindRenderbuffer(36161,X.__webglColorRenderbuffer);const ge=s.convert(N.format),re=s.convert(N.type),he=S(N.internalFormat,ge,re),ve=se(U);n.renderbufferStorageMultisample(36161,ve,he,U.width,U.height),t.bindFramebuffer(36160,X.__webglMultisampledFramebuffer),n.framebufferRenderbuffer(36160,36064,36161,X.__webglColorRenderbuffer),n.bindRenderbuffer(36161,null),U.depthBuffer&&(X.__webglDepthRenderbuffer=n.createRenderbuffer(),te(X.__webglDepthRenderbuffer,U,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(ie){t.bindTexture(34067,Y.__webglTexture),k(34067,N,ce);for(let ge=0;ge<6;ge++)j(X.__webglFramebuffer[ge],U,N,36064,34069+ge);w(N,ce)&&A(34067,N,U.width,U.height),t.bindTexture(34067,null)}else if(ue){const ge=U.texture;for(let re=0,he=ge.length;re<he;re++){const ve=ge[re],Ee=i.get(ve);t.bindTexture(3553,Ee.__webglTexture),k(3553,ve,ce),j(X.__webglFramebuffer,U,ve,36064+re,3553),w(ve,ce)&&A(3553,ve,U.width,U.height)}t.bindTexture(3553,null)}else{let ge=3553;be&&(l?ge=N.isDataTexture3D?32879:35866:console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.")),t.bindTexture(ge,Y.__webglTexture),k(ge,N,ce),j(X.__webglFramebuffer,U,N,36064,ge),w(N,ce)&&A(ge,N,U.width,U.height,U.depth),t.bindTexture(ge,null)}U.depthBuffer&&ae(U)}function Z(U){const N=y(U)||l,X=U.isWebGLMultipleRenderTargets===!0?U.texture:[U.texture];for(let Y=0,ie=X.length;Y<ie;Y++){const ue=X[Y];if(w(ue,N)){const me=U.isWebGLCubeRenderTarget?34067:3553,be=i.get(ue).__webglTexture;t.bindTexture(me,be),A(me,ue,U.width,U.height),t.bindTexture(me,null)}}}function $(U){if(U.isWebGLMultisampleRenderTarget)if(l){const N=U.width,X=U.height;let Y=16384;U.depthBuffer&&(Y|=256),U.stencilBuffer&&(Y|=1024);const ie=i.get(U);t.bindFramebuffer(36008,ie.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,ie.__webglFramebuffer),n.blitFramebuffer(0,0,N,X,0,0,N,X,Y,9728),t.bindFramebuffer(36008,null),t.bindFramebuffer(36009,ie.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function se(U){return l&&U.isWebGLMultisampleRenderTarget?Math.min(h,U.samples):0}function z(U){const N=o.render.frame;p.get(U)!==N&&(p.set(U,N),U.update())}let W=!1,q=!1;function le(U,N){U&&U.isWebGLRenderTarget&&(W===!1&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),W=!0),U=U.texture),L(U,N)}function oe(U,N){U&&U.isWebGLCubeRenderTarget&&(q===!1&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),q=!0),U=U.texture),O(U,N)}this.allocateTextureUnit=C,this.resetTextureUnits=E,this.setTexture2D=L,this.setTexture2DArray=I,this.setTexture3D=x,this.setTextureCube=O,this.setupRenderTarget=H,this.updateRenderTargetMipmap=Z,this.updateMultisampleRenderTarget=$,this.safeSetTexture2D=le,this.safeSetTextureCube=oe}function fy(n,e,t){const i=t.isWebGL2;function r(s){let o;if(s===Rr)return 5121;if(s===x0)return 32819;if(s===w0)return 32820;if(s===M0)return 33635;if(s===v0)return 5120;if(s===y0)return 5122;if(s===Jo)return 5123;if(s===b0)return 5124;if(s===Ko)return 5125;if(s===wi)return 5126;if(s===Fr)return i?5131:(o=e.get("OES_texture_half_float"),o!==null?o.HALF_FLOAT_OES:null);if(s===A0)return 6406;if(s===Mi)return 6407;if(s===hn)return 6408;if(s===S0)return 6409;if(s===_0)return 6410;if(s===Pr)return 6402;if(s===Ls)return 34041;if(s===E0)return 6403;if(s===C0)return 36244;if(s===L0)return 33319;if(s===R0)return 33320;if(s===F0)return 36248;if(s===P0)return 36249;if(s===hd||s===fd||s===pd||s===md)if(o=e.get("WEBGL_compressed_texture_s3tc"),o!==null){if(s===hd)return o.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===fd)return o.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===pd)return o.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===md)return o.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===gd||s===vd||s===yd||s===bd)if(o=e.get("WEBGL_compressed_texture_pvrtc"),o!==null){if(s===gd)return o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===vd)return o.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===yd)return o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===bd)return o.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===I0)return o=e.get("WEBGL_compressed_texture_etc1"),o!==null?o.COMPRESSED_RGB_ETC1_WEBGL:null;if((s===xd||s===wd)&&(o=e.get("WEBGL_compressed_texture_etc"),o!==null)){if(s===xd)return o.COMPRESSED_RGB8_ETC2;if(s===wd)return o.COMPRESSED_RGBA8_ETC2_EAC}if(s===O0||s===N0||s===B0||s===D0||s===V0||s===k0||s===z0||s===U0||s===G0||s===H0||s===W0||s===j0||s===$0||s===Z0||s===Y0||s===J0||s===K0||s===q0||s===Q0||s===ev||s===tv||s===nv||s===iv||s===rv||s===sv||s===ov||s===av||s===lv)return o=e.get("WEBGL_compressed_texture_astc"),o!==null?s:null;if(s===X0)return o=e.get("EXT_texture_compression_bptc"),o!==null?s:null;if(s===Cs)return i?34042:(o=e.get("WEBGL_depth_texture"),o!==null?o.UNSIGNED_INT_24_8_WEBGL:null)}return{convert:r}}class oh extends Dt{constructor(e=[]){super(),this.cameras=e}}oh.prototype.isArrayCamera=!0;class Qn extends Xe{constructor(){super(),this.type="Group"}}Qn.prototype.isGroup=!0;const aO={type:"move"};class ah{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Qn,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 Qn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Q,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Q),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Qn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Q,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Q),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}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 r=null,s=null,o=null;const l=this._targetRay,u=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred")if(l!==null&&(r=t.getPose(e.targetRaySpace,i),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),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,this.dispatchEvent(aO))),c&&e.hand){o=!0;for(const d of e.hand.values()){const b=t.getJointPose(d,i);if(c.joints[d.jointName]===void 0){const g=new Qn;g.matrixAutoUpdate=!1,g.visible=!1,c.joints[d.jointName]=g,c.add(g)}const y=c.joints[d.jointName];b!==null&&(y.matrix.fromArray(b.transform.matrix),y.matrix.decompose(y.position,y.rotation,y.scale),y.jointRadius=b.radius),y.visible=b!==null}const f=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],p=f.position.distanceTo(h.position),v=.02,m=.005;c.inputState.pinching&&p>v+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&p<=v-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else u!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,i),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1));return l!==null&&(l.visible=r!==null),u!==null&&(u.visible=s!==null),c!==null&&(c.visible=o!==null),this}}class lO extends tr{constructor(e,t){super();const i=this,r=e.state;let s=null,o=1,l=null,u="local-floor",c=null,f=null,h=null,p=null;const v=[],m=new Map,d=new Dt;d.layers.enable(1),d.viewport=new it;const b=new Dt;b.layers.enable(2),b.viewport=new it;const y=[d,b],g=new oh;g.layers.enable(1),g.layers.enable(2);let w=null,A=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(I){let x=v[I];return x===void 0&&(x=new ah,v[I]=x),x.getTargetRaySpace()},this.getControllerGrip=function(I){let x=v[I];return x===void 0&&(x=new ah,v[I]=x),x.getGripSpace()},this.getHand=function(I){let x=v[I];return x===void 0&&(x=new ah,v[I]=x),x.getHandSpace()};function S(I){const x=m.get(I.inputSource);x&&x.dispatchEvent({type:I.type,data:I.inputSource})}function M(){m.forEach(function(I,x){I.disconnect(x)}),m.clear(),w=null,A=null,r.bindXRFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),L.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(I){o=I,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(I){u=I,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return l},this.getSession=function(){return s},this.setSession=async function(I){if(s=I,s!==null){s.addEventListener("select",S),s.addEventListener("selectstart",S),s.addEventListener("selectend",S),s.addEventListener("squeeze",S),s.addEventListener("squeezestart",S),s.addEventListener("squeezeend",S),s.addEventListener("end",M),s.addEventListener("inputsourceschange",F);const x=t.getContextAttributes();if(x.xrCompatible!==!0&&await t.makeXRCompatible(),s.renderState.layers===void 0){const O={antialias:x.antialias,alpha:x.alpha,depth:x.depth,stencil:x.stencil,framebufferScaleFactor:o},B=new XRWebGLLayer(s,t,O);s.updateRenderState({baseLayer:B})}else{let O=0;x.depth&&(O=x.stencil?34041:6402);const B={colorFormat:x.alpha?6408:6407,depthFormat:O,scaleFactor:o};f=new XRWebGLBinding(s,t),p=f.createProjectionLayer(B),h=t.createFramebuffer(),s.updateRenderState({layers:[p]})}l=await s.requestReferenceSpace(u),L.setContext(s),L.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};function F(I){const x=s.inputSources;for(let O=0;O<v.length;O++)m.set(x[O],v[O]);for(let O=0;O<I.removed.length;O++){const B=I.removed[O],D=m.get(B);D&&(D.dispatchEvent({type:"disconnected",data:B}),m.delete(B))}for(let O=0;O<I.added.length;O++){const B=I.added[O],D=m.get(B);D&&D.dispatchEvent({type:"connected",data:B})}}const R=new Q,T=new Q;function P(I,x,O){R.setFromMatrixPosition(x.matrixWorld),T.setFromMatrixPosition(O.matrixWorld);const B=R.distanceTo(T),D=x.projectionMatrix.elements,k=O.projectionMatrix.elements,V=D[14]/(D[10]-1),G=D[14]/(D[10]+1),J=(D[9]+1)/D[5],j=(D[9]-1)/D[5],te=(D[8]-1)/D[0],ee=(k[8]+1)/k[0],ae=V*te,H=V*ee,Z=B/(-te+ee),$=Z*-te;x.matrixWorld.decompose(I.position,I.quaternion,I.scale),I.translateX($),I.translateZ(Z),I.matrixWorld.compose(I.position,I.quaternion,I.scale),I.matrixWorldInverse.copy(I.matrixWorld).invert();const se=V+Z,z=G+Z,W=ae-$,q=H+(B-$),le=J*G/z*se,oe=j*G/z*se;I.projectionMatrix.makePerspective(W,q,le,oe,se,z)}function _(I,x){x===null?I.matrixWorld.copy(I.matrix):I.matrixWorld.multiplyMatrices(x.matrixWorld,I.matrix),I.matrixWorldInverse.copy(I.matrixWorld).invert()}this.updateCamera=function(I){if(s===null)return;g.near=b.near=d.near=I.near,g.far=b.far=d.far=I.far,(w!==g.near||A!==g.far)&&(s.updateRenderState({depthNear:g.near,depthFar:g.far}),w=g.near,A=g.far);const x=I.parent,O=g.cameras;_(g,x);for(let D=0;D<O.length;D++)_(O[D],x);g.matrixWorld.decompose(g.position,g.quaternion,g.scale),I.position.copy(g.position),I.quaternion.copy(g.quaternion),I.scale.copy(g.scale),I.matrix.copy(g.matrix),I.matrixWorld.copy(g.matrixWorld);const B=I.children;for(let D=0,k=B.length;D<k;D++)B[D].updateMatrixWorld(!0);O.length===2?P(g,d,b):g.projectionMatrix.copy(d.projectionMatrix)},this.getCamera=function(){return g};let E=null;function C(I,x){if(c=x.getViewerPose(l),c!==null){const B=c.views,D=s.renderState.baseLayer;s.renderState.layers===void 0&&r.bindXRFramebuffer(D.framebuffer);let k=!1;B.length!==g.cameras.length&&(g.cameras.length=0,k=!0);for(let V=0;V<B.length;V++){const G=B[V];let J=null;if(s.renderState.layers===void 0)J=D.getViewport(G);else{const te=f.getViewSubImage(p,G);r.bindXRFramebuffer(h),t.framebufferTexture2D(36160,36064,3553,te.colorTexture,0),te.depthStencilTexture!==void 0&&t.framebufferTexture2D(36160,36096,3553,te.depthStencilTexture,0),J=te.viewport}const j=y[V];j.matrix.fromArray(G.transform.matrix),j.projectionMatrix.fromArray(G.projectionMatrix),j.viewport.set(J.x,J.y,J.width,J.height),V===0&&g.matrix.copy(j.matrix),k===!0&&g.cameras.push(j)}}const O=s.inputSources;for(let B=0;B<v.length;B++){const D=v[B],k=O[B];D.update(k,x,l)}E&&E(I,x)}const L=new Hv;L.setAnimationLoop(C),this.setAnimationLoop=function(I){E=I},this.dispose=function(){}}}function cO(n){function e(y,g){y.fogColor.value.copy(g.color),g.isFog?(y.fogNear.value=g.near,y.fogFar.value=g.far):g.isFogExp2&&(y.fogDensity.value=g.density)}function t(y,g,w,A,S){g.isMeshBasicMaterial?i(y,g):g.isMeshLambertMaterial?(i(y,g),u(y,g)):g.isMeshToonMaterial?(i(y,g),f(y,g)):g.isMeshPhongMaterial?(i(y,g),c(y,g)):g.isMeshStandardMaterial?(i(y,g),g.isMeshPhysicalMaterial?p(y,g,S):h(y,g)):g.isMeshMatcapMaterial?(i(y,g),v(y,g)):g.isMeshDepthMaterial?(i(y,g),m(y,g)):g.isMeshDistanceMaterial?(i(y,g),d(y,g)):g.isMeshNormalMaterial?(i(y,g),b(y,g)):g.isLineBasicMaterial?(r(y,g),g.isLineDashedMaterial&&s(y,g)):g.isPointsMaterial?o(y,g,w,A):g.isSpriteMaterial?l(y,g):g.isShadowMaterial?(y.color.value.copy(g.color),y.opacity.value=g.opacity):g.isShaderMaterial&&(g.uniformsNeedUpdate=!1)}function i(y,g){y.opacity.value=g.opacity,g.color&&y.diffuse.value.copy(g.color),g.emissive&&y.emissive.value.copy(g.emissive).multiplyScalar(g.emissiveIntensity),g.map&&(y.map.value=g.map),g.alphaMap&&(y.alphaMap.value=g.alphaMap),g.specularMap&&(y.specularMap.value=g.specularMap);const w=n.get(g).envMap;if(w){y.envMap.value=w,y.flipEnvMap.value=w.isCubeTexture&&w._needsFlipEnvMap?-1:1,y.reflectivity.value=g.reflectivity,y.refractionRatio.value=g.refractionRatio;const M=n.get(w).__maxMipLevel;M!==void 0&&(y.maxMipLevel.value=M)}g.lightMap&&(y.lightMap.value=g.lightMap,y.lightMapIntensity.value=g.lightMapIntensity),g.aoMap&&(y.aoMap.value=g.aoMap,y.aoMapIntensity.value=g.aoMapIntensity);let A;g.map?A=g.map:g.specularMap?A=g.specularMap:g.displacementMap?A=g.displacementMap:g.normalMap?A=g.normalMap:g.bumpMap?A=g.bumpMap:g.roughnessMap?A=g.roughnessMap:g.metalnessMap?A=g.metalnessMap:g.alphaMap?A=g.alphaMap:g.emissiveMap?A=g.emissiveMap:g.clearcoatMap?A=g.clearcoatMap:g.clearcoatNormalMap?A=g.clearcoatNormalMap:g.clearcoatRoughnessMap&&(A=g.clearcoatRoughnessMap),A!==void 0&&(A.isWebGLRenderTarget&&(A=A.texture),A.matrixAutoUpdate===!0&&A.updateMatrix(),y.uvTransform.value.copy(A.matrix));let S;g.aoMap?S=g.aoMap:g.lightMap&&(S=g.lightMap),S!==void 0&&(S.isWebGLRenderTarget&&(S=S.texture),S.matrixAutoUpdate===!0&&S.updateMatrix(),y.uv2Transform.value.copy(S.matrix))}function r(y,g){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity}function s(y,g){y.dashSize.value=g.dashSize,y.totalSize.value=g.dashSize+g.gapSize,y.scale.value=g.scale}function o(y,g,w,A){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,y.size.value=g.size*w,y.scale.value=A*.5,g.map&&(y.map.value=g.map),g.alphaMap&&(y.alphaMap.value=g.alphaMap);let S;g.map?S=g.map:g.alphaMap&&(S=g.alphaMap),S!==void 0&&(S.matrixAutoUpdate===!0&&S.updateMatrix(),y.uvTransform.value.copy(S.matrix))}function l(y,g){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,y.rotation.value=g.rotation,g.map&&(y.map.value=g.map),g.alphaMap&&(y.alphaMap.value=g.alphaMap);let w;g.map?w=g.map:g.alphaMap&&(w=g.alphaMap),w!==void 0&&(w.matrixAutoUpdate===!0&&w.updateMatrix(),y.uvTransform.value.copy(w.matrix))}function u(y,g){g.emissiveMap&&(y.emissiveMap.value=g.emissiveMap)}function c(y,g){y.specular.value.copy(g.specular),y.shininess.value=Math.max(g.shininess,1e-4),g.emissiveMap&&(y.emissiveMap.value=g.emissiveMap),g.bumpMap&&(y.bumpMap.value=g.bumpMap,y.bumpScale.value=g.bumpScale,g.side===xt&&(y.bumpScale.value*=-1)),g.normalMap&&(y.normalMap.value=g.normalMap,y.normalScale.value.copy(g.normalScale),g.side===xt&&y.normalScale.value.negate()),g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias)}function f(y,g){g.gradientMap&&(y.gradientMap.value=g.gradientMap),g.emissiveMap&&(y.emissiveMap.value=g.emissiveMap),g.bumpMap&&(y.bumpMap.value=g.bumpMap,y.bumpScale.value=g.bumpScale,g.side===xt&&(y.bumpScale.value*=-1)),g.normalMap&&(y.normalMap.value=g.normalMap,y.normalScale.value.copy(g.normalScale),g.side===xt&&y.normalScale.value.negate()),g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias)}function h(y,g){y.roughness.value=g.roughness,y.metalness.value=g.metalness,g.roughnessMap&&(y.roughnessMap.value=g.roughnessMap),g.metalnessMap&&(y.metalnessMap.value=g.metalnessMap),g.emissiveMap&&(y.emissiveMap.value=g.emissiveMap),g.bumpMap&&(y.bumpMap.value=g.bumpMap,y.bumpScale.value=g.bumpScale,g.side===xt&&(y.bumpScale.value*=-1)),g.normalMap&&(y.normalMap.value=g.normalMap,y.normalScale.value.copy(g.normalScale),g.side===xt&&y.normalScale.value.negate()),g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias),n.get(g).envMap&&(y.envMapIntensity.value=g.envMapIntensity)}function p(y,g,w){h(y,g),y.reflectivity.value=g.reflectivity,y.clearcoat.value=g.clearcoat,y.clearcoatRoughness.value=g.clearcoatRoughness,g.sheen&&y.sheen.value.copy(g.sheen),g.clearcoatMap&&(y.clearcoatMap.value=g.clearcoatMap),g.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap),g.clearcoatNormalMap&&(y.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),y.clearcoatNormalMap.value=g.clearcoatNormalMap,g.side===xt&&y.clearcoatNormalScale.value.negate()),y.transmission.value=g.transmission,g.transmissionMap&&(y.transmissionMap.value=g.transmissionMap),g.transmission>0&&(y.transmissionSamplerMap.value=w.texture,y.transmissionSamplerSize.value.set(w.width,w.height)),y.thickness.value=g.thickness,g.thicknessMap&&(y.thicknessMap.value=g.thicknessMap),y.attenuationDistance.value=g.attenuationDistance,y.attenuationColor.value.copy(g.attenuationColor)}function v(y,g){g.matcap&&(y.matcap.value=g.matcap),g.bumpMap&&(y.bumpMap.value=g.bumpMap,y.bumpScale.value=g.bumpScale,g.side===xt&&(y.bumpScale.value*=-1)),g.normalMap&&(y.normalMap.value=g.normalMap,y.normalScale.value.copy(g.normalScale),g.side===xt&&y.normalScale.value.negate()),g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias)}function m(y,g){g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias)}function d(y,g){g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias),y.referencePosition.value.copy(g.referencePosition),y.nearDistance.value=g.nearDistance,y.farDistance.value=g.farDistance}function b(y,g){g.bumpMap&&(y.bumpMap.value=g.bumpMap,y.bumpScale.value=g.bumpScale,g.side===xt&&(y.bumpScale.value*=-1)),g.normalMap&&(y.normalMap.value=g.normalMap,y.normalScale.value.copy(g.normalScale),g.side===xt&&y.normalScale.value.negate()),g.displacementMap&&(y.displacementMap.value=g.displacementMap,y.displacementScale.value=g.displacementScale,y.displacementBias.value=g.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:t}}function uO(){const n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.style.display="block",n}function rt(n={}){const e=n.canvas!==void 0?n.canvas:uO(),t=n.context!==void 0?n.context:null,i=n.alpha!==void 0?n.alpha:!1,r=n.depth!==void 0?n.depth:!0,s=n.stencil!==void 0?n.stencil:!0,o=n.antialias!==void 0?n.antialias:!1,l=n.premultipliedAlpha!==void 0?n.premultipliedAlpha:!0,u=n.preserveDrawingBuffer!==void 0?n.preserveDrawingBuffer:!1,c=n.powerPreference!==void 0?n.powerPreference:"default",f=n.failIfMajorPerformanceCaveat!==void 0?n.failIfMajorPerformanceCaveat:!1;let h=null,p=null;const v=[],m=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=tn,this.physicallyCorrectLights=!1,this.toneMapping=qi,this.toneMappingExposure=1;const d=this;let b=!1,y=0,g=0,w=null,A=-1,S=null;const M=new it,F=new it;let R=null,T=e.width,P=e.height,_=1,E=null,C=null;const L=new it(0,0,T,P),I=new it(0,0,T,P);let x=!1;const O=[],B=new oa;let D=!1,k=!1,V=null;const G=new Oe,J=new Q,j={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function te(){return w===null?_:1}let ee=t;function ae(K,pe){for(let de=0;de<K.length;de++){const ye=K[de],Me=e.getContext(ye,pe);if(Me!==null)return Me}return null}try{const K={alpha:i,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:u,powerPreference:c,failIfMajorPerformanceCaveat:f};if(e.addEventListener("webglcontextlost",Ne,!1),e.addEventListener("webglcontextrestored",Je,!1),ee===null){const pe=["webgl2","webgl","experimental-webgl"];if(d.isWebGL1Renderer===!0&&pe.shift(),ee=ae(pe,K),ee===null)throw ae(pe)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}ee.getShaderPrecisionFormat===void 0&&(ee.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(K){throw console.error("THREE.WebGLRenderer: "+K.message),K}let H,Z,$,se,z,W,q,le,oe,U,N,X,Y,ie,ue,me,be,ce,ge,re,he,ve;function Ee(){H=new OP(ee),Z=new FP(ee,H,n),H.init(Z),he=new fy(ee,H,Z),$=new sO(ee,H,Z),O[0]=1029,se=new DP,z=new XI,W=new oO(ee,H,$,z,Z,he,se),q=new IP(d),le=new o3(ee,Z),ve=new LP(ee,H,le,Z),oe=new NP(ee,le,se,ve),U=new UP(ee,oe,le,se),ce=new zP(ee),ue=new PP(z),N=new ZI(d,q,H,Z,ve,ue),X=new cO(z),Y=new JI(z),ie=new nO(H,Z),be=new CP(d,q,$,U,l),me=new hy(d,U,Z),ge=new RP(ee,H,se,Z),re=new BP(ee,H,se,Z),se.programs=N.programs,d.capabilities=Z,d.extensions=H,d.properties=z,d.renderLists=Y,d.shadowMap=me,d.state=$,d.info=se}Ee();const _e=new lO(d,ee);this.xr=_e,this.getContext=function(){return ee},this.getContextAttributes=function(){return ee.getContextAttributes()},this.forceContextLoss=function(){const K=H.get("WEBGL_lose_context");K&&K.loseContext()},this.forceContextRestore=function(){const K=H.get("WEBGL_lose_context");K&&K.restoreContext()},this.getPixelRatio=function(){return _},this.setPixelRatio=function(K){K!==void 0&&(_=K,this.setSize(T,P,!1))},this.getSize=function(K){return K.set(T,P)},this.setSize=function(K,pe,de){if(_e.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}T=K,P=pe,e.width=Math.floor(K*_),e.height=Math.floor(pe*_),de!==!1&&(e.style.width=K+"px",e.style.height=pe+"px"),this.setViewport(0,0,K,pe)},this.getDrawingBufferSize=function(K){return K.set(T*_,P*_).floor()},this.setDrawingBufferSize=function(K,pe,de){T=K,P=pe,_=de,e.width=Math.floor(K*de),e.height=Math.floor(pe*de),this.setViewport(0,0,K,pe)},this.getCurrentViewport=function(K){return K.copy(M)},this.getViewport=function(K){return K.copy(L)},this.setViewport=function(K,pe,de,ye){K.isVector4?L.set(K.x,K.y,K.z,K.w):L.set(K,pe,de,ye),$.viewport(M.copy(L).multiplyScalar(_).floor())},this.getScissor=function(K){return K.copy(I)},this.setScissor=function(K,pe,de,ye){K.isVector4?I.set(K.x,K.y,K.z,K.w):I.set(K,pe,de,ye),$.scissor(F.copy(I).multiplyScalar(_).floor())},this.getScissorTest=function(){return x},this.setScissorTest=function(K){$.setScissorTest(x=K)},this.setOpaqueSort=function(K){E=K},this.setTransparentSort=function(K){C=K},this.getClearColor=function(K){return K.copy(be.getClearColor())},this.setClearColor=function(){be.setClearColor.apply(be,arguments)},this.getClearAlpha=function(){return be.getClearAlpha()},this.setClearAlpha=function(){be.setClearAlpha.apply(be,arguments)},this.clear=function(K,pe,de){let ye=0;(K===void 0||K)&&(ye|=16384),(pe===void 0||pe)&&(ye|=256),(de===void 0||de)&&(ye|=1024),ee.clear(ye)},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(){e.removeEventListener("webglcontextlost",Ne,!1),e.removeEventListener("webglcontextrestored",Je,!1),Y.dispose(),ie.dispose(),z.dispose(),q.dispose(),U.dispose(),ve.dispose(),_e.dispose(),_e.removeEventListener("sessionstart",It),_e.removeEventListener("sessionend",mt),V&&(V.dispose(),V=null),bt.stop()};function Ne(K){K.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),b=!0}function Je(){console.log("THREE.WebGLRenderer: Context Restored."),b=!1;const K=se.autoReset,pe=me.enabled,de=me.autoUpdate,ye=me.needsUpdate,Me=me.type;Ee(),se.autoReset=K,me.enabled=pe,me.autoUpdate=de,me.needsUpdate=ye,me.type=Me}function ze(K){const pe=K.target;pe.removeEventListener("dispose",ze),st(pe)}function st(K){Ce(K),z.remove(K)}function Ce(K){const pe=z.get(K).programs;pe!==void 0&&pe.forEach(function(de){N.releaseProgram(de)})}function je(K,pe){K.render(function(de){d.renderBufferImmediate(de,pe)})}this.renderBufferImmediate=function(K,pe){ve.initAttributes();const de=z.get(K);K.hasPositions&&!de.position&&(de.position=ee.createBuffer()),K.hasNormals&&!de.normal&&(de.normal=ee.createBuffer()),K.hasUvs&&!de.uv&&(de.uv=ee.createBuffer()),K.hasColors&&!de.color&&(de.color=ee.createBuffer());const ye=pe.getAttributes();K.hasPositions&&(ee.bindBuffer(34962,de.position),ee.bufferData(34962,K.positionArray,35048),ve.enableAttribute(ye.position),ee.vertexAttribPointer(ye.position,3,5126,!1,0,0)),K.hasNormals&&(ee.bindBuffer(34962,de.normal),ee.bufferData(34962,K.normalArray,35048),ve.enableAttribute(ye.normal),ee.vertexAttribPointer(ye.normal,3,5126,!1,0,0)),K.hasUvs&&(ee.bindBuffer(34962,de.uv),ee.bufferData(34962,K.uvArray,35048),ve.enableAttribute(ye.uv),ee.vertexAttribPointer(ye.uv,2,5126,!1,0,0)),K.hasColors&&(ee.bindBuffer(34962,de.color),ee.bufferData(34962,K.colorArray,35048),ve.enableAttribute(ye.color),ee.vertexAttribPointer(ye.color,3,5126,!1,0,0)),ve.disableUnusedAttributes(),ee.drawArrays(4,0,K.count),K.count=0},this.renderBufferDirect=function(K,pe,de,ye,Me,fe){pe===null&&(pe=j);const xe=Me.isMesh&&Me.matrixWorld.determinant()<0,Se=Te(K,pe,ye,Me);$.setMaterial(ye,xe);let Fe=de.index;const Ie=de.attributes.position;if(Fe===null){if(Ie===void 0||Ie.count===0)return}else if(Fe.count===0)return;let Ue=1;ye.wireframe===!0&&(Fe=oe.getWireframeAttribute(de),Ue=2),(ye.morphTargets||ye.morphNormals)&&ce.update(Me,de,ye,Se),ve.setup(Me,ye,Se,de,Fe);let De,Qe=ge;Fe!==null&&(De=le.get(Fe),Qe=re,Qe.setIndex(De));const Lt=Fe!==null?Fe.count:Ie.count,Gt=de.drawRange.start*Ue,os=de.drawRange.count*Ue,dt=fe!==null?fe.start*Ue:0,as=fe!==null?fe.count*Ue:1/0,Qt=Math.max(Gt,dt),T4=Math.min(Lt,Gt+os,dt+as)-1,Xc=Math.max(0,T4-Qt+1);if(Xc!==0){if(Me.isMesh)ye.wireframe===!0?($.setLineWidth(ye.wireframeLinewidth*te()),Qe.setMode(1)):Qe.setMode(4);else if(Me.isLine){let za=ye.linewidth;za===void 0&&(za=1),$.setLineWidth(za*te()),Me.isLineSegments?Qe.setMode(1):Me.isLineLoop?Qe.setMode(2):Qe.setMode(3)}else Me.isPoints?Qe.setMode(0):Me.isSprite&&Qe.setMode(4);if(Me.isInstancedMesh)Qe.renderInstances(Qt,Xc,Me.count);else if(de.isInstancedBufferGeometry){const za=Math.min(de.instanceCount,de._maxInstanceCount);Qe.renderInstances(Qt,Xc,za)}else Qe.render(Qt,Xc)}},this.compile=function(K,pe){p=ie.get(K),p.init(),K.traverseVisible(function(de){de.isLight&&de.layers.test(pe.layers)&&(p.pushLight(de),de.castShadow&&p.pushShadow(de))}),p.setupLights(),K.traverse(function(de){const ye=de.material;if(ye)if(Array.isArray(ye))for(let Me=0;Me<ye.length;Me++){const fe=ye[Me];ne(fe,K,de)}else ne(ye,K,de)})};let He=null;function Pt(K){He&&He(K)}function It(){bt.stop()}function mt(){bt.start()}const bt=new Hv;bt.setAnimationLoop(Pt),typeof window<"u"&&bt.setContext(window),this.setAnimationLoop=function(K){He=K,_e.setAnimationLoop(K),K===null?bt.stop():bt.start()},_e.addEventListener("sessionstart",It),_e.addEventListener("sessionend",mt),this.render=function(K,pe){if(pe!==void 0&&pe.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(b===!0)return;K.autoUpdate===!0&&K.updateMatrixWorld(),pe.parent===null&&pe.updateMatrixWorld(),_e.enabled===!0&&_e.isPresenting===!0&&(_e.cameraAutoUpdate===!0&&_e.updateCamera(pe),pe=_e.getCamera()),K.isScene===!0&&K.onBeforeRender(d,K,pe,w),p=ie.get(K,m.length),p.init(),m.push(p),G.multiplyMatrices(pe.projectionMatrix,pe.matrixWorldInverse),B.setFromProjectionMatrix(G),k=this.localClippingEnabled,D=ue.init(this.clippingPlanes,k,pe),h=Y.get(K,v.length),h.init(),v.push(h),Oi(K,pe,0,d.sortObjects),h.finish(),d.sortObjects===!0&&h.sort(E,C),D===!0&&ue.beginShadows();const de=p.state.shadowsArray;me.render(de,K,pe),p.setupLights(),p.setupLightsView(pe),D===!0&&ue.endShadows(),this.info.autoReset===!0&&this.info.reset(),be.render(h,K);const ye=h.opaque,Me=h.transmissive,fe=h.transparent;ye.length>0&&Un(ye,K,pe),Me.length>0&&Ni(ye,Me,K,pe),fe.length>0&&Un(fe,K,pe),w!==null&&(W.updateMultisampleRenderTarget(w),W.updateRenderTargetMipmap(w)),K.isScene===!0&&K.onAfterRender(d,K,pe),$.buffers.depth.setTest(!0),$.buffers.depth.setMask(!0),$.buffers.color.setMask(!0),$.setPolygonOffset(!1),ve.resetDefaultState(),A=-1,S=null,m.pop(),m.length>0?p=m[m.length-1]:p=null,v.pop(),v.length>0?h=v[v.length-1]:h=null};function Oi(K,pe,de,ye){if(K.visible===!1)return;if(K.layers.test(pe.layers)){if(K.isGroup)de=K.renderOrder;else if(K.isLOD)K.autoUpdate===!0&&K.update(pe);else if(K.isLight)p.pushLight(K),K.castShadow&&p.pushShadow(K);else if(K.isSprite){if(!K.frustumCulled||B.intersectsSprite(K)){ye&&J.setFromMatrixPosition(K.matrixWorld).applyMatrix4(G);const xe=U.update(K),Se=K.material;Se.visible&&h.push(K,xe,Se,de,J.z,null)}}else if(K.isImmediateRenderObject)ye&&J.setFromMatrixPosition(K.matrixWorld).applyMatrix4(G),h.push(K,null,K.material,de,J.z,null);else if((K.isMesh||K.isLine||K.isPoints)&&(K.isSkinnedMesh&&K.skeleton.frame!==se.render.frame&&(K.skeleton.update(),K.skeleton.frame=se.render.frame),!K.frustumCulled||B.intersectsObject(K))){ye&&J.setFromMatrixPosition(K.matrixWorld).applyMatrix4(G);const xe=U.update(K),Se=K.material;if(Array.isArray(Se)){const Fe=xe.groups;for(let Ie=0,Ue=Fe.length;Ie<Ue;Ie++){const De=Fe[Ie],Qe=Se[De.materialIndex];Qe&&Qe.visible&&h.push(K,xe,Qe,de,J.z,De)}}else Se.visible&&h.push(K,xe,Se,de,J.z,null)}}const fe=K.children;for(let xe=0,Se=fe.length;xe<Se;xe++)Oi(fe[xe],pe,de,ye)}function Ni(K,pe,de,ye){if(V===null){const Se=o===!0&&Z.isWebGL2===!0?Pd:Pn;V=new Se(1024,1024,{generateMipmaps:!0,type:he.convert(Fr)!==null?Fr:Rr,minFilter:xi,magFilter:wt,wrapS:zt,wrapT:zt})}const Me=d.getRenderTarget();d.setRenderTarget(V),d.clear();const fe=d.toneMapping;d.toneMapping=qi,Un(K,de,ye),d.toneMapping=fe,W.updateMultisampleRenderTarget(V),W.updateRenderTargetMipmap(V),d.setRenderTarget(Me),Un(pe,de,ye)}function Un(K,pe,de){const ye=pe.isScene===!0?pe.overrideMaterial:null;for(let Me=0,fe=K.length;Me<fe;Me++){const xe=K[Me],Se=xe.object,Fe=xe.geometry,Ie=ye===null?xe.material:ye,Ue=xe.group;if(de.isArrayCamera){const De=de.cameras;for(let Qe=0,Lt=De.length;Qe<Lt;Qe++){const Gt=De[Qe];Se.layers.test(Gt.layers)&&($.viewport(M.copy(Gt.viewport)),p.setupLightsView(Gt),ss(Se,pe,Gt,Fe,Ie,Ue))}}else ss(Se,pe,de,Fe,Ie,Ue)}}function ss(K,pe,de,ye,Me,fe){if(K.onBeforeRender(d,pe,de,ye,Me,fe),K.modelViewMatrix.multiplyMatrices(de.matrixWorldInverse,K.matrixWorld),K.normalMatrix.getNormalMatrix(K.modelViewMatrix),K.isImmediateRenderObject){const xe=Te(de,pe,Me,K);$.setMaterial(Me),ve.reset(),je(K,xe)}else Me.transparent===!0&&Me.side===Ki?(Me.side=xt,Me.needsUpdate=!0,d.renderBufferDirect(de,pe,ye,Me,K,fe),Me.side=Ji,Me.needsUpdate=!0,d.renderBufferDirect(de,pe,ye,Me,K,fe),Me.side=Ki):d.renderBufferDirect(de,pe,ye,Me,K,fe);K.onAfterRender(d,pe,de,ye,Me,fe)}function ne(K,pe,de){pe.isScene!==!0&&(pe=j);const ye=z.get(K),Me=p.state.lights,fe=p.state.shadowsArray,xe=Me.state.version,Se=N.getParameters(K,Me.state,fe,pe,de),Fe=N.getProgramCacheKey(Se);let Ie=ye.programs;ye.environment=K.isMeshStandardMaterial?pe.environment:null,ye.fog=pe.fog,ye.envMap=q.get(K.envMap||ye.environment),Ie===void 0&&(K.addEventListener("dispose",ze),Ie=new Map,ye.programs=Ie);let Ue=Ie.get(Fe);if(Ue!==void 0){if(ye.currentProgram===Ue&&ye.lightsStateVersion===xe)return we(K,Se),Ue}else Se.uniforms=N.getUniforms(K),K.onBuild(Se,d),K.onBeforeCompile(Se,d),Ue=N.acquireProgram(Se,Fe),Ie.set(Fe,Ue),ye.uniforms=Se.uniforms;const De=ye.uniforms;(!K.isShaderMaterial&&!K.isRawShaderMaterial||K.clipping===!0)&&(De.clippingPlanes=ue.uniform),we(K,Se),ye.needsLights=qe(K),ye.lightsStateVersion=xe,ye.needsLights&&(De.ambientLightColor.value=Me.state.ambient,De.lightProbe.value=Me.state.probe,De.directionalLights.value=Me.state.directional,De.directionalLightShadows.value=Me.state.directionalShadow,De.spotLights.value=Me.state.spot,De.spotLightShadows.value=Me.state.spotShadow,De.rectAreaLights.value=Me.state.rectArea,De.ltc_1.value=Me.state.rectAreaLTC1,De.ltc_2.value=Me.state.rectAreaLTC2,De.pointLights.value=Me.state.point,De.pointLightShadows.value=Me.state.pointShadow,De.hemisphereLights.value=Me.state.hemi,De.directionalShadowMap.value=Me.state.directionalShadowMap,De.directionalShadowMatrix.value=Me.state.directionalShadowMatrix,De.spotShadowMap.value=Me.state.spotShadowMap,De.spotShadowMatrix.value=Me.state.spotShadowMatrix,De.pointShadowMap.value=Me.state.pointShadowMap,De.pointShadowMatrix.value=Me.state.pointShadowMatrix);const Qe=Ue.getUniforms(),Lt=ur.seqWithValue(Qe.seq,De);return ye.currentProgram=Ue,ye.uniformsList=Lt,Ue}function we(K,pe){const de=z.get(K);de.outputEncoding=pe.outputEncoding,de.instancing=pe.instancing,de.skinning=pe.skinning,de.numClippingPlanes=pe.numClippingPlanes,de.numIntersection=pe.numClipIntersection,de.vertexAlphas=pe.vertexAlphas}function Te(K,pe,de,ye){pe.isScene!==!0&&(pe=j),W.resetTextureUnits();const Me=pe.fog,fe=de.isMeshStandardMaterial?pe.environment:null,xe=w===null?d.outputEncoding:w.texture.encoding,Se=q.get(de.envMap||fe),Fe=de.vertexColors===!0&&ye.geometry&&ye.geometry.attributes.color&&ye.geometry.attributes.color.itemSize===4,Ie=z.get(de),Ue=p.state.lights;if(D===!0&&(k===!0||K!==S)){const Qt=K===S&&de.id===A;ue.setState(de,K,Qt)}let De=!1;de.version===Ie.__version?(Ie.needsLights&&Ie.lightsStateVersion!==Ue.state.version||Ie.outputEncoding!==xe||ye.isInstancedMesh&&Ie.instancing===!1||!ye.isInstancedMesh&&Ie.instancing===!0||ye.isSkinnedMesh&&Ie.skinning===!1||!ye.isSkinnedMesh&&Ie.skinning===!0||Ie.envMap!==Se||de.fog&&Ie.fog!==Me||Ie.numClippingPlanes!==void 0&&(Ie.numClippingPlanes!==ue.numPlanes||Ie.numIntersection!==ue.numIntersection)||Ie.vertexAlphas!==Fe)&&(De=!0):(De=!0,Ie.__version=de.version);let Qe=Ie.currentProgram;De===!0&&(Qe=ne(de,pe,ye));let Lt=!1,Gt=!1,os=!1;const dt=Qe.getUniforms(),as=Ie.uniforms;if($.useProgram(Qe.program)&&(Lt=!0,Gt=!0,os=!0),de.id!==A&&(A=de.id,Gt=!0),Lt||S!==K){if(dt.setValue(ee,"projectionMatrix",K.projectionMatrix),Z.logarithmicDepthBuffer&&dt.setValue(ee,"logDepthBufFC",2/(Math.log(K.far+1)/Math.LN2)),S!==K&&(S=K,Gt=!0,os=!0),de.isShaderMaterial||de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshStandardMaterial||de.envMap){const Qt=dt.map.cameraPosition;Qt!==void 0&&Qt.setValue(ee,J.setFromMatrixPosition(K.matrixWorld))}(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial)&&dt.setValue(ee,"isOrthographic",K.isOrthographicCamera===!0),(de.isMeshPhongMaterial||de.isMeshToonMaterial||de.isMeshLambertMaterial||de.isMeshBasicMaterial||de.isMeshStandardMaterial||de.isShaderMaterial||de.isShadowMaterial||ye.isSkinnedMesh)&&dt.setValue(ee,"viewMatrix",K.matrixWorldInverse)}if(ye.isSkinnedMesh){dt.setOptional(ee,ye,"bindMatrix"),dt.setOptional(ee,ye,"bindMatrixInverse");const Qt=ye.skeleton;Qt&&(Z.floatVertexTextures?(Qt.boneTexture===null&&Qt.computeBoneTexture(),dt.setValue(ee,"boneTexture",Qt.boneTexture,W),dt.setValue(ee,"boneTextureSize",Qt.boneTextureSize)):dt.setOptional(ee,Qt,"boneMatrices"))}return(Gt||Ie.receiveShadow!==ye.receiveShadow)&&(Ie.receiveShadow=ye.receiveShadow,dt.setValue(ee,"receiveShadow",ye.receiveShadow)),Gt&&(dt.setValue(ee,"toneMappingExposure",d.toneMappingExposure),Ie.needsLights&&Be(as,os),Me&&de.fog&&X.refreshFogUniforms(as,Me),X.refreshMaterialUniforms(as,de,_,P,V),ur.upload(ee,Ie.uniformsList,as,W)),de.isShaderMaterial&&de.uniformsNeedUpdate===!0&&(ur.upload(ee,Ie.uniformsList,as,W),de.uniformsNeedUpdate=!1),de.isSpriteMaterial&&dt.setValue(ee,"center",ye.center),dt.setValue(ee,"modelViewMatrix",ye.modelViewMatrix),dt.setValue(ee,"normalMatrix",ye.normalMatrix),dt.setValue(ee,"modelMatrix",ye.matrixWorld),Qe}function Be(K,pe){K.ambientLightColor.needsUpdate=pe,K.lightProbe.needsUpdate=pe,K.directionalLights.needsUpdate=pe,K.directionalLightShadows.needsUpdate=pe,K.pointLights.needsUpdate=pe,K.pointLightShadows.needsUpdate=pe,K.spotLights.needsUpdate=pe,K.spotLightShadows.needsUpdate=pe,K.rectAreaLights.needsUpdate=pe,K.hemisphereLights.needsUpdate=pe}function qe(K){return K.isMeshLambertMaterial||K.isMeshToonMaterial||K.isMeshPhongMaterial||K.isMeshStandardMaterial||K.isShadowMaterial||K.isShaderMaterial&&K.lights===!0}this.getActiveCubeFace=function(){return y},this.getActiveMipmapLevel=function(){return g},this.getRenderTarget=function(){return w},this.setRenderTarget=function(K,pe=0,de=0){w=K,y=pe,g=de,K&&z.get(K).__webglFramebuffer===void 0&&W.setupRenderTarget(K);let ye=null,Me=!1,fe=!1;if(K){const Se=K.texture;(Se.isDataTexture3D||Se.isDataTexture2DArray)&&(fe=!0);const Fe=z.get(K).__webglFramebuffer;K.isWebGLCubeRenderTarget?(ye=Fe[pe],Me=!0):K.isWebGLMultisampleRenderTarget?ye=z.get(K).__webglMultisampledFramebuffer:ye=Fe,M.copy(K.viewport),F.copy(K.scissor),R=K.scissorTest}else M.copy(L).multiplyScalar(_).floor(),F.copy(I).multiplyScalar(_).floor(),R=x;if($.bindFramebuffer(36160,ye)&&Z.drawBuffers){let Se=!1;if(K)if(K.isWebGLMultipleRenderTargets){const Fe=K.texture;if(O.length!==Fe.length||O[0]!==36064){for(let Ie=0,Ue=Fe.length;Ie<Ue;Ie++)O[Ie]=36064+Ie;O.length=Fe.length,Se=!0}}else(O.length!==1||O[0]!==36064)&&(O[0]=36064,O.length=1,Se=!0);else(O.length!==1||O[0]!==1029)&&(O[0]=1029,O.length=1,Se=!0);Se&&(Z.isWebGL2?ee.drawBuffers(O):H.get("WEBGL_draw_buffers").drawBuffersWEBGL(O))}if($.viewport(M),$.scissor(F),$.setScissorTest(R),Me){const Se=z.get(K.texture);ee.framebufferTexture2D(36160,36064,34069+pe,Se.__webglTexture,de)}else if(fe){const Se=z.get(K.texture),Fe=pe||0;ee.framebufferTextureLayer(36160,36064,Se.__webglTexture,de||0,Fe)}},this.readRenderTargetPixels=function(K,pe,de,ye,Me,fe,xe){if(!(K&&K.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Se=z.get(K).__webglFramebuffer;if(K.isWebGLCubeRenderTarget&&xe!==void 0&&(Se=Se[xe]),Se){$.bindFramebuffer(36160,Se);try{const Fe=K.texture,Ie=Fe.format,Ue=Fe.type;if(Ie!==hn&&he.convert(Ie)!==ee.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const De=Ue===Fr&&(H.has("EXT_color_buffer_half_float")||Z.isWebGL2&&H.has("EXT_color_buffer_float"));if(Ue!==Rr&&he.convert(Ue)!==ee.getParameter(35738)&&!(Ue===wi&&(Z.isWebGL2||H.has("OES_texture_float")||H.has("WEBGL_color_buffer_float")))&&!De){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ee.checkFramebufferStatus(36160)===36053?pe>=0&&pe<=K.width-ye&&de>=0&&de<=K.height-Me&&ee.readPixels(pe,de,ye,Me,he.convert(Ie),he.convert(Ue),fe):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const Fe=w!==null?z.get(w).__webglFramebuffer:null;$.bindFramebuffer(36160,Fe)}}},this.copyFramebufferToTexture=function(K,pe,de=0){const ye=Math.pow(2,-de),Me=Math.floor(pe.image.width*ye),fe=Math.floor(pe.image.height*ye);let xe=he.convert(pe.format);Z.isWebGL2&&(xe===6407&&(xe=32849),xe===6408&&(xe=32856)),W.setTexture2D(pe,0),ee.copyTexImage2D(3553,de,xe,K.x,K.y,Me,fe,0),$.unbindTexture()},this.copyTextureToTexture=function(K,pe,de,ye=0){const Me=pe.image.width,fe=pe.image.height,xe=he.convert(de.format),Se=he.convert(de.type);W.setTexture2D(de,0),ee.pixelStorei(37440,de.flipY),ee.pixelStorei(37441,de.premultiplyAlpha),ee.pixelStorei(3317,de.unpackAlignment),pe.isDataTexture?ee.texSubImage2D(3553,ye,K.x,K.y,Me,fe,xe,Se,pe.image.data):pe.isCompressedTexture?ee.compressedTexSubImage2D(3553,ye,K.x,K.y,pe.mipmaps[0].width,pe.mipmaps[0].height,xe,pe.mipmaps[0].data):ee.texSubImage2D(3553,ye,K.x,K.y,xe,Se,pe.image),ye===0&&de.generateMipmaps&&ee.generateMipmap(3553),$.unbindTexture()},this.copyTextureToTexture3D=function(K,pe,de,ye,Me=0){if(d.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const fe=K.max.x-K.min.x+1,xe=K.max.y-K.min.y+1,Se=K.max.z-K.min.z+1,Fe=he.convert(ye.format),Ie=he.convert(ye.type);let Ue;if(ye.isDataTexture3D)W.setTexture3D(ye,0),Ue=32879;else if(ye.isDataTexture2DArray)W.setTexture2DArray(ye,0),Ue=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}ee.pixelStorei(37440,ye.flipY),ee.pixelStorei(37441,ye.premultiplyAlpha),ee.pixelStorei(3317,ye.unpackAlignment);const De=ee.getParameter(3314),Qe=ee.getParameter(32878),Lt=ee.getParameter(3316),Gt=ee.getParameter(3315),os=ee.getParameter(32877),dt=de.isCompressedTexture?de.mipmaps[0]:de.image;ee.pixelStorei(3314,dt.width),ee.pixelStorei(32878,dt.height),ee.pixelStorei(3316,K.min.x),ee.pixelStorei(3315,K.min.y),ee.pixelStorei(32877,K.min.z),de.isDataTexture||de.isDataTexture3D?ee.texSubImage3D(Ue,Me,pe.x,pe.y,pe.z,fe,xe,Se,Fe,Ie,dt.data):de.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ee.compressedTexSubImage3D(Ue,Me,pe.x,pe.y,pe.z,fe,xe,Se,Fe,dt.data)):ee.texSubImage3D(Ue,Me,pe.x,pe.y,pe.z,fe,xe,Se,Fe,Ie,dt),ee.pixelStorei(3314,De),ee.pixelStorei(32878,Qe),ee.pixelStorei(3316,Lt),ee.pixelStorei(3315,Gt),ee.pixelStorei(32877,os),Me===0&&ye.generateMipmaps&&ee.generateMipmap(Ue),$.unbindTexture()},this.initTexture=function(K){W.setTexture2D(K,0),$.unbindTexture()},this.resetState=function(){y=0,g=0,w=null,$.reset(),ve.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}class py extends rt{}py.prototype.isWebGL1Renderer=!0;class ca{constructor(e,t=25e-5){this.name="",this.color=new Le(e),this.density=t}clone(){return new ca(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}ca.prototype.isFogExp2=!0;class ua{constructor(e,t=1,i=1e3){this.name="",this.color=new Le(e),this.near=t,this.far=i}clone(){return new ua(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}ua.prototype.isFog=!0;class oc extends Xe{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,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()),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),t}}oc.prototype.isScene=!0;class dr{constructor(e,t){this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Fs,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=fn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}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 r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[i+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=fn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(t,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=fn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}dr.prototype.isInterleavedBuffer=!0;const _t=new Q;class Fi{constructor(e,t,i,r=!1){this.name="",this.data=e,this.itemSize=t,this.offset=i,this.normalized=r===!0}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,i=this.data.count;t<i;t++)_t.x=this.getX(t),_t.y=this.getY(t),_t.z=this.getZ(t),_t.applyMatrix4(e),this.setXYZ(t,_t.x,_t.y,_t.z);return this}applyNormalMatrix(e){for(let t=0,i=this.count;t<i;t++)_t.x=this.getX(t),_t.y=this.getY(t),_t.z=this.getZ(t),_t.applyNormalMatrix(e),this.setXYZ(t,_t.x,_t.y,_t.z);return this}transformDirection(e){for(let t=0,i=this.count;t<i;t++)_t.x=this.getX(t),_t.y=this.getY(t),_t.z=this.getZ(t),_t.transformDirection(e),this.setXYZ(t,_t.x,_t.y,_t.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this}setXYZ(e,t,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this}setXYZW(e,t,i,r,s){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new Ze(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Fi(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let i=0;i<this.count;i++){const r=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}Fi.prototype.isInterleavedBufferAttribute=!0;class da extends Ft{constructor(e){super(),this.type="SpriteMaterial",this.color=new Le(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}da.prototype.isSpriteMaterial=!0;let Js;const ha=new Q,Ks=new Q,qs=new Q,Qs=new Ae,fa=new Ae,my=new Oe,ac=new Q,pa=new Q,lc=new Q,gy=new Ae,lh=new Ae,vy=new Ae;class ma extends Xe{constructor(e){if(super(),this.type="Sprite",Js===void 0){Js=new ke;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new dr(t,5);Js.setIndex([0,1,2,0,2,3]),Js.setAttribute("position",new Fi(i,3,0,!1)),Js.setAttribute("uv",new Fi(i,2,3,!1))}this.geometry=Js,this.material=e!==void 0?e:new da,this.center=new Ae(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Ks.setFromMatrixScale(this.matrixWorld),my.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),qs.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&Ks.multiplyScalar(-qs.z);const i=this.material.rotation;let r,s;i!==0&&(s=Math.cos(i),r=Math.sin(i));const o=this.center;cc(ac.set(-.5,-.5,0),qs,o,Ks,r,s),cc(pa.set(.5,-.5,0),qs,o,Ks,r,s),cc(lc.set(.5,.5,0),qs,o,Ks,r,s),gy.set(0,0),lh.set(1,0),vy.set(1,1);let l=e.ray.intersectTriangle(ac,pa,lc,!1,ha);if(l===null&&(cc(pa.set(-.5,.5,0),qs,o,Ks,r,s),lh.set(0,1),l=e.ray.intersectTriangle(ac,lc,pa,!1,ha),l===null))return;const u=e.ray.origin.distanceTo(ha);u<e.near||u>e.far||t.push({distance:u,point:ha.clone(),uv:At.getUV(ha,ac,pa,lc,gy,lh,vy,new Ae),face:null,object:this})}copy(e){return super.copy(e),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}ma.prototype.isSprite=!0;function cc(n,e,t,i,r,s){Qs.subVectors(n,t).addScalar(.5).multiply(i),r!==void 0?(fa.x=s*Qs.x-r*Qs.y,fa.y=r*Qs.x+s*Qs.y):fa.copy(Qs),n.copy(e),n.x+=fa.x,n.y+=fa.y,n.applyMatrix4(my)}const uc=new Q,yy=new Q;class by extends Xe{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let i=0,r=t.length;i<r;i++){const s=t[i];this.addLevel(s.object.clone(),s.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const i=this.levels;let r;for(r=0;r<i.length&&!(t<i[r].distance);r++);return i.splice(r,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let i,r;for(i=1,r=t.length;i<r&&!(e<t[i].distance);i++);return t[i-1].object}return null}raycast(e,t){if(this.levels.length>0){uc.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(uc);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){uc.setFromMatrixPosition(e.matrixWorld),yy.setFromMatrixPosition(this.matrixWorld);const i=uc.distanceTo(yy)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r<s&&i>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<s;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const i=this.levels;for(let r=0,s=i.length;r<s;r++){const o=i[r];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t}}const xy=new Q,wy=new it,My=new it,dO=new Q,Ay=new Oe;class ga extends St{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Oe,this.bindMatrixInverse=new Oe}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new it,t=this.geometry.attributes.skinWeight;for(let i=0,r=t.count;i<r;i++){e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.w=t.getW(i);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const i=this.skeleton,r=this.geometry;wy.fromBufferAttribute(r.attributes.skinIndex,e),My.fromBufferAttribute(r.attributes.skinWeight,e),xy.fromBufferAttribute(r.attributes.position,e).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=My.getComponent(s);if(o!==0){const l=wy.getComponent(s);Ay.multiplyMatrices(i.bones[l].matrixWorld,i.boneInverses[l]),t.addScaledVector(dO.copy(xy).applyMatrix4(Ay),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}ga.prototype.isSkinnedMesh=!0;class va extends Xe{constructor(){super(),this.type="Bone"}}va.prototype.isBone=!0;class Hr extends Mt{constructor(e=null,t=1,i=1,r,s,o,l,u,c=wt,f=wt,h,p){super(null,o,l,u,c,f,r,s,h,p),this.image={data:e,width:t,height:i},this.magFilter=c,this.minFilter=f,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Hr.prototype.isDataTexture=!0;const Sy=new Oe,hO=new Oe;class ya{constructor(e=[],t=[]){this.uuid=fn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new Oe)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const i=new Oe;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,t=this.boneInverses,i=this.boneMatrices,r=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const l=e[s]?e[s].matrixWorld:hO;Sy.multiplyMatrices(l,t[s]),Sy.toArray(i,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new ya(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=bv(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const i=new Hr(t,e,e,hn,wi);return this.boneMatrices=t,this.boneTexture=i,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,i=this.bones.length;t<i;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let i=0,r=e.bones.length;i<r;i++){const s=e.bones[i];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new va),this.bones.push(o),this.boneInverses.push(new Oe().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,i=this.boneInverses;for(let r=0,s=t.length;r<s;r++){const o=t[r];e.bones.push(o.uuid);const l=i[r];e.boneInverses.push(l.toArray())}return e}}const _y=new Oe,Ty=new Oe,dc=[],ba=new St;class ch extends St{constructor(e,t,i){super(e,t),this.instanceMatrix=new Ze(new Float32Array(i*16),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}raycast(e,t){const i=this.matrixWorld,r=this.count;if(ba.geometry=this.geometry,ba.material=this.material,ba.material!==void 0)for(let s=0;s<r;s++){this.getMatrixAt(s,_y),Ty.multiplyMatrices(i,_y),ba.matrixWorld=Ty,ba.raycast(e,dc);for(let o=0,l=dc.length;o<l;o++){const u=dc[o];u.instanceId=s,u.object=this,t.push(u)}dc.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new Ze(new Float32Array(this.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}ch.prototype.isInstancedMesh=!0;class Vt extends Ft{constructor(e){super(),this.type="LineBasicMaterial",this.color=new Le(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this}}Vt.prototype.isLineBasicMaterial=!0;const Ey=new Q,Cy=new Q,Ly=new Oe,uh=new sr,hc=new Si;class ei extends Xe{constructor(e=new ke,t=new Vt){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[0];for(let r=1,s=t.count;r<s;r++)Ey.fromBufferAttribute(t,r-1),Cy.fromBufferAttribute(t,r),i[r]=i[r-1],i[r]+=Ey.distanceTo(Cy);e.setAttribute("lineDistance",new Pe(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),hc.copy(i.boundingSphere),hc.applyMatrix4(r),hc.radius+=s,e.ray.intersectsSphere(hc)===!1)return;Ly.copy(r).invert(),uh.copy(e.ray).applyMatrix4(Ly);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,c=new Q,f=new Q,h=new Q,p=new Q,v=this.isLineSegments?2:1;if(i.isBufferGeometry){const m=i.index,b=i.attributes.position;if(m!==null){const y=Math.max(0,o.start),g=Math.min(m.count,o.start+o.count);for(let w=y,A=g-1;w<A;w+=v){const S=m.getX(w),M=m.getX(w+1);if(c.fromBufferAttribute(b,S),f.fromBufferAttribute(b,M),uh.distanceSqToSegment(c,f,p,h)>u)continue;p.applyMatrix4(this.matrixWorld);const R=e.ray.origin.distanceTo(p);R<e.near||R>e.far||t.push({distance:R,point:h.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const y=Math.max(0,o.start),g=Math.min(b.count,o.start+o.count);for(let w=y,A=g-1;w<A;w+=v){if(c.fromBufferAttribute(b,w),f.fromBufferAttribute(b,w+1),uh.distanceSqToSegment(c,f,p,h)>u)continue;p.applyMatrix4(this.matrixWorld);const M=e.ray.origin.distanceTo(p);M<e.near||M>e.far||t.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const l=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}ei.prototype.isLine=!0;const Ry=new Q,Fy=new Q;class rn extends ei{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(e.index===null){const t=e.attributes.position,i=[];for(let r=0,s=t.count;r<s;r+=2)Ry.fromBufferAttribute(t,r),Fy.fromBufferAttribute(t,r+1),i[r]=r===0?0:i[r-1],i[r+1]=i[r]+Ry.distanceTo(Fy);e.setAttribute("lineDistance",new Pe(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}rn.prototype.isLineSegments=!0;class fc extends ei{constructor(e,t){super(e,t),this.type="LineLoop"}}fc.prototype.isLineLoop=!0;class hr extends Ft{constructor(e){super(),this.type="PointsMaterial",this.color=new Le(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this}}hr.prototype.isPointsMaterial=!0;const Py=new Oe,dh=new sr,pc=new Si,mc=new Q;class eo extends Xe{constructor(e=new ke,t=new hr){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const i=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,o=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),pc.copy(i.boundingSphere),pc.applyMatrix4(r),pc.radius+=s,e.ray.intersectsSphere(pc)===!1)return;Py.copy(r).invert(),dh.copy(e.ray).applyMatrix4(Py);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l;if(i.isBufferGeometry){const c=i.index,h=i.attributes.position;if(c!==null){const p=Math.max(0,o.start),v=Math.min(c.count,o.start+o.count);for(let m=p,d=v;m<d;m++){const b=c.getX(m);mc.fromBufferAttribute(h,b),Iy(mc,b,u,r,e,t,this)}}else{const p=Math.max(0,o.start),v=Math.min(h.count,o.start+o.count);for(let m=p,d=v;m<d;m++)mc.fromBufferAttribute(h,m),Iy(mc,m,u,r,e,t,this)}}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,i=Object.keys(t);if(i.length>0){const r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=r.length;s<o;s++){const l=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}else{const t=e.morphTargets;t!==void 0&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}eo.prototype.isPoints=!0;function Iy(n,e,t,i,r,s,o){const l=dh.distanceSqToPoint(n);if(l<t){const u=new Q;dh.closestPointToPoint(n,u),u.applyMatrix4(i);const c=r.ray.origin.distanceTo(u);if(c<r.near||c>r.far)return;s.push({distance:c,distanceToRay:Math.sqrt(l),point:u,index:e,face:null,object:o})}}class Oy extends Mt{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.format=l!==void 0?l:Mi,this.minFilter=o!==void 0?o:vt,this.magFilter=s!==void 0?s:vt,this.generateMipmaps=!1;const f=this;function h(){f.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}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)}}Oy.prototype.isVideoTexture=!0;class hh extends Mt{constructor(e,t,i,r,s,o,l,u,c,f,h,p){super(null,o,l,u,c,f,r,s,h,p),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}hh.prototype.isCompressedTexture=!0;class Ny extends Mt{constructor(e,t,i,r,s,o,l,u,c){super(e,t,i,r,s,o,l,u,c),this.needsUpdate=!0}}Ny.prototype.isCanvasTexture=!0;class By extends Mt{constructor(e,t,i,r,s,o,l,u,c,f){if(f=f!==void 0?f:Pr,f!==Pr&&f!==Ls)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");i===void 0&&f===Pr&&(i=Jo),i===void 0&&f===Ls&&(i=Cs),super(null,r,s,o,l,u,f,i,c),this.image={width:e,height:t},this.magFilter=l!==void 0?l:wt,this.minFilter=u!==void 0?u:wt,this.flipY=!1,this.generateMipmaps=!1}}By.prototype.isDepthTexture=!0;class to extends ke{constructor(e=1,t=8,i=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},t=Math.max(3,t);const s=[],o=[],l=[],u=[],c=new Q,f=new Ae;o.push(0,0,0),l.push(0,0,1),u.push(.5,.5);for(let h=0,p=3;h<=t;h++,p+=3){const v=i+h/t*r;c.x=e*Math.cos(v),c.y=e*Math.sin(v),o.push(c.x,c.y,c.z),l.push(0,0,1),f.x=(o[p]/e+1)/2,f.y=(o[p+1]/e+1)/2,u.push(f.x,f.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new Pe(o,3)),this.setAttribute("normal",new Pe(l,3)),this.setAttribute("uv",new Pe(u,2))}static fromJSON(e){return new to(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class fr extends ke{constructor(e=1,t=1,i=1,r=8,s=1,o=!1,l=0,u=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:s,openEnded:o,thetaStart:l,thetaLength:u};const c=this;r=Math.floor(r),s=Math.floor(s);const f=[],h=[],p=[],v=[];let m=0;const d=[],b=i/2;let y=0;g(),o===!1&&(e>0&&w(!0),t>0&&w(!1)),this.setIndex(f),this.setAttribute("position",new Pe(h,3)),this.setAttribute("normal",new Pe(p,3)),this.setAttribute("uv",new Pe(v,2));function g(){const A=new Q,S=new Q;let M=0;const F=(t-e)/i;for(let R=0;R<=s;R++){const T=[],P=R/s,_=P*(t-e)+e;for(let E=0;E<=r;E++){const C=E/r,L=C*u+l,I=Math.sin(L),x=Math.cos(L);S.x=_*I,S.y=-P*i+b,S.z=_*x,h.push(S.x,S.y,S.z),A.set(I,F,x).normalize(),p.push(A.x,A.y,A.z),v.push(C,1-P),T.push(m++)}d.push(T)}for(let R=0;R<r;R++)for(let T=0;T<s;T++){const P=d[T][R],_=d[T+1][R],E=d[T+1][R+1],C=d[T][R+1];f.push(P,_,C),f.push(_,E,C),M+=6}c.addGroup(y,M,0),y+=M}function w(A){const S=m,M=new Ae,F=new Q;let R=0;const T=A===!0?e:t,P=A===!0?1:-1;for(let E=1;E<=r;E++)h.push(0,b*P,0),p.push(0,P,0),v.push(.5,.5),m++;const _=m;for(let E=0;E<=r;E++){const L=E/r*u+l,I=Math.cos(L),x=Math.sin(L);F.x=T*x,F.y=b*P,F.z=T*I,h.push(F.x,F.y,F.z),p.push(0,P,0),M.x=I*.5+.5,M.y=x*.5*P+.5,v.push(M.x,M.y),m++}for(let E=0;E<r;E++){const C=S+E,L=_+E;A===!0?f.push(L,L+1,C):f.push(L+1,L,C),R+=3}c.addGroup(y,R,A===!0?1:2),y+=R}}static fromJSON(e){return new fr(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class no extends fr{constructor(e=1,t=1,i=8,r=1,s=!1,o=0,l=Math.PI*2){super(0,e,t,i,r,s,o,l),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:l}}static fromJSON(e){return new no(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class ti extends ke{constructor(e,t,i=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r};const s=[],o=[];l(r),c(i),f(),this.setAttribute("position",new Pe(s,3)),this.setAttribute("normal",new Pe(s.slice(),3)),this.setAttribute("uv",new Pe(o,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function l(g){const w=new Q,A=new Q,S=new Q;for(let M=0;M<t.length;M+=3)v(t[M+0],w),v(t[M+1],A),v(t[M+2],S),u(w,A,S,g)}function u(g,w,A,S){const M=S+1,F=[];for(let R=0;R<=M;R++){F[R]=[];const T=g.clone().lerp(A,R/M),P=w.clone().lerp(A,R/M),_=M-R;for(let E=0;E<=_;E++)E===0&&R===M?F[R][E]=T:F[R][E]=T.clone().lerp(P,E/_)}for(let R=0;R<M;R++)for(let T=0;T<2*(M-R)-1;T++){const P=Math.floor(T/2);T%2===0?(p(F[R][P+1]),p(F[R+1][P]),p(F[R][P])):(p(F[R][P+1]),p(F[R+1][P+1]),p(F[R+1][P]))}}function c(g){const w=new Q;for(let A=0;A<s.length;A+=3)w.x=s[A+0],w.y=s[A+1],w.z=s[A+2],w.normalize().multiplyScalar(g),s[A+0]=w.x,s[A+1]=w.y,s[A+2]=w.z}function f(){const g=new Q;for(let w=0;w<s.length;w+=3){g.x=s[w+0],g.y=s[w+1],g.z=s[w+2];const A=b(g)/2/Math.PI+.5,S=y(g)/Math.PI+.5;o.push(A,1-S)}m(),h()}function h(){for(let g=0;g<o.length;g+=6){const w=o[g+0],A=o[g+2],S=o[g+4],M=Math.max(w,A,S),F=Math.min(w,A,S);M>.9&&F<.1&&(w<.2&&(o[g+0]+=1),A<.2&&(o[g+2]+=1),S<.2&&(o[g+4]+=1))}}function p(g){s.push(g.x,g.y,g.z)}function v(g,w){const A=g*3;w.x=e[A+0],w.y=e[A+1],w.z=e[A+2]}function m(){const g=new Q,w=new Q,A=new Q,S=new Q,M=new Ae,F=new Ae,R=new Ae;for(let T=0,P=0;T<s.length;T+=9,P+=6){g.set(s[T+0],s[T+1],s[T+2]),w.set(s[T+3],s[T+4],s[T+5]),A.set(s[T+6],s[T+7],s[T+8]),M.set(o[P+0],o[P+1]),F.set(o[P+2],o[P+3]),R.set(o[P+4],o[P+5]),S.copy(g).add(w).add(A).divideScalar(3);const _=b(S);d(M,P+0,g,_),d(F,P+2,w,_),d(R,P+4,A,_)}}function d(g,w,A,S){S<0&&g.x===1&&(o[w]=g.x-1),A.x===0&&A.z===0&&(o[w]=S/2/Math.PI+.5)}function b(g){return Math.atan2(g.z,-g.x)}function y(g){return Math.atan2(-g.y,Math.sqrt(g.x*g.x+g.z*g.z))}}static fromJSON(e){return new ti(e.vertices,e.indices,e.radius,e.details)}}class io extends ti{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=1/i,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new io(e.radius,e.detail)}}const gc=new Q,vc=new Q,fh=new Q,yc=new At;class ph extends ke{constructor(e,t){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=t!==void 0?t:1,e.isGeometry===!0){console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return}const r=Math.pow(10,4),s=Math.cos(Dr*t),o=e.getIndex(),l=e.getAttribute("position"),u=o?o.count:l.count,c=[0,0,0],f=["a","b","c"],h=new Array(3),p={},v=[];for(let m=0;m<u;m+=3){o?(c[0]=o.getX(m),c[1]=o.getX(m+1),c[2]=o.getX(m+2)):(c[0]=m,c[1]=m+1,c[2]=m+2);const{a:d,b,c:y}=yc;if(d.fromBufferAttribute(l,c[0]),b.fromBufferAttribute(l,c[1]),y.fromBufferAttribute(l,c[2]),yc.getNormal(fh),h[0]=`${Math.round(d.x*r)},${Math.round(d.y*r)},${Math.round(d.z*r)}`,h[1]=`${Math.round(b.x*r)},${Math.round(b.y*r)},${Math.round(b.z*r)}`,h[2]=`${Math.round(y.x*r)},${Math.round(y.y*r)},${Math.round(y.z*r)}`,!(h[0]===h[1]||h[1]===h[2]||h[2]===h[0]))for(let g=0;g<3;g++){const w=(g+1)%3,A=h[g],S=h[w],M=yc[f[g]],F=yc[f[w]],R=`${A}_${S}`,T=`${S}_${A}`;T in p&&p[T]?(fh.dot(p[T].normal)<=s&&(v.push(M.x,M.y,M.z),v.push(F.x,F.y,F.z)),p[T]=null):R in p||(p[R]={index0:c[g],index1:c[w],normal:fh.clone()})}}for(const m in p)if(p[m]){const{index0:d,index1:b}=p[m];gc.fromBufferAttribute(l,d),vc.fromBufferAttribute(l,b),v.push(gc.x,gc.y,gc.z),v.push(vc.x,vc.y,vc.z)}this.setAttribute("position",new Pe(v,3))}}class gn{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const i=this.getUtoTmapping(e);return this.getPoint(i,t)}getPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return t}getSpacedPoints(e=5){const t=[];for(let i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let i,r=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)i=this.getPoint(o/e),s+=i.distanceTo(r),t.push(s),r=i;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const i=this.getLengths();let r=0;const s=i.length;let o;t?o=t:o=e*i[s-1];let l=0,u=s-1,c;for(;l<=u;)if(r=Math.floor(l+(u-l)/2),c=i[r]-o,c<0)l=r+1;else if(c>0)u=r-1;else{u=r;break}if(r=u,i[r]===o)return r/(s-1);const f=i[r],p=i[r+1]-f,v=(o-f)/p;return(r+v)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const o=this.getPoint(r),l=this.getPoint(s),u=t||(o.isVector2?new Ae:new Q);return u.copy(l).sub(o).normalize(),u}getTangentAt(e,t){const i=this.getUtoTmapping(e);return this.getTangent(i,t)}computeFrenetFrames(e,t){const i=new Q,r=[],s=[],o=[],l=new Q,u=new Oe;for(let v=0;v<=e;v++){const m=v/e;r[v]=this.getTangentAt(m,new Q),r[v].normalize()}s[0]=new Q,o[0]=new Q;let c=Number.MAX_VALUE;const f=Math.abs(r[0].x),h=Math.abs(r[0].y),p=Math.abs(r[0].z);f<=c&&(c=f,i.set(1,0,0)),h<=c&&(c=h,i.set(0,1,0)),p<=c&&i.set(0,0,1),l.crossVectors(r[0],i).normalize(),s[0].crossVectors(r[0],l),o[0].crossVectors(r[0],s[0]);for(let v=1;v<=e;v++){if(s[v]=s[v-1].clone(),o[v]=o[v-1].clone(),l.crossVectors(r[v-1],r[v]),l.length()>Number.EPSILON){l.normalize();const m=Math.acos($t(r[v-1].dot(r[v]),-1,1));s[v].applyMatrix4(u.makeRotationAxis(l,m))}o[v].crossVectors(r[v],s[v])}if(t===!0){let v=Math.acos($t(s[0].dot(s[e]),-1,1));v/=e,r[0].dot(l.crossVectors(s[0],s[e]))>0&&(v=-v);for(let m=1;m<=e;m++)s[m].applyMatrix4(u.makeRotationAxis(r[m],v*m)),o[m].crossVectors(r[m],s[m])}return{tangents:r,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class xa extends gn{constructor(e=0,t=0,i=1,r=1,s=0,o=Math.PI*2,l=!1,u=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=l,this.aRotation=u}getPoint(e,t){const i=t||new Ae,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(o?s=0:s=r),this.aClockwise===!0&&!o&&(s===r?s=-r:s=s-r);const l=this.aStartAngle+e*s;let u=this.aX+this.xRadius*Math.cos(l),c=this.aY+this.yRadius*Math.sin(l);if(this.aRotation!==0){const f=Math.cos(this.aRotation),h=Math.sin(this.aRotation),p=u-this.aX,v=c-this.aY;u=p*f-v*h+this.aX,c=p*h+v*f+this.aY}return i.set(u,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(){const 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}}xa.prototype.isEllipseCurve=!0;class mh extends xa{constructor(e,t,i,r,s,o){super(e,t,i,i,r,s,o),this.type="ArcCurve"}}mh.prototype.isArcCurve=!0;function gh(){let n=0,e=0,t=0,i=0;function r(s,o,l,u){n=s,e=l,t=-3*s+3*o-2*l-u,i=2*s-2*o+l+u}return{initCatmullRom:function(s,o,l,u,c){r(o,l,c*(l-s),c*(u-o))},initNonuniformCatmullRom:function(s,o,l,u,c,f,h){let p=(o-s)/c-(l-s)/(c+f)+(l-o)/f,v=(l-o)/f-(u-o)/(f+h)+(u-l)/h;p*=f,v*=f,r(o,l,p,v)},calc:function(s){const o=s*s,l=o*s;return n+e*s+t*o+i*l}}}const bc=new Q,vh=new gh,yh=new gh,bh=new gh;class xh extends gn{constructor(e=[],t=!1,i="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=i,this.tension=r}getPoint(e,t=new Q){const i=t,r=this.points,s=r.length,o=(s-(this.closed?0:1))*e;let l=Math.floor(o),u=o-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/s)+1)*s:u===0&&l===s-1&&(l=s-2,u=1);let c,f;this.closed||l>0?c=r[(l-1)%s]:(bc.subVectors(r[0],r[1]).add(r[0]),c=bc);const h=r[l%s],p=r[(l+1)%s];if(this.closed||l+2<s?f=r[(l+2)%s]:(bc.subVectors(r[s-1],r[s-2]).add(r[s-1]),f=bc),this.curveType==="centripetal"||this.curveType==="chordal"){const v=this.curveType==="chordal"?.5:.25;let m=Math.pow(c.distanceToSquared(h),v),d=Math.pow(h.distanceToSquared(p),v),b=Math.pow(p.distanceToSquared(f),v);d<1e-4&&(d=1),m<1e-4&&(m=d),b<1e-4&&(b=d),vh.initNonuniformCatmullRom(c.x,h.x,p.x,f.x,m,d,b),yh.initNonuniformCatmullRom(c.y,h.y,p.y,f.y,m,d,b),bh.initNonuniformCatmullRom(c.z,h.z,p.z,f.z,m,d,b)}else this.curveType==="catmullrom"&&(vh.initCatmullRom(c.x,h.x,p.x,f.x,this.tension),yh.initCatmullRom(c.y,h.y,p.y,f.y,this.tension),bh.initCatmullRom(c.z,h.z,p.z,f.z,this.tension));return i.set(vh.calc(u),yh.calc(u),bh.calc(u)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new Q().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}xh.prototype.isCatmullRomCurve3=!0;function Dy(n,e,t,i,r){const s=(i-e)*.5,o=(r-t)*.5,l=n*n,u=n*l;return(2*t-2*i+s+o)*u+(-3*t+3*i-2*s-o)*l+s*n+t}function fO(n,e){const t=1-n;return t*t*e}function pO(n,e){return 2*(1-n)*n*e}function mO(n,e){return n*n*e}function wa(n,e,t,i){return fO(n,e)+pO(n,t)+mO(n,i)}function gO(n,e){const t=1-n;return t*t*t*e}function vO(n,e){const t=1-n;return 3*t*t*n*e}function yO(n,e){return 3*(1-n)*n*n*e}function bO(n,e){return n*n*n*e}function Ma(n,e,t,i,r){return gO(n,e)+vO(n,t)+yO(n,i)+bO(n,r)}class xc extends gn{constructor(e=new Ae,t=new Ae,i=new Ae,r=new Ae){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new Ae){const i=t,r=this.v0,s=this.v1,o=this.v2,l=this.v3;return i.set(Ma(e,r.x,s.x,o.x,l.x),Ma(e,r.y,s.y,o.y,l.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}xc.prototype.isCubicBezierCurve=!0;class wh extends gn{constructor(e=new Q,t=new Q,i=new Q,r=new Q){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=i,this.v3=r}getPoint(e,t=new Q){const i=t,r=this.v0,s=this.v1,o=this.v2,l=this.v3;return i.set(Ma(e,r.x,s.x,o.x,l.x),Ma(e,r.y,s.y,o.y,l.y),Ma(e,r.z,s.z,o.z,l.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}wh.prototype.isCubicBezierCurve3=!0;class Aa extends gn{constructor(e=new Ae,t=new Ae){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Ae){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const i=t||new Ae;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Aa.prototype.isLineCurve=!0;class Vy extends gn{constructor(e=new Q,t=new Q){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new Q){const i=t;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class wc extends gn{constructor(e=new Ae,t=new Ae,i=new Ae){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new Ae){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(wa(e,r.x,s.x,o.x),wa(e,r.y,s.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}wc.prototype.isQuadraticBezierCurve=!0;class Mh extends gn{constructor(e=new Q,t=new Q,i=new Q){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=i}getPoint(e,t=new Q){const i=t,r=this.v0,s=this.v1,o=this.v2;return i.set(wa(e,r.x,s.x,o.x),wa(e,r.y,s.y,o.y),wa(e,r.z,s.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}Mh.prototype.isQuadraticBezierCurve3=!0;class Mc extends gn{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new Ae){const i=t,r=this.points,s=(r.length-1)*e,o=Math.floor(s),l=s-o,u=r[o===0?o:o-1],c=r[o],f=r[o>r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set(Dy(l,u.x,c.x,f.x,h.x),Dy(l,u.y,c.y,f.y,h.y)),i}copy(e){super.copy(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,i=this.points.length;t<i;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,i=e.points.length;t<i;t++){const r=e.points[t];this.points.push(new Ae().fromArray(r))}return this}}Mc.prototype.isSplineCurve=!0;var Ah=Object.freeze({__proto__:null,ArcCurve:mh,CatmullRomCurve3:xh,CubicBezierCurve:xc,CubicBezierCurve3:wh,EllipseCurve:xa,LineCurve:Aa,LineCurve3:Vy,QuadraticBezierCurve:wc,QuadraticBezierCurve3:Mh,SplineCurve:Mc});const xO={triangulate:function(n,e,t=2){const i=e&&e.length,r=i?e[0]*t:n.length;let s=ky(n,0,r,t,!0);const o=[];if(!s||s.next===s.prev)return o;let l,u,c,f,h,p,v;if(i&&(s=_O(n,e,s,t)),n.length>80*t){l=c=n[0],u=f=n[1];for(let m=t;m<r;m+=t)h=n[m],p=n[m+1],h<l&&(l=h),p<u&&(u=p),h>c&&(c=h),p>f&&(f=p);v=Math.max(c-l,f-u),v=v!==0?1/v:0}return Sa(s,o,t,l,u,v),o}};function ky(n,e,t,i,r){let s,o;if(r===BO(n,e,t,i)>0)for(s=e;s<t;s+=i)o=Gy(s,n[s],n[s+1],o);else for(s=t-i;s>=e;s-=i)o=Gy(s,n[s],n[s+1],o);return o&&Ac(o,o.next)&&(Ta(o),o=o.next),o}function pr(n,e){if(!n)return n;e||(e=n);let t=n,i;do if(i=!1,!t.steiner&&(Ac(t,t.next)||ft(t.prev,t,t.next)===0)){if(Ta(t),t=e=t.prev,t===t.next)break;i=!0}else t=t.next;while(i||t!==e);return e}function Sa(n,e,t,i,r,s,o){if(!n)return;!o&&s&&RO(n,i,r,s);let l=n,u,c;for(;n.prev!==n.next;){if(u=n.prev,c=n.next,s?MO(n,i,r,s):wO(n)){e.push(u.i/t),e.push(n.i/t),e.push(c.i/t),Ta(n),n=c.next,l=c.next;continue}if(n=c,n===l){o?o===1?(n=AO(pr(n),e,t),Sa(n,e,t,i,r,s,2)):o===2&&SO(n,e,t,i,r,s):Sa(pr(n),e,t,i,r,s,1);break}}}function wO(n){const e=n.prev,t=n,i=n.next;if(ft(e,t,i)>=0)return!1;let r=n.next.next;for(;r!==n.prev;){if(ro(e.x,e.y,t.x,t.y,i.x,i.y,r.x,r.y)&&ft(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function MO(n,e,t,i){const r=n.prev,s=n,o=n.next;if(ft(r,s,o)>=0)return!1;const l=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,u=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,c=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,f=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,h=Sh(l,u,e,t,i),p=Sh(c,f,e,t,i);let v=n.prevZ,m=n.nextZ;for(;v&&v.z>=h&&m&&m.z<=p;){if(v!==n.prev&&v!==n.next&&ro(r.x,r.y,s.x,s.y,o.x,o.y,v.x,v.y)&&ft(v.prev,v,v.next)>=0||(v=v.prevZ,m!==n.prev&&m!==n.next&&ro(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&ft(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;v&&v.z>=h;){if(v!==n.prev&&v!==n.next&&ro(r.x,r.y,s.x,s.y,o.x,o.y,v.x,v.y)&&ft(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;m&&m.z<=p;){if(m!==n.prev&&m!==n.next&&ro(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&ft(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function AO(n,e,t){let i=n;do{const r=i.prev,s=i.next.next;!Ac(r,s)&&zy(r,i,i.next,s)&&_a(r,s)&&_a(s,r)&&(e.push(r.i/t),e.push(i.i/t),e.push(s.i/t),Ta(i),Ta(i.next),i=n=s),i=i.next}while(i!==n);return pr(i)}function SO(n,e,t,i,r,s){let o=n;do{let l=o.next.next;for(;l!==o.prev;){if(o.i!==l.i&&IO(o,l)){let u=Uy(o,l);o=pr(o,o.next),u=pr(u,u.next),Sa(o,e,t,i,r,s),Sa(u,e,t,i,r,s);return}l=l.next}o=o.next}while(o!==n)}function _O(n,e,t,i){const r=[];let s,o,l,u,c;for(s=0,o=e.length;s<o;s++)l=e[s]*i,u=s<o-1?e[s+1]*i:n.length,c=ky(n,l,u,i,!1),c===c.next&&(c.steiner=!0),r.push(PO(c));for(r.sort(TO),s=0;s<r.length;s++)EO(r[s],t),t=pr(t,t.next);return t}function TO(n,e){return n.x-e.x}function EO(n,e){if(e=CO(n,e),e){const t=Uy(e,n);pr(e,e.next),pr(t,t.next)}}function CO(n,e){let t=e;const i=n.x,r=n.y;let s=-1/0,o;do{if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const p=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=i&&p>s){if(s=p,p===i){if(r===t.y)return t;if(r===t.next.y)return t.next}o=t.x<t.next.x?t:t.next}}t=t.next}while(t!==e);if(!o)return null;if(i===s)return o;const l=o,u=o.x,c=o.y;let f=1/0,h;t=o;do i>=t.x&&t.x>=u&&i!==t.x&&ro(r<c?i:s,r,u,c,r<c?s:i,r,t.x,t.y)&&(h=Math.abs(r-t.y)/(i-t.x),_a(t,n)&&(h<f||h===f&&(t.x>o.x||t.x===o.x&&LO(o,t)))&&(o=t,f=h)),t=t.next;while(t!==l);return o}function LO(n,e){return ft(n.prev,n,e.prev)<0&&ft(e.next,n,n.next)<0}function RO(n,e,t,i){let r=n;do r.z===null&&(r.z=Sh(r.x,r.y,e,t,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,FO(r)}function FO(n){let e,t,i,r,s,o,l,u,c=1;do{for(t=n,n=null,s=null,o=0;t;){for(o++,i=t,l=0,e=0;e<c&&(l++,i=i.nextZ,!!i);e++);for(u=c;l>0||u>0&&i;)l!==0&&(u===0||!i||t.z<=i.z)?(r=t,t=t.nextZ,l--):(r=i,i=i.nextZ,u--),s?s.nextZ=r:n=r,r.prevZ=s,s=r;t=i}s.nextZ=null,c*=2}while(o>1);return n}function Sh(n,e,t,i,r){return n=32767*(n-t)*r,e=32767*(e-i)*r,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 PO(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function ro(n,e,t,i,r,s,o,l){return(r-o)*(e-l)-(n-o)*(s-l)>=0&&(n-o)*(i-l)-(t-o)*(e-l)>=0&&(t-o)*(s-l)-(r-o)*(i-l)>=0}function IO(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!OO(n,e)&&(_a(n,e)&&_a(e,n)&&NO(n,e)&&(ft(n.prev,n,e.prev)||ft(n,e.prev,e))||Ac(n,e)&&ft(n.prev,n,n.next)>0&&ft(e.prev,e,e.next)>0)}function ft(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Ac(n,e){return n.x===e.x&&n.y===e.y}function zy(n,e,t,i){const r=_c(ft(n,e,t)),s=_c(ft(n,e,i)),o=_c(ft(t,i,n)),l=_c(ft(t,i,e));return!!(r!==s&&o!==l||r===0&&Sc(n,t,e)||s===0&&Sc(n,i,e)||o===0&&Sc(t,n,i)||l===0&&Sc(t,e,i))}function Sc(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 _c(n){return n>0?1:n<0?-1:0}function OO(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&&zy(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function _a(n,e){return ft(n.prev,n,n.next)<0?ft(n,e,n.next)>=0&&ft(n,n.prev,e)>=0:ft(n,e,n.prev)<0||ft(n,n.next,e)<0}function NO(n,e){let t=n,i=!1;const r=(n.x+e.x)/2,s=(n.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(i=!i),t=t.next;while(t!==n);return i}function Uy(n,e){const t=new _h(n.i,n.x,n.y),i=new _h(e.i,e.x,e.y),r=n.next,s=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,i.next=t,t.prev=i,s.next=i,i.prev=s,i}function Gy(n,e,t,i){const r=new _h(n,e,t);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Ta(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 _h(n,e,t){this.i=n,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function BO(n,e,t,i){let r=0;for(let s=e,o=t-i;s<t;s+=i)r+=(n[o]-n[s])*(n[s+1]+n[o+1]),o=s;return r}class ni{static area(e){const t=e.length;let i=0;for(let r=t-1,s=0;s<t;r=s++)i+=e[r].x*e[s].y-e[s].x*e[r].y;return i*.5}static isClockWise(e){return ni.area(e)<0}static triangulateShape(e,t){const i=[],r=[],s=[];Hy(e),Wy(i,e);let o=e.length;t.forEach(Hy);for(let u=0;u<t.length;u++)r.push(o),o+=t[u].length,Wy(i,t[u]);const l=xO.triangulate(i,r);for(let u=0;u<l.length;u+=3)s.push(l.slice(u,u+3));return s}}function Hy(n){const e=n.length;e>2&&n[e-1].equals(n[0])&&n.pop()}function Wy(n,e){for(let t=0;t<e.length;t++)n.push(e[t].x),n.push(e[t].y)}class Dn extends ke{constructor(e,t){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const i=this,r=[],s=[];for(let l=0,u=e.length;l<u;l++){const c=e[l];o(c)}this.setAttribute("position",new Pe(r,3)),this.setAttribute("uv",new Pe(s,2)),this.computeVertexNormals();function o(l){const u=[],c=t.curveSegments!==void 0?t.curveSegments:12,f=t.steps!==void 0?t.steps:1;let h=t.depth!==void 0?t.depth:100,p=t.bevelEnabled!==void 0?t.bevelEnabled:!0,v=t.bevelThickness!==void 0?t.bevelThickness:6,m=t.bevelSize!==void 0?t.bevelSize:v-2,d=t.bevelOffset!==void 0?t.bevelOffset:0,b=t.bevelSegments!==void 0?t.bevelSegments:3;const y=t.extrudePath,g=t.UVGenerator!==void 0?t.UVGenerator:DO;t.amount!==void 0&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),h=t.amount);let w,A=!1,S,M,F,R;y&&(w=y.getSpacedPoints(f),A=!0,p=!1,S=y.computeFrenetFrames(f,!1),M=new Q,F=new Q,R=new Q),p||(b=0,v=0,m=0,d=0);const T=l.extractPoints(c);let P=T.shape;const _=T.holes;if(!ni.isClockWise(P)){P=P.reverse();for(let z=0,W=_.length;z<W;z++){const q=_[z];ni.isClockWise(q)&&(_[z]=q.reverse())}}const C=ni.triangulateShape(P,_),L=P;for(let z=0,W=_.length;z<W;z++){const q=_[z];P=P.concat(q)}function I(z,W,q){return W||console.error("THREE.ExtrudeGeometry: vec does not exist"),W.clone().multiplyScalar(q).add(z)}const x=P.length,O=C.length;function B(z,W,q){let le,oe,U;const N=z.x-W.x,X=z.y-W.y,Y=q.x-z.x,ie=q.y-z.y,ue=N*N+X*X,me=N*ie-X*Y;if(Math.abs(me)>Number.EPSILON){const be=Math.sqrt(ue),ce=Math.sqrt(Y*Y+ie*ie),ge=W.x-X/be,re=W.y+N/be,he=q.x-ie/ce,ve=q.y+Y/ce,Ee=((he-ge)*ie-(ve-re)*Y)/(N*ie-X*Y);le=ge+N*Ee-z.x,oe=re+X*Ee-z.y;const _e=le*le+oe*oe;if(_e<=2)return new Ae(le,oe);U=Math.sqrt(_e/2)}else{let be=!1;N>Number.EPSILON?Y>Number.EPSILON&&(be=!0):N<-Number.EPSILON?Y<-Number.EPSILON&&(be=!0):Math.sign(X)===Math.sign(ie)&&(be=!0),be?(le=-X,oe=N,U=Math.sqrt(ue)):(le=N,oe=X,U=Math.sqrt(ue/2))}return new Ae(le/U,oe/U)}const D=[];for(let z=0,W=L.length,q=W-1,le=z+1;z<W;z++,q++,le++)q===W&&(q=0),le===W&&(le=0),D[z]=B(L[z],L[q],L[le]);const k=[];let V,G=D.concat();for(let z=0,W=_.length;z<W;z++){const q=_[z];V=[];for(let le=0,oe=q.length,U=oe-1,N=le+1;le<oe;le++,U++,N++)U===oe&&(U=0),N===oe&&(N=0),V[le]=B(q[le],q[U],q[N]);k.push(V),G=G.concat(V)}for(let z=0;z<b;z++){const W=z/b,q=v*Math.cos(W*Math.PI/2),le=m*Math.sin(W*Math.PI/2)+d;for(let oe=0,U=L.length;oe<U;oe++){const N=I(L[oe],D[oe],le);ae(N.x,N.y,-q)}for(let oe=0,U=_.length;oe<U;oe++){const N=_[oe];V=k[oe];for(let X=0,Y=N.length;X<Y;X++){const ie=I(N[X],V[X],le);ae(ie.x,ie.y,-q)}}}const J=m+d;for(let z=0;z<x;z++){const W=p?I(P[z],G[z],J):P[z];A?(F.copy(S.normals[0]).multiplyScalar(W.x),M.copy(S.binormals[0]).multiplyScalar(W.y),R.copy(w[0]).add(F).add(M),ae(R.x,R.y,R.z)):ae(W.x,W.y,0)}for(let z=1;z<=f;z++)for(let W=0;W<x;W++){const q=p?I(P[W],G[W],J):P[W];A?(F.copy(S.normals[z]).multiplyScalar(q.x),M.copy(S.binormals[z]).multiplyScalar(q.y),R.copy(w[z]).add(F).add(M),ae(R.x,R.y,R.z)):ae(q.x,q.y,h/f*z)}for(let z=b-1;z>=0;z--){const W=z/b,q=v*Math.cos(W*Math.PI/2),le=m*Math.sin(W*Math.PI/2)+d;for(let oe=0,U=L.length;oe<U;oe++){const N=I(L[oe],D[oe],le);ae(N.x,N.y,h+q)}for(let oe=0,U=_.length;oe<U;oe++){const N=_[oe];V=k[oe];for(let X=0,Y=N.length;X<Y;X++){const ie=I(N[X],V[X],le);A?ae(ie.x,ie.y+w[f-1].y,w[f-1].x+q):ae(ie.x,ie.y,h+q)}}}j(),te();function j(){const z=r.length/3;if(p){let W=0,q=x*W;for(let le=0;le<O;le++){const oe=C[le];H(oe[2]+q,oe[1]+q,oe[0]+q)}W=f+b*2,q=x*W;for(let le=0;le<O;le++){const oe=C[le];H(oe[0]+q,oe[1]+q,oe[2]+q)}}else{for(let W=0;W<O;W++){const q=C[W];H(q[2],q[1],q[0])}for(let W=0;W<O;W++){const q=C[W];H(q[0]+x*f,q[1]+x*f,q[2]+x*f)}}i.addGroup(z,r.length/3-z,0)}function te(){const z=r.length/3;let W=0;ee(L,W),W+=L.length;for(let q=0,le=_.length;q<le;q++){const oe=_[q];ee(oe,W),W+=oe.length}i.addGroup(z,r.length/3-z,1)}function ee(z,W){let q=z.length;for(;--q>=0;){const le=q;let oe=q-1;oe<0&&(oe=z.length-1);for(let U=0,N=f+b*2;U<N;U++){const X=x*U,Y=x*(U+1),ie=W+le+X,ue=W+oe+X,me=W+oe+Y,be=W+le+Y;Z(ie,ue,me,be)}}}function ae(z,W,q){u.push(z),u.push(W),u.push(q)}function H(z,W,q){$(z),$(W),$(q);const le=r.length/3,oe=g.generateTopUV(i,r,le-3,le-2,le-1);se(oe[0]),se(oe[1]),se(oe[2])}function Z(z,W,q,le){$(z),$(W),$(le),$(W),$(q),$(le);const oe=r.length/3,U=g.generateSideWallUV(i,r,oe-6,oe-3,oe-2,oe-1);se(U[0]),se(U[1]),se(U[3]),se(U[1]),se(U[2]),se(U[3])}function $(z){r.push(u[z*3+0]),r.push(u[z*3+1]),r.push(u[z*3+2])}function se(z){s.push(z.x),s.push(z.y)}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,i=this.parameters.options;return VO(t,i,e)}static fromJSON(e,t){const i=[];for(let s=0,o=e.shapes.length;s<o;s++){const l=t[e.shapes[s]];i.push(l)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new Ah[r.type]().fromJSON(r)),new Dn(i,e.options)}}const DO={generateTopUV:function(n,e,t,i,r){const s=e[t*3],o=e[t*3+1],l=e[i*3],u=e[i*3+1],c=e[r*3],f=e[r*3+1];return[new Ae(s,o),new Ae(l,u),new Ae(c,f)]},generateSideWallUV:function(n,e,t,i,r,s){const o=e[t*3],l=e[t*3+1],u=e[t*3+2],c=e[i*3],f=e[i*3+1],h=e[i*3+2],p=e[r*3],v=e[r*3+1],m=e[r*3+2],d=e[s*3],b=e[s*3+1],y=e[s*3+2];return Math.abs(l-f)<Math.abs(o-c)?[new Ae(o,1-u),new Ae(c,1-h),new Ae(p,1-m),new Ae(d,1-y)]:[new Ae(l,1-u),new Ae(f,1-h),new Ae(v,1-m),new Ae(b,1-y)]}};function VO(n,e,t){if(t.shapes=[],Array.isArray(n))for(let i=0,r=n.length;i<r;i++){const s=n[i];t.shapes.push(s.uuid)}else t.shapes.push(n.uuid);return e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class so extends ti{constructor(e=1,t=0){const i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new so(e.radius,e.detail)}}class oo extends ke{constructor(e,t=12,i=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t),r=$t(r,0,Math.PI*2);const s=[],o=[],l=[],u=1/t,c=new Q,f=new Ae;for(let h=0;h<=t;h++){const p=i+h*u*r,v=Math.sin(p),m=Math.cos(p);for(let d=0;d<=e.length-1;d++)c.x=e[d].x*v,c.y=e[d].y,c.z=e[d].x*m,o.push(c.x,c.y,c.z),f.x=h/t,f.y=d/(e.length-1),l.push(f.x,f.y)}for(let h=0;h<t;h++)for(let p=0;p<e.length-1;p++){const v=p+h*e.length,m=v,d=v+e.length,b=v+e.length+1,y=v+1;s.push(m,d,y),s.push(d,b,y)}if(this.setIndex(s),this.setAttribute("position",new Pe(o,3)),this.setAttribute("uv",new Pe(l,2)),this.computeVertexNormals(),r===Math.PI*2){const h=this.attributes.normal.array,p=new Q,v=new Q,m=new Q,d=t*e.length*3;for(let b=0,y=0;b<e.length;b++,y+=3)p.x=h[y+0],p.y=h[y+1],p.z=h[y+2],v.x=h[d+y+0],v.y=h[d+y+1],v.z=h[d+y+2],m.addVectors(p,v).normalize(),h[y+0]=h[d+y+0]=m.x,h[y+1]=h[d+y+1]=m.y,h[y+2]=h[d+y+2]=m.z}}static fromJSON(e){return new oo(e.points,e.segments,e.phiStart,e.phiLength)}}class Wr extends ti{constructor(e=1,t=0){const i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(i,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Wr(e.radius,e.detail)}}class Tc extends ke{constructor(e,t,i){super(),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:i};const r=[],s=[],o=[],l=[],u=1e-5,c=new Q,f=new Q,h=new Q,p=new Q,v=new Q;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const m=t+1;for(let d=0;d<=i;d++){const b=d/i;for(let y=0;y<=t;y++){const g=y/t;e(g,b,f),s.push(f.x,f.y,f.z),g-u>=0?(e(g-u,b,h),p.subVectors(f,h)):(e(g+u,b,h),p.subVectors(h,f)),b-u>=0?(e(g,b-u,h),v.subVectors(f,h)):(e(g,b+u,h),v.subVectors(h,f)),c.crossVectors(p,v).normalize(),o.push(c.x,c.y,c.z),l.push(g,b)}}for(let d=0;d<i;d++)for(let b=0;b<t;b++){const y=d*m+b,g=d*m+b+1,w=(d+1)*m+b+1,A=(d+1)*m+b;r.push(y,g,A),r.push(g,w,A)}this.setIndex(r),this.setAttribute("position",new Pe(s,3)),this.setAttribute("normal",new Pe(o,3)),this.setAttribute("uv",new Pe(l,2))}}class ao extends ke{constructor(e=.5,t=1,i=8,r=1,s=0,o=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:s,thetaLength:o},i=Math.max(3,i),r=Math.max(1,r);const l=[],u=[],c=[],f=[];let h=e;const p=(t-e)/r,v=new Q,m=new Ae;for(let d=0;d<=r;d++){for(let b=0;b<=i;b++){const y=s+b/i*o;v.x=h*Math.cos(y),v.y=h*Math.sin(y),u.push(v.x,v.y,v.z),c.push(0,0,1),m.x=(v.x/t+1)/2,m.y=(v.y/t+1)/2,f.push(m.x,m.y)}h+=p}for(let d=0;d<r;d++){const b=d*(i+1);for(let y=0;y<i;y++){const g=y+b,w=g,A=g+i+1,S=g+i+2,M=g+1;l.push(w,A,M),l.push(A,S,M)}}this.setIndex(l),this.setAttribute("position",new Pe(u,3)),this.setAttribute("normal",new Pe(c,3)),this.setAttribute("uv",new Pe(f,2))}static fromJSON(e){return new ao(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class jr extends ke{constructor(e,t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const i=[],r=[],s=[],o=[];let l=0,u=0;if(Array.isArray(e)===!1)c(e);else for(let f=0;f<e.length;f++)c(e[f]),this.addGroup(l,u,f),l+=u,u=0;this.setIndex(i),this.setAttribute("position",new Pe(r,3)),this.setAttribute("normal",new Pe(s,3)),this.setAttribute("uv",new Pe(o,2));function c(f){const h=r.length/3,p=f.extractPoints(t);let v=p.shape;const m=p.holes;ni.isClockWise(v)===!1&&(v=v.reverse());for(let b=0,y=m.length;b<y;b++){const g=m[b];ni.isClockWise(g)===!0&&(m[b]=g.reverse())}const d=ni.triangulateShape(v,m);for(let b=0,y=m.length;b<y;b++){const g=m[b];v=v.concat(g)}for(let b=0,y=v.length;b<y;b++){const g=v[b];r.push(g.x,g.y,0),s.push(0,0,1),o.push(g.x,g.y)}for(let b=0,y=d.length;b<y;b++){const g=d[b],w=g[0]+h,A=g[1]+h,S=g[2]+h;i.push(w,A,S),u+=3}}}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return kO(t,e)}static fromJSON(e,t){const i=[];for(let r=0,s=e.shapes.length;r<s;r++){const o=t[e.shapes[r]];i.push(o)}return new jr(i,e.curveSegments)}}function kO(n,e){if(e.shapes=[],Array.isArray(n))for(let t=0,i=n.length;t<i;t++){const r=n[t];e.shapes.push(r.uuid)}else e.shapes.push(n.uuid);return e}class $r extends ke{constructor(e=1,t=8,i=6,r=0,s=Math.PI*2,o=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:s,thetaStart:o,thetaLength:l},t=Math.max(3,Math.floor(t)),i=Math.max(2,Math.floor(i));const u=Math.min(o+l,Math.PI);let c=0;const f=[],h=new Q,p=new Q,v=[],m=[],d=[],b=[];for(let y=0;y<=i;y++){const g=[],w=y/i;let A=0;y==0&&o==0?A=.5/t:y==i&&u==Math.PI&&(A=-.5/t);for(let S=0;S<=t;S++){const M=S/t;h.x=-e*Math.cos(r+M*s)*Math.sin(o+w*l),h.y=e*Math.cos(o+w*l),h.z=e*Math.sin(r+M*s)*Math.sin(o+w*l),m.push(h.x,h.y,h.z),p.copy(h).normalize(),d.push(p.x,p.y,p.z),b.push(M+A,1-w),g.push(c++)}f.push(g)}for(let y=0;y<i;y++)for(let g=0;g<t;g++){const w=f[y][g+1],A=f[y][g],S=f[y+1][g],M=f[y+1][g+1];(y!==0||o>0)&&v.push(w,A,M),(y!==i-1||u<Math.PI)&&v.push(A,S,M)}this.setIndex(v),this.setAttribute("position",new Pe(m,3)),this.setAttribute("normal",new Pe(d,3)),this.setAttribute("uv",new Pe(b,2))}static fromJSON(e){return new $r(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class lo extends ti{constructor(e=1,t=0){const i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(i,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new lo(e.radius,e.detail)}}class Ec extends Dn{constructor(e,t={}){const i=t.font;if(!(i&&i.isFont))return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ke;const r=i.generateShapes(e,t.size);t.depth=t.height!==void 0?t.height:50,t.bevelThickness===void 0&&(t.bevelThickness=10),t.bevelSize===void 0&&(t.bevelSize=8),t.bevelEnabled===void 0&&(t.bevelEnabled=!1),super(r,t),this.type="TextGeometry"}}class co extends ke{constructor(e=1,t=.4,i=8,r=6,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:s},i=Math.floor(i),r=Math.floor(r);const o=[],l=[],u=[],c=[],f=new Q,h=new Q,p=new Q;for(let v=0;v<=i;v++)for(let m=0;m<=r;m++){const d=m/r*s,b=v/i*Math.PI*2;h.x=(e+t*Math.cos(b))*Math.cos(d),h.y=(e+t*Math.cos(b))*Math.sin(d),h.z=t*Math.sin(b),l.push(h.x,h.y,h.z),f.x=e*Math.cos(d),f.y=e*Math.sin(d),p.subVectors(h,f).normalize(),u.push(p.x,p.y,p.z),c.push(m/r),c.push(v/i)}for(let v=1;v<=i;v++)for(let m=1;m<=r;m++){const d=(r+1)*v+m-1,b=(r+1)*(v-1)+m-1,y=(r+1)*(v-1)+m,g=(r+1)*v+m;o.push(d,b,g),o.push(b,y,g)}this.setIndex(o),this.setAttribute("position",new Pe(l,3)),this.setAttribute("normal",new Pe(u,3)),this.setAttribute("uv",new Pe(c,2))}static fromJSON(e){return new co(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class uo extends ke{constructor(e=1,t=.4,i=64,r=8,s=2,o=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:s,q:o},i=Math.floor(i),r=Math.floor(r);const l=[],u=[],c=[],f=[],h=new Q,p=new Q,v=new Q,m=new Q,d=new Q,b=new Q,y=new Q;for(let w=0;w<=i;++w){const A=w/i*s*Math.PI*2;g(A,s,o,e,v),g(A+.01,s,o,e,m),b.subVectors(m,v),y.addVectors(m,v),d.crossVectors(b,y),y.crossVectors(d,b),d.normalize(),y.normalize();for(let S=0;S<=r;++S){const M=S/r*Math.PI*2,F=-t*Math.cos(M),R=t*Math.sin(M);h.x=v.x+(F*y.x+R*d.x),h.y=v.y+(F*y.y+R*d.y),h.z=v.z+(F*y.z+R*d.z),u.push(h.x,h.y,h.z),p.subVectors(h,v).normalize(),c.push(p.x,p.y,p.z),f.push(w/i),f.push(S/r)}}for(let w=1;w<=i;w++)for(let A=1;A<=r;A++){const S=(r+1)*(w-1)+(A-1),M=(r+1)*w+(A-1),F=(r+1)*w+A,R=(r+1)*(w-1)+A;l.push(S,M,R),l.push(M,F,R)}this.setIndex(l),this.setAttribute("position",new Pe(u,3)),this.setAttribute("normal",new Pe(c,3)),this.setAttribute("uv",new Pe(f,2));function g(w,A,S,M,F){const R=Math.cos(w),T=Math.sin(w),P=S/A*w,_=Math.cos(P);F.x=M*(2+_)*.5*R,F.y=M*(2+_)*T*.5,F.z=M*Math.sin(P)*.5}}static fromJSON(e){return new uo(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class ho extends ke{constructor(e,t=64,i=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:s};const o=e.computeFrenetFrames(t,s);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const l=new Q,u=new Q,c=new Ae;let f=new Q;const h=[],p=[],v=[],m=[];d(),this.setIndex(m),this.setAttribute("position",new Pe(h,3)),this.setAttribute("normal",new Pe(p,3)),this.setAttribute("uv",new Pe(v,2));function d(){for(let w=0;w<t;w++)b(w);b(s===!1?t:0),g(),y()}function b(w){f=e.getPointAt(w/t,f);const A=o.normals[w],S=o.binormals[w];for(let M=0;M<=r;M++){const F=M/r*Math.PI*2,R=Math.sin(F),T=-Math.cos(F);u.x=T*A.x+R*S.x,u.y=T*A.y+R*S.y,u.z=T*A.z+R*S.z,u.normalize(),p.push(u.x,u.y,u.z),l.x=f.x+i*u.x,l.y=f.y+i*u.y,l.z=f.z+i*u.z,h.push(l.x,l.y,l.z)}}function y(){for(let w=1;w<=t;w++)for(let A=1;A<=r;A++){const S=(r+1)*(w-1)+(A-1),M=(r+1)*w+(A-1),F=(r+1)*w+A,R=(r+1)*(w-1)+A;m.push(S,M,R),m.push(M,F,R)}}function g(){for(let w=0;w<=t;w++)for(let A=0;A<=r;A++)c.x=w/t,c.y=A/r,v.push(c.x,c.y)}}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new ho(new Ah[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class Th extends ke{constructor(e){if(super(),this.type="WireframeGeometry",e.isGeometry===!0){console.error("THREE.WireframeGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return}const t=[],i=[0,0],r={},s=new Q;if(e.index!==null){const o=e.attributes.position,l=e.index;let u=e.groups;u.length===0&&(u=[{start:0,count:l.count,materialIndex:0}]);for(let c=0,f=u.length;c<f;++c){const h=u[c],p=h.start,v=h.count;for(let m=p,d=p+v;m<d;m+=3)for(let b=0;b<3;b++){const y=l.getX(m+b),g=l.getX(m+(b+1)%3);i[0]=Math.min(y,g),i[1]=Math.max(y,g);const w=i[0]+","+i[1];r[w]===void 0&&(r[w]={index1:i[0],index2:i[1]})}}for(const c in r){const f=r[c];s.fromBufferAttribute(o,f.index1),t.push(s.x,s.y,s.z),s.fromBufferAttribute(o,f.index2),t.push(s.x,s.y,s.z)}}else{const o=e.attributes.position;for(let l=0,u=o.count/3;l<u;l++)for(let c=0;c<3;c++){const f=3*l+c;s.fromBufferAttribute(o,f),t.push(s.x,s.y,s.z);const h=3*l+(c+1)%3;s.fromBufferAttribute(o,h),t.push(s.x,s.y,s.z)}}this.setAttribute("position",new Pe(t,3))}}var jy=Object.freeze({__proto__:null,BoxGeometry:Li,BoxBufferGeometry:Li,CircleGeometry:to,CircleBufferGeometry:to,ConeGeometry:no,ConeBufferGeometry:no,CylinderGeometry:fr,CylinderBufferGeometry:fr,DodecahedronGeometry:io,DodecahedronBufferGeometry:io,EdgesGeometry:ph,ExtrudeGeometry:Dn,ExtrudeBufferGeometry:Dn,IcosahedronGeometry:so,IcosahedronBufferGeometry:so,LatheGeometry:oo,LatheBufferGeometry:oo,OctahedronGeometry:Wr,OctahedronBufferGeometry:Wr,ParametricGeometry:Tc,ParametricBufferGeometry:Tc,PlaneGeometry:Gr,PlaneBufferGeometry:Gr,PolyhedronGeometry:ti,PolyhedronBufferGeometry:ti,RingGeometry:ao,RingBufferGeometry:ao,ShapeGeometry:jr,ShapeBufferGeometry:jr,SphereGeometry:$r,SphereBufferGeometry:$r,TetrahedronGeometry:lo,TetrahedronBufferGeometry:lo,TextGeometry:Ec,TextBufferGeometry:Ec,TorusGeometry:co,TorusBufferGeometry:co,TorusKnotGeometry:uo,TorusKnotBufferGeometry:uo,TubeGeometry:ho,TubeBufferGeometry:ho,WireframeGeometry:Th});class Eh extends Ft{constructor(e){super(),this.type="ShadowMaterial",this.color=new Le(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}Eh.prototype.isShadowMaterial=!0;class fo extends Ri{constructor(e){super(e),this.type="RawShaderMaterial"}}fo.prototype.isRawShaderMaterial=!0;class Zr extends Ft{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Le(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=er,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,this.vertexTangents=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,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.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this}}Zr.prototype.isMeshStandardMaterial=!0;class Ea extends Zr{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ae(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,Object.defineProperty(this,"ior",{get:function(){return(1+.4*this.reflectivity)/(1-.4*this.reflectivity)},set:function(t){this.reflectivity=$t(2.5*(t-1)/(t+1),0,1)}}),this.sheen=null,this.transmission=0,this.transmissionMap=null,this.thickness=.01,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new Le(1,1,1),this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},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.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new Le).copy(e.sheen):this.sheen=null,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}}Ea.prototype.isMeshPhysicalMaterial=!0;class Ch extends Ft{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new Le(16777215),this.specular=new Le(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=er,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Wo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,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.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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Ch.prototype.isMeshPhongMaterial=!0;class Lh extends Ft{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Le(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=er,this.normalScale=new Ae(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.morphTargets=!1,this.morphNormals=!1,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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}Lh.prototype.isMeshToonMaterial=!0;class Rh extends Ft{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=er,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.morphTargets=!1,this.morphNormals=!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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Rh.prototype.isMeshNormalMaterial=!0;class Fh extends Ft{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new Le(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Le(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Wo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.morphTargets=!1,this.morphNormals=!1,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.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this}}Fh.prototype.isMeshLambertMaterial=!0;class Ph extends Ft{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Le(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=er,this.normalScale=new Ae(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.morphTargets=!1,this.morphNormals=!1,this.flatShading=!1,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.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.flatShading=e.flatShading,this}}Ph.prototype.isMeshMatcapMaterial=!0;class Ih extends Vt{constructor(e){super(),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}}Ih.prototype.isLineDashedMaterial=!0;var zO=Object.freeze({__proto__:null,ShadowMaterial:Eh,SpriteMaterial:da,RawShaderMaterial:fo,ShaderMaterial:Ri,PointsMaterial:hr,MeshPhysicalMaterial:Ea,MeshStandardMaterial:Zr,MeshPhongMaterial:Ch,MeshToonMaterial:Lh,MeshNormalMaterial:Rh,MeshLambertMaterial:Fh,MeshDepthMaterial:rc,MeshDistanceMaterial:sc,MeshBasicMaterial:cn,MeshMatcapMaterial:Ph,LineDashedMaterial:Ih,LineBasicMaterial:Vt,Material:Ft});const ut={arraySlice:function(n,e,t){return ut.isTypedArray(n)?new n.constructor(n.subarray(e,t!==void 0?t:n.length)):n.slice(e,t)},convertArray:function(n,e,t){return!n||!t&&n.constructor===e?n:typeof e.BYTES_PER_ELEMENT=="number"?new e(n):Array.prototype.slice.call(n)},isTypedArray:function(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)},getKeyframeOrder:function(n){function e(r,s){return n[r]-n[s]}const t=n.length,i=new Array(t);for(let r=0;r!==t;++r)i[r]=r;return i.sort(e),i},sortedArray:function(n,e,t){const i=n.length,r=new n.constructor(i);for(let s=0,o=0;o!==i;++s){const l=t[s]*e;for(let u=0;u!==e;++u)r[o++]=n[l+u]}return r},flattenJSON:function(n,e,t,i){let r=1,s=n[0];for(;s!==void 0&&s[i]===void 0;)s=n[r++];if(s===void 0)return;let o=s[i];if(o!==void 0)if(Array.isArray(o))do o=s[i],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=n[r++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[i],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=n[r++];while(s!==void 0);else do o=s[i],o!==void 0&&(e.push(s.time),t.push(o)),s=n[r++];while(s!==void 0)},subclip:function(n,e,t,i,r=30){const s=n.clone();s.name=e;const o=[];for(let u=0;u<s.tracks.length;++u){const c=s.tracks[u],f=c.getValueSize(),h=[],p=[];for(let v=0;v<c.times.length;++v){const m=c.times[v]*r;if(!(m<t||m>=i)){h.push(c.times[v]);for(let d=0;d<f;++d)p.push(c.values[v*f+d])}}h.length!==0&&(c.times=ut.convertArray(h,c.times.constructor),c.values=ut.convertArray(p,c.values.constructor),o.push(c))}s.tracks=o;let l=1/0;for(let u=0;u<s.tracks.length;++u)l>s.tracks[u].times[0]&&(l=s.tracks[u].times[0]);for(let u=0;u<s.tracks.length;++u)s.tracks[u].shift(-1*l);return s.resetDuration(),s},makeClipAdditive:function(n,e=0,t=n,i=30){i<=0&&(i=30);const r=t.tracks.length,s=e/i;for(let o=0;o<r;++o){const l=t.tracks[o],u=l.ValueTypeName;if(u==="bool"||u==="string")continue;const c=n.tracks.find(function(y){return y.name===l.name&&y.ValueTypeName===u});if(c===void 0)continue;let f=0;const h=l.getValueSize();l.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(f=h/3);let p=0;const v=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=v/3);const m=l.times.length-1;let d;if(s<=l.times[0]){const y=f,g=h-f;d=ut.arraySlice(l.values,y,g)}else if(s>=l.times[m]){const y=m*h+f,g=y+h-f;d=ut.arraySlice(l.values,y,g)}else{const y=l.createInterpolant(),g=f,w=h-f;y.evaluate(s),d=ut.arraySlice(y.resultBuffer,g,w)}u==="quaternion"&&new Zt().fromArray(d).normalize().conjugate().toArray(d);const b=c.times.length;for(let y=0;y<b;++y){const g=y*v+p;if(u==="quaternion")Zt.multiplyQuaternionsFlat(c.values,g,d,0,c.values,g);else{const w=v-p*2;for(let A=0;A<w;++A)c.values[g+A]-=d[A]}}}return n.blendMode=Md,n}};class ii{constructor(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let i=this._cachedIndex,r=t[i],s=t[i-1];e:{t:{let o;n:{i:if(!(e<r)){for(let l=i+2;;){if(r===void 0){if(e<s)break i;return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,e,s)}if(i===l)break;if(s=r,r=t[++i],e<r)break t}o=t.length;break n}if(!(e>=s)){const l=t[1];e<l&&(i=2,s=l);for(let u=i-2;;){if(s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(i===u)break;if(r=s,s=t[--i-1],e>=s)break t}o=i,i=0;break n}break e}for(;i<o;){const l=i+o>>>1;e<t[l]?o=l:i=l+1}if(r=t[i],s=t[i-1],s===void 0)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(r===void 0)return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,s,e)}this._cachedIndex=i,this.intervalChanged_(i,s,r)}return this.interpolate_(i,s,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r;for(let o=0;o!==r;++o)t[o]=i[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}ii.prototype.beforeStart_=ii.prototype.copySampleValue_,ii.prototype.afterEnd_=ii.prototype.copySampleValue_;class $y extends ii{constructor(e,t,i,r){super(e,t,i,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Or,endingEnd:Or}}intervalChanged_(e,t,i){const r=this.parameterPositions;let s=e-2,o=e+1,l=r[s],u=r[o];if(l===void 0)switch(this.getSettings_().endingStart){case Nr:s=e,l=2*t-i;break;case qo:s=r.length-2,l=t+r[s]-r[s+1];break;default:s=e,l=i}if(u===void 0)switch(this.getSettings_().endingEnd){case Nr:o=e,u=2*i-t;break;case qo:o=1,u=i+r[1]-r[0];break;default:o=e-1,u=t}const c=(i-t)*.5,f=this.valueSize;this._weightPrev=c/(t-l),this._weightNext=c/(u-i),this._offsetPrev=s*f,this._offsetNext=o*f}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,c=u-l,f=this._offsetPrev,h=this._offsetNext,p=this._weightPrev,v=this._weightNext,m=(i-t)/(r-t),d=m*m,b=d*m,y=-p*b+2*p*d-p*m,g=(1+p)*b+(-1.5-2*p)*d+(-.5+p)*m+1,w=(-1-v)*b+(1.5+v)*d+.5*m,A=v*b-v*d;for(let S=0;S!==l;++S)s[S]=y*o[f+S]+g*o[c+S]+w*o[u+S]+A*o[h+S];return s}}class Oh extends ii{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=e*l,c=u-l,f=(i-t)/(r-t),h=1-f;for(let p=0;p!==l;++p)s[p]=o[c+p]*h+o[u+p]*f;return s}}class Zy extends ii{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class Vn{constructor(e,t,i,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=ut.convertArray(t,this.TimeBufferType),this.values=ut.convertArray(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let i;if(t.toJSON!==this.toJSON)i=t.toJSON(e);else{i={name:e.name,times:ut.convertArray(e.times,Array),values:ut.convertArray(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(i.interpolation=r)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new Zy(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Oh(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new $y(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Rs:t=this.InterpolantFactoryMethodDiscrete;break;case Ir:t=this.InterpolantFactoryMethodLinear;break;case Fl:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Rs;case this.InterpolantFactoryMethodLinear:return Ir;case this.InterpolantFactoryMethodSmooth:return Fl}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let i=0,r=t.length;i!==r;++i)t[i]*=e}return this}trim(e,t){const i=this.times,r=i.length;let s=0,o=r-1;for(;s!==r&&i[s]<e;)++s;for(;o!==-1&&i[o]>t;)--o;if(++o,s!==0||o!==r){s>=o&&(o=Math.max(o,1),s=o-1);const l=this.getValueSize();this.times=ut.arraySlice(i,s,o),this.values=ut.arraySlice(this.values,s*l,o*l)}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,r=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let l=0;l!==s;l++){const u=i[l];if(typeof u=="number"&&isNaN(u)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,l,u),e=!1;break}if(o!==null&&o>u){console.error("THREE.KeyframeTrack: Out of order keys.",this,l,u,o),e=!1;break}o=u}if(r!==void 0&&ut.isTypedArray(r))for(let l=0,u=r.length;l!==u;++l){const c=r[l];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,c),e=!1;break}}return e}optimize(){const e=ut.arraySlice(this.times),t=ut.arraySlice(this.values),i=this.getValueSize(),r=this.getInterpolation()===Fl,s=e.length-1;let o=1;for(let l=1;l<s;++l){let u=!1;const c=e[l],f=e[l+1];if(c!==f&&(l!==1||c!==e[0]))if(r)u=!0;else{const h=l*i,p=h-i,v=h+i;for(let m=0;m!==i;++m){const d=t[h+m];if(d!==t[p+m]||d!==t[v+m]){u=!0;break}}}if(u){if(l!==o){e[o]=e[l];const h=l*i,p=o*i;for(let v=0;v!==i;++v)t[p+v]=t[h+v]}++o}}if(s>0){e[o]=e[s];for(let l=s*i,u=o*i,c=0;c!==i;++c)t[u+c]=t[l+c];++o}return o!==e.length?(this.times=ut.arraySlice(e,0,o),this.values=ut.arraySlice(t,0,o*i)):(this.times=e,this.values=t),this}clone(){const e=ut.arraySlice(this.times,0),t=ut.arraySlice(this.values,0),i=this.constructor,r=new i(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Vn.prototype.TimeBufferType=Float32Array,Vn.prototype.ValueBufferType=Float32Array,Vn.prototype.DefaultInterpolation=Ir;class Xr extends Vn{}Xr.prototype.ValueTypeName="bool",Xr.prototype.ValueBufferType=Array,Xr.prototype.DefaultInterpolation=Rs,Xr.prototype.InterpolantFactoryMethodLinear=void 0,Xr.prototype.InterpolantFactoryMethodSmooth=void 0;class Nh extends Vn{}Nh.prototype.ValueTypeName="color";class po extends Vn{}po.prototype.ValueTypeName="number";class Xy extends ii{constructor(e,t,i,r){super(e,t,i,r)}interpolate_(e,t,i,r){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,u=(i-t)/(r-t);let c=e*l;for(let f=c+l;c!==f;c+=4)Zt.slerpFlat(s,0,o,c-l,o,c,u);return s}}class Yr extends Vn{InterpolantFactoryMethodLinear(e){return new Xy(this.times,this.values,this.getValueSize(),e)}}Yr.prototype.ValueTypeName="quaternion",Yr.prototype.DefaultInterpolation=Ir,Yr.prototype.InterpolantFactoryMethodSmooth=void 0;class Jr extends Vn{}Jr.prototype.ValueTypeName="string",Jr.prototype.ValueBufferType=Array,Jr.prototype.DefaultInterpolation=Rs,Jr.prototype.InterpolantFactoryMethodLinear=void 0,Jr.prototype.InterpolantFactoryMethodSmooth=void 0;class mo extends Vn{}mo.prototype.ValueTypeName="vector";class go{constructor(e,t=-1,i,r=Pl){this.name=e,this.tracks=i,this.duration=t,this.blendMode=r,this.uuid=fn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],i=e.tracks,r=1/(e.fps||1);for(let o=0,l=i.length;o!==l;++o)t.push(GO(i[o]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=i.length;s!==o;++s)t.push(Vn.toJSON(i[s]));return r}static CreateFromMorphTargetSequence(e,t,i,r){const s=t.length,o=[];for(let l=0;l<s;l++){let u=[],c=[];u.push((l+s-1)%s,l,(l+1)%s),c.push(0,1,0);const f=ut.getKeyframeOrder(u);u=ut.sortedArray(u,1,f),c=ut.sortedArray(c,1,f),!r&&u[0]===0&&(u.push(s),c.push(c[0])),o.push(new po(".morphTargetInfluences["+t[l].name+"]",u,c).scale(1/i))}return new this(e,-1,o)}static findByName(e,t){let i=e;if(!Array.isArray(e)){const r=e;i=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<i.length;r++)if(i[r].name===t)return i[r];return null}static CreateClipsFromMorphTargetSequences(e,t,i){const r={},s=/^([\w-]*?)([\d]+)$/;for(let l=0,u=e.length;l<u;l++){const c=e[l],f=c.name.match(s);if(f&&f.length>1){const h=f[1];let p=r[h];p||(r[h]=p=[]),p.push(c)}}const o=[];for(const l in r)o.push(this.CreateFromMorphTargetSequence(l,r[l],t,i));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(h,p,v,m,d){if(v.length!==0){const b=[],y=[];ut.flattenJSON(v,b,y,m),b.length!==0&&d.push(new h(p,b,y))}},r=[],s=e.name||"default",o=e.fps||30,l=e.blendMode;let u=e.length||-1;const c=e.hierarchy||[];for(let h=0;h<c.length;h++){const p=c[h].keys;if(!(!p||p.length===0))if(p[0].morphTargets){const v={};let m;for(m=0;m<p.length;m++)if(p[m].morphTargets)for(let d=0;d<p[m].morphTargets.length;d++)v[p[m].morphTargets[d]]=-1;for(const d in v){const b=[],y=[];for(let g=0;g!==p[m].morphTargets.length;++g){const w=p[m];b.push(w.time),y.push(w.morphTarget===d?1:0)}r.push(new po(".morphTargetInfluence["+d+"]",b,y))}u=v.length*(o||1)}else{const v=".bones["+t[h].name+"]";i(mo,v+".position",p,"pos",r),i(Yr,v+".quaternion",p,"rot",r),i(mo,v+".scale",p,"scl",r)}}return r.length===0?null:new this(s,u,r,l)}resetDuration(){const e=this.tracks;let t=0;for(let i=0,r=e.length;i!==r;++i){const s=this.tracks[i];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function UO(n){switch(n.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return po;case"vector":case"vector2":case"vector3":case"vector4":return mo;case"color":return Nh;case"quaternion":return Yr;case"bool":case"boolean":return Xr;case"string":return Jr}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+n)}function GO(n){if(n.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=UO(n.type);if(n.times===void 0){const t=[],i=[];ut.flattenJSON(n.keys,t,i,"value"),n.times=t,n.values=i}return e.parse!==void 0?e.parse(n):new e(n.name,n.times,n.values,n.interpolation)}const Kr={enabled:!1,files:{},add:function(n,e){this.enabled!==!1&&(this.files[n]=e)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class Bh{constructor(e,t,i){const r=this;let s=!1,o=0,l=0,u;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(f){l++,s===!1&&r.onStart!==void 0&&r.onStart(f,o,l),s=!0},this.itemEnd=function(f){o++,r.onProgress!==void 0&&r.onProgress(f,o,l),o===l&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(f){r.onError!==void 0&&r.onError(f)},this.resolveURL=function(f){return u?u(f):f},this.setURLModifier=function(f){return u=f,this},this.addHandler=function(f,h){return c.push(f,h),this},this.removeHandler=function(f){const h=c.indexOf(f);return h!==-1&&c.splice(h,2),this},this.getHandler=function(f){for(let h=0,p=c.length;h<p;h+=2){const v=c[h],m=c[h+1];if(v.global&&(v.lastIndex=0),v.test(f))return m}return null}}}const Yy=new Bh;class Xt{constructor(e){this.manager=e!==void 0?e:Yy,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const i=this;return new Promise(function(r,s){i.load(e,r,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const kn={};class vn extends Xt{constructor(e){super(e)}load(e,t,i,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Kr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;if(kn[e]!==void 0){kn[e].push({onLoad:t,onProgress:i,onError:r});return}const l=/^data:(.*?)(;base64)?,(.*)$/,u=e.match(l);let c;if(u){const f=u[1],h=!!u[2];let p=u[3];p=decodeURIComponent(p),h&&(p=atob(p));try{let v;const m=(this.responseType||"").toLowerCase();switch(m){case"arraybuffer":case"blob":const d=new Uint8Array(p.length);for(let y=0;y<p.length;y++)d[y]=p.charCodeAt(y);m==="blob"?v=new Blob([d.buffer],{type:f}):v=d.buffer;break;case"document":v=new DOMParser().parseFromString(p,f);break;case"json":v=JSON.parse(p);break;default:v=p;break}setTimeout(function(){t&&t(v),s.manager.itemEnd(e)},0)}catch(v){setTimeout(function(){r&&r(v),s.manager.itemError(e),s.manager.itemEnd(e)},0)}}else{kn[e]=[],kn[e].push({onLoad:t,onProgress:i,onError:r}),c=new XMLHttpRequest,c.open("GET",e,!0),c.addEventListener("load",function(f){const h=this.response,p=kn[e];if(delete kn[e],this.status===200||this.status===0){this.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Kr.add(e,h);for(let v=0,m=p.length;v<m;v++){const d=p[v];d.onLoad&&d.onLoad(h)}s.manager.itemEnd(e)}else{for(let v=0,m=p.length;v<m;v++){const d=p[v];d.onError&&d.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)}},!1),c.addEventListener("progress",function(f){const h=kn[e];for(let p=0,v=h.length;p<v;p++){const m=h[p];m.onProgress&&m.onProgress(f)}},!1),c.addEventListener("error",function(f){const h=kn[e];delete kn[e];for(let p=0,v=h.length;p<v;p++){const m=h[p];m.onError&&m.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)},!1),c.addEventListener("abort",function(f){const h=kn[e];delete kn[e];for(let p=0,v=h.length;p<v;p++){const m=h[p];m.onError&&m.onError(f)}s.manager.itemError(e),s.manager.itemEnd(e)},!1),this.responseType!==void 0&&(c.responseType=this.responseType),this.withCredentials!==void 0&&(c.withCredentials=this.withCredentials),c.overrideMimeType&&c.overrideMimeType(this.mimeType!==void 0?this.mimeType:"text/plain");for(const f in this.requestHeader)c.setRequestHeader(f,this.requestHeader[f]);c.send(null)}return s.manager.itemStart(e),c}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class HO extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new vn(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=[];for(let i=0;i<e.length;i++){const r=go.parse(e[i]);t.push(r)}return t}}class WO extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=[],l=new hh,u=new vn(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(s.withCredentials);let c=0;function f(h){u.load(e[h],function(p){const v=s.parse(p,!0);o[h]={width:v.width,height:v.height,format:v.format,mipmaps:v.mipmaps},c+=1,c===6&&(v.mipmapCount===1&&(l.minFilter=vt),l.image=o,l.format=v.format,l.needsUpdate=!0,t&&t(l))},i,r)}if(Array.isArray(e))for(let h=0,p=e.length;h<p;++h)f(h);else u.load(e,function(h){const p=s.parse(h,!0);if(p.isCubemap){const v=p.mipmaps.length/p.mipmapCount;for(let m=0;m<v;m++){o[m]={mipmaps:[]};for(let d=0;d<p.mipmapCount;d++)o[m].mipmaps.push(p.mipmaps[m*p.mipmapCount+d]),o[m].format=p.format,o[m].width=p.width,o[m].height=p.height}l.image=o}else l.image.width=p.width,l.image.height=p.height,l.mipmaps=p.mipmaps;p.mipmapCount===1&&(l.minFilter=vt),l.format=p.format,l.needsUpdate=!0,t&&t(l)},i,r);return l}}class Ca extends Xt{constructor(e){super(e)}load(e,t,i,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Kr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l=document.createElementNS("http://www.w3.org/1999/xhtml","img");function u(){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1),Kr.add(e,this),t&&t(this),s.manager.itemEnd(e)}function c(f){l.removeEventListener("load",u,!1),l.removeEventListener("error",c,!1),r&&r(f),s.manager.itemError(e),s.manager.itemEnd(e)}return l.addEventListener("load",u,!1),l.addEventListener("error",c,!1),e.substr(0,5)!=="data:"&&this.crossOrigin!==void 0&&(l.crossOrigin=this.crossOrigin),s.manager.itemStart(e),l.src=e,l}}class Jy extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=new Zs,o=new Ca(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let l=0;function u(c){o.load(e[c],function(f){s.images[c]=f,l++,l===6&&(s.needsUpdate=!0,t&&t(s))},void 0,r)}for(let c=0;c<e.length;++c)u(c);return s}}class Ky extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new Hr,l=new vn(this.manager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(s.withCredentials),l.load(e,function(u){const c=s.parse(u);c&&(c.image!==void 0?o.image=c.image:c.data!==void 0&&(o.image.width=c.width,o.image.height=c.height,o.image.data=c.data),o.wrapS=c.wrapS!==void 0?c.wrapS:zt,o.wrapT=c.wrapT!==void 0?c.wrapT:zt,o.magFilter=c.magFilter!==void 0?c.magFilter:vt,o.minFilter=c.minFilter!==void 0?c.minFilter:vt,o.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.encoding!==void 0&&(o.encoding=c.encoding),c.flipY!==void 0&&(o.flipY=c.flipY),c.format!==void 0&&(o.format=c.format),c.type!==void 0&&(o.type=c.type),c.mipmaps!==void 0&&(o.mipmaps=c.mipmaps,o.minFilter=xi),c.mipmapCount===1&&(o.minFilter=vt),c.generateMipmaps!==void 0&&(o.generateMipmaps=c.generateMipmaps),o.needsUpdate=!0,t&&t(o,c))},i,r),o}}class Dh extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=new Mt,o=new Ca(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(l){s.image=l;const u=e.search(/\.jpe?g($|\?)/i)>0||e.search(/^data\:image\/jpeg/)===0;s.format=u?Mi:hn,s.needsUpdate=!0,t!==void 0&&t(s)},i,r),s}}class qy extends gn{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new Aa(t,e))}getPoint(e){const t=e*this.getLength(),i=this.getCurveLengths();let r=0;for(;r<i.length;){if(i[r]>=t){const s=i[r]-t,o=this.curves[r],l=o.getLength(),u=l===0?0:1-s/l;return o.getPointAt(u)}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,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let i;for(let r=0,s=this.curves;r<s.length;r++){const o=s[r],l=o&&o.isEllipseCurve?e*2:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?e*o.points.length:e,u=o.getPoints(l);for(let c=0;c<u.length;c++){const f=u[c];i&&i.equals(f)||(t.push(f),i=f)}}return this.autoClose&&t.length>1&&!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;t<i;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,i=this.curves.length;t<i;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,i=e.curves.length;t<i;t++){const r=e.curves[t];this.curves.push(new Ah[r.type]().fromJSON(r))}return this}}class La extends qy{constructor(e){super(),this.type="Path",this.currentPoint=new Ae,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const i=new Aa(this.currentPoint.clone(),new Ae(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,i,r){const s=new wc(this.currentPoint.clone(),new Ae(e,t),new Ae(i,r));return this.curves.push(s),this.currentPoint.set(i,r),this}bezierCurveTo(e,t,i,r,s,o){const l=new xc(this.currentPoint.clone(),new Ae(e,t),new Ae(i,r),new Ae(s,o));return this.curves.push(l),this.currentPoint.set(s,o),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),i=new Mc(t);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,i,r,s,o){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absarc(e+l,t+u,i,r,s,o),this}absarc(e,t,i,r,s,o){return this.absellipse(e,t,i,i,r,s,o),this}ellipse(e,t,i,r,s,o,l,u){const c=this.currentPoint.x,f=this.currentPoint.y;return this.absellipse(e+c,t+f,i,r,s,o,l,u),this}absellipse(e,t,i,r,s,o,l,u){const c=new xa(e,t,i,r,s,o,l,u);if(this.curves.length>0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const f=c.getPoint(1);return this.currentPoint.copy(f),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 mr extends La{constructor(e){super(e),this.uuid=fn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,i=this.holes.length;t<i;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,i=e.holes.length;t<i;t++){const r=e.holes[t];this.holes.push(new La().fromJSON(r))}return this}}class zn extends Xe{constructor(e,t=1){super(),this.type="Light",this.color=new Le(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}zn.prototype.isLight=!0;class Vh extends zn{constructor(e,t,i){super(e,i),this.type="HemisphereLight",this.position.copy(Xe.DefaultUp),this.updateMatrix(),this.groundColor=new Le(t)}copy(e){return zn.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}Vh.prototype.isHemisphereLight=!0;const Qy=new Oe,eb=new Q,tb=new Q;class kh{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new Ae(512,512),this.map=null,this.mapPass=null,this.matrix=new Oe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new oa,this._frameExtents=new Ae(1,1),this._viewportCount=1,this._viewports=[new it(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,i=this.matrix;eb.setFromMatrixPosition(e.matrixWorld),t.position.copy(eb),tb.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(tb),t.updateMatrixWorld(),Qy.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Qy),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(t.projectionMatrix),i.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class nb extends kh{constructor(){super(new Dt(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,i=Qo*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(i!==t.fov||r!==t.aspect||s!==t.far)&&(t.fov=i,t.aspect=r,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}nb.prototype.isSpotLightShadow=!0;class Cc extends zn{constructor(e,t,i=0,r=Math.PI/3,s=0,o=1){super(e,t),this.type="SpotLight",this.position.copy(Xe.DefaultUp),this.updateMatrix(),this.target=new Xe,this.distance=i,this.angle=r,this.penumbra=s,this.decay=o,this.shadow=new nb}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Cc.prototype.isSpotLight=!0;const ib=new Oe,Ra=new Q,zh=new Q;class rb extends kh{constructor(){super(new Dt(90,1,.5,500)),this._frameExtents=new Ae(4,2),this._viewportCount=6,this._viewports=[new it(2,1,1,1),new it(0,1,1,1),new it(3,1,1,1),new it(1,1,1,1),new it(3,0,1,1),new it(1,0,1,1)],this._cubeDirections=[new Q(1,0,0),new Q(-1,0,0),new Q(0,0,1),new Q(0,0,-1),new Q(0,1,0),new Q(0,-1,0)],this._cubeUps=[new Q(0,1,0),new Q(0,1,0),new Q(0,1,0),new Q(0,1,0),new Q(0,0,1),new Q(0,0,-1)]}updateMatrices(e,t=0){const i=this.camera,r=this.matrix,s=e.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),Ra.setFromMatrixPosition(e.matrixWorld),i.position.copy(Ra),zh.copy(i.position),zh.add(this._cubeDirections[t]),i.up.copy(this._cubeUps[t]),i.lookAt(zh),i.updateMatrixWorld(),r.makeTranslation(-Ra.x,-Ra.y,-Ra.z),ib.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ib)}}rb.prototype.isPointLightShadow=!0;class Lc extends zn{constructor(e,t,i=0,r=1){super(e,t),this.type="PointLight",this.distance=i,this.decay=r,this.shadow=new rb}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}Lc.prototype.isPointLight=!0;class vo extends sa{constructor(e=-1,t=1,i=1,r=-1,s=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,i,r,s,o){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=r,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=i-e,o=i+e,l=r+t,u=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,f=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,l-=f*this.view.offsetY,u=l-f*this.view.height}this.projectionMatrix.makeOrthographic(s,o,l,u,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}vo.prototype.isOrthographicCamera=!0;class sb extends kh{constructor(){super(new vo(-5,5,5,-5,.5,500))}}sb.prototype.isDirectionalLightShadow=!0;class Rc extends zn{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(Xe.DefaultUp),this.updateMatrix(),this.target=new Xe,this.shadow=new sb}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}Rc.prototype.isDirectionalLight=!0;class Uh extends zn{constructor(e,t){super(e,t),this.type="AmbientLight"}}Uh.prototype.isAmbientLight=!0;class Gh extends zn{constructor(e,t,i=10,r=10){super(e,t),this.type="RectAreaLight",this.width=i,this.height=r}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}Gh.prototype.isRectAreaLight=!0;class Hh{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new Q)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.282095),t.addScaledVector(o[1],.488603*r),t.addScaledVector(o[2],.488603*s),t.addScaledVector(o[3],.488603*i),t.addScaledVector(o[4],1.092548*(i*r)),t.addScaledVector(o[5],1.092548*(r*s)),t.addScaledVector(o[6],.315392*(3*s*s-1)),t.addScaledVector(o[7],1.092548*(i*s)),t.addScaledVector(o[8],.546274*(i*i-r*r)),t}getIrradianceAt(e,t){const i=e.x,r=e.y,s=e.z,o=this.coefficients;return t.copy(o[0]).multiplyScalar(.886227),t.addScaledVector(o[1],2*.511664*r),t.addScaledVector(o[2],2*.511664*s),t.addScaledVector(o[3],2*.511664*i),t.addScaledVector(o[4],2*.429043*i*r),t.addScaledVector(o[5],2*.429043*r*s),t.addScaledVector(o[6],.743125*s*s-.247708),t.addScaledVector(o[7],2*.429043*i*s),t.addScaledVector(o[8],.429043*(i*i-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const i=this.coefficients;for(let r=0;r<9;r++)i[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const i=e.x,r=e.y,s=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*s,t[3]=.488603*i,t[4]=1.092548*i*r,t[5]=1.092548*r*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*i*s,t[8]=.546274*(i*i-r*r)}}Hh.prototype.isSphericalHarmonics3=!0;class Fa extends zn{constructor(e=new Hh,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}Fa.prototype.isLightProbe=!0;class ob extends Xt{constructor(e){super(e),this.textures={}}load(e,t,i,r){const s=this,o=new vn(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t=this.textures;function i(s){return t[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),t[s]}const r=new zO[e.type];if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=new Le().setHex(e.sheen)),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==1&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.morphTargets!==void 0&&(r.morphTargets=e.morphTargets),e.morphNormals!==void 0&&(r.morphNormals=e.morphNormals),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.vertexTangents!==void 0&&(r.vertexTangents=e.vertexTangents),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(r.uniforms[s]={},o.type){case"t":r.uniforms[s].value=i(o.value);break;case"c":r.uniforms[s].value=new Le().setHex(o.value);break;case"v2":r.uniforms[s].value=new Ae().fromArray(o.value);break;case"v3":r.uniforms[s].value=new Q().fromArray(o.value);break;case"v4":r.uniforms[s].value=new it().fromArray(o.value);break;case"m3":r.uniforms[s].value=new Bt().fromArray(o.value);break;case"m4":r.uniforms[s].value=new Oe().fromArray(o.value);break;default:r.uniforms[s].value=o.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.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.shading!==void 0&&(r.flatShading=e.shading===1),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=i(e.map)),e.matcap!==void 0&&(r.matcap=i(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new Ae().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=i(e.specularMap)),e.envMap!==void 0&&(r.envMap=i(e.envMap)),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=i(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new Ae().fromArray(e.clearcoatNormalScale)),e.transmissionMap!==void 0&&(r.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=i(e.thicknessMap)),r}setTextures(e){return this.textures=e,this}}class Pi{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let i=0,r=e.length;i<r;i++)t+=String.fromCharCode(e[i]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.substr(0,t+1)}}class Wh extends ke{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return new this.constructor().copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}Wh.prototype.isInstancedBufferGeometry=!0;class jh extends Ze{constructor(e,t,i,r=1){typeof i=="number"&&(r=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,i),this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}jh.prototype.isInstancedBufferAttribute=!0;class ab extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new vn(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){try{t(s.parse(JSON.parse(l)))}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}parse(e){const t={},i={};function r(v,m){if(t[m]!==void 0)return t[m];const b=v.interleavedBuffers[m],y=s(v,b.buffer),g=Us(b.type,y),w=new dr(g,b.stride);return w.uuid=b.uuid,t[m]=w,w}function s(v,m){if(i[m]!==void 0)return i[m];const b=v.arrayBuffers[m],y=new Uint32Array(b).buffer;return i[m]=y,y}const o=e.isInstancedBufferGeometry?new Wh:new ke,l=e.data.index;if(l!==void 0){const v=Us(l.type,l.array);o.setIndex(new Ze(v,1))}const u=e.data.attributes;for(const v in u){const m=u[v];let d;if(m.isInterleavedBufferAttribute){const b=r(e.data,m.data);d=new Fi(b,m.itemSize,m.offset,m.normalized)}else{const b=Us(m.type,m.array),y=m.isInstancedBufferAttribute?jh:Ze;d=new y(b,m.itemSize,m.normalized)}m.name!==void 0&&(d.name=m.name),m.usage!==void 0&&d.setUsage(m.usage),m.updateRange!==void 0&&(d.updateRange.offset=m.updateRange.offset,d.updateRange.count=m.updateRange.count),o.setAttribute(v,d)}const c=e.data.morphAttributes;if(c)for(const v in c){const m=c[v],d=[];for(let b=0,y=m.length;b<y;b++){const g=m[b];let w;if(g.isInterleavedBufferAttribute){const A=r(e.data,g.data);w=new Fi(A,g.itemSize,g.offset,g.normalized)}else{const A=Us(g.type,g.array);w=new Ze(A,g.itemSize,g.normalized)}g.name!==void 0&&(w.name=g.name),d.push(w)}o.morphAttributes[v]=d}e.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const h=e.data.groups||e.data.drawcalls||e.data.offsets;if(h!==void 0)for(let v=0,m=h.length;v!==m;++v){const d=h[v];o.addGroup(d.start,d.count,d.materialIndex)}const p=e.data.boundingSphere;if(p!==void 0){const v=new Q;p.center!==void 0&&v.fromArray(p.center),o.boundingSphere=new Si(v,p.radius)}return e.name&&(o.name=e.name),e.userData&&(o.userData=e.userData),o}}class jO extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=this.path===""?Pi.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||o;const l=new vn(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){let c=null;try{c=JSON.parse(u)}catch(h){r!==void 0&&r(h),console.error("THREE:ObjectLoader: Can't parse "+e+".",h.message);return}const f=c.metadata;if(f===void 0||f.type===void 0||f.type.toLowerCase()==="geometry"){console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(c,t)},i,r)}async loadAsync(e,t){const i=this,r=this.path===""?Pi.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const s=new vn(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const o=await s.loadAsync(e,t),l=JSON.parse(o),u=l.metadata;if(u===void 0||u.type===void 0||u.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(l)}parse(e,t){const i=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,r),o=this.parseImages(e.images,function(){t!==void 0&&t(c)}),l=this.parseTextures(e.textures,o),u=this.parseMaterials(e.materials,l),c=this.parseObject(e.object,s,u,l,i),f=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,f),t!==void 0){let h=!1;for(const p in o)if(o[p]instanceof HTMLImageElement){h=!0;break}h===!1&&t(c)}return c}async parseAsync(e){const t=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,i),s=await this.parseImagesAsync(e.images),o=this.parseTextures(e.textures,s),l=this.parseMaterials(e.materials,o),u=this.parseObject(e.object,r,l,o,t),c=this.parseSkeletons(e.skeletons,u);return this.bindSkeletons(u,c),u}parseShapes(e){const t={};if(e!==void 0)for(let i=0,r=e.length;i<r;i++){const s=new mr().fromJSON(e[i]);t[s.uuid]=s}return t}parseSkeletons(e,t){const i={},r={};if(t.traverse(function(s){s.isBone&&(r[s.uuid]=s)}),e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=new ya().fromJSON(e[s],r);i[l.uuid]=l}return i}parseGeometries(e,t){const i={};if(e!==void 0){const r=new ab;for(let s=0,o=e.length;s<o;s++){let l;const u=e[s];switch(u.type){case"BufferGeometry":case"InstancedBufferGeometry":l=r.parse(u);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:u.type in jy?l=jy[u.type].fromJSON(u,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${u.type}"`)}l.uuid=u.uuid,u.name!==void 0&&(l.name=u.name),l.isBufferGeometry===!0&&u.userData!==void 0&&(l.userData=u.userData),i[u.uuid]=l}}return i}parseMaterials(e,t){const i={},r={};if(e!==void 0){const s=new ob;s.setTextures(t);for(let o=0,l=e.length;o<l;o++){const u=e[o];if(u.type==="MultiMaterial"){const c=[];for(let f=0;f<u.materials.length;f++){const h=u.materials[f];i[h.uuid]===void 0&&(i[h.uuid]=s.parse(h)),c.push(i[h.uuid])}r[u.uuid]=c}else i[u.uuid]===void 0&&(i[u.uuid]=s.parse(u)),r[u.uuid]=i[u.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let i=0;i<e.length;i++){const r=e[i],s=go.parse(r);t[s.uuid]=s}return t}parseImages(e,t){const i=this,r={};let s;function o(u){return i.manager.itemStart(u),s.load(u,function(){i.manager.itemEnd(u)},void 0,function(){i.manager.itemError(u),i.manager.itemEnd(u)})}function l(u){if(typeof u=="string"){const c=u,f=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:i.resourcePath+c;return o(f)}else return u.data?{data:Us(u.type,u.data),width:u.width,height:u.height}:null}if(e!==void 0&&e.length>0){const u=new Bh(t);s=new Ca(u),s.setCrossOrigin(this.crossOrigin);for(let c=0,f=e.length;c<f;c++){const h=e[c],p=h.url;if(Array.isArray(p)){r[h.uuid]=[];for(let v=0,m=p.length;v<m;v++){const d=p[v],b=l(d);b!==null&&(b instanceof HTMLImageElement?r[h.uuid].push(b):r[h.uuid].push(new Hr(b.data,b.width,b.height)))}}else{const v=l(h.url);v!==null&&(r[h.uuid]=v)}}}return r}async parseImagesAsync(e){const t=this,i={};let r;async function s(o){if(typeof o=="string"){const l=o,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l)?l:t.resourcePath+l;return await r.loadAsync(u)}else return o.data?{data:Us(o.type,o.data),width:o.width,height:o.height}:null}if(e!==void 0&&e.length>0){r=new Ca(this.manager),r.setCrossOrigin(this.crossOrigin);for(let o=0,l=e.length;o<l;o++){const u=e[o],c=u.url;if(Array.isArray(c)){i[u.uuid]=[];for(let f=0,h=c.length;f<h;f++){const p=c[f],v=await s(p);v!==null&&(v instanceof HTMLImageElement?i[u.uuid].push(v):i[u.uuid].push(new Hr(v.data,v.width,v.height)))}}else{const f=await s(u.url);f!==null&&(i[u.uuid]=f)}}}return i}parseTextures(e,t){function i(s,o){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),o[s])}const r={};if(e!==void 0)for(let s=0,o=e.length;s<o;s++){const l=e[s];l.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',l.uuid),t[l.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",l.image);let u;const c=t[l.image];Array.isArray(c)?(u=new Zs(c),c.length===6&&(u.needsUpdate=!0)):(c&&c.data?u=new Hr(c.data,c.width,c.height):u=new Mt(c),c&&(u.needsUpdate=!0)),u.uuid=l.uuid,l.name!==void 0&&(u.name=l.name),l.mapping!==void 0&&(u.mapping=i(l.mapping,$O)),l.offset!==void 0&&u.offset.fromArray(l.offset),l.repeat!==void 0&&u.repeat.fromArray(l.repeat),l.center!==void 0&&u.center.fromArray(l.center),l.rotation!==void 0&&(u.rotation=l.rotation),l.wrap!==void 0&&(u.wrapS=i(l.wrap[0],lb),u.wrapT=i(l.wrap[1],lb)),l.format!==void 0&&(u.format=l.format),l.type!==void 0&&(u.type=l.type),l.encoding!==void 0&&(u.encoding=l.encoding),l.minFilter!==void 0&&(u.minFilter=i(l.minFilter,cb)),l.magFilter!==void 0&&(u.magFilter=i(l.magFilter,cb)),l.anisotropy!==void 0&&(u.anisotropy=l.anisotropy),l.flipY!==void 0&&(u.flipY=l.flipY),l.premultiplyAlpha!==void 0&&(u.premultiplyAlpha=l.premultiplyAlpha),l.unpackAlignment!==void 0&&(u.unpackAlignment=l.unpackAlignment),r[l.uuid]=u}return r}parseObject(e,t,i,r,s){let o;function l(p){return t[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),t[p]}function u(p){if(p!==void 0){if(Array.isArray(p)){const v=[];for(let m=0,d=p.length;m<d;m++){const b=p[m];i[b]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",b),v.push(i[b])}return v}return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),i[p]}}function c(p){return r[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),r[p]}let f,h;switch(e.type){case"Scene":o=new oc,e.background!==void 0&&(Number.isInteger(e.background)?o.background=new Le(e.background):o.background=c(e.background)),e.environment!==void 0&&(o.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?o.fog=new ua(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(o.fog=new ca(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":o=new Dt(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(o.focus=e.focus),e.zoom!==void 0&&(o.zoom=e.zoom),e.filmGauge!==void 0&&(o.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(o.filmOffset=e.filmOffset),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new vo(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(o.zoom=e.zoom),e.view!==void 0&&(o.view=Object.assign({},e.view));break;case"AmbientLight":o=new Uh(e.color,e.intensity);break;case"DirectionalLight":o=new Rc(e.color,e.intensity);break;case"PointLight":o=new Lc(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new Gh(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new Cc(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new Vh(e.color,e.groundColor,e.intensity);break;case"LightProbe":o=new Fa().fromJSON(e);break;case"SkinnedMesh":f=l(e.geometry),h=u(e.material),o=new ga(f,h),e.bindMode!==void 0&&(o.bindMode=e.bindMode),e.bindMatrix!==void 0&&o.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(o.skeleton=e.skeleton);break;case"Mesh":f=l(e.geometry),h=u(e.material),o=new St(f,h);break;case"InstancedMesh":f=l(e.geometry),h=u(e.material);const p=e.count,v=e.instanceMatrix,m=e.instanceColor;o=new ch(f,h,p),o.instanceMatrix=new Ze(new Float32Array(v.array),16),m!==void 0&&(o.instanceColor=new Ze(new Float32Array(m.array),m.itemSize));break;case"LOD":o=new by;break;case"Line":o=new ei(l(e.geometry),u(e.material));break;case"LineLoop":o=new fc(l(e.geometry),u(e.material));break;case"LineSegments":o=new rn(l(e.geometry),u(e.material));break;case"PointCloud":case"Points":o=new eo(l(e.geometry),u(e.material));break;case"Sprite":o=new ma(u(e.material));break;case"Group":o=new Qn;break;case"Bone":o=new va;break;default:o=new Xe}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.castShadow!==void 0&&(o.castShadow=e.castShadow),e.receiveShadow!==void 0&&(o.receiveShadow=e.receiveShadow),e.shadow&&(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 p=e.children;for(let v=0;v<p.length;v++)o.add(this.parseObject(p[v],t,i,r,s))}if(e.animations!==void 0){const p=e.animations;for(let v=0;v<p.length;v++){const m=p[v];o.animations.push(s[m])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(o.autoUpdate=e.autoUpdate);const p=e.levels;for(let v=0;v<p.length;v++){const m=p[v],d=o.getObjectByProperty("uuid",m.object);d!==void 0&&o.addLevel(d,m.distance)}}return o}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const r=t[i.skeleton];r===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(r,i.bindMatrix)}})}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}const $O={UVMapping:El,CubeReflectionMapping:jo,CubeRefractionMapping:$o,EquirectangularReflectionMapping:Cl,EquirectangularRefractionMapping:Ll,CubeUVReflectionMapping:Ts,CubeUVRefractionMapping:Zo},lb={RepeatWrapping:Qi,ClampToEdgeWrapping:zt,MirroredRepeatWrapping:Es},cb={NearestFilter:wt,NearestMipmapNearestFilter:Xo,NearestMipmapLinearFilter:Yo,LinearFilter:vt,LinearMipmapNearestFilter:Rl,LinearMipmapLinearFilter:xi};class $h extends Xt{constructor(e){super(e),typeof createImageBitmap>"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,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Kr.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l={};l.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",l.headers=this.requestHeader,fetch(e,l).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){Kr.add(e,u),t&&t(u),s.manager.itemEnd(e)}).catch(function(u){r&&r(u),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}$h.prototype.isImageBitmapLoader=!0;class ub{constructor(){this.type="ShapePath",this.color=new Le,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new La,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,r){return this.currentPath.quadraticCurveTo(e,t,i,r),this}bezierCurveTo(e,t,i,r,s,o){return this.currentPath.bezierCurveTo(e,t,i,r,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function i(g){const w=[];for(let A=0,S=g.length;A<S;A++){const M=g[A],F=new mr;F.curves=M.curves,w.push(F)}return w}function r(g,w){const A=w.length;let S=!1;for(let M=A-1,F=0;F<A;M=F++){let R=w[M],T=w[F],P=T.x-R.x,_=T.y-R.y;if(Math.abs(_)>Number.EPSILON){if(_<0&&(R=w[F],P=-P,T=w[M],_=-_),g.y<R.y||g.y>T.y)continue;if(g.y===R.y){if(g.x===R.x)return!0}else{const E=_*(g.x-R.x)-P*(g.y-R.y);if(E===0)return!0;if(E<0)continue;S=!S}}else{if(g.y!==R.y)continue;if(T.x<=g.x&&g.x<=R.x||R.x<=g.x&&g.x<=T.x)return!0}}return S}const s=ni.isClockWise,o=this.subPaths;if(o.length===0)return[];if(t===!0)return i(o);let l,u,c;const f=[];if(o.length===1)return u=o[0],c=new mr,c.curves=u.curves,f.push(c),f;let h=!s(o[0].getPoints());h=e?!h:h;const p=[],v=[];let m=[],d=0,b;v[d]=void 0,m[d]=[];for(let g=0,w=o.length;g<w;g++)u=o[g],b=u.getPoints(),l=s(b),l=e?!l:l,l?(!h&&v[d]&&d++,v[d]={s:new mr,p:b},v[d].s.curves=u.curves,h&&d++,m[d]=[]):m[d].push({h:u,p:b[0]});if(!v[0])return i(o);if(v.length>1){let g=!1;const w=[];for(let A=0,S=v.length;A<S;A++)p[A]=[];for(let A=0,S=v.length;A<S;A++){const M=m[A];for(let F=0;F<M.length;F++){const R=M[F];let T=!0;for(let P=0;P<v.length;P++)r(R.p,v[P].p)&&(A!==P&&w.push({froms:A,tos:P,hole:F}),T?(T=!1,p[P].push(R)):g=!0);T&&p[A].push(R)}}w.length>0&&(g||(m=p))}let y;for(let g=0,w=v.length;g<w;g++){c=v[g].s,f.push(c),y=m[g];for(let A=0,S=y.length;A<S;A++)c.holes.push(y[A].h)}return f}}class Zh{constructor(e){this.type="Font",this.data=e}generateShapes(e,t=100){const i=[],r=ZO(e,t,this.data);for(let s=0,o=r.length;s<o;s++)Array.prototype.push.apply(i,r[s].toShapes());return i}}function ZO(n,e,t){const i=Array.from(n),r=e/t.resolution,s=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*r,o=[];let l=0,u=0;for(let c=0;c<i.length;c++){const f=i[c];if(f===`
|
|
2916
2916
|
`)l=0,u-=s;else{const h=XO(f,r,l,u,t);l+=h.offsetX,o.push(h.path)}}return o}function XO(n,e,t,i,r){const s=r.glyphs[n]||r.glyphs["?"];if(!s){console.error('THREE.Font: character "'+n+'" does not exists in font family '+r.familyName+".");return}const o=new ub;let l,u,c,f,h,p,v,m;if(s.o){const d=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let b=0,y=d.length;b<y;)switch(d[b++]){case"m":l=d[b++]*e+t,u=d[b++]*e+i,o.moveTo(l,u);break;case"l":l=d[b++]*e+t,u=d[b++]*e+i,o.lineTo(l,u);break;case"q":c=d[b++]*e+t,f=d[b++]*e+i,h=d[b++]*e+t,p=d[b++]*e+i,o.quadraticCurveTo(h,p,c,f);break;case"b":c=d[b++]*e+t,f=d[b++]*e+i,h=d[b++]*e+t,p=d[b++]*e+i,v=d[b++]*e+t,m=d[b++]*e+i,o.bezierCurveTo(h,p,v,m,c,f);break}}return{offsetX:s.ha*e,path:o}}Zh.prototype.isFont=!0;class YO extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new vn(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(s.withCredentials),o.load(e,function(l){let u;try{u=JSON.parse(l)}catch{console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),u=JSON.parse(l.substring(65,l.length-2))}const c=s.parse(u);t&&t(c)},i,r)}parse(e){return new Zh(e)}}let Fc;const Xh={getContext:function(){return Fc===void 0&&(Fc=new(window.AudioContext||window.webkitAudioContext)),Fc},setContext:function(n){Fc=n}};class db extends Xt{constructor(e){super(e)}load(e,t,i,r){const s=this,o=new vn(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const u=l.slice(0);Xh.getContext().decodeAudioData(u,function(f){t(f)})}catch(u){r?r(u):console.error(u),s.manager.itemError(e)}},i,r)}}class hb extends Fa{constructor(e,t,i=1){super(void 0,i);const r=new Le().set(e),s=new Le().set(t),o=new Q(r.r,r.g,r.b),l=new Q(s.r,s.g,s.b),u=Math.sqrt(Math.PI),c=u*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(l).multiplyScalar(u),this.sh.coefficients[1].copy(o).sub(l).multiplyScalar(c)}}hb.prototype.isHemisphereLightProbe=!0;class fb extends Fa{constructor(e,t=1){super(void 0,t);const i=new Le().set(e);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}}fb.prototype.isAmbientLightProbe=!0;const pb=new Oe,mb=new Oe;class JO{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Dt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Dt,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;const r=e.projectionMatrix.clone(),s=t.eyeSep/2,o=s*t.near/t.focus,l=t.near*Math.tan(Dr*t.fov*.5)/t.zoom;let u,c;mb.elements[12]=-s,pb.elements[12]=s,u=-l*t.aspect+o,c=l*t.aspect+o,r.elements[0]=2*t.near/(c-u),r.elements[8]=(c+u)/(c-u),this.cameraL.projectionMatrix.copy(r),u=-l*t.aspect-o,c=l*t.aspect-o,r.elements[0]=2*t.near/(c-u),r.elements[8]=(c+u)/(c-u),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(mb),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(pb)}}class gb{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=vb(),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=vb();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function vb(){return(typeof performance>"u"?Date:performance).now()}const qr=new Q,yb=new Zt,KO=new Q,Qr=new Q;class qO extends Xe{constructor(){super(),this.type="AudioListener",this.context=Xh.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new gb}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,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(qr,yb,KO),Qr.set(0,0,-1).applyQuaternion(yb),t.positionX){const r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(qr.x,r),t.positionY.linearRampToValueAtTime(qr.y,r),t.positionZ.linearRampToValueAtTime(qr.z,r),t.forwardX.linearRampToValueAtTime(Qr.x,r),t.forwardY.linearRampToValueAtTime(Qr.y,r),t.forwardZ.linearRampToValueAtTime(Qr.z,r),t.upX.linearRampToValueAtTime(i.x,r),t.upY.linearRampToValueAtTime(i.y,r),t.upZ.linearRampToValueAtTime(i.z,r)}else t.setPosition(qr.x,qr.y,qr.z),t.setOrientation(Qr.x,Qr.y,Qr.z,i.x,i.y,i.z)}}class Yh extends Xe{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(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source.stop(),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;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,this.source.detune!==void 0)return this.isPlaying===!0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const es=new Q,bb=new Zt,QO=new Q,ts=new Q;class eN extends Yh{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(es,bb,QO),ts.set(0,0,1).applyQuaternion(bb);const t=this.panner;if(t.positionX){const i=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(es.x,i),t.positionY.linearRampToValueAtTime(es.y,i),t.positionZ.linearRampToValueAtTime(es.z,i),t.orientationX.linearRampToValueAtTime(ts.x,i),t.orientationY.linearRampToValueAtTime(ts.y,i),t.orientationZ.linearRampToValueAtTime(ts.z,i)}else t.setPosition(es.x,es.y,es.z),t.setOrientation(ts.x,ts.y,ts.z)}}class xb{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let i=0;i<t.length;i++)e+=t[i];return e/t.length}}class wb{constructor(e,t,i){this.binding=e,this.valueSize=i;let r,s,o;switch(t){case"quaternion":r=this._slerp,s=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":r=this._select,s=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:r=this._lerp,s=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=s,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const i=this.buffer,r=this.valueSize,s=e*r+r;let o=this.cumulativeWeight;if(o===0){for(let l=0;l!==r;++l)i[s+l]=i[l];o=t}else{o+=t;const l=t/o;this._mixBufferRegion(i,s,0,l,r)}this.cumulativeWeight=o}accumulateAdditive(e){const t=this.buffer,i=this.valueSize,r=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,i=this.buffer,r=e*t+t,s=this.cumulativeWeight,o=this.cumulativeWeightAdditive,l=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const u=t*this._origIndex;this._mixBufferRegion(i,r,u,1-s,t)}o>0&&this._mixBufferRegionAdditive(i,r,this._addIndex*t,1,t);for(let u=t,c=t+t;u!==c;++u)if(i[u]!==i[u+t]){l.setValue(i,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,i=this.valueSize,r=i*this._origIndex;e.getValue(t,r);for(let s=i,o=r;s!==o;++s)t[s]=t[r+s%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<t;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[t+i]=this.buffer[e+i]}_select(e,t,i,r,s){if(r>=.5)for(let o=0;o!==s;++o)e[t+o]=e[i+o]}_slerp(e,t,i,r){Zt.slerpFlat(e,t,e,t,e,i,r)}_slerpAdditive(e,t,i,r,s){const o=this._workIndex*s;Zt.multiplyQuaternionsFlat(e,o,e,t,e,i),Zt.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,i,r,s){const o=1-r;for(let l=0;l!==s;++l){const u=t+l;e[u]=e[u]*o+e[i+l]*r}}_lerpAdditive(e,t,i,r,s){for(let o=0;o!==s;++o){const l=t+o;e[l]=e[l]+e[i+o]*r}}}const Jh="\\[\\]\\.:\\/",tN=new RegExp("["+Jh+"]","g"),Kh="[^"+Jh+"]",nN="[^"+Jh.replace("\\.","")+"]",iN=/((?:WC+[\/:])*)/.source.replace("WC",Kh),rN=/(WCOD+)?/.source.replace("WCOD",nN),sN=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Kh),oN=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Kh),aN=new RegExp("^"+iN+rN+sN+oN+"$"),lN=["material","materials","bones"];class cN{constructor(e,t,i){const r=i||et.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const i=this._targetGroup.nCachedObjects_,r=this._bindings[i];r!==void 0&&r.getValue(e,t)}setValue(e,t){const i=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=i.length;r!==s;++r)i[r].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 et{constructor(e,t,i){this.path=t,this.parsedPath=i||et.parseTrackName(t),this.node=et.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,i){return e&&e.isAnimationObjectGroup?new et.Composite(e,t,i):new et(e,t,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(tN,"")}static parseTrackName(e){const t=aN.exec(e);if(!t)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]},r=i.nodeName&&i.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=i.nodeName.substring(r+1);lN.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,r),i.objectName=s)}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||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(s){for(let o=0;o<s.length;o++){const l=s[o];if(l.name===t||l.uuid===t)return l;const u=i(l.children);if(u)return u}return null},r=i(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.node[this.propertyName]}_getValue_array(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)e[t++]=i[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const i=this.resolvedProperty;for(let r=0,s=i.length;r!==s;++r)i[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,i=t.objectName,r=t.propertyName;let s=t.propertyIndex;if(e||(e=et.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");return}if(i){let c=t.objectIndex;switch(i){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let f=0;f<e.length;f++)if(e[f].name===c){c=f;break}break;default:if(e[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(c!==void 0){if(e[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[c]}}const o=e[r];if(o===void 0){const c=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",e);return}let l=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?l=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(l=this.Versioning.MatrixWorldNeedsUpdate);let u=this.BindingType.Direct;if(s!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}else{console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);return}}u=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(u=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(u=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=r;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][l]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}et.Composite=cN,et.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},et.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},et.prototype.GetterByBindingType=[et.prototype._getValue_direct,et.prototype._getValue_array,et.prototype._getValue_arrayElement,et.prototype._getValue_toArray],et.prototype.SetterByBindingTypeAndVersioning=[[et.prototype._setValue_direct,et.prototype._setValue_direct_setNeedsUpdate,et.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[et.prototype._setValue_array,et.prototype._setValue_array_setNeedsUpdate,et.prototype._setValue_array_setMatrixWorldNeedsUpdate],[et.prototype._setValue_arrayElement,et.prototype._setValue_arrayElement_setNeedsUpdate,et.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[et.prototype._setValue_fromArray,et.prototype._setValue_fromArray_setNeedsUpdate,et.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Mb{constructor(){this.uuid=fn(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let i=0,r=arguments.length;i!==r;++i)e[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,i=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length;let l,u=e.length,c=this.nCachedObjects_;for(let f=0,h=arguments.length;f!==h;++f){const p=arguments[f],v=p.uuid;let m=t[v];if(m===void 0){m=u++,t[v]=m,e.push(p);for(let d=0,b=o;d!==b;++d)s[d].push(new et(p,i[d],r[d]))}else if(m<c){l=e[m];const d=--c,b=e[d];t[b.uuid]=m,e[m]=b,t[v]=d,e[d]=p;for(let y=0,g=o;y!==g;++y){const w=s[y],A=w[d];let S=w[m];w[m]=A,S===void 0&&(S=new et(p,i[y],r[y])),w[d]=S}}else e[m]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c}remove(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_;for(let o=0,l=arguments.length;o!==l;++o){const u=arguments[o],c=u.uuid,f=t[c];if(f!==void 0&&f>=s){const h=s++,p=e[h];t[p.uuid]=f,e[f]=p,t[c]=h,e[h]=u;for(let v=0,m=r;v!==m;++v){const d=i[v],b=d[h],y=d[f];d[f]=b,d[h]=y}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,i=this._bindings,r=i.length;let s=this.nCachedObjects_,o=e.length;for(let l=0,u=arguments.length;l!==u;++l){const c=arguments[l],f=c.uuid,h=t[f];if(h!==void 0)if(delete t[f],h<s){const p=--s,v=e[p],m=--o,d=e[m];t[v.uuid]=h,e[h]=v,t[d.uuid]=p,e[p]=d,e.pop();for(let b=0,y=r;b!==y;++b){const g=i[b],w=g[p],A=g[m];g[h]=w,g[p]=A,g.pop()}}else{const p=--o,v=e[p];p>0&&(t[v.uuid]=h),e[h]=v,e.pop();for(let m=0,d=r;m!==d;++m){const b=i[m];b[h]=b[p],b.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const i=this._bindingsIndicesByPath;let r=i[e];const s=this._bindings;if(r!==void 0)return s[r];const o=this._paths,l=this._parsedPaths,u=this._objects,c=u.length,f=this.nCachedObjects_,h=new Array(c);r=s.length,i[e]=r,o.push(e),l.push(t),s.push(h);for(let p=f,v=u.length;p!==v;++p){const m=u[p];h[p]=new et(m,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,i=t[e];if(i!==void 0){const r=this._paths,s=this._parsedPaths,o=this._bindings,l=o.length-1,u=o[l],c=e[l];t[c]=i,o[i]=u,o.pop(),s[i]=s[l],s.pop(),r[i]=r[l],r.pop()}}}Mb.prototype.isAnimationObjectGroup=!0;class uN{constructor(e,t,i=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=i,this.blendMode=r;const s=t.tracks,o=s.length,l=new Array(o),u={endingStart:Or,endingEnd:Or};for(let c=0;c!==o;++c){const f=s[c].createInterpolant(null);l[c]=f,f.settings=u}this._interpolantSettings=u,this._interpolants=l,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=uv,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){if(e.fadeOut(t),this.fadeIn(t),i){const r=this._clip.duration,s=e._clip.duration,o=s/r,l=r/s;e.warp(1,o,t),this.warp(l,1,t)}return this}crossFadeTo(e,t,i){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 r=this._mixer,s=r.time,o=this.timeScale;let l=this._timeScaleInterpolant;l===null&&(l=r._lendControlInterpolant(),this._timeScaleInterpolant=l);const u=l.parameterPositions,c=l.sampleValues;return u[0]=s,u[1]=s+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,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const u=(e-s)*i;if(u<0||i===0)return;this._startTime=null,t=i*u}t*=this._updateTimeScale(e);const o=this._updateTime(t),l=this._updateWeight(e);if(l>0){const u=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Md:for(let f=0,h=u.length;f!==h;++f)u[f].evaluate(o),c[f].accumulateAdditive(l);break;case Pl:default:for(let f=0,h=u.length;f!==h;++f)u[f].evaluate(o),c[f].accumulate(r,l)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const i=this._weightInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,e>i.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;const i=this._timeScaleInterpolant;if(i!==null){const r=i.evaluate(e)[0];t*=r,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 r=this.time+e,s=this._loopCount;const o=i===dv;if(e===0)return s===-1?r:o&&(s&1)===1?t-r:r;if(i===cv){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}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(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),r>=t||r<0){const l=Math.floor(r/t);r-=t*l,s+=Math.abs(l);const u=this.repetitions-s;if(u<=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(u===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:l})}}else this.time=r;if(o&&(s&1)===1)return t-r}return r}_setEndings(e,t,i){const r=this._interpolantSettings;i?(r.endingStart=Nr,r.endingEnd=Nr):(e?r.endingStart=this.zeroSlopeAtStart?Nr:Or:r.endingStart=qo,t?r.endingEnd=this.zeroSlopeAtEnd?Nr:Or:r.endingEnd=qo)}_scheduleFading(e,t,i){const r=this._mixer,s=r.time;let o=this._weightInterpolant;o===null&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const l=o.parameterPositions,u=o.sampleValues;return l[0]=s,u[0]=t,l[1]=s+e,u[1]=i,this}}class Ab extends tr{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,r=e._clip.tracks,s=r.length,o=e._propertyBindings,l=e._interpolants,u=i.uuid,c=this._bindingsByRootAndName;let f=c[u];f===void 0&&(f={},c[u]=f);for(let h=0;h!==s;++h){const p=r[h],v=p.name;let m=f[v];if(m!==void 0)o[h]=m;else{if(m=o[h],m!==void 0){m._cacheIndex===null&&(++m.referenceCount,this._addInactiveBinding(m,u,v));continue}const d=t&&t._propertyBindings[h].binding.parsedPath;m=new wb(et.create(i,v,d),p.ValueTypeName,p.getValueSize()),++m.referenceCount,this._addInactiveBinding(m,u,v),o[h]=m}l[h].resultBuffer=m.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,i)}const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}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<this._nActiveActions}_addInactiveAction(e,t,i){const r=this._actions,s=this._actionsByClip;let o=s[t];if(o===void 0)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=o;else{const l=o.knownActions;e._byClipCacheIndex=l.length,l.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[i]=e}_removeInactiveAction(e){const t=this._actions,i=t[t.length-1],r=e._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,o=this._actionsByClip,l=o[s],u=l.knownActions,c=u[u.length-1],f=e._byClipCacheIndex;c._byClipCacheIndex=f,u[f]=c,u.pop(),e._byClipCacheIndex=null;const h=l.actionByRoot,p=(e._localRoot||this._root).uuid;delete h[p],u.length===0&&delete o[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let i=0,r=t.length;i!==r;++i){const s=t[i];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const t=this._actions,i=e._cacheIndex,r=this._nActiveActions++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_takeBackAction(e){const t=this._actions,i=e._cacheIndex,r=--this._nActiveActions,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_addInactiveBinding(e,t,i){const r=this._bindingsByRootAndName,s=this._bindings;let o=r[t];o===void 0&&(o={},r[t]=o),o[i]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,i=e.binding,r=i.rootNode.uuid,s=i.path,o=this._bindingsByRootAndName,l=o[r],u=t[t.length-1],c=e._cacheIndex;u._cacheIndex=c,t[c]=u,t.pop(),delete l[s],Object.keys(l).length===0&&delete o[r]}_lendBinding(e){const t=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_takeBackBinding(e){const t=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=i,t[i]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let i=e[t];return i===void 0&&(i=new Oh(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=t,e[t]=i),i}_takeBackControlInterpolant(e){const t=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,s=t[r];e.__cacheIndex=r,t[r]=e,s.__cacheIndex=i,t[i]=s}clipAction(e,t,i){const r=t||this._root,s=r.uuid;let o=typeof e=="string"?go.findByName(r,e):e;const l=o!==null?o.uuid:e,u=this._actionsByClip[l];let c=null;if(i===void 0&&(o!==null?i=o.blendMode:i=Pl),u!==void 0){const h=u.actionByRoot[s];if(h!==void 0&&h.blendMode===i)return h;c=u.knownActions[0],o===null&&(o=c._clip)}if(o===null)return null;const f=new uN(this,o,t,i);return this._bindAction(f,c),this._addInactiveAction(f,l,s),f}existingAction(e,t){const i=t||this._root,r=i.uuid,s=typeof e=="string"?go.findByName(i,e):e,o=s?s.uuid:e,l=this._actionsByClip[o];return l!==void 0&&l.actionByRoot[r]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let i=t-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const t=this._actions,i=this._nActiveActions,r=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==i;++c)t[c]._update(r,e,s,o);const l=this._bindings,u=this._nActiveBindings;for(let c=0;c!==u;++c)l[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,i=e.uuid,r=this._actionsByClip,s=r[i];if(s!==void 0){const o=s.knownActions;for(let l=0,u=o.length;l!==u;++l){const c=o[l];this._deactivateAction(c);const f=c._cacheIndex,h=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,h._cacheIndex=f,t[f]=h,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[i]}}uncacheRoot(e){const t=e.uuid,i=this._actionsByClip;for(const o in i){const l=i[o].actionByRoot,u=l[t];u!==void 0&&(this._deactivateAction(u),this._removeInactiveAction(u))}const r=this._bindingsByRootAndName,s=r[t];if(s!==void 0)for(const o in s){const l=s[o];l.restoreOriginalState(),this._removeInactiveBinding(l)}}uncacheAction(e,t){const i=this.existingAction(e,t);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}Ab.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class Pc{constructor(e){typeof e=="string"&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new Pc(this.value.clone===void 0?this.value:this.value.clone())}}class Sb extends dr{constructor(e,t,i=1){super(e,t),this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}Sb.prototype.isInstancedInterleavedBuffer=!0;class _b{constructor(e,t,i,r,s){this.buffer=e,this.type=t,this.itemSize=i,this.elementSize=r,this.count=s,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}_b.prototype.isGLBufferAttribute=!0;class dN{constructor(e,t,i=0,r=1/0){this.ray=new sr(e,t),this.near=i,this.far=r,this.camera=null,this.layers=new Ud,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!1,i=[]){return qh(e,this,i,t),i.sort(Tb),i}intersectObjects(e,t=!1,i=[]){for(let r=0,s=e.length;r<s;r++)qh(e[r],this,i,t);return i.sort(Tb),i}}function Tb(n,e){return n.distance-e.distance}function qh(n,e,t,i){if(n.layers.test(e.layers)&&n.raycast(e,t),i===!0){const r=n.children;for(let s=0,o=r.length;s<o;s++)qh(r[s],e,t,!0)}}class hN{constructor(e=1,t=0,i=0){return this.radius=e,this.phi=t,this.theta=i,this}set(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+t*t+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos($t(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class fN{constructor(e=1,t=0,i=0){return this.radius=e,this.theta=t,this.y=i,this}set(e,t,i){return this.radius=e,this.theta=t,this.y=i,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=t,this}clone(){return new this.constructor().copy(this)}}const Eb=new Ae;class yo{constructor(e=new Ae(1/0,1/0),t=new Ae(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const i=Eb.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<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 Eb.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),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)}}yo.prototype.isBox2=!0;const Cb=new Q,Ic=new Q;class Lb{constructor(e=new Q,t=new Q){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){Cb.subVectors(e,this.start),Ic.subVectors(this.end,this.start);const i=Ic.dot(Ic);let s=Ic.dot(Cb)/i;return t&&(s=$t(s,0,1)),s}closestPointToPoint(e,t,i){const r=this.closestPointToPointParameter(e,t);return this.delta(i).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)}}class Rb extends Xe{constructor(e){super(),this.material=e,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}}Rb.prototype.isImmediateRenderObject=!0;const Fb=new Q;class pN extends Xe{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const i=new ke,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 o=0,l=1,u=32;o<u;o++,l++){const c=o/u*Math.PI*2,f=l/u*Math.PI*2;r.push(Math.cos(c),Math.sin(c),1,Math.cos(f),Math.sin(f),1)}i.setAttribute("position",new Pe(r,3));const s=new Vt({fog:!1,toneMapped:!1});this.cone=new rn(i,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Fb.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Fb),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const gr=new Q,Oc=new Oe,Qh=new Oe;class Pb extends rn{constructor(e){const t=Ib(e),i=new ke,r=[],s=[],o=new Le(0,0,1),l=new Le(0,1,0);for(let c=0;c<t.length;c++){const f=t[c];f.parent&&f.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),s.push(o.r,o.g,o.b),s.push(l.r,l.g,l.b))}i.setAttribute("position",new Pe(r,3)),i.setAttribute("color",new Pe(s,3));const u=new Vt({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(i,u),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,i=this.geometry,r=i.getAttribute("position");Qh.copy(this.root.matrixWorld).invert();for(let s=0,o=0;s<t.length;s++){const l=t[s];l.parent&&l.parent.isBone&&(Oc.multiplyMatrices(Qh,l.matrixWorld),gr.setFromMatrixPosition(Oc),r.setXYZ(o,gr.x,gr.y,gr.z),Oc.multiplyMatrices(Qh,l.parent.matrixWorld),gr.setFromMatrixPosition(Oc),r.setXYZ(o+1,gr.x,gr.y,gr.z),o+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}function Ib(n){const e=[];n&&n.isBone&&e.push(n);for(let t=0;t<n.children.length;t++)e.push.apply(e,Ib(n.children[t]));return e}class mN extends St{constructor(e,t,i){const r=new $r(t,4,2),s=new cn({wireframe:!0,fog:!1,toneMapped:!1});super(r,s),this.light=e,this.light.updateMatrixWorld(),this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const gN=new Q,Ob=new Le,Nb=new Le;class vN extends Xe{constructor(e,t,i){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;const r=new Wr(t);r.rotateY(Math.PI*.5),this.material=new cn({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=r.getAttribute("position"),o=new Float32Array(s.count*3);r.setAttribute("color",new Ze(o,3)),this.add(new St(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");Ob.copy(this.light.color),Nb.copy(this.light.groundColor);for(let i=0,r=t.count;i<r;i++){const s=i<r/2?Ob:Nb;t.setXYZ(i,s.r,s.g,s.b)}t.needsUpdate=!0}e.lookAt(gN.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Bb extends rn{constructor(e=10,t=10,i=4473924,r=8947848){i=new Le(i),r=new Le(r);const s=t/2,o=e/t,l=e/2,u=[],c=[];for(let p=0,v=0,m=-l;p<=t;p++,m+=o){u.push(-l,0,m,l,0,m),u.push(m,0,-l,m,0,l);const d=p===s?i:r;d.toArray(c,v),v+=3,d.toArray(c,v),v+=3,d.toArray(c,v),v+=3,d.toArray(c,v),v+=3}const f=new ke;f.setAttribute("position",new Pe(u,3)),f.setAttribute("color",new Pe(c,3));const h=new Vt({vertexColors:!0,toneMapped:!1});super(f,h),this.type="GridHelper"}}class yN extends rn{constructor(e=10,t=16,i=8,r=64,s=4473924,o=8947848){s=new Le(s),o=new Le(o);const l=[],u=[];for(let h=0;h<=t;h++){const p=h/t*(Math.PI*2),v=Math.sin(p)*e,m=Math.cos(p)*e;l.push(0,0,0),l.push(v,0,m);const d=h&1?s:o;u.push(d.r,d.g,d.b),u.push(d.r,d.g,d.b)}for(let h=0;h<=i;h++){const p=h&1?s:o,v=e-e/i*h;for(let m=0;m<r;m++){let d=m/r*(Math.PI*2),b=Math.sin(d)*v,y=Math.cos(d)*v;l.push(b,0,y),u.push(p.r,p.g,p.b),d=(m+1)/r*(Math.PI*2),b=Math.sin(d)*v,y=Math.cos(d)*v,l.push(b,0,y),u.push(p.r,p.g,p.b)}}const c=new ke;c.setAttribute("position",new Pe(l,3)),c.setAttribute("color",new Pe(u,3));const f=new Vt({vertexColors:!0,toneMapped:!1});super(c,f),this.type="PolarGridHelper"}}const Db=new Q,Nc=new Q,Vb=new Q;class bN extends Xe{constructor(e,t,i){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,t===void 0&&(t=1);let r=new ke;r.setAttribute("position",new Pe([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new Vt({fog:!1,toneMapped:!1});this.lightPlane=new ei(r,s),this.add(this.lightPlane),r=new ke,r.setAttribute("position",new Pe([0,0,0,0,0,1],3)),this.targetLine=new ei(r,s),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){Db.setFromMatrixPosition(this.light.matrixWorld),Nc.setFromMatrixPosition(this.light.target.matrixWorld),Vb.subVectors(Nc,Db),this.lightPlane.lookAt(Nc),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Nc),this.targetLine.scale.z=Vb.length()}}const Bc=new Q,yt=new sa;class xN extends rn{constructor(e){const t=new ke,i=new Vt({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],s=[],o={},l=new Le(16755200),u=new Le(16711680),c=new Le(43775),f=new Le(16777215),h=new Le(3355443);p("n1","n2",l),p("n2","n4",l),p("n4","n3",l),p("n3","n1",l),p("f1","f2",l),p("f2","f4",l),p("f4","f3",l),p("f3","f1",l),p("n1","f1",l),p("n2","f2",l),p("n3","f3",l),p("n4","f4",l),p("p","n1",u),p("p","n2",u),p("p","n3",u),p("p","n4",u),p("u1","u2",c),p("u2","u3",c),p("u3","u1",c),p("c","t",f),p("p","c",h),p("cn1","cn2",h),p("cn3","cn4",h),p("cf1","cf2",h),p("cf3","cf4",h);function p(m,d,b){v(m,b),v(d,b)}function v(m,d){r.push(0,0,0),s.push(d.r,d.g,d.b),o[m]===void 0&&(o[m]=[]),o[m].push(r.length/3-1)}t.setAttribute("position",new Pe(r,3)),t.setAttribute("color",new Pe(s,3)),super(t,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}update(){const e=this.geometry,t=this.pointMap,i=1,r=1;yt.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Tt("c",t,e,yt,0,0,-1),Tt("t",t,e,yt,0,0,1),Tt("n1",t,e,yt,-i,-r,-1),Tt("n2",t,e,yt,i,-r,-1),Tt("n3",t,e,yt,-i,r,-1),Tt("n4",t,e,yt,i,r,-1),Tt("f1",t,e,yt,-i,-r,1),Tt("f2",t,e,yt,i,-r,1),Tt("f3",t,e,yt,-i,r,1),Tt("f4",t,e,yt,i,r,1),Tt("u1",t,e,yt,i*.7,r*1.1,-1),Tt("u2",t,e,yt,-i*.7,r*1.1,-1),Tt("u3",t,e,yt,0,r*2,-1),Tt("cf1",t,e,yt,-i,0,1),Tt("cf2",t,e,yt,i,0,1),Tt("cf3",t,e,yt,0,-r,1),Tt("cf4",t,e,yt,0,r,1),Tt("cn1",t,e,yt,-i,0,-1),Tt("cn2",t,e,yt,i,0,-1),Tt("cn3",t,e,yt,0,-r,-1),Tt("cn4",t,e,yt,0,r,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Tt(n,e,t,i,r,s,o){Bc.set(r,s,o).unproject(i);const l=e[n];if(l!==void 0){const u=t.getAttribute("position");for(let c=0,f=l.length;c<f;c++)u.setXYZ(l[c],Bc.x,Bc.y,Bc.z)}}const Dc=new ln;class kb extends rn{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(8*3),s=new ke;s.setIndex(new Ze(i,1)),s.setAttribute("position",new Ze(r,3)),super(s,new Vt({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(e!==void 0&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),this.object!==void 0&&Dc.setFromObject(this.object),Dc.isEmpty())return;const t=Dc.min,i=Dc.max,r=this.geometry.attributes.position,s=r.array;s[0]=i.x,s[1]=i.y,s[2]=i.z,s[3]=t.x,s[4]=i.y,s[5]=i.z,s[6]=t.x,s[7]=t.y,s[8]=i.z,s[9]=i.x,s[10]=t.y,s[11]=i.z,s[12]=i.x,s[13]=i.y,s[14]=t.z,s[15]=t.x,s[16]=i.y,s[17]=t.z,s[18]=t.x,s[19]=t.y,s[20]=t.z,s[21]=i.x,s[22]=t.y,s[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return rn.prototype.copy.call(this,e),this.object=e.object,this}}class wN extends rn{constructor(e,t=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new ke;s.setIndex(new Ze(i,1)),s.setAttribute("position",new Pe(r,3)),super(s,new Vt({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}class MN extends ei{constructor(e,t=1,i=16776960){const r=i,s=[1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],o=new ke;o.setAttribute("position",new Pe(s,3)),o.computeBoundingSphere(),super(o,new Vt({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const l=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],u=new ke;u.setAttribute("position",new Pe(l,3)),u.computeBoundingSphere(),this.add(new St(u,new cn({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?xt:Ji,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}}const zb=new Q;let Vc,ef;class AN extends Xe{constructor(e=new Q(0,0,1),t=new Q(0,0,0),i=1,r=16776960,s=i*.2,o=s*.2){super(),this.type="ArrowHelper",Vc===void 0&&(Vc=new ke,Vc.setAttribute("position",new Pe([0,0,0,0,1,0],3)),ef=new fr(0,.5,1,5,1),ef.translate(0,-.5,0)),this.position.copy(t),this.line=new ei(Vc,new Vt({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new St(ef,new cn({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,s,o)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{zb.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(zb,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}}class Ub extends rn{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],r=new ke;r.setAttribute("position",new Pe(t,3)),r.setAttribute("color",new Pe(i,3));const s=new Vt({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}setColors(e,t,i){const r=new Le,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(i),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}const Gb=new Float32Array(1),SN=new Int32Array(Gb.buffer);class _N{static toHalfFloat(e){Gb[0]=e;const t=SN[0];let i=t>>16&32768,r=t>>12&2047;const s=t>>23&255;return s<103?i:s>142?(i|=31744,i|=(s==255?0:1)&&t&8388607,i):s<113?(r|=2048,i|=(r>>114-s)+(r>>113-s&1),i):(i|=s-112<<10|r>>1,i+=r&1,i)}}const bo=4,vr=8,ri=Math.pow(2,vr),Hb=[.125,.215,.35,.446,.526,.582],Wb=vr-bo+1+Hb.length,xo=20,si={[tn]:0,[Br]:1,[Ol]:2,[Sd]:3,[_d]:4,[Td]:5,[Il]:6},ns=new cn({side:xt,depthWrite:!1,depthTest:!1}),TN=new St(new Li,ns),tf=new vo,{_lodPlanes:Pa,_sizeLods:jb,_sigmas:kc}=LN(),$b=new Le;let nf=null;const is=(1+Math.sqrt(5))/2,wo=1/is,Zb=[new Q(1,1,1),new Q(-1,1,1),new Q(1,1,-1),new Q(-1,1,-1),new Q(0,is,wo),new Q(0,is,-wo),new Q(wo,0,is),new Q(-wo,0,is),new Q(is,wo,0),new Q(-is,wo,0)];function Xb(n){const e=Math.max(n.r,n.g,n.b),t=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);return n.multiplyScalar(Math.pow(2,-t)),(t+128)/255}class EN{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=RN(xo),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,i=.1,r=100){nf=this._renderer.getRenderTarget();const s=this._allocateTargets();return this._sceneToCubeUV(e,i,r,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e){return this._fromTexture(e)}fromCubemap(e){return this._fromTexture(e)}compileCubemapShader(){this._cubemapShader===null&&(this._cubemapShader=Kb(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){this._equirectShader===null&&(this._equirectShader=Jb(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),this._cubemapShader!==null&&this._cubemapShader.dispose(),this._equirectShader!==null&&this._equirectShader.dispose();for(let e=0;e<Pa.length;e++)Pa[e].dispose()}_cleanup(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(nf),e.scissorTest=!1,zc(e,0,0,e.width,e.height)}_fromTexture(e){nf=this._renderer.getRenderTarget();const t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t}_allocateTargets(e){const t={magFilter:wt,minFilter:wt,generateMipmaps:!1,type:Rr,format:T0,encoding:CN(e)?e.encoding:Ol,depthBuffer:!1},i=Yb(t);return i.depthBuffer=!e,this._pingPongRenderTarget=Yb(t),i}_compileMaterial(e){const t=new St(Pa[0],e);this._renderer.compile(t,tf)}_sceneToCubeUV(e,t,i,r){const l=new Dt(90,1,t,i),u=[1,-1,1,1,1,1],c=[1,1,1,-1,-1,-1],f=this._renderer,h=f.autoClear,p=f.outputEncoding,v=f.toneMapping;f.getClearColor($b),f.toneMapping=qi,f.outputEncoding=tn,f.autoClear=!1;let m=!1;const d=e.background;if(d){if(d.isColor){ns.color.copy(d).convertSRGBToLinear(),e.background=null;const b=Xb(ns.color);ns.opacity=b,m=!0}}else{ns.color.copy($b).convertSRGBToLinear();const b=Xb(ns.color);ns.opacity=b,m=!0}for(let b=0;b<6;b++){const y=b%3;y==0?(l.up.set(0,u[b],0),l.lookAt(c[b],0,0)):y==1?(l.up.set(0,0,u[b]),l.lookAt(0,c[b],0)):(l.up.set(0,u[b],0),l.lookAt(0,0,c[b])),zc(r,y*ri,b>2?ri:0,ri,ri),f.setRenderTarget(r),m&&f.render(TN,l),f.render(e,l)}f.toneMapping=v,f.outputEncoding=p,f.autoClear=h}_textureToCubeUV(e,t){const i=this._renderer;e.isCubeTexture?this._cubemapShader==null&&(this._cubemapShader=Kb()):this._equirectShader==null&&(this._equirectShader=Jb());const r=e.isCubeTexture?this._cubemapShader:this._equirectShader,s=new St(Pa[0],r),o=r.uniforms;o.envMap.value=e,e.isCubeTexture||o.texelSize.value.set(1/e.image.width,1/e.image.height),o.inputEncoding.value=si[e.encoding],o.outputEncoding.value=si[t.texture.encoding],zc(t,0,0,3*ri,2*ri),i.setRenderTarget(t),i.render(s,tf)}_applyPMREM(e){const t=this._renderer,i=t.autoClear;t.autoClear=!1;for(let r=1;r<Wb;r++){const s=Math.sqrt(kc[r]*kc[r]-kc[r-1]*kc[r-1]),o=Zb[(r-1)%Zb.length];this._blur(e,r-1,r,s,o)}t.autoClear=i}_blur(e,t,i,r,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,i,r,"latitudinal",s),this._halfBlur(o,e,i,i,r,"longitudinal",s)}_halfBlur(e,t,i,r,s,o,l){const u=this._renderer,c=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const f=3,h=new St(Pa[r],c),p=c.uniforms,v=jb[i]-1,m=isFinite(s)?Math.PI/(2*v):2*Math.PI/(2*xo-1),d=s/m,b=isFinite(s)?1+Math.floor(f*d):xo;b>xo&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${b} samples when the maximum is set to ${xo}`);const y=[];let g=0;for(let M=0;M<xo;++M){const F=M/d,R=Math.exp(-F*F/2);y.push(R),M==0?g+=R:M<b&&(g+=2*R)}for(let M=0;M<y.length;M++)y[M]=y[M]/g;p.envMap.value=e.texture,p.samples.value=b,p.weights.value=y,p.latitudinal.value=o==="latitudinal",l&&(p.poleAxis.value=l),p.dTheta.value=m,p.mipInt.value=vr-i,p.inputEncoding.value=si[e.texture.encoding],p.outputEncoding.value=si[e.texture.encoding];const w=jb[r],A=3*Math.max(0,ri-2*w),S=(r===0?0:2*ri)+2*w*(r>vr-bo?r-vr+bo:0);zc(t,A,S,3*w,2*w),u.setRenderTarget(t),u.render(h,tf)}}function CN(n){return n===void 0||n.type!==Rr?!1:n.encoding===tn||n.encoding===Br||n.encoding===Il}function LN(){const n=[],e=[],t=[];let i=vr;for(let r=0;r<Wb;r++){const s=Math.pow(2,i);e.push(s);let o=1/s;r>vr-bo?o=Hb[r-vr+bo-1]:r==0&&(o=0),t.push(o);const l=1/(s-1),u=-l/2,c=1+l/2,f=[u,u,c,u,c,c,u,u,c,c,u,c],h=6,p=6,v=3,m=2,d=1,b=new Float32Array(v*p*h),y=new Float32Array(m*p*h),g=new Float32Array(d*p*h);for(let A=0;A<h;A++){const S=A%3*2/3-1,M=A>2?0:-1,F=[S,M,0,S+2/3,M,0,S+2/3,M+1,0,S,M,0,S+2/3,M+1,0,S,M+1,0];b.set(F,v*p*A),y.set(f,m*p*A);const R=[A,A,A,A,A,A];g.set(R,d*p*A)}const w=new ke;w.setAttribute("position",new Ze(b,v)),w.setAttribute("uv",new Ze(y,m)),w.setAttribute("faceIndex",new Ze(g,d)),n.push(w),i>bo&&i--}return{_lodPlanes:n,_sizeLods:e,_sigmas:t}}function Yb(n){const e=new Pn(3*ri,3*ri,n);return e.texture.mapping=Ts,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function zc(n,e,t,i,r){n.viewport.set(e,t,i,r),n.scissor.set(e,t,i,r)}function RN(n){const e=new Float32Array(n),t=new Q(0,1,0);return new fo({name:"SphericalGaussianBlur",defines:{n},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:si[tn]},outputEncoding:{value:si[tn]}},vertexShader:rf(),fragmentShader:`
|
|
2917
2917
|
|
|
2918
2918
|
precision mediump float;
|
|
@@ -3179,9 +3179,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
3179
3179
|
`),s=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP"," vec4 texelGlossiness = texture2D( glossinessMap, vUv );"," // reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture"," glossinessFactor *= texelGlossiness.a;","#endif"].join(`
|
|
3180
3180
|
`),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor;"].join(`
|
|
3181
3181
|
`),l={specular:{value:new Le().setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=l,this.onBeforeCompile=function(u){for(const c in l)u.uniforms[c]=l[c];u.fragmentShader=u.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",t).replace("#include <metalnessmap_pars_fragment>",i).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",s).replace("#include <lights_physical_fragment>",o)},Object.defineProperties(this,{specular:{get:function(){return l.specular.value},set:function(u){l.specular.value=u}},specularMap:{get:function(){return l.specularMap.value},set:function(u){l.specularMap.value=u,u?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return l.glossiness.value},set:function(u){l.glossiness.value=u}},glossinessMap:{get:function(){return l.glossinessMap.value},set:function(u){l.glossinessMap.value=u,u?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class GB{constructor(){this.name=nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"]}getMaterialType(){return cf}extendParams(e,t,i){const r=t.extensions[this.name];e.color=new Le(1,1,1),e.opacity=1;const s=[];if(Array.isArray(r.diffuseFactor)){const o=r.diffuseFactor;e.color.fromArray(o),e.opacity=o[3]}if(r.diffuseTexture!==void 0&&s.push(i.assignTexture(e,"map",r.diffuseTexture)),e.emissive=new Le(0,0,0),e.glossiness=r.glossinessFactor!==void 0?r.glossinessFactor:1,e.specular=new Le(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),r.specularGlossinessTexture!==void 0){const o=r.specularGlossinessTexture;s.push(i.assignTexture(e,"glossinessMap",o)),s.push(i.assignTexture(e,"specularMap",o))}return Promise.all(s)}createMaterial(e){const t=new cf(e);return t.fog=!0,t.color=e.color,t.map=e.map===void 0?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=e.aoMap===void 0?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=e.emissiveMap===void 0?null:e.emissiveMap,t.bumpMap=e.bumpMap===void 0?null:e.bumpMap,t.bumpScale=1,t.normalMap=e.normalMap===void 0?null:e.normalMap,t.normalMapType=er,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=e.specularMap===void 0?null:e.specularMap,t.specular=e.specular,t.glossinessMap=e.glossinessMap===void 0?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=e.envMap===void 0?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}class HB{constructor(){this.name=nt.KHR_MESH_QUANTIZATION}}class Mo extends ii{constructor(e,t,i,r){super(e,t,i,r)}copySampleValue_(e){const t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,s=e*r*3+r;for(let o=0;o!==r;o++)t[o]=i[s+o];return t}}Mo.prototype.beforeStart_=Mo.prototype.copySampleValue_,Mo.prototype.afterEnd_=Mo.prototype.copySampleValue_,Mo.prototype.interpolate_=function(n,e,t,i){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=o*2,u=o*3,c=i-e,f=(t-e)/c,h=f*f,p=h*f,v=n*u,m=v-u,d=-2*p+3*h,b=p-h,y=1-d,g=b-h+f;for(let w=0;w!==o;w++){const A=s[m+w+o],S=s[m+w+l]*c,M=s[v+w+o],F=s[v+w]*c;r[w]=y*A+g*S+d*M+b*F}return r};const Ii={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Na={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},ix={9728:wt,9729:vt,9984:Xo,9985:Rl,9986:Yo,9987:xi},rx={33071:zt,33648:Es,10497:Qi},sx={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},uf={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},yr={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},WB={CUBICSPLINE:void 0,LINEAR:Ir,STEP:Rs},df={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function ox(n,e){return typeof n!="string"||n===""?"":(/^https?:\/\//i.test(e)&&/^\//.test(n)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(n)||/^data:.*,.*$/i.test(n)||/^blob:.*$/i.test(n)?n:e+n)}function jB(n){return n.DefaultMaterial===void 0&&(n.DefaultMaterial=new Zr({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:Ji})),n.DefaultMaterial}function Ba(n,e,t){for(const i in t.extensions)n[i]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=t.extensions[i])}function rs(n,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(n.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function $B(n,e,t){let i=!1,r=!1;for(let l=0,u=e.length;l<u;l++){const c=e[l];if(c.POSITION!==void 0&&(i=!0),c.NORMAL!==void 0&&(r=!0),i&&r)break}if(!i&&!r)return Promise.resolve(n);const s=[],o=[];for(let l=0,u=e.length;l<u;l++){const c=e[l];if(i){const f=c.POSITION!==void 0?t.getDependency("accessor",c.POSITION):n.attributes.position;s.push(f)}if(r){const f=c.NORMAL!==void 0?t.getDependency("accessor",c.NORMAL):n.attributes.normal;o.push(f)}}return Promise.all([Promise.all(s),Promise.all(o)]).then(function(l){const u=l[0],c=l[1];return i&&(n.morphAttributes.position=u),r&&(n.morphAttributes.normal=c),n.morphTargetsRelative=!0,n})}function ZB(n,e){if(n.updateMorphTargets(),e.weights!==void 0)for(let t=0,i=e.weights.length;t<i;t++)n.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(n.morphTargetInfluences.length===t.length){n.morphTargetDictionary={};for(let i=0,r=t.length;i<r;i++)n.morphTargetDictionary[t[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function XB(n){const e=n.extensions&&n.extensions[nt.KHR_DRACO_MESH_COMPRESSION];let t;return e?t="draco:"+e.bufferView+":"+e.indices+":"+ax(e.attributes):t=n.indices+":"+ax(n.attributes)+":"+n.mode,t}function ax(n){let e="";const t=Object.keys(n).sort();for(let i=0,r=t.length;i<r;i++)e+=t[i]+":"+n[t[i]]+";";return e}function hf(n){switch(n){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}class YB{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new FB,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.textureCache={},this.nodeNamesUsed={},typeof createImageBitmap<"u"&&/Firefox/.test(navigator.userAgent)===!1?this.textureLoader=new $h(this.options.manager):this.textureLoader=new Dh(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new vn(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const i=this,r=this.json,s=this.extensions;this.cache.removeAll(),this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])}).then(function(o){const l={scene:o[0][r.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:r.asset,parser:i,userData:{}};Ba(s,l,r),rs(l,r),Promise.all(i._invokeAll(function(u){return u.afterRoot&&u.afterRoot(l)})).then(function(){e(l)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],i=this.json.meshes||[];for(let r=0,s=t.length;r<s;r++){const o=t[r].joints;for(let l=0,u=o.length;l<u;l++)e[o[l]].isBone=!0}for(let r=0,s=e.length;r<s;r++){const o=e[r];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(i[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,i){if(e.refs[t]<=1)return i;const r=i.clone();return r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let i=0;i<t.length;i++){const r=e(t[i]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const i=[];for(let r=0;r<t.length;r++){const s=e(t[r]);s&&i.push(s)}return i}getDependency(e,t){const i=e+":"+t;let r=this.cache.get(i);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this.loadNode(t);break;case"mesh":r=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":r=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":r=this.loadSkin(t);break;case"animation":r=this.loadAnimation(t);break;case"camera":r=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(i,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const i=this,r=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(r.map(function(s,o){return i.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],i=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[nt.KHR_BINARY_GLTF].body);const r=this.options;return new Promise(function(s,o){i.load(ox(t.uri,r.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(i){const r=t.byteLength||0,s=t.byteOffset||0;return i.slice(s,s+r)})}loadAccessor(e){const t=this,i=this.json,r=this.json.accessors[e];if(r.bufferView===void 0&&r.sparse===void 0)return Promise.resolve(null);const s=[];return r.bufferView!==void 0?s.push(this.getDependency("bufferView",r.bufferView)):s.push(null),r.sparse!==void 0&&(s.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(s).then(function(o){const l=o[0],u=sx[r.type],c=Na[r.componentType],f=c.BYTES_PER_ELEMENT,h=f*u,p=r.byteOffset||0,v=r.bufferView!==void 0?i.bufferViews[r.bufferView].byteStride:void 0,m=r.normalized===!0;let d,b;if(v&&v!==h){const y=Math.floor(p/v),g="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+y+":"+r.count;let w=t.cache.get(g);w||(d=new c(l,y*v,r.count*v/f),w=new dr(d,v/f),t.cache.add(g,w)),b=new Fi(w,u,p%v/f,m)}else l===null?d=new c(r.count*u):d=new c(l,p,r.count*u),b=new Ze(d,u,m);if(r.sparse!==void 0){const y=sx.SCALAR,g=Na[r.sparse.indices.componentType],w=r.sparse.indices.byteOffset||0,A=r.sparse.values.byteOffset||0,S=new g(o[1],w,r.sparse.count*y),M=new c(o[2],A,r.sparse.count*u);l!==null&&(b=new Ze(b.array.slice(),b.itemSize,b.normalized));for(let F=0,R=S.length;F<R;F++){const T=S[F];if(b.setX(T,M[F*u]),u>=2&&b.setY(T,M[F*u+1]),u>=3&&b.setZ(T,M[F*u+2]),u>=4&&b.setW(T,M[F*u+3]),u>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return b})}loadTexture(e){const t=this.json,i=this.options,r=t.textures[e],s=t.images[r.source];let o=this.textureLoader;if(s.uri){const l=i.manager.getHandler(s.uri);l!==null&&(o=l)}return this.loadTextureImage(e,s,o)}loadTextureImage(e,t,i){const r=this,s=this.json,o=this.options,l=s.textures[e],u=(t.uri||t.bufferView)+":"+l.sampler;if(this.textureCache[u])return this.textureCache[u];const c=self.URL||self.webkitURL;let f=t.uri||"",h=!1,p=!0;const v=f.search(/\.jpe?g($|\?)/i)>0||f.search(/^data\:image\/jpeg/)===0;if((t.mimeType==="image/jpeg"||v)&&(p=!1),t.bufferView!==void 0)f=r.getDependency("bufferView",t.bufferView).then(function(d){if(t.mimeType==="image/png"){const y=new DataView(d,25,1).getUint8(0,!1);p=y===6||y===4||y===3}h=!0;const b=new Blob([d],{type:t.mimeType});return f=c.createObjectURL(b),f});else if(t.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const m=Promise.resolve(f).then(function(d){return new Promise(function(b,y){let g=b;i.isImageBitmapLoader===!0&&(g=function(w){const A=new Mt(w);A.needsUpdate=!0,b(A)}),i.load(ox(d,o.path),g,void 0,y)})}).then(function(d){h===!0&&c.revokeObjectURL(f),d.flipY=!1,l.name&&(d.name=l.name),p||(d.format=Mi);const y=(s.samplers||{})[l.sampler]||{};return d.magFilter=ix[y.magFilter]||vt,d.minFilter=ix[y.minFilter]||xi,d.wrapS=rx[y.wrapS]||Qi,d.wrapT=rx[y.wrapT]||Qi,r.associations.set(d,{type:"textures",index:e}),d}).catch(function(){return console.error("THREE.GLTFLoader: Couldn't load texture",f),null});return this.textureCache[u]=m,m}assignTexture(e,t,i){const r=this;return this.getDependency("texture",i.index).then(function(s){if(i.texCoord!==void 0&&i.texCoord!=0&&!(t==="aoMap"&&i.texCoord==1)&&console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+t+" not yet supported."),r.extensions[nt.KHR_TEXTURE_TRANSFORM]){const o=i.extensions!==void 0?i.extensions[nt.KHR_TEXTURE_TRANSFORM]:void 0;if(o){const l=r.associations.get(s);s=r.extensions[nt.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),r.associations.set(s,l)}}e[t]=s})}assignFinalMaterial(e){const t=e.geometry;let i=e.material;const r=t.attributes.tangent!==void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0,l=Object.keys(t.morphAttributes).length>0,u=l&&t.morphAttributes.normal!==void 0;if(e.isPoints){const c="PointsMaterial:"+i.uuid;let f=this.cache.get(c);f||(f=new hr,Ft.prototype.copy.call(f,i),f.color.copy(i.color),f.map=i.map,f.sizeAttenuation=!1,this.cache.add(c,f)),i=f}else if(e.isLine){const c="LineBasicMaterial:"+i.uuid;let f=this.cache.get(c);f||(f=new Vt,Ft.prototype.copy.call(f,i),f.color.copy(i.color),this.cache.add(c,f)),i=f}if(r||s||o||l){let c="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),r&&(c+="vertex-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:"),l&&(c+="morph-targets:"),u&&(c+="morph-normals:");let f=this.cache.get(c);f||(f=i.clone(),s&&(f.vertexColors=!0),o&&(f.flatShading=!0),l&&(f.morphTargets=!0),u&&(f.morphNormals=!0),r&&(f.vertexTangents=!0,f.normalScale&&(f.normalScale.y*=-1),f.clearcoatNormalScale&&(f.clearcoatNormalScale.y*=-1)),this.cache.add(c,f),this.associations.set(f,this.associations.get(i))),i=f}i.aoMap&&t.attributes.uv2===void 0&&t.attributes.uv!==void 0&&t.setAttribute("uv2",t.attributes.uv),e.material=i}getMaterialType(){return Zr}loadMaterial(e){const t=this,i=this.json,r=this.extensions,s=i.materials[e];let o;const l={},u=s.extensions||{},c=[];if(u[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const h=r[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];o=h.getMaterialType(),c.push(h.extendParams(l,s,t))}else if(u[nt.KHR_MATERIALS_UNLIT]){const h=r[nt.KHR_MATERIALS_UNLIT];o=h.getMaterialType(),c.push(h.extendParams(l,s,t))}else{const h=s.pbrMetallicRoughness||{};if(l.color=new Le(1,1,1),l.opacity=1,Array.isArray(h.baseColorFactor)){const p=h.baseColorFactor;l.color.fromArray(p),l.opacity=p[3]}h.baseColorTexture!==void 0&&c.push(t.assignTexture(l,"map",h.baseColorTexture)),l.metalness=h.metallicFactor!==void 0?h.metallicFactor:1,l.roughness=h.roughnessFactor!==void 0?h.roughnessFactor:1,h.metallicRoughnessTexture!==void 0&&(c.push(t.assignTexture(l,"metalnessMap",h.metallicRoughnessTexture)),c.push(t.assignTexture(l,"roughnessMap",h.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),c.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,l)})))}s.doubleSided===!0&&(l.side=Ki);const f=s.alphaMode||df.OPAQUE;return f===df.BLEND?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,f===df.MASK&&(l.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==cn&&(c.push(t.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new Ae(1,-1),s.normalTexture.scale!==void 0&&l.normalScale.set(s.normalTexture.scale,-s.normalTexture.scale)),s.occlusionTexture!==void 0&&o!==cn&&(c.push(t.assignTexture(l,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(l.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==cn&&(l.emissive=new Le().fromArray(s.emissiveFactor)),s.emissiveTexture!==void 0&&o!==cn&&c.push(t.assignTexture(l,"emissiveMap",s.emissiveTexture)),Promise.all(c).then(function(){let h;return o===cf?h=r[nt.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):h=new o(l),s.name&&(h.name=s.name),h.map&&(h.map.encoding=Br),h.emissiveMap&&(h.emissiveMap.encoding=Br),rs(h,s),t.associations.set(h,{type:"materials",index:e}),s.extensions&&Ba(r,h,s),h})}createUniqueName(e){const t=et.sanitizeNodeName(e||"");let i=t;for(let r=1;this.nodeNamesUsed[i];++r)i=t+"_"+r;return this.nodeNamesUsed[i]=!0,i}loadGeometries(e){const t=this,i=this.extensions,r=this.primitiveCache;function s(l){return i[nt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(l,t).then(function(u){return cx(u,l,t)})}const o=[];for(let l=0,u=e.length;l<u;l++){const c=e[l],f=XB(c),h=r[f];if(h)o.push(h.promise);else{let p;c.extensions&&c.extensions[nt.KHR_DRACO_MESH_COMPRESSION]?p=s(c):p=cx(new ke,c,t),r[f]={primitive:c,promise:p},o.push(p)}}return Promise.all(o)}loadMesh(e){const t=this,i=this.json,r=this.extensions,s=i.meshes[e],o=s.primitives,l=[];for(let u=0,c=o.length;u<c;u++){const f=o[u].material===void 0?jB(this.cache):this.getDependency("material",o[u].material);l.push(f)}return l.push(t.loadGeometries(o)),Promise.all(l).then(function(u){const c=u.slice(0,u.length-1),f=u[u.length-1],h=[];for(let v=0,m=f.length;v<m;v++){const d=f[v],b=o[v];let y;const g=c[v];if(b.mode===Ii.TRIANGLES||b.mode===Ii.TRIANGLE_STRIP||b.mode===Ii.TRIANGLE_FAN||b.mode===void 0)y=s.isSkinnedMesh===!0?new ga(d,g):new St(d,g),y.isSkinnedMesh===!0&&!y.geometry.attributes.skinWeight.normalized&&y.normalizeSkinWeights(),b.mode===Ii.TRIANGLE_STRIP?y.geometry=ux(y.geometry,fv):b.mode===Ii.TRIANGLE_FAN&&(y.geometry=ux(y.geometry,Ad));else if(b.mode===Ii.LINES)y=new rn(d,g);else if(b.mode===Ii.LINE_STRIP)y=new ei(d,g);else if(b.mode===Ii.LINE_LOOP)y=new fc(d,g);else if(b.mode===Ii.POINTS)y=new eo(d,g);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+b.mode);Object.keys(y.geometry.morphAttributes).length>0&&ZB(y,s),y.name=t.createUniqueName(s.name||"mesh_"+e),rs(y,s),b.extensions&&Ba(r,y,b),t.assignFinalMaterial(y),h.push(y)}if(h.length===1)return h[0];const p=new Qn;for(let v=0,m=h.length;v<m;v++)p.add(h[v]);return p})}loadCamera(e){let t;const i=this.json.cameras[e],r=i[i.type];if(!r){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return i.type==="perspective"?t=new Dt(Rd.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):i.type==="orthographic"&&(t=new vo(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(t.name=this.createUniqueName(i.name)),rs(t,i),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],i={joints:t.joints};return t.inverseBindMatrices===void 0?Promise.resolve(i):this.getDependency("accessor",t.inverseBindMatrices).then(function(r){return i.inverseBindMatrices=r,i})}loadAnimation(e){const i=this.json.animations[e],r=[],s=[],o=[],l=[],u=[];for(let c=0,f=i.channels.length;c<f;c++){const h=i.channels[c],p=i.samplers[h.sampler],v=h.target,m=v.node!==void 0?v.node:v.id,d=i.parameters!==void 0?i.parameters[p.input]:p.input,b=i.parameters!==void 0?i.parameters[p.output]:p.output;r.push(this.getDependency("node",m)),s.push(this.getDependency("accessor",d)),o.push(this.getDependency("accessor",b)),l.push(p),u.push(v)}return Promise.all([Promise.all(r),Promise.all(s),Promise.all(o),Promise.all(l),Promise.all(u)]).then(function(c){const f=c[0],h=c[1],p=c[2],v=c[3],m=c[4],d=[];for(let y=0,g=f.length;y<g;y++){const w=f[y],A=h[y],S=p[y],M=v[y],F=m[y];if(w===void 0)continue;w.updateMatrix(),w.matrixAutoUpdate=!0;let R;switch(yr[F.path]){case yr.weights:R=po;break;case yr.rotation:R=Yr;break;case yr.position:case yr.scale:default:R=mo;break}const T=w.name?w.name:w.uuid,P=M.interpolation!==void 0?WB[M.interpolation]:Ir,_=[];yr[F.path]===yr.weights?w.traverse(function(C){C.isMesh===!0&&C.morphTargetInfluences&&_.push(C.name?C.name:C.uuid)}):_.push(T);let E=S.array;if(S.normalized){const C=hf(E.constructor),L=new Float32Array(E.length);for(let I=0,x=E.length;I<x;I++)L[I]=E[I]*C;E=L}for(let C=0,L=_.length;C<L;C++){const I=new R(_[C]+"."+yr[F.path],A.array,E,P);M.interpolation==="CUBICSPLINE"&&(I.createInterpolant=function(O){return new Mo(this.times,this.values,this.getValueSize()/3,O)},I.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),d.push(I)}}const b=i.name?i.name:"animation_"+e;return new go(b,void 0,d)})}createNodeMesh(e){const t=this.json,i=this,r=t.nodes[e];return r.mesh===void 0?null:i.getDependency("mesh",r.mesh).then(function(s){const o=i._getNodeRef(i.meshCache,r.mesh,s);return r.weights!==void 0&&o.traverse(function(l){if(l.isMesh)for(let u=0,c=r.weights.length;u<c;u++)l.morphTargetInfluences[u]=r.weights[u]}),o})}loadNode(e){const t=this.json,i=this.extensions,r=this,s=t.nodes[e],o=s.name?r.createUniqueName(s.name):"";return function(){const l=[],u=r._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(e)});return u&&l.push(u),s.camera!==void 0&&l.push(r.getDependency("camera",s.camera).then(function(c){return r._getNodeRef(r.cameraCache,s.camera,c)})),r._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(e)}).forEach(function(c){l.push(c)}),Promise.all(l)}().then(function(l){let u;if(s.isBone===!0?u=new va:l.length>1?u=new Qn:l.length===1?u=l[0]:u=new Xe,u!==l[0])for(let c=0,f=l.length;c<f;c++)u.add(l[c]);if(s.name&&(u.userData.name=s.name,u.name=o),rs(u,s),s.extensions&&Ba(i,u,s),s.matrix!==void 0){const c=new Oe;c.fromArray(s.matrix),u.applyMatrix4(c)}else s.translation!==void 0&&u.position.fromArray(s.translation),s.rotation!==void 0&&u.quaternion.fromArray(s.rotation),s.scale!==void 0&&u.scale.fromArray(s.scale);return r.associations.set(u,{type:"nodes",index:e}),u})}loadScene(e){const t=this.json,i=this.extensions,r=this.json.scenes[e],s=this,o=new Qn;r.name&&(o.name=s.createUniqueName(r.name)),rs(o,r),r.extensions&&Ba(i,o,r);const l=r.nodes||[],u=[];for(let c=0,f=l.length;c<f;c++)u.push(lx(l[c],o,t,s));return Promise.all(u).then(function(){return o})}}function lx(n,e,t,i){const r=t.nodes[n];return i.getDependency("node",n).then(function(s){if(r.skin===void 0)return s;let o;return i.getDependency("skin",r.skin).then(function(l){o=l;const u=[];for(let c=0,f=o.joints.length;c<f;c++)u.push(i.getDependency("node",o.joints[c]));return Promise.all(u)}).then(function(l){return s.traverse(function(u){if(!u.isMesh)return;const c=[],f=[];for(let h=0,p=l.length;h<p;h++){const v=l[h];if(v){c.push(v);const m=new Oe;o.inverseBindMatrices!==void 0&&m.fromArray(o.inverseBindMatrices.array,h*16),f.push(m)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',o.joints[h])}u.bind(new ya(c,f),u.matrixWorld)}),s})}).then(function(s){e.add(s);const o=[];if(r.children){const l=r.children;for(let u=0,c=l.length;u<c;u++){const f=l[u];o.push(lx(f,s,t,i))}}return Promise.all(o)})}function JB(n,e,t){const i=e.attributes,r=new ln;if(i.POSITION!==void 0){const l=t.json.accessors[i.POSITION],u=l.min,c=l.max;if(u!==void 0&&c!==void 0){if(r.set(new Q(u[0],u[1],u[2]),new Q(c[0],c[1],c[2])),l.normalized){const f=hf(Na[l.componentType]);r.min.multiplyScalar(f),r.max.multiplyScalar(f)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const l=new Q,u=new Q;for(let c=0,f=s.length;c<f;c++){const h=s[c];if(h.POSITION!==void 0){const p=t.json.accessors[h.POSITION],v=p.min,m=p.max;if(v!==void 0&&m!==void 0){if(u.setX(Math.max(Math.abs(v[0]),Math.abs(m[0]))),u.setY(Math.max(Math.abs(v[1]),Math.abs(m[1]))),u.setZ(Math.max(Math.abs(v[2]),Math.abs(m[2]))),p.normalized){const d=hf(Na[p.componentType]);u.multiplyScalar(d)}l.max(u)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}r.expandByVector(l)}n.boundingBox=r;const o=new Si;r.getCenter(o.center),o.radius=r.min.distanceTo(r.max)/2,n.boundingSphere=o}function cx(n,e,t){const i=e.attributes,r=[];function s(o,l){return t.getDependency("accessor",o).then(function(u){n.setAttribute(l,u)})}for(const o in i){const l=uf[o]||o.toLowerCase();l in n.attributes||r.push(s(i[o],l))}if(e.indices!==void 0&&!n.index){const o=t.getDependency("accessor",e.indices).then(function(l){n.setIndex(l)});r.push(o)}return rs(n,e),JB(n,e,t),Promise.all(r).then(function(){return e.targets!==void 0?$B(n,e.targets,t):n})}function ux(n,e){let t=n.getIndex();if(t===null){const o=[],l=n.getAttribute("position");if(l!==void 0){for(let u=0;u<l.count;u++)o.push(u);n.setIndex(o),t=n.getIndex()}else return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),n}const i=t.count-2,r=[];if(e===Ad)for(let o=1;o<=i;o++)r.push(t.getX(0)),r.push(t.getX(o)),r.push(t.getX(o+1));else for(let o=0;o<i;o++)o%2===0?(r.push(t.getX(o)),r.push(t.getX(o+1)),r.push(t.getX(o+2))):(r.push(t.getX(o+2)),r.push(t.getX(o+1)),r.push(t.getX(o)));r.length/3!==i&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=n.clone();return s.setIndex(r),s}const KB=xl(Object.freeze(Object.defineProperty({__proto__:null,GLTFLoader:RB},Symbol.toStringTag,{value:"Module"})));var ff={exports:{}},dx;function qB(){return dx||(dx=1,function(n){function e(c){var f={};function h(v){if(f[v])return f[v].exports;var m=f[v]={i:v,l:!1,exports:{}};return c[v].call(m.exports,m,m.exports,h),m.l=!0,m.exports}h.m=c,h.c=f,h.i=function(v){return v},h.d=function(v,m,d){h.o(v,m)||Object.defineProperty(v,m,{configurable:!1,enumerable:!0,get:d})},h.r=function(v){Object.defineProperty(v,"__esModule",{value:!0})},h.n=function(v){var m=v&&v.__esModule?function(){return v.default}:function(){return v};return h.d(m,"a",m),m},h.o=function(v,m){return Object.prototype.hasOwnProperty.call(v,m)},h.p="/",h.oe=function(v){throw console.error(v),v};var p=h(h.s=ENTRY_MODULE);return p.default||p}var t="[\\.|\\-|\\+|\\w|/|@]+",i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+t+").*?\\)";function r(c){return(c+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(c){return!isNaN(1*c)}function o(c,f,h){var p={};p[h]=[];var v=f.toString(),m=v.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!m)return p;for(var d=m[1],b=new RegExp("(\\\\n|\\W)"+r(d)+i,"g"),y;y=b.exec(v);)y[3]!=="dll-reference"&&p[h].push(y[3]);for(b=new RegExp("\\("+r(d)+'\\("(dll-reference\\s('+t+'))"\\)\\)'+i,"g");y=b.exec(v);)c[y[2]]||(p[h].push(y[1]),c[y[2]]=__webpack_require__(y[1]).m),p[y[2]]=p[y[2]]||[],p[y[2]].push(y[4]);for(var g=Object.keys(p),w=0;w<g.length;w++)for(var A=0;A<p[g[w]].length;A++)s(p[g[w]][A])&&(p[g[w]][A]=1*p[g[w]][A]);return p}function l(c){var f=Object.keys(c);return f.reduce(function(h,p){return h||c[p].length>0},!1)}function u(c,f){for(var h={main:[f]},p={main:[]},v={main:{}};l(h);)for(var m=Object.keys(h),d=0;d<m.length;d++){var b=m[d],y=h[b],g=y.pop();if(v[b]=v[b]||{},!(v[b][g]||!c[b][g])){v[b][g]=!0,p[b]=p[b]||[],p[b].push(g);for(var w=o(c,c[b][g],b),A=Object.keys(w),S=0;S<A.length;S++)h[A[S]]=h[A[S]]||[],h[A[S]]=h[A[S]].concat(w[A[S]])}}return p}n.exports=function(c,f){f=f||{};var h={main:__webpack_modules__},p=f.all?{main:Object.keys(h.main)}:u(h,c),v="";Object.keys(p).filter(function(g){return g!=="main"}).forEach(function(g){for(var w=0;p[g][w];)w++;p[g].push(w),h[g][w]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",v=v+"var "+g+" = ("+e.toString().replace("ENTRY_MODULE",JSON.stringify(w))+")({"+p[g].map(function(A){return""+JSON.stringify(A)+": "+h[g][A].toString()}).join(",")+`});
|
|
3182
|
-
`}),v=v+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+p.main.map(function(g){return""+JSON.stringify(g)+": "+h.main[g].toString()}).join(",")+"}))(self);";var m=new window.Blob([v],{type:"text/javascript"});if(f.bare)return m;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,b=d.createObjectURL(m),y=new window.Worker(b);return y.objectURL=b,y}}(ff)),ff.exports}function QB(n){var e=this.constructor;return this.then(function(t){return e.resolve(n()).then(function(){return t})},function(t){return e.resolve(n()).then(function(){return e.reject(t)})})}function eD(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(n);if(r.length===0)return t([]);var s=r.length;function o(u,c){if(c&&(typeof c=="object"||typeof c=="function")){var f=c.then;if(typeof f=="function"){f.call(c,function(h){o(u,h)},function(h){r[u]={status:"rejected",reason:h},--s===0&&t(r)});return}}r[u]={status:"fulfilled",value:c},--s===0&&t(r)}for(var l=0;l<r.length;l++)o(l,r[l])})}function hx(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}hx.prototype=Error.prototype;function tD(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError("Promise.any accepts an array"));var r=Array.prototype.slice.call(n);if(r.length===0)return i();for(var s=[],o=0;o<r.length;o++)try{e.resolve(r[o]).then(t).catch(function(l){s.push(l),s.length===r.length&&i(new hx(s,"All promises were rejected"))})}catch(l){i(l)}})}var nD=setTimeout;function fx(n){return!!(n&&typeof n.length<"u")}function iD(){}function rD(n,e){return function(){n.apply(e,arguments)}}function pt(n){if(!(this instanceof pt))throw new TypeError("Promises must be constructed via new");if(typeof n!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],mx(n,this)}function px(n,e){for(;n._state===3;)n=n._value;if(n._state===0){n._deferreds.push(e);return}n._handled=!0,pt._immediateFn(function(){var t=n._state===1?e.onFulfilled:e.onRejected;if(t===null){(n._state===1?pf:Da)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Da(e.promise,r);return}pf(e.promise,i)})}function pf(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof pt){n._state=3,n._value=e,mf(n);return}else if(typeof t=="function"){mx(rD(t,e),n);return}}n._state=1,n._value=e,mf(n)}catch(i){Da(n,i)}}function Da(n,e){n._state=2,n._value=e,mf(n)}function mf(n){n._state===2&&n._deferreds.length===0&&pt._immediateFn(function(){n._handled||pt._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)px(n,n._deferreds[e]);n._deferreds=null}function sD(n,e,t){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function mx(n,e){var t=!1;try{n(function(i){t||(t=!0,pf(e,i))},function(i){t||(t=!0,Da(e,i))})}catch(i){if(t)return;t=!0,Da(e,i)}}pt.prototype.catch=function(n){return this.then(null,n)},pt.prototype.then=function(n,e){var t=new this.constructor(iD);return px(this,new sD(n,e,t)),t},pt.prototype.finally=QB,pt.all=function(n){return new pt(function(e,t){if(!fx(n))return t(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(n);if(i.length===0)return e([]);var r=i.length;function s(l,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var c=u.then;if(typeof c=="function"){c.call(u,function(f){s(l,f)},t);return}}i[l]=u,--r===0&&e(i)}catch(f){t(f)}}for(var o=0;o<i.length;o++)s(o,i[o])})},pt.any=tD,pt.allSettled=eD,pt.resolve=function(n){return n&&typeof n=="object"&&n.constructor===pt?n:new pt(function(e){e(n)})},pt.reject=function(n){return new pt(function(e,t){t(n)})},pt.race=function(n){return new pt(function(e,t){if(!fx(n))return t(new TypeError("Promise.race accepts an array"));for(var i=0,r=n.length;i<r;i++)pt.resolve(n[i]).then(e,t)})},pt._immediateFn=typeof setImmediate=="function"&&function(n){setImmediate(n)}||function(n){nD(n,0)},pt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const oD=xl(Object.freeze(Object.defineProperty({__proto__:null,default:pt},Symbol.toStringTag,{value:"Module"})));(function(n,e){(function(i,r){n.exports=r()})(Xi,()=>(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,h=function(){this.Revision=f,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=u(3).Geometry,this.Glyph=u(16).Glyph,this.Glyphset=u(18).Glyphset,this.Pointset=u(22).Pointset,this.Label=u(17).Label,this.Lines=u(24).Lines,this.TextureArray=u(25).TextureArray,this.TextureSlides=u(27).TextureSlides,this.Renderer=u(30).Renderer,this.Scene=u(32).Scene,this.GeometryCSG=u(51).GeometryCSG,this.GlyphsetCSG=u(57).GlyphsetCSG,this.Viewport=u(44).Viewport,this.CameraControls=u(44).CameraControls,this.SmoothCameraTransition=u(44).SmoothCameraTransition,this.RayCaster=u(44).RayCaster,this.CameraAutoTumble=u(44).CameraAutoTumble,this.StereoEffect=u(44).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new h},o=>{o.exports=QL()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.16.2","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}')},function(o,l,u){var c=u(4),f=u(5).toBufferGeometry,h=(v,m,d)=>{var b=f(v,d),y=!1;1>d.opacity&&(y=!0);var g;if(b._video===void 0){var w=d.localTimeEnabled||d.localMorphColour;m?(g=m,g.morphTargets=w,g.morphNormals=d.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:d.colour,morphTargets:w,morphNormals:d.localTimeEnabled,transparent:y,opacity:d.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:d.colour,morphTargets:w,morphNormals:d.localTimeEnabled,vertexColors:c.VertexColors,transparent:y,opacity:d.opacity,side:c.DoubleSide}),d.localMorphColour&&b.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor())}else{var A=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:d.localTimeEnabled,color:new c.Color(1,1,1),transparent:y,opacity:d.opacity,map:A,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,g)},p=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(v,m,d)=>{if(!(this.morph&&this.morph.geometry&&v!=null)){var b=h(v,m,d);this.setMesh(b,d.localTimeEnabled,d.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var v=this.geometry.boundingBox.max,m=this.geometry.boundingBox.min,d=new c.Vector2(0-m.x,0-m.y),b=new c.Vector2(v.x-m.x,v.y-m.y);this.geometry.faceVertexUvs[0]=[];for(var y=0;y<this.geometry.faces.length;y++){var g=this.geometry.vertices[this.geometry.faces[y].a],w=this.geometry.vertices[this.geometry.faces[y].b],A=this.geometry.vertices[this.geometry.faces[y].c];geometry.faceVertexUvs[0].push([new c.Vector2((g.x+d.x)/b.x,(g.y+d.y)/b.y),new c.Vector2((w.x+d.x)/b.x,(w.y+d.y)/b.y),new c.Vector2((A.x+d.x)/b.x,(A.y+d.y)/b.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=v=>{this.morph.material.wireframe=v},this.editVertices=function(v,m){if(v&&v.length){var d=this.getMorph(),b=d.geometry.getAttribute("position");if(!d||0>m)return;var y=3*m;v.forEach(g=>{b.array[y++]=g[0],b.array[y++]=g[1],b.array[y++]=g[2]}),b.needsUpdate=!0,d.geometry.computeBoundingBox(),d.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=p},o=>{o.exports=hB},(o,l,u)=>{function c(T){throw new TypeError('"'+T+'" is read-only')}var f=u(4),h=u(6).Geometry,p=u(7).default;function v(T){var P=T,_=u(0).modelPrefix;return _&&(_[_.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(T)||(P=_+T)),P}function m(T,P){var _=(C,L)=>{try{var I=new URL(C,L).href;if(C&&2>C.split("?").length){var x=L.split("?");x.length===2&&(I=I+"?"+x[1])}return I}catch{console.error("There is an issue creating the url link with: ".concat(C,"."))}};if(!Array.isArray(T))return _(T,P);var E=[];return T.forEach(C=>{E.push(_(C,P))}),E}function d(T,P,_,E,C){var L=T.morphTargetInfluences,I=void 0;T.geometry&&(I=T.geometry.morphAttributes);var x=!1;if(L&&I&&I.position){E.set(0,0,0),C.set(0,0,0);for(var O=0;O<L.length;O++)0<L[O]&&(x=!0,_.setFromArray(I.position[O].array),E.add(_.min.multiplyScalar(L[O])),C.add(_.max.multiplyScalar(L[O])));x&&P.set(E,C)}x||P.setFromBufferAttribute(T.geometry.attributes.position),T.updateWorldMatrix(!0,!0),P.applyMatrix4(T.matrixWorld)}function b(T,P,_,E){var C=new XMLHttpRequest;C.open("GET",v(T),!0),C.onreadystatechange=()=>{C.readyState==4&&(C.status==200?_(C.responseText,P):E(T))},C.send(null)}function y(T,P,_){function E(O,B){I[B]=O,L++,L==C&&P(I)}for(var C=T.length,L=0,I=[],x=0;x<C;x++)b(T[x],x,E,_)}l.getColorsRGB=(T,P)=>{var _=Math.floor(P/3),E=P%3,C=0;E==0?C=T[_].r:E==1?C=T[_].g:E==2&&(C=T[_].b);var L=new f.Color(C);return[L.r,L.g,L.b]},l.updateMorphColorAttribute=function(T,P){if(P&&T&&T.morphAttributes&&T.morphAttributes.color){var _=T.morphAttributes.color,E=P.morphTargetInfluences,C=E.length;T.deleteAttribute("morphColor0"),T.deleteAttribute("morphColor1");for(var L=0,I=[],x=0;1>L||x<C;x++)0<E[x]&&(L++,I.push([x,E[x]]));I.length==2?(T.setAttribute("morphColor0",_[I[0][0]]),T.setAttribute("morphColor1",_[I[1][0]])):I.length==1&&(T.setAttribute("morphColor0",_[I[0][0]]),T.setAttribute("morphColor1",_[I[0][0]]))}},l.toBufferGeometry=(T,P)=>{var _;return T instanceof h?(P.localTimeEnabled&&!T.morphNormalsReady&&(T.morphNormals==null||T.morphNormals.length==0)&&T.computeMorphNormals(),_=T.toIndexedBufferGeometry(),P.localMorphColour&&g(T,_)):T instanceof f.BufferGeometry&&(_=T.clone()),_.colorsNeedUpdate=!0,_.computeBoundingBox(),_.computeBoundingSphere(),T._video&&(_._video=T._video),_},l.copyMorphColorsToBufferGeometry=(T,P)=>{if(T&&T.morphColors&&0<T.morphColors.length){for(var _=[],E=T.morphColors,C=u(5).getColorsRGB,L=0,I=E.length;L<I;L++){for(var x=E[L],O=[],B=0;B<T.faces.length;B++){var D=T.faces[B],k=C(x.colors,D.a);O.push(k[0],k[1],k[2]),k=C(x.colors,D.b),O.push(k[0],k[1],k[2]),k=C(x.colors,D.c),O.push(k[0],k[1],k[2])}var V=new f.Float32BufferAttribute(3*(3*T.faces.length),3);V.name=x.name,_.push(V.copyArray(O))}P.morphAttributes.color=_}};var g=(T,P)=>{if(T&&T.morphColors&&0<T.morphColors.length){for(var _=[],E=T.morphColors,C=u(5).getColorsRGB,L=0,I=E.length;L<I;L++){for(var x,O=E[L],B=[],D=0;D<3*O.colors.length;D++)x=C(O.colors,D),B.push(x[0],x[1],x[2]);var k=new f.Float32BufferAttribute(B,3);k.name=O.name,_.push(k)}P.morphAttributes.color=_}};function w(T){for(var P,_,E,C,L=-1,I=0,x=0;x<T.length;++x){if(C=T[x],P===void 0&&(P=C.array.constructor),P!==C.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(_===void 0&&(_=C.itemSize),_!==C.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(E===void 0&&(E=C.normalized),E!==C.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(L===-1&&(L=C.gpuType),L!==C.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;I+=C.count*_}for(var O,B=new P(I),D=new f.BufferAttribute(B,_,E),k=0,V=0;V<T.length;++V){if(O=T[V],O.isInterleavedBufferAttribute)for(var G=k/_,J=0,j=O.count;J<j;J++)for(var te,ee=0;ee<_;ee++)te=O.getComponent(J,ee),D.setComponent(J+G,ee,te);else B.set(O.array,k);k+=O.count*_}return L!==void 0&&(D.gpuType=L),D}l.mergeGeometries=function(T){for(var P=1<arguments.length&&arguments[1]!==void 0&&arguments[1],_=T[0].index!==null,E=new Set(Object.keys(T[0].attributes)),C=new Set(Object.keys(T[0].morphAttributes)),L={},I={},x=T[0].morphTargetsRelative,O=new f.BufferGeometry,B=0,D=0;D<T.length;++D){var k=T[D],V=0;if(_!==(k.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(var G in k.attributes){if(!E.has(G))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+'. All geometries must have compatible attributes; make sure "'+G+'" attribute exists among all geometries, or in none of them.'),null;L[G]===void 0&&(L[G]=[]),L[G].push(k.attributes[G]),V++}if(V!==E.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". Make sure all geometries have the same number of attributes."),null;if(x!==k.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(var J in k.morphAttributes){if(!C.has(J))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". .morphAttributes must be consistent throughout all geometries."),null;I[J]===void 0&&(I[J]=[]),I[J].push(k.morphAttributes[J])}if(P){var j=void 0;if(_)j=k.index.count;else if(k.attributes.position!==void 0)j=k.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". The geometry must have either an index or a position attribute"),null;O.addGroup(B,j,D),B+=j}}if(_){for(var te,ee=0,ae=[],H=0;H<T.length;++H){te=T[H].index;for(var Z=0;Z<te.count;++Z)ae.push(te.getX(Z)+ee);ee+=T[H].attributes.position.count}O.setIndex(ae)}for(var $ in L){var se=w(L[$]);if(!se)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+$+" attribute."),null;O.setAttribute($,se)}for(var z in I){var W=I[z][0].length;if(W===0)break;O.morphAttributes=O.morphAttributes||{},O.morphAttributes[z]=[];for(var q,le=0;le<W;++le){q=[];for(var oe=0;oe<I[z].length;++oe)q.push(I[z][oe][le]);var U=w(q);if(!U)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+z+" morphAttribute."),null;O.morphAttributes[z].push(U)}}return O},l.mergeVertices=function(T){var P=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;P=Math.max(P,Number.EPSILON);for(var _,E={},C=T.getIndex(),L=T.getAttribute("position"),I=C?C.count:L.count,x=0,O=Object.keys(T.attributes),B={},D={},me=[],k=["getX","getY","getZ","getW"],V=0,G=O.length;V<G;V++){_=O[V],B[_]=[];var J=T.morphAttributes[_];J&&(D[_]=Array(J.length).fill().map(()=>[]))}for(var j=Math.log10(1/P),te=Math.pow(10,j),V=0;V<I;V++){for(var ee=C?C.getX(V):V,ae="",H=0,G=O.length;H<G;H++)for(var _=O[H],Z=T.getAttribute(_),$=Z.itemSize,se=0;se<$;se++)ae+="".concat(~~(Z[k[se]](ee)*te),",");if(ae in E)me.push(E[ae]);else{for(var H=0,G=O.length;H<G;H++)for(var z,_=O[H],Z=T.getAttribute(_),J=T.morphAttributes[_],$=Z.itemSize,W=B[_],q=D[_],se=0;se<$;se++)if(z=k[se],W.push(Z[z](ee)),J)for(var le=0,oe=J.length;le<oe;le++)q[le].push(J[le][z](ee));E[ae]=x,me.push(x),x++}}for(var U=T.clone(),V=0,G=O.length;V<G;V++){var Z,_=O[V],N=T.getAttribute(_),X=new N.array.constructor(B[_]);if(N.isInterleavedBufferAttribute?Z=new f.BufferAttribute(X,N.itemSize,N.itemSize):(Z=T.getAttribute(_).clone(),Z.setArray(X)),U.setAttribute(_,Z),_ in D)for(var Y,H=0;H<D[_].length;H++)Y=T.morphAttributes[_][H].clone(),Y.setArray(new Y.array.constructor(D[_][H])),U.morphAttributes[_][H]=Y}var ie=Uint8Array;me.length>=Math.pow(2,8)&&(ie=Uint16Array),me.length>=Math.pow(2,16)&&(ie=Uint32Array);var ue=new ie(me),me=null;return C===null?me=new f.BufferAttribute(ue,1):(me=T.getIndex().clone(),me.setArray(ue)),U.setIndex(me),U};function A(T){if(T.isMeshPhongMaterial){var P=new f.MeshToonMaterial({color:T.color.clone(),morphTargets:T.morphTargets,morphNormals:T.morphNormals,vertexColors:T.vertexColors,transparent:T.transparent,opacity:T.opacity,side:T.side});return T.map&&(P.map=T.map),P}return T}function S(T,P){if(P&&T>=P.length){var _=new f.BufferGeometry,E=new Float32Array(3*T),C=0;return P.forEach(L=>{E[C++]=L[0],E[C++]=L[1],E[C++]=L[2]}),_.setAttribute("position",new f.BufferAttribute(E,3)),_.setDrawRange(0,P.length),_}}function M(){var T=new Image;T.src=u(8);var P=new f.Texture;return P.image=T,P.needsUpdate=!0,P}function F(T,P,_,E,C,L){var I=new p(T,P,_,E,C,L);return I.fontFace=E,I.fontSize=C,I.fontWeight=L,I.material.map.generateMipmaps=!1,I.material.map.anisotropy=4,I.material.sizeAttenuation=!1,I.material.alphaTest=.5,I.material.transparent=!0,I.material.depthWrite=!1,I.material.depthTest=!1,I.center.set(.5,-1.2),I.renderOrder=1e4,I}function R(T,P,_){if(_){var E=T||"",C=P||"",L=_.lastIndexOf("/");if(-1<L){var I=void 0,x=void 0;if(I=_.substring(0,L),x=_.substring(L+1),(I==="*"||I==="**"||I.toLowerCase()===E.toLowerCase())&&(x==="*"||x==="**"||x.toLowerCase()===C.toLowerCase()))return!0}else if(E.toLowerCase()===_.toLowerCase()||C.toLowerCase()===_.toLowerCase())return!0}return!1}l.getBoundingBox=d,l.createNewURL=m,l.createBufferGeometry=S,l.getCircularTexture=M,l.resolveURL=v,l.loadExternalFile=b,l.loadExternalFiles=y,l.PhongToToon=A,l.createNewSpriteText=F,l.isRegionGroup=R},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>m});var c=u(4),f=new c.Matrix4,h=new c.Object3D,p=new c.Vector3,v=new c.Vector3;function m(){this.uuid=c.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.normals=[],this.uvs=[],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this.morphNormalsReady=!1}m.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:m,isGeometry:!0,applyMatrix4:function(g){for(var w,A=new c.Matrix3().getNormalMatrix(g),S=0,M=this.vertices.length;S<M;S++)w=this.vertices[S],w.applyMatrix4(g);for(var F,R=0,T=this.faces.length;R<T;R++){F=this.faces[R],F.normal.applyMatrix3(A).normalize();for(var P=0,_=F.vertexNormals.length;P<_;P++)F.vertexNormals[P].applyMatrix3(A).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(g){return f.makeRotationX(g),this.applyMatrix4(f),this},rotateY:function(g){return f.makeRotationY(g),this.applyMatrix4(f),this},rotateZ:function(g){return f.makeRotationZ(g),this.applyMatrix4(f),this},translate:function(g,w,A){return f.makeTranslation(g,w,A),this.applyMatrix4(f),this},scale:function(g,w,A){return f.makeScale(g,w,A),this.applyMatrix4(f),this},lookAt:function(g){return h.lookAt(g),h.updateMatrix(),this.applyMatrix4(h.matrix),this},fromBufferGeometry:function(g){function w(G,J,j,te){var ee=T===void 0?[]:[A.colors[G].clone(),A.colors[J].clone(),A.colors[j].clone()],ae=R===void 0?[]:[new c.Vector3().fromBufferAttribute(R,G),new c.Vector3().fromBufferAttribute(R,J),new c.Vector3().fromBufferAttribute(R,j)],H=new b(G,J,j,ae,ee,te);A.faces.push(H),P!==void 0&&A.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(P,G),new c.Vector2().fromBufferAttribute(P,J),new c.Vector2().fromBufferAttribute(P,j)]),_!==void 0&&A.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(_,G),new c.Vector2().fromBufferAttribute(_,J),new c.Vector2().fromBufferAttribute(_,j)])}var A=this,S=g.index===null?void 0:g.index,M=g.attributes;if(M.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var F=M.position,R=M.normal,T=M.color,P=M.uv,_=M.uv2;_!==void 0&&(this.faceVertexUvs[1]=[]);for(var E=0;E<F.count;E++)A.vertices.push(new c.Vector3().fromBufferAttribute(F,E)),T!==void 0&&A.colors.push(new c.Color().fromBufferAttribute(T,E));var C=g.groups;if(0<C.length)for(var L=0;L<C.length;L++)for(var I=C[L],x=I.start,O=I.count,B=x,D=x+O;B<D;B+=3)S===void 0?w(B,B+1,B+2,I.materialIndex):w(S.getX(B),S.getX(B+1),S.getX(B+2),I.materialIndex);else if(S!==void 0)for(var k=0;k<S.count;k+=3)w(S.getX(k),S.getX(k+1),S.getX(k+2));else for(var V=0;V<F.count;V+=3)w(V,V+1,V+2);return this.computeFaceNormals(),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(p).negate(),this.translate(p.x,p.y,p.z),this},normalize:function(){this.computeBoundingSphere();var g=this.boundingSphere.center,w=this.boundingSphere.radius,A=w===0?1:1/w,S=new c.Matrix4;return S.set(A,0,0,-A*g.x,0,A,0,-A*g.y,0,0,A,-A*g.z,0,0,0,1),this.applyMatrix4(S),this},computeFaceNormals:function(){for(var g=new c.Vector3,w=new c.Vector3,A=0,S=this.faces.length;A<S;A++){var M=this.faces[A],F=this.vertices[M.a],R=this.vertices[M.b],T=this.vertices[M.c];g.subVectors(T,R),w.subVectors(F,R),g.cross(w),g.normalize(),M.normal.copy(g)}},computeVertexNormals:function(){for(var g=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],w=Array(this.vertices.length),A=0,S=this.vertices.length;A<S;A++)w[A]=new c.Vector3;if(g)for(var M=new c.Vector3,F=new c.Vector3,R=0,T=this.faces.length;R<T;R++){var P=this.faces[R],_=this.vertices[P.a],E=this.vertices[P.b],C=this.vertices[P.c];M.subVectors(C,E),F.subVectors(_,E),M.cross(F),w[P.a].add(M),w[P.b].add(M),w[P.c].add(M)}else{this.computeFaceNormals();for(var L,I=0,x=this.faces.length;I<x;I++)L=this.faces[I],w[L.a].add(L.normal),w[L.b].add(L.normal),w[L.c].add(L.normal)}for(var O=0,B=this.vertices.length;O<B;O++)w[O].normalize();for(var D=0,k=this.faces.length;D<k;D++){var V=this.faces[D],G=V.vertexNormals;G.length===3?(G[0].copy(w[V.a]),G[1].copy(w[V.b]),G[2].copy(w[V.c])):(G[0]=w[V.a].clone(),G[1]=w[V.b].clone(),G[2]=w[V.c].clone())}return 0<this.faces.length&&(this.normalsNeedUpdate=!0),w},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var g=0,w=this.faces.length;g<w;g++){var A=this.faces[g],S=A.vertexNormals;S.length===3?(S[0].copy(A.normal),S[1].copy(A.normal),S[2].copy(A.normal)):(S[0]=A.normal.clone(),S[1]=A.normal.clone(),S[2]=A.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var g,w=0,A=this.faces.length;w<A;w++){g=this.faces[w],g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone(),g.__originalVertexNormals||(g.__originalVertexNormals=[]);for(var S=0,M=g.vertexNormals.length;S<M;S++)g.__originalVertexNormals[S]?g.__originalVertexNormals[S].copy(g.vertexNormals[S]):g.__originalVertexNormals[S]=g.vertexNormals[S].clone()}var F=new m;F.faces=this.faces;for(var R=0,T=this.morphTargets.length;R<T;R++){if(!this.morphNormals[R]){this.morphNormals[R]={},this.morphNormals[R].faceNormals=[],this.morphNormals[R].vertexNormals=[];for(var P=this.morphNormals[R].faceNormals,_=this.morphNormals[R].vertexNormals,E=0,C=this.faces.length;E<C;E++){var L=new c.Vector3,I={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};P.push(L),_.push(I)}}var x=this.morphNormals[R];F.vertices=this.morphTargets[R].vertices,F.computeFaceNormals();var O=F.computeVertexNormals();if(O&&0<O.length){this.morphTargets[R].normals=Array(this.vertices.length);for(var B=0;B<O.length;B++)this.morphTargets[R].normals[B]=O[B].clone()}for(var D=0,k=this.faces.length;D<k;D++){var V=this.faces[D],G=x.faceNormals[D],J=x.vertexNormals[D];G.copy(V.normal),J.a.copy(V.vertexNormals[0]),J.b.copy(V.vertexNormals[1]),J.c.copy(V.vertexNormals[2])}}for(var j,te=0,ee=this.faces.length;te<ee;te++)j=this.faces[te],j.normal=j.__originalFaceNormal,j.vertexNormals=j.__originalVertexNormals;this.morphNormalsReady=!0},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new c.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingSphere.setFromPoints(this.vertices)},mergeMorph:function(g,w){var A=this.morphTargets.length,S=this.morphTargets,M=g.morphTargets,F=this.morphColors.length,R=this.morphColors,T=g.morphColors;if(0<A&&A==M.length)for(var P=0,_=S.length;P<_;P++){for(var E=S[P],C=M[P],L=0,I=C.vertices.length;L<I;L++){var x=C.vertices[L],O=x.clone();w!==void 0&&O.applyMatrix4(w),E.vertices.push(O)}if(E.normals&&C.normals)for(var B=0;B<C.normals.length;B+=3)v.set(C.normals2[B],C.normals2[B+1],C.normals2[B+2]),w!==void 0&&v.applyMatrix4(w),E.normals.push(v.x,v.y,v.z)}if(0<F&&F==T.length)for(var D=0,k=R.length;D<k;D++)for(var V=R[D],G=T[D],J=0,j=G.colors;J<j;J++)V.colors.push(G.colors[J].clone())},merge:function(g,w){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0;if(!(g&&g.isGeometry))return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",g);var S,M=this.vertices.length,F=this.vertices,R=g.vertices,T=g.normals,P=this.faces,_=g.faces,E=this.colors,C=g.colors;w!==void 0&&(S=new c.Matrix3().getNormalMatrix(w));for(var L=0,I=R.length;L<I;L++){var x=R[L],O=x.clone();w!==void 0&&O.applyMatrix4(w),F.push(O)}for(var B=0;B<T.length;B+=3)v.set(T[B],T[B+1],T[B+2]),w!==void 0&&v.applyMatrix4(w),this.normals.push(v.x,v.y,v.z);for(var D=0,k=C.length;D<k;D++)typeof C[D]=="number"?E.push(C[D]):E.push(C[D].clone());for(var V=0,G=_.length;V<G;V++){var J=_[V],j=void 0,te=void 0,ee=J.vertexNormals,ae=J.vertexColors,H=new b(J.a+M,J.b+M,J.c+M);H.normal.copy(J.normal),S!==void 0&&H.normal.applyMatrix3(S).normalize();for(var Z=0,$=ee.length;Z<$;Z++)j=ee[Z].clone(),S!==void 0&&j.applyMatrix3(S).normalize(),H.vertexNormals.push(j);H.color.copy(J.color);for(var se=0,z=ae.length;se<z;se++)te=ae[se],H.vertexColors.push(te.clone());H.materialIndex=J.materialIndex+A,P.push(H)}for(var W,q=0,le=g.faceVertexUvs.length;q<le;q++){W=g.faceVertexUvs[q],this.faceVertexUvs[q]===void 0&&(this.faceVertexUvs[q]=[]);for(var oe=0,U=W.length;oe<U;oe++){for(var N=W[oe],X=[],Y=0,ie=N.length;Y<ie;Y++)X.push(N[Y].clone());this.faceVertexUvs[q].push(X)}}this.mergeMorph(g,w)},mergeMesh:function(g){return g&&g.isMesh?(g.matrixAutoUpdate&&g.updateMatrix(),void this.merge(g.geometry,g.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",g)},mergeVertices:function(){for(var g=0<arguments.length&&arguments[0]!==void 0?arguments[0]:4,w={},A=[],S=[],M=Math.pow(10,g),F=0,R=this.vertices.length;F<R;F++){var T=this.vertices[F],P=Math.round(T.x*M)+"_"+Math.round(T.y*M)+"_"+Math.round(T.z*M);w[P]===void 0?(w[P]=F,A.push(this.vertices[F]),S[F]=A.length-1):S[F]=S[w[P]]}for(var _,E=[],C=0,L=this.faces.length;C<L;C++){_=this.faces[C],_.a=S[_.a],_.b=S[_.b],_.c=S[_.c];for(var I=[_.a,_.b,_.c],x=0;3>x;x++)if(I[x]===I[(x+1)%3]){E.push(C);break}}for(var O,B=E.length-1;0<=B;B--){O=E[B],this.faces.splice(O,1);for(var D=0,k=this.faceVertexUvs.length;D<k;D++)this.faceVertexUvs[D].splice(O,1)}var V=this.vertices.length-A.length;return this.vertices=A,V},setFromPoints:function(g){this.vertices=[];for(var w,A=0,S=g.length;A<S;A++)w=g[A],this.vertices.push(new c.Vector3(w.x,w.y,w.z||0));return this},sortFacesByMaterialIndex:function(){for(var g=this.faces,w=g.length,A=0;A<w;A++)g[A]._id=A;g.sort(function(_,E){return _.materialIndex-E.materialIndex});var S,M,F=this.faceVertexUvs[0],R=this.faceVertexUvs[1];F&&F.length===w&&(S=[]),R&&R.length===w&&(M=[]);for(var T,P=0;P<w;P++)T=g[P]._id,S&&S.push(F[T]),M&&M.push(R[T]);S&&(this.faceVertexUvs[0]=S),M&&(this.faceVertexUvs[1]=M)},toJSON:function(){function g(z,W,q){return q?z|1<<W:z&~(1<<W)}function w(z){var W=z.x.toString()+z.y.toString()+z.z.toString();return L[W]===void 0&&(L[W]=C.length/3,C.push(z.x,z.y,z.z)),L[W]}function A(z){var W=z.r.toString()+z.g.toString()+z.b.toString();return x[W]===void 0&&(x[W]=I.length,I.push(z.getHex())),x[W]}function S(z){var W=z.x.toString()+z.y.toString();return B[W]===void 0&&(B[W]=O.length/2,O.push(z.x,z.y)),B[W]}var M={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(M.uuid=this.uuid,M.type=this.type,this.name!==""&&(M.name=this.name),this.parameters!==void 0){var F=this.parameters;for(var R in F)F[R]!==void 0&&(M[R]=F[R]);return M}for(var T,P=[],_=0;_<this.vertices.length;_++)T=this.vertices[_],P.push(T.x,T.y,T.z);for(var E=[],C=[],L={},I=[],x={},O=[],B={},D=0;D<this.faces.length;D++){var k=this.faces[D],V=!0,G=!1,J=this.faceVertexUvs[0][D]!==void 0,j=0<k.normal.length(),te=0<k.vertexNormals.length,ee=k.color.r!==1||k.color.g!==1||k.color.b!==1,ae=0<k.vertexColors.length,H=0;if(H=g(H,0,0),H=g(H,1,V),H=g(H,2,G),H=g(H,3,J),H=g(H,4,j),H=g(H,5,te),H=g(H,6,ee),H=g(H,7,ae),E.push(H),E.push(k.a,k.b,k.c),E.push(k.materialIndex),J){var Z=this.faceVertexUvs[0][D];E.push(S(Z[0]),S(Z[1]),S(Z[2]))}if(j&&E.push(w(k.normal)),te){var $=k.vertexNormals;E.push(w($[0]),w($[1]),w($[2]))}if(ee&&E.push(A(k.color)),ae){var se=k.vertexColors;E.push(A(se[0]),A(se[1]),A(se[2]))}}return M.data={},M.data.vertices=P,M.data.normals=C,0<I.length&&(M.data.colors=I),0<O.length&&(M.data.uvs=[O]),M.data.faces=E,M},clone:function(){return new m().copy(this)},copy:function(g){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=g.name;for(var w=g.vertices,A=0,S=w.length;A<S;A++)this.vertices.push(w[A].clone());for(var M=g.colors,F=0,R=M.length;F<R;F++)this.colors.push(M[F].clone());for(var T=g.faces,P=0,_=T.length;P<_;P++)this.faces.push(T[P].clone());for(var E,C=0,L=g.faceVertexUvs.length;C<L;C++){E=g.faceVertexUvs[C],this.faceVertexUvs[C]===void 0&&(this.faceVertexUvs[C]=[]);for(var I=0,x=E.length;I<x;I++){for(var O,B=E[I],D=[],k=0,V=B.length;k<V;k++)O=B[k],D.push(O.clone());this.faceVertexUvs[C].push(D)}}for(var G,J=g.morphTargets,j=0,te=J.length;j<te;j++){if(G={},G.name=J[j].name,J[j].vertices!==void 0){G.vertices=[];for(var ee=0,ae=J[j].vertices.length;ee<ae;ee++)G.vertices.push(J[j].vertices[ee].clone())}if(J[j].normals!==void 0){G.normals=[];for(var H=0,Z=J[j].normals.length;H<Z;H++)G.normals.push(J[j].normals[H].clone())}this.morphTargets.push(G)}for(var $,se=g.morphNormals,z=0,W=se.length;z<W;z++){if($={},se[z].vertexNormals!==void 0){$.vertexNormals=[];for(var q=0,le=se[z].vertexNormals.length;q<le;q++){var oe=se[z].vertexNormals[q],U={};U.a=oe.a.clone(),U.b=oe.b.clone(),U.c=oe.c.clone(),$.vertexNormals.push(U)}}if(se[z].faceNormals!==void 0){$.faceNormals=[];for(var N=0,X=se[z].faceNormals.length;N<X;N++)$.faceNormals.push(se[z].faceNormals[N].clone())}this.morphNormals.push($)}for(var Y=g.skinWeights,ie=0,ue=Y.length;ie<ue;ie++)this.skinWeights.push(Y[ie].clone());for(var me=g.skinIndices,be=0,ce=me.length;be<ce;be++)this.skinIndices.push(me[be].clone());for(var ge=g.lineDistances,re=0,he=ge.length;re<he;re++)this.lineDistances.push(ge[re]);var ve=g.boundingBox;ve!==null&&(this.boundingBox=ve.clone());var Ee=g.boundingSphere;return Ee!==null&&(this.boundingSphere=Ee.clone()),this.elementsNeedUpdate=g.elementsNeedUpdate,this.verticesNeedUpdate=g.verticesNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.lineDistancesNeedUpdate=g.lineDistancesNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,this},computeGroups(){var y,g,w=[],A=void 0,S=this.faces;for(g=0;g<S.length;g++){var M=S[g];M.materialIndex!==A&&(A=M.materialIndex,y!==void 0&&(y.count=3*g-y.start,w.push(y)),y={start:3*g,materialIndex:A})}return y!==void 0&&(y.count=3*g-y.start,w.push(y)),w},toBufferGeometry:function(){var g=new d().fromGeometry(this),w=new c.BufferGeometry,A=new Float32Array(3*g.vertices.length);if(w.setAttribute("position",new c.BufferAttribute(A,3).copyVector3sArray(g.vertices)),0<g.normals.length){var S=new Float32Array(3*g.normals.length);w.setAttribute("normal",new c.BufferAttribute(S,3).copyVector3sArray(g.normals))}if(0<g.colors.length){var M=new Float32Array(3*g.colors.length);w.setAttribute("color",new c.BufferAttribute(M,3).copyColorsArray(g.colors))}if(0<g.uvs.length){var F=new Float32Array(2*g.uvs.length);w.setAttribute("uv",new c.BufferAttribute(F,2).copyVector2sArray(g.uvs))}if(0<g.uvs2.length){var R=new Float32Array(2*g.uvs2.length);w.setAttribute("uv2",new c.BufferAttribute(R,2).copyVector2sArray(g.uvs2))}for(var T in w.groups=g.groups,g.morphTargets){for(var P=[],_=g.morphTargets[T],E=0,C=_.length;E<C;E++){var L=_[E],I=new c.Float32BufferAttribute(3*L.data.length,3);I.name=L.name,P.push(I.copyVector3sArray(L.data))}w.morphAttributes[T]=P}if(0<g.skinIndices.length){var x=new c.Float32BufferAttribute(4*g.skinIndices.length,4);w.setAttribute("skinIndex",x.copyVector4sArray(g.skinIndices))}if(0<g.skinWeights.length){var O=new c.Float32BufferAttribute(4*g.skinWeights.length,4);w.setAttribute("skinWeight",O.copyVector4sArray(g.skinWeights))}return g.boundingSphere!==null&&(w.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(w.boundingBox=g.boundingBox.clone()),w},toIndexedBufferGeometry:function(){var g=new c.BufferGeometry,w=new Float32Array(3*this.vertices.length);if(g.setAttribute("position",new c.BufferAttribute(w,3).copyVector3sArray(this.vertices)),0<this.normals.length){var A=new Float32Array(this.normals.length),S=new c.BufferAttribute(A,3).copyArray(this.normals);g.setAttribute("normal",S)}if(0<this.uvs.length&&0<this.uvs[0].length){var M=new Float32Array(2*this.uvs[0].length);g.setAttribute("uv",new c.BufferAttribute(M,2).copyArray(this.uvs[0]))}if(1<this.uvs.length&&0<this.uvs[1].length){var F=new Float32Array(2*this.uvs[1].length);g.setAttribute("uv2",new c.BufferAttribute(F,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var R=[],T=0;T<this.colors.length;T++)R.push(new c.Color(this.colors[T]));var P=new Float32Array(3*R.length);g.setAttribute("color",new c.BufferAttribute(P,3).copyColorsArray(R))}else{for(var _=new Float32Array(3*this.vertices.length),E=0;E<3*this.vertices.length;E++)_[E]=1;g.setAttribute("color",new c.BufferAttribute(_,3))}if(0<this.faces.length){for(var C=[],L=[],I=0;I<this.faces.length;I++){L.push(this.faces[I].a,this.faces[I].b,this.faces[I].c);var x=this.faces[I].vertexColors;if(x.length===3)C.push(x[0],x[1],x[2]);else{var O=this.faces[I].color;C.push(O,O,O)}}g.setIndex(L),g.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],D=[],k=0,V=this.morphTargets.length;k<V;k++){var G=this.morphTargets[k],J=new c.Float32BufferAttribute(3*G.vertices.length,3);if(J.name=G.name,B.push(J.copyVector3sArray(G.vertices)),G.normals){var j=new c.Float32BufferAttribute(3*G.normals.length,3);j.name=G.name,D.push(j.copyVector3sArray(G.normals))}}g.morphAttributes.position=B,g.morphAttributes.normal=D}if(0<this.skinIndices.length){var te=new c.Float32BufferAttribute(4*this.skinIndices.length,4);g.setAttribute("skinIndex",te.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var ee=new c.Float32BufferAttribute(4*this.skinWeights.length,4);g.setAttribute("skinWeight",ee.copyVector4sArray(this.skinWeights))}return this.boundingSphere!==null&&(g.boundingSphere=this.boundingSphere.clone()),this.boundingBox!==null&&(g.boundingBox=this.boundingBox.clone()),g},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(g){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(g)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),m.createBufferGeometryFromObject=function(y){var g=new c.BufferGeometry,w=y.geometry;if(y.isPoints||y.isLine){var A=new c.Float32BufferAttribute(3*w.vertices.length,3),S=new c.Float32BufferAttribute(3*w.colors.length,3);if(g.setAttribute("position",A.copyVector3sArray(w.vertices)),g.setAttribute("color",S.copyColorsArray(w.colors)),w.lineDistances&&w.lineDistances.length===w.vertices.length){var M=new c.Float32BufferAttribute(w.lineDistances.length,1);g.setAttribute("lineDistance",M.copyArray(w.lineDistances))}w.boundingSphere!==null&&(g.boundingSphere=w.boundingSphere.clone()),w.boundingBox!==null&&(g.boundingBox=w.boundingBox.clone())}else y.isMesh&&(g=w.toBufferGeometry());return g};class d{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(g){var w,A,S=[],M=void 0,F=g.faces;for(A=0;A<F.length;A++){var R=F[A];R.materialIndex!==M&&(M=R.materialIndex,w!==void 0&&(w.count=3*A-w.start,S.push(w)),w={start:3*A,materialIndex:M})}w!==void 0&&(w.count=3*A-w.start,S.push(w)),this.groups=S}fromGeometry(g){var w,A=g.faces,S=g.vertices,M=g.faceVertexUvs,F=M[0]&&0<M[0].length,R=M[1]&&0<M[1].length,T=g.morphTargets,P=T.length;if(0<P){w=[];for(var _=0;_<P;_++)w[_]={name:T[_].name,data:[]};this.morphTargets.position=w}var E,C=g.morphNormals,L=C.length;if(0<L){E=[];for(var I=0;I<L;I++)E[I]={name:C[I].name,data:[]};this.morphTargets.normal=E}var x=g.skinIndices,O=g.skinWeights,B=x.length===S.length,D=O.length===S.length;0<S.length&&A.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var k,V=0;V<A.length;V++){k=A[V],this.vertices.push(S[k.a],S[k.b],S[k.c]);var G=k.vertexNormals;if(G.length===3)this.normals.push(G[0],G[1],G[2]);else{var J=k.normal;this.normals.push(J,J,J)}var j=k.vertexColors;if(j.length===3)this.colors.push(j[0],j[1],j[2]);else{var te=k.color;this.colors.push(te,te,te)}if(F===!0){var ee=M[0][V];ee===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",V),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(ee[0],ee[1],ee[2])}if(R===!0){var ae=M[1][V];ae===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",V),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(ae[0],ae[1],ae[2])}for(var H,Z=0;Z<P;Z++)H=T[Z].vertices,w[Z].data.push(H[k.a],H[k.b],H[k.c]);for(var $,se=0;se<L;se++)$=C[se].vertexNormals[V],E[se].data.push($.a,$.b,$.c);B&&this.skinIndices.push(x[k.a],x[k.b],x[k.c]),D&&this.skinWeights.push(O[k.a],O[k.b],O[k.c])}return this.computeGroups(g),this.verticesNeedUpdate=g.verticesNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),this}}class b{constructor(g,w,A,S,M){var F=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=g,this.b=w,this.c=A,this.normal=S&&S.isVector3?S:new c.Vector3,this.vertexNormals=Array.isArray(S)?S:[],this.color=M&&M.isColor?M:new c.Color,this.vertexColors=Array.isArray(M)?M:[],this.materialIndex=F}clone(){return new this.constructor().copy(this)}copy(g){this.a=g.a,this.b=g.b,this.c=g.c,this.normal.copy(g.normal),this.color.copy(g.color),this.materialIndex=g.materialIndex;for(var w=0,A=g.vertexNormals.length;w<A;w++)this.vertexNormals[w]=g.vertexNormals[w].clone();for(var S=0,M=g.vertexColors.length;S<M;S++)this.vertexColors[S]=g.vertexColors[S].clone();return this}}},o=>{o.exports=CB},o=>{o.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="},(o,l)=>{l.augmentMorphColor=function(){return function(u){u.vertexShader=u.vertexShader.replace("#include <color_pars_vertex>",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join(`
|
|
3182
|
+
`}),v=v+"new (("+e.toString().replace("ENTRY_MODULE",JSON.stringify(c))+")({"+p.main.map(function(g){return""+JSON.stringify(g)+": "+h.main[g].toString()}).join(",")+"}))(self);";var m=new window.Blob([v],{type:"text/javascript"});if(f.bare)return m;var d=window.URL||window.webkitURL||window.mozURL||window.msURL,b=d.createObjectURL(m),y=new window.Worker(b);return y.objectURL=b,y}}(ff)),ff.exports}function QB(n){var e=this.constructor;return this.then(function(t){return e.resolve(n()).then(function(){return t})},function(t){return e.resolve(n()).then(function(){return e.reject(t)})})}function eD(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(n);if(r.length===0)return t([]);var s=r.length;function o(u,c){if(c&&(typeof c=="object"||typeof c=="function")){var f=c.then;if(typeof f=="function"){f.call(c,function(h){o(u,h)},function(h){r[u]={status:"rejected",reason:h},--s===0&&t(r)});return}}r[u]={status:"fulfilled",value:c},--s===0&&t(r)}for(var l=0;l<r.length;l++)o(l,r[l])})}function hx(n,e){this.name="AggregateError",this.errors=n,this.message=e||""}hx.prototype=Error.prototype;function tD(n){var e=this;return new e(function(t,i){if(!(n&&typeof n.length<"u"))return i(new TypeError("Promise.any accepts an array"));var r=Array.prototype.slice.call(n);if(r.length===0)return i();for(var s=[],o=0;o<r.length;o++)try{e.resolve(r[o]).then(t).catch(function(l){s.push(l),s.length===r.length&&i(new hx(s,"All promises were rejected"))})}catch(l){i(l)}})}var nD=setTimeout;function fx(n){return!!(n&&typeof n.length<"u")}function iD(){}function rD(n,e){return function(){n.apply(e,arguments)}}function pt(n){if(!(this instanceof pt))throw new TypeError("Promises must be constructed via new");if(typeof n!="function")throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],mx(n,this)}function px(n,e){for(;n._state===3;)n=n._value;if(n._state===0){n._deferreds.push(e);return}n._handled=!0,pt._immediateFn(function(){var t=n._state===1?e.onFulfilled:e.onRejected;if(t===null){(n._state===1?pf:Da)(e.promise,n._value);return}var i;try{i=t(n._value)}catch(r){Da(e.promise,r);return}pf(e.promise,i)})}function pf(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&(typeof e=="object"||typeof e=="function")){var t=e.then;if(e instanceof pt){n._state=3,n._value=e,mf(n);return}else if(typeof t=="function"){mx(rD(t,e),n);return}}n._state=1,n._value=e,mf(n)}catch(i){Da(n,i)}}function Da(n,e){n._state=2,n._value=e,mf(n)}function mf(n){n._state===2&&n._deferreds.length===0&&pt._immediateFn(function(){n._handled||pt._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)px(n,n._deferreds[e]);n._deferreds=null}function sD(n,e,t){this.onFulfilled=typeof n=="function"?n:null,this.onRejected=typeof e=="function"?e:null,this.promise=t}function mx(n,e){var t=!1;try{n(function(i){t||(t=!0,pf(e,i))},function(i){t||(t=!0,Da(e,i))})}catch(i){if(t)return;t=!0,Da(e,i)}}pt.prototype.catch=function(n){return this.then(null,n)},pt.prototype.then=function(n,e){var t=new this.constructor(iD);return px(this,new sD(n,e,t)),t},pt.prototype.finally=QB,pt.all=function(n){return new pt(function(e,t){if(!fx(n))return t(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(n);if(i.length===0)return e([]);var r=i.length;function s(l,u){try{if(u&&(typeof u=="object"||typeof u=="function")){var c=u.then;if(typeof c=="function"){c.call(u,function(f){s(l,f)},t);return}}i[l]=u,--r===0&&e(i)}catch(f){t(f)}}for(var o=0;o<i.length;o++)s(o,i[o])})},pt.any=tD,pt.allSettled=eD,pt.resolve=function(n){return n&&typeof n=="object"&&n.constructor===pt?n:new pt(function(e){e(n)})},pt.reject=function(n){return new pt(function(e,t){t(n)})},pt.race=function(n){return new pt(function(e,t){if(!fx(n))return t(new TypeError("Promise.race accepts an array"));for(var i=0,r=n.length;i<r;i++)pt.resolve(n[i]).then(e,t)})},pt._immediateFn=typeof setImmediate=="function"&&function(n){setImmediate(n)}||function(n){nD(n,0)},pt._unhandledRejectionFn=function(e){typeof console<"u"&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const oD=xl(Object.freeze(Object.defineProperty({__proto__:null,default:pt},Symbol.toStringTag,{value:"Module"})));(function(n,e){(function(i,r){n.exports=r()})(Xi,()=>(()=>{var t=[(o,l,u)=>{u(1);var c=u(2),f=c.version,h=function(){this.Revision=f,this.defaultMaterialColor=16777215,this.defaultOpacity=1,this.modelPrefix=void 0,this.Geometry=u(3).Geometry,this.Glyph=u(16).Glyph,this.Glyphset=u(18).Glyphset,this.Pointset=u(22).Pointset,this.Label=u(17).Label,this.Lines=u(24).Lines,this.TextureArray=u(25).TextureArray,this.TextureSlides=u(27).TextureSlides,this.Renderer=u(30).Renderer,this.Scene=u(32).Scene,this.GeometryCSG=u(51).GeometryCSG,this.GlyphsetCSG=u(57).GlyphsetCSG,this.Viewport=u(44).Viewport,this.CameraControls=u(44).CameraControls,this.SmoothCameraTransition=u(44).SmoothCameraTransition,this.RayCaster=u(44).RayCaster,this.CameraAutoTumble=u(44).CameraAutoTumble,this.StereoEffect=u(44).StereoEffect,this.loadExternalFile=u(5).loadExternalFile,this.loadExternalFiles=u(5).loadExternalFiles,this.THREE=u(4)};o.exports=new h},o=>{o.exports=QL()},o=>{o.exports=JSON.parse('{"name":"zincjs","version":"1.16.3","description":"ZincJS (Web-based-Zinc-Visualisation)","main":"build/zinc.js","directories":{"doc":"docs"},"files":["package.json","LICENSE","README.md","src/*","build/zinc.js","build/zinc.frontend.js","build/zinc.js.map","webpack.config.js"],"scripts":{"build-bundle":"webpack --config webpack.frontend.js; webpack --config webpack.backend.js","build-backend":"webpack --config webpack.backend.js","test":"npm --prefix ./test install && npm --prefix ./test run test-ci","changelog":"auto-changelog -p --output CHANGELOG.md --template keepachangelog","jsdoc":"jsdoc -c jsdoc_conf.json","version":"npm run build-bundle;npm run jsdoc;npm run changelog; git add CHANGELOG.md docs","release:beta":"npm version prerelease --preid=beta; npm publish --tag beta","release:minor":"npm version minor; npm publish","release:patch":"npm version patch; npm publish"},"repository":{"type":"git","url":"git+https://github.com/alan-wu/ZincJS.git"},"keywords":["library","webgl","3d","zincjs"],"author":"Alan Wu <alan.wu@auckland.ac.nz>","license":"MIT","bugs":{"url":"https://github.com/alan-wu/ZincJS/issues"},"homepage":"http://alan-wu.github.io/ZincJS/","devDependencies":{"@babel/core":"^7.23.9","@babel/preset-env":"^7.23.9","auto-changelog":"^2.4.0","babel-loader":"^9.1.3","babel-preset-minify":"^0.5.1","file-loader":"^6.2.0","jsdoc":"^4.0.2","raw-loader":"^4.0.2","webpack":"^5.90.3","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"css-element-queries":"^1.2.2","lodash":"^4.17.19","promise-polyfill":"^8.1.3","three":"^0.130.1","three-spritetext":"1.6.2","url-loader":"^4.1.1","url-polyfill":"^1.1.7","webworkify-webpack":"^2.1.5"}}')},function(o,l,u){var c=u(4),f=u(5).toBufferGeometry,h=(v,m,d)=>{var b=f(v,d),y=!1;1>d.opacity&&(y=!0);var g;if(b._video===void 0){var w=d.localTimeEnabled||d.localMorphColour;m?(g=m,g.morphTargets=w,g.morphNormals=d.localTimeEnabled):b instanceof c.BufferGeometry&&b.attributes.color===void 0?g=new c.MeshPhongMaterial({color:d.colour,morphTargets:w,morphNormals:d.localTimeEnabled,transparent:y,opacity:d.opacity,side:c.DoubleSide}):g=new c.MeshPhongMaterial({color:d.colour,morphTargets:w,morphNormals:d.localTimeEnabled,vertexColors:c.VertexColors,transparent:y,opacity:d.opacity,side:c.DoubleSide}),d.localMorphColour&&b.morphAttributes.color&&(g.onBeforeCompile=u(9).augmentMorphColor())}else{var A=b._video.createCanvasVideoTexture();g=new c.MeshBasicMaterial({morphTargets:d.localTimeEnabled,color:new c.Color(1,1,1),transparent:y,opacity:d.opacity,map:A,side:c.DoubleSide}),this.videoHandler=b._video}return new c.Mesh(b,g)},p=function(){u(10).ZincObject.call(this),this.videoHandler=void 0,this.isGeometry=!0,this.createMesh=(v,m,d)=>{if(!(this.morph&&this.morph.geometry&&v!=null)){var b=h(v,m,d);this.setMesh(b,d.localTimeEnabled,d.localMorphColour)}},this.calculateUVs=()=>{this.geometry.computeBoundingBox();var v=this.geometry.boundingBox.max,m=this.geometry.boundingBox.min,d=new c.Vector2(0-m.x,0-m.y),b=new c.Vector2(v.x-m.x,v.y-m.y);this.geometry.faceVertexUvs[0]=[];for(var y=0;y<this.geometry.faces.length;y++){var g=this.geometry.vertices[this.geometry.faces[y].a],w=this.geometry.vertices[this.geometry.faces[y].b],A=this.geometry.vertices[this.geometry.faces[y].c];geometry.faceVertexUvs[0].push([new c.Vector2((g.x+d.x)/b.x,(g.y+d.y)/b.y),new c.Vector2((w.x+d.x)/b.x,(w.y+d.y)/b.y),new c.Vector2((A.x+d.x)/b.x,(A.y+d.y)/b.y)])}geometry.uvsNeedUpdate=!0},this.checkTransparentMesh=function(){this._lod.checkTransparentMesh()},this.setWireframe=v=>{this.morph.material.wireframe=v},this.editVertices=function(v,m){if(v&&v.length){var d=this.getMorph(),b=d.geometry.getAttribute("position");if(!d||0>m)return;var y=3*m;v.forEach(g=>{b.array[y++]=g[0],b.array[y++]=g[1],b.array[y++]=g[2]}),b.needsUpdate=!0,d.geometry.computeBoundingBox(),d.geometry.computeBoundingSphere(),this.boundingBoxUpdateRequired=!0}}};p.prototype=Object.create(u(10).ZincObject.prototype),l.Geometry=p},o=>{o.exports=hB},(o,l,u)=>{function c(T){throw new TypeError('"'+T+'" is read-only')}var f=u(4),h=u(6).Geometry,p=u(7).default;function v(T){var P=T,_=u(0).modelPrefix;return _&&(_[_.length-1]!="/"&&c("prefix"),/^(?:[a-z]+:)?\/\//i.test(T)||(P=_+T)),P}function m(T,P){var _=(C,L)=>{try{var I=new URL(C,L).href;if(C&&2>C.split("?").length){var x=L.split("?");x.length===2&&(I=I+"?"+x[1])}return I}catch{console.error("There is an issue creating the url link with: ".concat(C,"."))}};if(!Array.isArray(T))return _(T,P);var E=[];return T.forEach(C=>{E.push(_(C,P))}),E}function d(T,P,_,E,C){var L=T.morphTargetInfluences,I=void 0;T.geometry&&(I=T.geometry.morphAttributes);var x=!1;if(L&&I&&I.position){E.set(0,0,0),C.set(0,0,0);for(var O=0;O<L.length;O++)0<L[O]&&(x=!0,_.setFromArray(I.position[O].array),E.add(_.min.multiplyScalar(L[O])),C.add(_.max.multiplyScalar(L[O])));x&&P.set(E,C)}x||P.setFromBufferAttribute(T.geometry.attributes.position),T.updateWorldMatrix(!0,!0),P.applyMatrix4(T.matrixWorld)}function b(T,P,_,E){var C=new XMLHttpRequest;C.open("GET",v(T),!0),C.onreadystatechange=()=>{C.readyState==4&&(C.status==200?_(C.responseText,P):E(T))},C.send(null)}function y(T,P,_){function E(O,B){I[B]=O,L++,L==C&&P(I)}for(var C=T.length,L=0,I=[],x=0;x<C;x++)b(T[x],x,E,_)}l.getColorsRGB=(T,P)=>{var _=Math.floor(P/3),E=P%3,C=0;E==0?C=T[_].r:E==1?C=T[_].g:E==2&&(C=T[_].b);var L=new f.Color(C);return[L.r,L.g,L.b]},l.updateMorphColorAttribute=function(T,P){if(P&&T&&T.morphAttributes&&T.morphAttributes.color){var _=T.morphAttributes.color,E=P.morphTargetInfluences,C=E.length;T.deleteAttribute("morphColor0"),T.deleteAttribute("morphColor1");for(var L=0,I=[],x=0;1>L||x<C;x++)0<E[x]&&(L++,I.push([x,E[x]]));I.length==2?(T.setAttribute("morphColor0",_[I[0][0]]),T.setAttribute("morphColor1",_[I[1][0]])):I.length==1&&(T.setAttribute("morphColor0",_[I[0][0]]),T.setAttribute("morphColor1",_[I[0][0]]))}},l.toBufferGeometry=(T,P)=>{var _;return T instanceof h?(P.localTimeEnabled&&!T.morphNormalsReady&&(T.morphNormals==null||T.morphNormals.length==0)&&T.computeMorphNormals(),_=T.toIndexedBufferGeometry(),P.localMorphColour&&g(T,_)):T instanceof f.BufferGeometry&&(_=T.clone()),_.colorsNeedUpdate=!0,_.computeBoundingBox(),_.computeBoundingSphere(),T._video&&(_._video=T._video),_},l.copyMorphColorsToBufferGeometry=(T,P)=>{if(T&&T.morphColors&&0<T.morphColors.length){for(var _=[],E=T.morphColors,C=u(5).getColorsRGB,L=0,I=E.length;L<I;L++){for(var x=E[L],O=[],B=0;B<T.faces.length;B++){var D=T.faces[B],k=C(x.colors,D.a);O.push(k[0],k[1],k[2]),k=C(x.colors,D.b),O.push(k[0],k[1],k[2]),k=C(x.colors,D.c),O.push(k[0],k[1],k[2])}var V=new f.Float32BufferAttribute(3*(3*T.faces.length),3);V.name=x.name,_.push(V.copyArray(O))}P.morphAttributes.color=_}};var g=(T,P)=>{if(T&&T.morphColors&&0<T.morphColors.length){for(var _=[],E=T.morphColors,C=u(5).getColorsRGB,L=0,I=E.length;L<I;L++){for(var x,O=E[L],B=[],D=0;D<3*O.colors.length;D++)x=C(O.colors,D),B.push(x[0],x[1],x[2]);var k=new f.Float32BufferAttribute(B,3);k.name=O.name,_.push(k)}P.morphAttributes.color=_}};function w(T){for(var P,_,E,C,L=-1,I=0,x=0;x<T.length;++x){if(C=T[x],P===void 0&&(P=C.array.constructor),P!==C.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(_===void 0&&(_=C.itemSize),_!==C.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(E===void 0&&(E=C.normalized),E!==C.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(L===-1&&(L=C.gpuType),L!==C.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;I+=C.count*_}for(var O,B=new P(I),D=new f.BufferAttribute(B,_,E),k=0,V=0;V<T.length;++V){if(O=T[V],O.isInterleavedBufferAttribute)for(var G=k/_,J=0,j=O.count;J<j;J++)for(var te,ee=0;ee<_;ee++)te=O.getComponent(J,ee),D.setComponent(J+G,ee,te);else B.set(O.array,k);k+=O.count*_}return L!==void 0&&(D.gpuType=L),D}l.mergeGeometries=function(T){for(var P=1<arguments.length&&arguments[1]!==void 0&&arguments[1],_=T[0].index!==null,E=new Set(Object.keys(T[0].attributes)),C=new Set(Object.keys(T[0].morphAttributes)),L={},I={},x=T[0].morphTargetsRelative,O=new f.BufferGeometry,B=0,D=0;D<T.length;++D){var k=T[D],V=0;if(_!==(k.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(var G in k.attributes){if(!E.has(G))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+'. All geometries must have compatible attributes; make sure "'+G+'" attribute exists among all geometries, or in none of them.'),null;L[G]===void 0&&(L[G]=[]),L[G].push(k.attributes[G]),V++}if(V!==E.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". Make sure all geometries have the same number of attributes."),null;if(x!==k.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(var J in k.morphAttributes){if(!C.has(J))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". .morphAttributes must be consistent throughout all geometries."),null;I[J]===void 0&&(I[J]=[]),I[J].push(k.morphAttributes[J])}if(P){var j=void 0;if(_)j=k.index.count;else if(k.attributes.position!==void 0)j=k.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+D+". The geometry must have either an index or a position attribute"),null;O.addGroup(B,j,D),B+=j}}if(_){for(var te,ee=0,ae=[],H=0;H<T.length;++H){te=T[H].index;for(var Z=0;Z<te.count;++Z)ae.push(te.getX(Z)+ee);ee+=T[H].attributes.position.count}O.setIndex(ae)}for(var $ in L){var se=w(L[$]);if(!se)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+$+" attribute."),null;O.setAttribute($,se)}for(var z in I){var W=I[z][0].length;if(W===0)break;O.morphAttributes=O.morphAttributes||{},O.morphAttributes[z]=[];for(var q,le=0;le<W;++le){q=[];for(var oe=0;oe<I[z].length;++oe)q.push(I[z][oe][le]);var U=w(q);if(!U)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+z+" morphAttribute."),null;O.morphAttributes[z].push(U)}}return O},l.mergeVertices=function(T){var P=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1e-4;P=Math.max(P,Number.EPSILON);for(var _,E={},C=T.getIndex(),L=T.getAttribute("position"),I=C?C.count:L.count,x=0,O=Object.keys(T.attributes),B={},D={},me=[],k=["getX","getY","getZ","getW"],V=0,G=O.length;V<G;V++){_=O[V],B[_]=[];var J=T.morphAttributes[_];J&&(D[_]=Array(J.length).fill().map(()=>[]))}for(var j=Math.log10(1/P),te=Math.pow(10,j),V=0;V<I;V++){for(var ee=C?C.getX(V):V,ae="",H=0,G=O.length;H<G;H++)for(var _=O[H],Z=T.getAttribute(_),$=Z.itemSize,se=0;se<$;se++)ae+="".concat(~~(Z[k[se]](ee)*te),",");if(ae in E)me.push(E[ae]);else{for(var H=0,G=O.length;H<G;H++)for(var z,_=O[H],Z=T.getAttribute(_),J=T.morphAttributes[_],$=Z.itemSize,W=B[_],q=D[_],se=0;se<$;se++)if(z=k[se],W.push(Z[z](ee)),J)for(var le=0,oe=J.length;le<oe;le++)q[le].push(J[le][z](ee));E[ae]=x,me.push(x),x++}}for(var U=T.clone(),V=0,G=O.length;V<G;V++){var Z,_=O[V],N=T.getAttribute(_),X=new N.array.constructor(B[_]);if(N.isInterleavedBufferAttribute?Z=new f.BufferAttribute(X,N.itemSize,N.itemSize):(Z=T.getAttribute(_).clone(),Z.setArray(X)),U.setAttribute(_,Z),_ in D)for(var Y,H=0;H<D[_].length;H++)Y=T.morphAttributes[_][H].clone(),Y.setArray(new Y.array.constructor(D[_][H])),U.morphAttributes[_][H]=Y}var ie=Uint8Array;me.length>=Math.pow(2,8)&&(ie=Uint16Array),me.length>=Math.pow(2,16)&&(ie=Uint32Array);var ue=new ie(me),me=null;return C===null?me=new f.BufferAttribute(ue,1):(me=T.getIndex().clone(),me.setArray(ue)),U.setIndex(me),U};function A(T){if(T.isMeshPhongMaterial){var P=new f.MeshToonMaterial({color:T.color.clone(),morphTargets:T.morphTargets,morphNormals:T.morphNormals,vertexColors:T.vertexColors,transparent:T.transparent,opacity:T.opacity,side:T.side});return T.map&&(P.map=T.map),P}return T}function S(T,P){if(P&&T>=P.length){var _=new f.BufferGeometry,E=new Float32Array(3*T),C=0;return P.forEach(L=>{E[C++]=L[0],E[C++]=L[1],E[C++]=L[2]}),_.setAttribute("position",new f.BufferAttribute(E,3)),_.setDrawRange(0,P.length),_}}function M(){var T=new Image;T.src=u(8);var P=new f.Texture;return P.image=T,P.needsUpdate=!0,P}function F(T,P,_,E,C,L){var I=new p(T,P,_,E,C,L);return I.fontFace=E,I.fontSize=C,I.fontWeight=L,I.material.map.generateMipmaps=!1,I.material.map.anisotropy=4,I.material.sizeAttenuation=!1,I.material.alphaTest=.5,I.material.transparent=!0,I.material.depthWrite=!1,I.material.depthTest=!1,I.center.set(.5,-1.2),I.renderOrder=1e4,I}function R(T,P,_){if(_){var E=T||"",C=P||"",L=_.lastIndexOf("/");if(-1<L){var I=void 0,x=void 0;if(I=_.substring(0,L),x=_.substring(L+1),(I==="*"||I==="**"||I.toLowerCase()===E.toLowerCase())&&(x==="*"||x==="**"||x.toLowerCase()===C.toLowerCase()))return!0}else if(E.toLowerCase()===_.toLowerCase()||C.toLowerCase()===_.toLowerCase())return!0}return!1}l.getBoundingBox=d,l.createNewURL=m,l.createBufferGeometry=S,l.getCircularTexture=M,l.resolveURL=v,l.loadExternalFile=b,l.loadExternalFiles=y,l.PhongToToon=A,l.createNewSpriteText=F,l.isRegionGroup=R},(o,l,u)=>{u.r(l),u.d(l,{Face3:()=>b,Geometry:()=>m});var c=u(4),f=new c.Matrix4,h=new c.Object3D,p=new c.Vector3,v=new c.Vector3;function m(){this.uuid=c.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.normals=[],this.uvs=[],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this.morphNormalsReady=!1}m.prototype=Object.assign(Object.create(c.EventDispatcher.prototype),{constructor:m,isGeometry:!0,applyMatrix4:function(g){for(var w,A=new c.Matrix3().getNormalMatrix(g),S=0,M=this.vertices.length;S<M;S++)w=this.vertices[S],w.applyMatrix4(g);for(var F,R=0,T=this.faces.length;R<T;R++){F=this.faces[R],F.normal.applyMatrix3(A).normalize();for(var P=0,_=F.vertexNormals.length;P<_;P++)F.vertexNormals[P].applyMatrix3(A).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(g){return f.makeRotationX(g),this.applyMatrix4(f),this},rotateY:function(g){return f.makeRotationY(g),this.applyMatrix4(f),this},rotateZ:function(g){return f.makeRotationZ(g),this.applyMatrix4(f),this},translate:function(g,w,A){return f.makeTranslation(g,w,A),this.applyMatrix4(f),this},scale:function(g,w,A){return f.makeScale(g,w,A),this.applyMatrix4(f),this},lookAt:function(g){return h.lookAt(g),h.updateMatrix(),this.applyMatrix4(h.matrix),this},fromBufferGeometry:function(g){function w(G,J,j,te){var ee=T===void 0?[]:[A.colors[G].clone(),A.colors[J].clone(),A.colors[j].clone()],ae=R===void 0?[]:[new c.Vector3().fromBufferAttribute(R,G),new c.Vector3().fromBufferAttribute(R,J),new c.Vector3().fromBufferAttribute(R,j)],H=new b(G,J,j,ae,ee,te);A.faces.push(H),P!==void 0&&A.faceVertexUvs[0].push([new c.Vector2().fromBufferAttribute(P,G),new c.Vector2().fromBufferAttribute(P,J),new c.Vector2().fromBufferAttribute(P,j)]),_!==void 0&&A.faceVertexUvs[1].push([new c.Vector2().fromBufferAttribute(_,G),new c.Vector2().fromBufferAttribute(_,J),new c.Vector2().fromBufferAttribute(_,j)])}var A=this,S=g.index===null?void 0:g.index,M=g.attributes;if(M.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var F=M.position,R=M.normal,T=M.color,P=M.uv,_=M.uv2;_!==void 0&&(this.faceVertexUvs[1]=[]);for(var E=0;E<F.count;E++)A.vertices.push(new c.Vector3().fromBufferAttribute(F,E)),T!==void 0&&A.colors.push(new c.Color().fromBufferAttribute(T,E));var C=g.groups;if(0<C.length)for(var L=0;L<C.length;L++)for(var I=C[L],x=I.start,O=I.count,B=x,D=x+O;B<D;B+=3)S===void 0?w(B,B+1,B+2,I.materialIndex):w(S.getX(B),S.getX(B+1),S.getX(B+2),I.materialIndex);else if(S!==void 0)for(var k=0;k<S.count;k+=3)w(S.getX(k),S.getX(k+1),S.getX(k+2));else for(var V=0;V<F.count;V+=3)w(V,V+1,V+2);return this.computeFaceNormals(),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(p).negate(),this.translate(p.x,p.y,p.z),this},normalize:function(){this.computeBoundingSphere();var g=this.boundingSphere.center,w=this.boundingSphere.radius,A=w===0?1:1/w,S=new c.Matrix4;return S.set(A,0,0,-A*g.x,0,A,0,-A*g.y,0,0,A,-A*g.z,0,0,0,1),this.applyMatrix4(S),this},computeFaceNormals:function(){for(var g=new c.Vector3,w=new c.Vector3,A=0,S=this.faces.length;A<S;A++){var M=this.faces[A],F=this.vertices[M.a],R=this.vertices[M.b],T=this.vertices[M.c];g.subVectors(T,R),w.subVectors(F,R),g.cross(w),g.normalize(),M.normal.copy(g)}},computeVertexNormals:function(){for(var g=!(0<arguments.length&&arguments[0]!==void 0)||arguments[0],w=Array(this.vertices.length),A=0,S=this.vertices.length;A<S;A++)w[A]=new c.Vector3;if(g)for(var M=new c.Vector3,F=new c.Vector3,R=0,T=this.faces.length;R<T;R++){var P=this.faces[R],_=this.vertices[P.a],E=this.vertices[P.b],C=this.vertices[P.c];M.subVectors(C,E),F.subVectors(_,E),M.cross(F),w[P.a].add(M),w[P.b].add(M),w[P.c].add(M)}else{this.computeFaceNormals();for(var L,I=0,x=this.faces.length;I<x;I++)L=this.faces[I],w[L.a].add(L.normal),w[L.b].add(L.normal),w[L.c].add(L.normal)}for(var O=0,B=this.vertices.length;O<B;O++)w[O].normalize();for(var D=0,k=this.faces.length;D<k;D++){var V=this.faces[D],G=V.vertexNormals;G.length===3?(G[0].copy(w[V.a]),G[1].copy(w[V.b]),G[2].copy(w[V.c])):(G[0]=w[V.a].clone(),G[1]=w[V.b].clone(),G[2]=w[V.c].clone())}return 0<this.faces.length&&(this.normalsNeedUpdate=!0),w},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var g=0,w=this.faces.length;g<w;g++){var A=this.faces[g],S=A.vertexNormals;S.length===3?(S[0].copy(A.normal),S[1].copy(A.normal),S[2].copy(A.normal)):(S[0]=A.normal.clone(),S[1]=A.normal.clone(),S[2]=A.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var g,w=0,A=this.faces.length;w<A;w++){g=this.faces[w],g.__originalFaceNormal?g.__originalFaceNormal.copy(g.normal):g.__originalFaceNormal=g.normal.clone(),g.__originalVertexNormals||(g.__originalVertexNormals=[]);for(var S=0,M=g.vertexNormals.length;S<M;S++)g.__originalVertexNormals[S]?g.__originalVertexNormals[S].copy(g.vertexNormals[S]):g.__originalVertexNormals[S]=g.vertexNormals[S].clone()}var F=new m;F.faces=this.faces;for(var R=0,T=this.morphTargets.length;R<T;R++){if(!this.morphNormals[R]){this.morphNormals[R]={},this.morphNormals[R].faceNormals=[],this.morphNormals[R].vertexNormals=[];for(var P=this.morphNormals[R].faceNormals,_=this.morphNormals[R].vertexNormals,E=0,C=this.faces.length;E<C;E++){var L=new c.Vector3,I={a:new c.Vector3,b:new c.Vector3,c:new c.Vector3};P.push(L),_.push(I)}}var x=this.morphNormals[R];F.vertices=this.morphTargets[R].vertices,F.computeFaceNormals();var O=F.computeVertexNormals();if(O&&0<O.length){this.morphTargets[R].normals=Array(this.vertices.length);for(var B=0;B<O.length;B++)this.morphTargets[R].normals[B]=O[B].clone()}for(var D=0,k=this.faces.length;D<k;D++){var V=this.faces[D],G=x.faceNormals[D],J=x.vertexNormals[D];G.copy(V.normal),J.a.copy(V.vertexNormals[0]),J.b.copy(V.vertexNormals[1]),J.c.copy(V.vertexNormals[2])}}for(var j,te=0,ee=this.faces.length;te<ee;te++)j=this.faces[te],j.normal=j.__originalFaceNormal,j.vertexNormals=j.__originalVertexNormals;this.morphNormalsReady=!0},computeBoundingBox:function(){this.boundingBox===null&&(this.boundingBox=new c.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingSphere.setFromPoints(this.vertices)},mergeMorph:function(g,w){var A=this.morphTargets.length,S=this.morphTargets,M=g.morphTargets,F=this.morphColors.length,R=this.morphColors,T=g.morphColors;if(0<A&&A==M.length)for(var P=0,_=S.length;P<_;P++){for(var E=S[P],C=M[P],L=0,I=C.vertices.length;L<I;L++){var x=C.vertices[L],O=x.clone();w!==void 0&&O.applyMatrix4(w),E.vertices.push(O)}if(E.normals&&C.normals)for(var B=0;B<C.normals.length;B+=3)v.set(C.normals2[B],C.normals2[B+1],C.normals2[B+2]),w!==void 0&&v.applyMatrix4(w),E.normals.push(v.x,v.y,v.z)}if(0<F&&F==T.length)for(var D=0,k=R.length;D<k;D++)for(var V=R[D],G=T[D],J=0,j=G.colors;J<j;J++)V.colors.push(G.colors[J].clone())},merge:function(g,w){var A=2<arguments.length&&arguments[2]!==void 0?arguments[2]:0;if(!(g&&g.isGeometry))return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",g);var S,M=this.vertices.length,F=this.vertices,R=g.vertices,T=g.normals,P=this.faces,_=g.faces,E=this.colors,C=g.colors;w!==void 0&&(S=new c.Matrix3().getNormalMatrix(w));for(var L=0,I=R.length;L<I;L++){var x=R[L],O=x.clone();w!==void 0&&O.applyMatrix4(w),F.push(O)}for(var B=0;B<T.length;B+=3)v.set(T[B],T[B+1],T[B+2]),w!==void 0&&v.applyMatrix4(w),this.normals.push(v.x,v.y,v.z);for(var D=0,k=C.length;D<k;D++)typeof C[D]=="number"?E.push(C[D]):E.push(C[D].clone());for(var V=0,G=_.length;V<G;V++){var J=_[V],j=void 0,te=void 0,ee=J.vertexNormals,ae=J.vertexColors,H=new b(J.a+M,J.b+M,J.c+M);H.normal.copy(J.normal),S!==void 0&&H.normal.applyMatrix3(S).normalize();for(var Z=0,$=ee.length;Z<$;Z++)j=ee[Z].clone(),S!==void 0&&j.applyMatrix3(S).normalize(),H.vertexNormals.push(j);H.color.copy(J.color);for(var se=0,z=ae.length;se<z;se++)te=ae[se],H.vertexColors.push(te.clone());H.materialIndex=J.materialIndex+A,P.push(H)}for(var W,q=0,le=g.faceVertexUvs.length;q<le;q++){W=g.faceVertexUvs[q],this.faceVertexUvs[q]===void 0&&(this.faceVertexUvs[q]=[]);for(var oe=0,U=W.length;oe<U;oe++){for(var N=W[oe],X=[],Y=0,ie=N.length;Y<ie;Y++)X.push(N[Y].clone());this.faceVertexUvs[q].push(X)}}this.mergeMorph(g,w)},mergeMesh:function(g){return g&&g.isMesh?(g.matrixAutoUpdate&&g.updateMatrix(),void this.merge(g.geometry,g.matrix)):void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",g)},mergeVertices:function(){for(var g=0<arguments.length&&arguments[0]!==void 0?arguments[0]:4,w={},A=[],S=[],M=Math.pow(10,g),F=0,R=this.vertices.length;F<R;F++){var T=this.vertices[F],P=Math.round(T.x*M)+"_"+Math.round(T.y*M)+"_"+Math.round(T.z*M);w[P]===void 0?(w[P]=F,A.push(this.vertices[F]),S[F]=A.length-1):S[F]=S[w[P]]}for(var _,E=[],C=0,L=this.faces.length;C<L;C++){_=this.faces[C],_.a=S[_.a],_.b=S[_.b],_.c=S[_.c];for(var I=[_.a,_.b,_.c],x=0;3>x;x++)if(I[x]===I[(x+1)%3]){E.push(C);break}}for(var O,B=E.length-1;0<=B;B--){O=E[B],this.faces.splice(O,1);for(var D=0,k=this.faceVertexUvs.length;D<k;D++)this.faceVertexUvs[D].splice(O,1)}var V=this.vertices.length-A.length;return this.vertices=A,V},setFromPoints:function(g){this.vertices=[];for(var w,A=0,S=g.length;A<S;A++)w=g[A],this.vertices.push(new c.Vector3(w.x,w.y,w.z||0));return this},sortFacesByMaterialIndex:function(){for(var g=this.faces,w=g.length,A=0;A<w;A++)g[A]._id=A;g.sort(function(_,E){return _.materialIndex-E.materialIndex});var S,M,F=this.faceVertexUvs[0],R=this.faceVertexUvs[1];F&&F.length===w&&(S=[]),R&&R.length===w&&(M=[]);for(var T,P=0;P<w;P++)T=g[P]._id,S&&S.push(F[T]),M&&M.push(R[T]);S&&(this.faceVertexUvs[0]=S),M&&(this.faceVertexUvs[1]=M)},toJSON:function(){function g(z,W,q){return q?z|1<<W:z&~(1<<W)}function w(z){var W=z.x.toString()+z.y.toString()+z.z.toString();return L[W]===void 0&&(L[W]=C.length/3,C.push(z.x,z.y,z.z)),L[W]}function A(z){var W=z.r.toString()+z.g.toString()+z.b.toString();return x[W]===void 0&&(x[W]=I.length,I.push(z.getHex())),x[W]}function S(z){var W=z.x.toString()+z.y.toString();return B[W]===void 0&&(B[W]=O.length/2,O.push(z.x,z.y)),B[W]}var M={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(M.uuid=this.uuid,M.type=this.type,this.name!==""&&(M.name=this.name),this.parameters!==void 0){var F=this.parameters;for(var R in F)F[R]!==void 0&&(M[R]=F[R]);return M}for(var T,P=[],_=0;_<this.vertices.length;_++)T=this.vertices[_],P.push(T.x,T.y,T.z);for(var E=[],C=[],L={},I=[],x={},O=[],B={},D=0;D<this.faces.length;D++){var k=this.faces[D],V=!0,G=!1,J=this.faceVertexUvs[0][D]!==void 0,j=0<k.normal.length(),te=0<k.vertexNormals.length,ee=k.color.r!==1||k.color.g!==1||k.color.b!==1,ae=0<k.vertexColors.length,H=0;if(H=g(H,0,0),H=g(H,1,V),H=g(H,2,G),H=g(H,3,J),H=g(H,4,j),H=g(H,5,te),H=g(H,6,ee),H=g(H,7,ae),E.push(H),E.push(k.a,k.b,k.c),E.push(k.materialIndex),J){var Z=this.faceVertexUvs[0][D];E.push(S(Z[0]),S(Z[1]),S(Z[2]))}if(j&&E.push(w(k.normal)),te){var $=k.vertexNormals;E.push(w($[0]),w($[1]),w($[2]))}if(ee&&E.push(A(k.color)),ae){var se=k.vertexColors;E.push(A(se[0]),A(se[1]),A(se[2]))}}return M.data={},M.data.vertices=P,M.data.normals=C,0<I.length&&(M.data.colors=I),0<O.length&&(M.data.uvs=[O]),M.data.faces=E,M},clone:function(){return new m().copy(this)},copy:function(g){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=g.name;for(var w=g.vertices,A=0,S=w.length;A<S;A++)this.vertices.push(w[A].clone());for(var M=g.colors,F=0,R=M.length;F<R;F++)this.colors.push(M[F].clone());for(var T=g.faces,P=0,_=T.length;P<_;P++)this.faces.push(T[P].clone());for(var E,C=0,L=g.faceVertexUvs.length;C<L;C++){E=g.faceVertexUvs[C],this.faceVertexUvs[C]===void 0&&(this.faceVertexUvs[C]=[]);for(var I=0,x=E.length;I<x;I++){for(var O,B=E[I],D=[],k=0,V=B.length;k<V;k++)O=B[k],D.push(O.clone());this.faceVertexUvs[C].push(D)}}for(var G,J=g.morphTargets,j=0,te=J.length;j<te;j++){if(G={},G.name=J[j].name,J[j].vertices!==void 0){G.vertices=[];for(var ee=0,ae=J[j].vertices.length;ee<ae;ee++)G.vertices.push(J[j].vertices[ee].clone())}if(J[j].normals!==void 0){G.normals=[];for(var H=0,Z=J[j].normals.length;H<Z;H++)G.normals.push(J[j].normals[H].clone())}this.morphTargets.push(G)}for(var $,se=g.morphNormals,z=0,W=se.length;z<W;z++){if($={},se[z].vertexNormals!==void 0){$.vertexNormals=[];for(var q=0,le=se[z].vertexNormals.length;q<le;q++){var oe=se[z].vertexNormals[q],U={};U.a=oe.a.clone(),U.b=oe.b.clone(),U.c=oe.c.clone(),$.vertexNormals.push(U)}}if(se[z].faceNormals!==void 0){$.faceNormals=[];for(var N=0,X=se[z].faceNormals.length;N<X;N++)$.faceNormals.push(se[z].faceNormals[N].clone())}this.morphNormals.push($)}for(var Y=g.skinWeights,ie=0,ue=Y.length;ie<ue;ie++)this.skinWeights.push(Y[ie].clone());for(var me=g.skinIndices,be=0,ce=me.length;be<ce;be++)this.skinIndices.push(me[be].clone());for(var ge=g.lineDistances,re=0,he=ge.length;re<he;re++)this.lineDistances.push(ge[re]);var ve=g.boundingBox;ve!==null&&(this.boundingBox=ve.clone());var Ee=g.boundingSphere;return Ee!==null&&(this.boundingSphere=Ee.clone()),this.elementsNeedUpdate=g.elementsNeedUpdate,this.verticesNeedUpdate=g.verticesNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.lineDistancesNeedUpdate=g.lineDistancesNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,this},computeGroups(){var y,g,w=[],A=void 0,S=this.faces;for(g=0;g<S.length;g++){var M=S[g];M.materialIndex!==A&&(A=M.materialIndex,y!==void 0&&(y.count=3*g-y.start,w.push(y)),y={start:3*g,materialIndex:A})}return y!==void 0&&(y.count=3*g-y.start,w.push(y)),w},toBufferGeometry:function(){var g=new d().fromGeometry(this),w=new c.BufferGeometry,A=new Float32Array(3*g.vertices.length);if(w.setAttribute("position",new c.BufferAttribute(A,3).copyVector3sArray(g.vertices)),0<g.normals.length){var S=new Float32Array(3*g.normals.length);w.setAttribute("normal",new c.BufferAttribute(S,3).copyVector3sArray(g.normals))}if(0<g.colors.length){var M=new Float32Array(3*g.colors.length);w.setAttribute("color",new c.BufferAttribute(M,3).copyColorsArray(g.colors))}if(0<g.uvs.length){var F=new Float32Array(2*g.uvs.length);w.setAttribute("uv",new c.BufferAttribute(F,2).copyVector2sArray(g.uvs))}if(0<g.uvs2.length){var R=new Float32Array(2*g.uvs2.length);w.setAttribute("uv2",new c.BufferAttribute(R,2).copyVector2sArray(g.uvs2))}for(var T in w.groups=g.groups,g.morphTargets){for(var P=[],_=g.morphTargets[T],E=0,C=_.length;E<C;E++){var L=_[E],I=new c.Float32BufferAttribute(3*L.data.length,3);I.name=L.name,P.push(I.copyVector3sArray(L.data))}w.morphAttributes[T]=P}if(0<g.skinIndices.length){var x=new c.Float32BufferAttribute(4*g.skinIndices.length,4);w.setAttribute("skinIndex",x.copyVector4sArray(g.skinIndices))}if(0<g.skinWeights.length){var O=new c.Float32BufferAttribute(4*g.skinWeights.length,4);w.setAttribute("skinWeight",O.copyVector4sArray(g.skinWeights))}return g.boundingSphere!==null&&(w.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(w.boundingBox=g.boundingBox.clone()),w},toIndexedBufferGeometry:function(){var g=new c.BufferGeometry,w=new Float32Array(3*this.vertices.length);if(g.setAttribute("position",new c.BufferAttribute(w,3).copyVector3sArray(this.vertices)),0<this.normals.length){var A=new Float32Array(this.normals.length),S=new c.BufferAttribute(A,3).copyArray(this.normals);g.setAttribute("normal",S)}if(0<this.uvs.length&&0<this.uvs[0].length){var M=new Float32Array(2*this.uvs[0].length);g.setAttribute("uv",new c.BufferAttribute(M,2).copyArray(this.uvs[0]))}if(1<this.uvs.length&&0<this.uvs[1].length){var F=new Float32Array(2*this.uvs[1].length);g.setAttribute("uv2",new c.BufferAttribute(F,2).copyArray(this.uvs[1]))}if(0<this.colors.length){for(var R=[],T=0;T<this.colors.length;T++)R.push(new c.Color(this.colors[T]));var P=new Float32Array(3*R.length);g.setAttribute("color",new c.BufferAttribute(P,3).copyColorsArray(R))}else{for(var _=new Float32Array(3*this.vertices.length),E=0;E<3*this.vertices.length;E++)_[E]=1;g.setAttribute("color",new c.BufferAttribute(_,3))}if(0<this.faces.length){for(var C=[],L=[],I=0;I<this.faces.length;I++){L.push(this.faces[I].a,this.faces[I].b,this.faces[I].c);var x=this.faces[I].vertexColors;if(x.length===3)C.push(x[0],x[1],x[2]);else{var O=this.faces[I].color;C.push(O,O,O)}}g.setIndex(L),g.groups=this.computeGroups()}if(0<this.morphTargets.length){for(var B=[],D=[],k=0,V=this.morphTargets.length;k<V;k++){var G=this.morphTargets[k],J=new c.Float32BufferAttribute(3*G.vertices.length,3);if(J.name=G.name,B.push(J.copyVector3sArray(G.vertices)),G.normals){var j=new c.Float32BufferAttribute(3*G.normals.length,3);j.name=G.name,D.push(j.copyVector3sArray(G.normals))}}g.morphAttributes.position=B,g.morphAttributes.normal=D}if(0<this.skinIndices.length){var te=new c.Float32BufferAttribute(4*this.skinIndices.length,4);g.setAttribute("skinIndex",te.copyVector4sArray(this.skinIndices))}if(0<this.skinWeights.length){var ee=new c.Float32BufferAttribute(4*this.skinWeights.length,4);g.setAttribute("skinWeight",ee.copyVector4sArray(this.skinWeights))}return this.boundingSphere!==null&&(g.boundingSphere=this.boundingSphere.clone()),this.boundingBox!==null&&(g.boundingBox=this.boundingBox.clone()),g},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(g){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(g)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),m.createBufferGeometryFromObject=function(y){var g=new c.BufferGeometry,w=y.geometry;if(y.isPoints||y.isLine){var A=new c.Float32BufferAttribute(3*w.vertices.length,3),S=new c.Float32BufferAttribute(3*w.colors.length,3);if(g.setAttribute("position",A.copyVector3sArray(w.vertices)),g.setAttribute("color",S.copyColorsArray(w.colors)),w.lineDistances&&w.lineDistances.length===w.vertices.length){var M=new c.Float32BufferAttribute(w.lineDistances.length,1);g.setAttribute("lineDistance",M.copyArray(w.lineDistances))}w.boundingSphere!==null&&(g.boundingSphere=w.boundingSphere.clone()),w.boundingBox!==null&&(g.boundingBox=w.boundingBox.clone())}else y.isMesh&&(g=w.toBufferGeometry());return g};class d{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(g){var w,A,S=[],M=void 0,F=g.faces;for(A=0;A<F.length;A++){var R=F[A];R.materialIndex!==M&&(M=R.materialIndex,w!==void 0&&(w.count=3*A-w.start,S.push(w)),w={start:3*A,materialIndex:M})}w!==void 0&&(w.count=3*A-w.start,S.push(w)),this.groups=S}fromGeometry(g){var w,A=g.faces,S=g.vertices,M=g.faceVertexUvs,F=M[0]&&0<M[0].length,R=M[1]&&0<M[1].length,T=g.morphTargets,P=T.length;if(0<P){w=[];for(var _=0;_<P;_++)w[_]={name:T[_].name,data:[]};this.morphTargets.position=w}var E,C=g.morphNormals,L=C.length;if(0<L){E=[];for(var I=0;I<L;I++)E[I]={name:C[I].name,data:[]};this.morphTargets.normal=E}var x=g.skinIndices,O=g.skinWeights,B=x.length===S.length,D=O.length===S.length;0<S.length&&A.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var k,V=0;V<A.length;V++){k=A[V],this.vertices.push(S[k.a],S[k.b],S[k.c]);var G=k.vertexNormals;if(G.length===3)this.normals.push(G[0],G[1],G[2]);else{var J=k.normal;this.normals.push(J,J,J)}var j=k.vertexColors;if(j.length===3)this.colors.push(j[0],j[1],j[2]);else{var te=k.color;this.colors.push(te,te,te)}if(F===!0){var ee=M[0][V];ee===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",V),this.uvs.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs.push(ee[0],ee[1],ee[2])}if(R===!0){var ae=M[1][V];ae===void 0?(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",V),this.uvs2.push(new c.Vector2,new c.Vector2,new c.Vector2)):this.uvs2.push(ae[0],ae[1],ae[2])}for(var H,Z=0;Z<P;Z++)H=T[Z].vertices,w[Z].data.push(H[k.a],H[k.b],H[k.c]);for(var $,se=0;se<L;se++)$=C[se].vertexNormals[V],E[se].data.push($.a,$.b,$.c);B&&this.skinIndices.push(x[k.a],x[k.b],x[k.c]),D&&this.skinWeights.push(O[k.a],O[k.b],O[k.c])}return this.computeGroups(g),this.verticesNeedUpdate=g.verticesNeedUpdate,this.normalsNeedUpdate=g.normalsNeedUpdate,this.colorsNeedUpdate=g.colorsNeedUpdate,this.uvsNeedUpdate=g.uvsNeedUpdate,this.groupsNeedUpdate=g.groupsNeedUpdate,g.boundingSphere!==null&&(this.boundingSphere=g.boundingSphere.clone()),g.boundingBox!==null&&(this.boundingBox=g.boundingBox.clone()),this}}class b{constructor(g,w,A,S,M){var F=5<arguments.length&&arguments[5]!==void 0?arguments[5]:0;this.a=g,this.b=w,this.c=A,this.normal=S&&S.isVector3?S:new c.Vector3,this.vertexNormals=Array.isArray(S)?S:[],this.color=M&&M.isColor?M:new c.Color,this.vertexColors=Array.isArray(M)?M:[],this.materialIndex=F}clone(){return new this.constructor().copy(this)}copy(g){this.a=g.a,this.b=g.b,this.c=g.c,this.normal.copy(g.normal),this.color.copy(g.color),this.materialIndex=g.materialIndex;for(var w=0,A=g.vertexNormals.length;w<A;w++)this.vertexNormals[w]=g.vertexNormals[w].clone();for(var S=0,M=g.vertexColors.length;S<M;S++)this.vertexColors[S]=g.vertexColors[S].clone();return this}}},o=>{o.exports=CB},o=>{o.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sHDgwCEMBJZu0AAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAABM5JREFUWMO1V0tPG2cUPZ4Hxh6DazIOrjFNqJs0FIMqWFgWQkatsmvVbtggKlSVRVf5AWz4AWz4AUSKEChll19QJYSXkECuhFxsHjEhxCYm+DWGMZ5HF72DJq4bAzFXurI0M/I5997v3u9cC65vTJVn2lX/xHINQOYSBLTLEuIuCWw4Z3IGAEvf6ASmVHjNzHCXBG4A0AjACsAOwEbO0nsFQBnAGYASAIl+ZRMR7SolMEdsByD09fV5R0ZGgg8ePPjW5/N1iqLYpuu6RZblciKR2I9Go69evnwZnZ+fjwI4IS8AKBIRzeQfJWCANwKwh0KhtrGxsYehUOin1tbW+zzP23ietzY2NnIAoGmaLsuyUiqVyvl8XtrY2NiamZn589mzZxsAUgCOAeQAnFI2tI+VxIjaAeDzoaGh7xYWFuZOTk6OZVk+12uYqqq6JEnn0Wg0OT4+/geAXwGEAdwDIFJQXC1wO4DWR48e/RCPxxclSSroVzRFUbSDg4P848ePFwH8DuAhkWih83TRQWxFOXgAwvDwcOfo6OhvXV1d39tsNtuVBwTDWBwOh1UUxVsMw1hXVlbSdCgNV43uYSvrHg6H24aHh38eHBz85TrgF9FYLHA4HLzH43FvbW2d7u/vG+dANp8FpqIlbd3d3V8Fg8EfBUFw4BONZVmL3+9vHhkZCQL4AoAHgJPK8G+yzC0XDofdoVAo5PP5vkadTBAEtr+/39ff3x8gAp/RPOEqx2qjx+NpvXv3bk9DQ0NDvQgwDIOWlhZrMBj8kgi0UJdxRgYMArzL5XJ7vd57qLPZ7Xamp6fnNgBXtQxcjFuHw+Hyer3t9SYgCAITCAScAJoBNNEY/08GOFVVrfVMv7kMNDntFD1vjIAPrlRN0xjckOm6biFQ3jwNPwDMZrOnqVTqfb3Bi8Wivru7W/VCYkwPlKOjo0IikXh7EwQikYgE4Nw0CfXKDCipVCoTj8df3QABbW1tLUc6oUgkFPMkVACUNjc337148eKvw8PDbJ2jP1taWkoCyNDVXDSECmNSK4qiKNLq6urW8+fPI/UicHx8rD59+jSVy+WOAKSJhKENwFItLtoxk8mwsixzHR0dHe3t7c5PAU+n09rs7OzJkydPYqVSaQfANoDXALIk31S2smU1TWMPDg7K5XKZ7+3t9TudTut1U7+wsFCcmJiIpdPpbQBxADsAknQWymYCOukBHYCuKApisdhpMpnURFEU79y503TVyKenpzOTk5M7e3t7MQKPV0Zv1gNm+awB0MvlshqLxfLb29uyJElWURSbXC4XXyvqxcXFs6mpqeTc3Nzu3t7e3wQcA7BPZ8Cov1pNlJplmQtAG8MwHV6v95tAINA5MDBwPxAIuLu6upr8fr/VAN3c3JQjkcjZ+vp6fnl5+d2bN29SuVzuNYAEpf01CdRChUL+X1VskHACuA3Ay3Fcu9vt7nA6nZ7m5uYWQRCaNE3jVVW15PP580KhIGUymWw2m00DOAJwSP4WwPtq4LX2Ao6USxNlQyS/RcQcdLGwlNIz6vEMAaZpNzCk2Pll94LK/cDYimxERiBwG10sxjgvEZBE0UpE6vxj+0Ct5bTaXthgEhRmja8QWNkkPGsuIpfdjpkK+cZUWTC0KredVmtD/gdlSl6EG4AMvQAAAABJRU5ErkJggg=="},(o,l)=>{l.augmentMorphColor=function(){return function(u){u.vertexShader=u.vertexShader.replace("#include <color_pars_vertex>",["varying vec3 vColor;","attribute vec3 morphColor0;","attribute vec3 morphColor1;"].join(`
|
|
3183
3183
|
`)),u.vertexShader=u.vertexShader.replace("#include <color_vertex>",["vColor.xyz = color.xyz;","#ifdef USE_MORPHTARGETS","vColor = morphColor0 * morphTargetInfluences[ 0 ];","vColor += morphColor1 * morphTargetInfluences[ 1 ];","#endif"].join(`
|
|
3184
|
-
`))}}},(o,l,u)=>{var c=u(4),f=u(5).createBufferGeometry,h=u(5).resolveURL,p=0,v=function(){return"pr"+p++},m=function(){this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new c.Group,this._lod=new(u(11)).LOD(this),this.groupName=void 0,this.timeEnabled=!1,this.morphColour=!1,this.inbuildTime=0,this.mixer=void 0,this.animationGroup=void 0,this.duration=6e3,this.clipAction=void 0,this.userData={},this.videoHandler=void 0,this.marker=void 0,this.markerNumber=void 0,this.markerUpdateRequired=!0,this.closestVertexIndex=-1,this.boundingBoxUpdateRequired=!0,this.cachedBoundingBox=new c.Box3,this.anatomicalId=void 0,this.region=void 0,this.animationClip=void 0,this.markerMode="inherited",this.uuid=v(),this._v1=new c.Vector3,this._v2=new c.Vector3,this._b1=new c.Box3,this.center=new c.Vector3,this.radius=0,this.visible=!0,this.drawRange=-1,this.origColour=void 0,this.origVertexColors=!1,this.isPickable=!0};m.prototype.setDuration=function(d){this.duration=d,this.clipAction&&this.clipAction.setDuration(this.duration)},m.prototype.getDuration=function(){return this.duration},m.prototype.setRegion=function(d){this.region=d},m.prototype.getRegion=function(){return this.region},m.prototype.getMorph=function(){var d=this._lod.getCurrentMorph();return d||this.morph},m.prototype.getGroup=function(){return this.group},m.prototype.setMorph=function(d){this.morph=d,this.group.add(this.morph);var b=this._lod.calculateDistance("far");this._lod.addLevel(d,b),this._lod.setMaterial(d.material)},m.prototype.checkTransparentMesh=function(){},m.prototype.setMesh=function(d,b,y){this.animationGroup=new c.AnimationObjectGroup(d),this.mixer=new c.AnimationMixer(this.animationGroup);var g=d.geometry;if(this.geometry=d.geometry,this.clipAction=void 0,g&&g.morphAttributes){var w=g.morphAttributes.position;w||(w=g.morphAttributes.color?g.morphAttributes.color:g.morphAttributes.normal),w&&(this.animationClip=c.AnimationClip.CreateClipsFromMorphTargetSequences(w,10,!0),this.animationClip&&this.animationClip[0]!=null&&(this.clipAction=this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration),this.clipAction.loop=c.loopOnce,this.clipAction.clampWhenFinished=!0,this.clipAction.play()))}this.timeEnabled=b,this.morphColour=y,d.userData=this,d.matrixAutoUpdate=!1,this.setMorph(d),this.checkTransparentMesh(),this.timeEnabled?this.setFrustumCulled(!1):this.morphColour&&(g.setAttribute("morphTarget0",g.getAttribute("position")),g.setAttribute("morphTarget1",g.getAttribute("position"))),this.boundingBoxUpdateRequired=!0},m.prototype.setIsPickable=function(d){this.isPickable!==d&&(this.isPickable=d,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAnatomicalId=function(d){this.anatomicalId=d},m.prototype.setName=function(d){this.groupName=d,this._lod.setName(d)},m.prototype.getCurrentTime=function(){if(this.clipAction){var d=this.clipAction.time/this.clipAction._clip.duration;return this.duration*d}return this.inbuildTime},m.prototype.setMorphTime=function(d){var b=!1;if(this.clipAction){var y=d/this.duration,g=this.clipAction._clip.duration,w=y*g;w!=this.clipAction.time&&(this.clipAction.time=w,b=!0),b&&this.isTimeVarying()&&this.mixer.update(0)}else{var A=d;A=d>this.duration?this.duration:0>d?0:d,A!=this.inbuildTime&&(this.inbuildTime=A,b=!0)}b&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},m.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},m.prototype.getVisibility=function(){return this.visible},m.prototype.setVisibility=function(d){d!==this.visible&&(this.visible=d,this.group.visible=d,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAlpha=function(d){var b=this._lod._material,y=!1;1>d&&(y=!0),b.opacity=d,b.transparent=y,this.checkTransparentMesh()},m.prototype.setFrustumCulled=function(d){this._lod.setFrustumCulled(d)},m.prototype.setVertexColors=function(d){this._lod.setVertexColors(d)},m.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},m.prototype.setColour=function(d){this._lod.setColour(d)},m.prototype.setGreyScale=function(d){if(d){if(!this.origColour&&this._lod._material)return this.origColour=this._lod._material.color,this.origVertexColors=this._lod._material.vertexColors,this._lod.setVertexColors(!1),this._lod.setColour(new c.Color().setHex(12303291)),!0}else if(this.origColour)return this._lod.setColour(this.origColour),this._lod.setVertexColors(this.origVertexColors),this.origColour=void 0,!0;return!1},m.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},m.prototype.setColourHex=function(d){this._lod._material.color.setHex(d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(d)},m.prototype.setEmissiveRGB=function(d){this._lod._material&&this._lod._material.emissive&&this._lod._material.emissive.setRGB(...d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.emissive.setRGB(...d)},m.prototype.setMaterial=function(d){this._lod.setMaterial(d)},m.prototype.getClosestVertexIndex=function(){var d=-1,b=this.getMorph();if(b&&b.geoemtry){var y=b.geometry.attributes.position;if(this._b1.setFromBufferAttribute(y),this._b1.getCenter(this._v1),y)for(var g=-1,w=0,A=0;A<y.count;A++)this._v2.fromArray(y.array,3*A),w=this._v2.distanceTo(this._v1),g==-1?g=w:g>w&&(g=w,d=A)}return d},m.prototype.getClosestVertex=function(d){var b=new c.Vector3;this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex());var y=this.getMorph();if(y&&y.geometry&&0<=this.closestVertexIndex){var g=y.morphTargetInfluences,w=y.geometry.morphAttributes;if(g&&w&&w.position){for(var A=!1,S=0;S<g.length;S++)0<g[S]&&(A=!0,this._v1.fromArray(w.position[S].array,3*this.closestVertexIndex),b.add(this._v1.multiplyScalar(g[S])));if(A)return d?b.applyMatrix4(y.matrixWorld):b}else return b.fromArray(y.geometry.attributes.position.array,3*this.closestVertexIndex),d?b.applyMatrix4(y.matrixWorld):b}return this.getBoundingBox(),b.copy(this.center),d?b.applyMatrix4(this.morph.matrixWorld):b},m.prototype.getBoundingBox=function(){if(this.visible){var d=this._lod.getCurrentMorph();if(d&&d.visible)return this.boundingBoxUpdateRequired&&(u(5).getBoundingBox(d,this.cachedBoundingBox,this._b1,this._v1,this._v2),this.cachedBoundingBox.getCenter(this.center),this.radius=this.center.distanceTo(this.cachedBoundingBox.max),this.boundingBoxUpdateRequired=!1),this.cachedBoundingBox}},m.prototype.dispose=function(){this._lod.dispose(),this.animationGroup=void 0,this.mixer=void 0,this.morph=void 0,this.group=void 0,this.clipAction=void 0,this.groupName=void 0},m.prototype.markerIsRequired=function(d){return!!(this.visible&&(this.markerMode==="on"||d&&d.displayMarkers&&this.markerMode==="inherited"))},m.prototype.updateMarker=function(d,b){if(d==!1&&this.markerIsRequired(b)){var y=b.ndcToBeUpdated;if(this.groupName){if(this.marker||(this.marker=new(u(14)).Marker(this),this.markerUpdateRequired=!0),this.markerUpdateRequired){var g=this.getClosestVertex(!1);g&&(this.marker.setPosition(g.x,g.y,g.z),this.markerUpdateRequired=!1)}this.marker.isEnabled()||(b.markersList&&!(this.marker.uuid in b.markersList)&&(y=!0,b.markersList[this.marker.uuid]=this.marker),this.marker.enable(),this.group.add(this.marker.morph)),this.marker.setNumber(this.markerNumber),this.markerImgURL?this.marker.loadUserSprite(this.markerImgURL):this.marker.setDefaultSprite(),b&&b.camera&&(y||b.markerCluster.markerUpdateRequired)&&(this.marker.updateNDC(b.camera.cameraObject),b.markerCluster.markerUpdateRequired=!0)}}else this.marker&&this.marker.isEnabled()&&(this.marker.disable(),this.group.remove(this.marker.morph),b.markersList&&this.marker.uuid in b.markersList&&(b.markerCluster.markerUpdateRequired=!0,delete b.markersList[this.marker.uuid])),this.markerUpdateRequired=!0},m.prototype.processMarkerVisual=function(d,b){this.marker&&this.marker.isEnabled()&&this.marker.updateVisual(d,b)},m.prototype.initiateMorphColor=function(){this.morphColour==1&&this._lod.updateMorphColorAttribute(!1)},m.prototype.setRenderOrder=function(d){this._lod.setRenderOrder(d)},m.prototype.getClosestVertexDOMElementCoords=function(d){if(d&&d.camera){var b=!0,y=this.getClosestVertex(!0);return y.project(d.camera),y.z=Math.min(Math.max(y.z,0),1),(1<y.x||-1>y.x||1<y.y||-1>y.y)&&(b=!1),d.getZincCameraControls().getRelativeCoordsFromNDC(y.x,y.y,y),{position:y,inView:b}}},m.prototype.setMarkerMode=function(d,b){d!==this.markerMode&&(this.markerMode=d==="on"||d==="off"?d:"inherited",this.region&&(this.region.pickableUpdateRequired=!0)),b&&(this.markerNumber=b.number,this.markerImgURL=b.imgURL)},m.prototype.render=function(d,b,y,g){if(this.visible&&!(this.timeEnabled&&b)&&this._lod.update(y,this.center),b==!0){if(this.clipAction&&this.isTimeVarying())this.mixer.update(d);else{var w=this.inbuildTime+d;w>this.duration&&(w-=this.duration),this.inbuildTime=w}this.visible&&d!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(b,g)},m.prototype.addLOD=function(d,b,y,g,w){this._lod.addLevelFromURL(d,b,y,g,w)},m.prototype.addVertices=function(d){var b=this.getMorph(),y=void 0;if(!b)y=f(500,d),this.drawRange=d.length;else if(-1<this.drawRange){var g=b.geometry.getAttribute("position");d.forEach(w=>{g.setXYZ(this.drawRange,w[0],w[1],w[2]),++this.drawRange}),g.needsUpdate=!0,b.geometry.setDrawRange(0,this.drawRange),b.geometry.computeBoundingBox(),b.geometry.computeBoundingSphere(),y=b.geoemtry,this.boundingBoxUpdateRequired=!0}return y},m.prototype.setPosition=function(d,b,y){var g=this.getGroup();g&&(g.position.set(d,b,y),g.updateMatrix(),this.boundingBoxUpdateRequired=!0)},m.prototype.loadAdditionalSources=function(d){d.load(h(filename),meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,void 0,void 0,void 0,void 0,finishCallback),this.onProgress(filename),this.onError(finishCallback))},m.prototype.setScaleAll=function(d){var b=this.getGroup();b&&(b.scale.set(d,d,d),b.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=m},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,h=u(5).toBufferGeometry,p=function(v){this.levels=[],this._currentLevel=0,this._renderOrder=1,this._material=void 0,this._secondaryMaterial=void 0,this._loader=void 0,this._parent=v,this.addLevel=(d,b)=>{if(d){var y,g=Math.abs(b);for(y=0;y<this.levels.length&&!(g<this.levels[y].distance);y++);this.levels.splice(y,0,{distance:g,morph:d,loaded:!0,loading:!1,url:""}),d.renderOrder=this._renderOrder}},this.levelLoaded=(d,b)=>{if(d){for(var y=Math.abs(b),g=0;g<this.levels.length;g++)if(y===this.levels[g].distance){this._parent.group.add(d),this.levels[g].morph=d,this.levels[g].loaded=!0,this.levels[g].loading=!1;break}this.checkTransparentMesh()}},this.addLevelFromURL=(d,b,y,g,w)=>{this._loader=d;var A,S=this.calculateDistance(b);for(A=0;A<this.levels.length&&!(S<this.levels[A].distance);A++);this.levels.splice(A,0,{distance:S,morph:void 0,loaded:!1,loading:!1,url:y,index:g}),w&&this.loadLevel(A)},this.loadLevel=d=>{var b=this.levels[d];return b.morph||b.loaded||b.loading||(b.loading=!0,this._loader.load(b.url,this.lodLoader(b.distance),void 0,void 0,{index:b.index})),b.morph===void 0},this.calculateDistance=function(d){this._parent.getBoundingBox();var b=this._parent.radius,y=0;return d==="far"?y=4.5*b:d==="medium"?y=2.5*b:d=="close"&&(y=0),y},this.containsLevels=()=>!!(this.levels&&1<this.levels.length),this.checkTransparentMesh=()=>{var d=this.levels[this._currentLevel];this._material&&(this._material.transparent?(!this._secondaryMaterial&&(this._secondaryMaterial=this._material.clone(),this._secondaryMaterial.side=c.FrontSide),this._secondaryMaterial.opacity=this._material.opacity,this._secondaryMaterial.emissive&&this._secondaryMaterial.emissive.copy(this._material.emissive),this._secondaryMaterial.needsUpdate=!0,!d.secondaryMesh&&(d.secondaryMesh=new c.Mesh(d.morph.geometry,this._secondaryMaterial),d.secondaryMesh.renderOrder=d.morph.renderOrder+1,d.secondaryMesh.userData=d.morph.userData,d.secondaryMesh.name=d.morph.name),this._material.side=c.BackSide,this._material.needsUpdate=!0,!d.secondaryMesh.parent&&(d.morph.add(d.secondaryMesh),this._parent.animationGroup&&this._parent.animationGroup.add(d.secondaryMesh))):(d.secondaryMesh&&(d.morph.remove(d.secondaryMesh),this._parent.animationGroup&&(this._parent.animationGroup.uncache(d.secondaryMesh),this._parent.animationGroup.remove(d.secondaryMesh))),this._material.side=c.DoubleSide,this._material.needsUpdate=!0))},this.dispose=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&d.morph.geometry.dispose()}),this._material&&this._material.dispose(),this._secondaryMaterial&&this._secondaryMaterial.dispose()},this.getCurrentLevel=()=>this._currentLevel,this.getCurrentMorph=()=>{var d=this.levels[this._currentLevel];return d&&d.morph?d.morph:this._parent.morph},this.lodLoader=function(d){return b=>{var y=this._material,g={localTimeEnabled:this._parent.timeEnabled,localMorphColour:this._parent.morphColour},w=h(b,g),A=void 0;this._parent.isGeometry?A=new c.Mesh(w,y):this._parent.isLines&&(A=new(u(12)).LineSegments(w,y)),A.userData=this._parent,A.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(A,d)}},this.updateMorphColorAttribute=d=>{if(this._material&&(this._material.vertexColors==c.VertexColors||this._material.vertexColors==!0))if(d){var b=this.getCurrentMorph();f(b.geometry,b)}else this.levels.forEach(y=>{y.morph&&y.morph.geometry&&f(y.morph.geometry,y.morph)})},this.setColour=d=>{this._material.color=d,this._secondaryMaterial&&(this._secondaryMaterial.color=d),m()},this.setFrustumCulled=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.frustumCulled=d),b.secondaryMesh&&(b.secondaryMesh.frustumCulled=d)})},this.setMaterial=d=>{d&&(!this._material||this._material.id!==d.id)&&(this._material=d,this._secondaryMaterial&&this._secondaryMaterial.dispose(),this._secondaryMaterial=d.clone(),this._secondaryMaterial.side=c.FrontSide,this._secondaryMaterial.transparent=!0,this.levels.forEach(b=>{b.morph&&(b.morph.material=this._material,b.morph.geometry&&(b.morph.geometry.colorsNeedUpdate=!0)),b.secondaryMesh&&(b.secondaryMesh.material=this._secondaryMaterial)}))},this.setName=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.name=d),b.secondaryMesh&&(b.secondaryMesh.name=d)})},this.setRenderOrder=d=>{this._renderOrder=d,this.levels.forEach(b=>{b.morph&&(b.morph.renderOrder=d),b.secondaryMesh&&(b.secondaryMesh.renderOrder=d)})},this.setVertexColors=d=>{this._material.vertexColors=d,m(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=d)},this.update=(d,b)=>{var y=this.levels;if(1<y.length){var g,w,A=d.cameraObject.position.distanceTo(b),S=-1,M=-1;for(g=0,w=y.length;g<w&&A>=y[g].distance;g++)y[g].morph?(-1<S&&y[S].morph&&(y[S].morph.visible=!1),S=g,y[g].morph.visible=!0,M=-1):M=g;for(-1<M&&this.loadLevel(M);g<w;g++)y[g].morph&&(-1<S?y[g].morph.visible=!1:(y[g].morph.visible=!0,S=g));this._currentLevel!=S&&(this._currentLevel=S,this.checkTransparentMesh())}},this.toggleMarker=(d,b)=>{this.levels.forEach(y=>{y.morph&&(b?y.morph.add(d):y.morph.remove(d))})};var m=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&(d.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>v});var c=u(13),f=u(4),h=new f.Vector3,p=new f.Vector3;class v extends c.Line{constructor(d,b){super(d,b),this.type="LineSegments"}computeLineDistances(){var d=this.geometry;if(!d.isBufferGeometry)d.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(d.index===null){for(var b=d.attributes.position,y=[],g=0,w=b.count;g<w;g+=2)h.fromBufferAttribute(b,g),p.fromBufferAttribute(b,g+1),y[g]=g==0?0:y[g-1],y[g+1]=y[g]+h.distanceTo(p);d.setAttribute("lineDistance",new f.Float32BufferAttribute(y,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}v.prototype.isLineSegments=!0},(o,l,u)=>{u.r(l),u.d(l,{Line:()=>w});var c=u(4),f=new c.Vector3,h=new c.Vector3,p=new c.Matrix4,v=new c.Ray,m=new c.Sphere,d=new c.Vector3,b=new c.Vector3,y=new c.Vector3,g=new c.Vector3;class w extends c.Object3D{constructor(){var M=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,F=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.LineBasicMaterial;super(),this.type="Line",this.geometry=M,this.material=F,this.updateMorphTargets()}copy(M){return super.copy(M),this.material=M.material,this.geometry=M.geometry,this}computeLineDistances(){var M=this.geometry;if(!M.isBufferGeometry)M.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(M.index===null){for(var F=M.attributes.position,R=[0],T=1,P=F.count;T<P;T++)f.fromBufferAttribute(F,T-1),h.fromBufferAttribute(F,T),R[T]=R[T-1],R[T]+=f.distanceTo(h);M.setAttribute("lineDistance",new c.Float32BufferAttribute(R,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(M,F){var R=this.geometry,T=this.matrixWorld,P=M.params.Line.threshold,_=R.drawRange,E=R.morphAttributes.position;if(R.boundingSphere===null&&R.computeBoundingSphere(),m.copy(R.boundingSphere),m.applyMatrix4(T),m.radius+=P,M.ray.intersectsSphere(m)!==!1){p.copy(T).invert(),v.copy(M.ray).applyMatrix4(p);var C=P/((this.scale.x+this.scale.y+this.scale.z)/3),L=C*C,I=new c.Vector3,x=new c.Vector3,O=new c.Vector3,B=new c.Vector3,D=this.isLineSegments?2:1;if(R.isBufferGeometry){var k=R.index,V=R.attributes,G=V.position;if(k!==null)for(var J=Math.max(0,_.start),j=Math.min(k.count,_.start+_.count),te=J;te<j-1;te+=D){var ee=k.getX(te),ae=k.getX(te+1);A(I,x,this,G,E,ee,ae);var H=v.distanceSqToSegment(I,x,B,O);if(!(H>L)){B.applyMatrix4(this.matrixWorld);var Z=M.ray.origin.distanceTo(B);Z<M.near||Z>M.far||F.push({distance:Z,point:O.clone().applyMatrix4(this.matrixWorld),index:te,face:null,faceIndex:null,object:this})}}else for(var $=Math.max(0,_.start),se=Math.min(G.count,_.start+_.count),z=$;z<se-1;z+=D){A(I,x,this,G,E,z,z+1);var W=v.distanceSqToSegment(I,x,B,O);if(!(W>L)){B.applyMatrix4(this.matrixWorld);var q=M.ray.origin.distanceTo(B);q<M.near||q>M.far||F.push({distance:q,point:O.clone().applyMatrix4(this.matrixWorld),index:z,face:null,faceIndex:null,object:this})}}}else R.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var M=this.geometry;if(M.isBufferGeometry){var F=M.morphAttributes,R=Object.keys(F);if(0<R.length){var T=F[R[0]];if(T!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var P,_=0,E=T.length;_<E;_++)P=T[_].name||_+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[P]=_}}}else{var C=M.morphTargets;C!==void 0&&0<C.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function A(S,M,F,R,T,P,_){S.fromBufferAttribute(R,P),M.fromBufferAttribute(R,_);var E=F.morphTargetInfluences;if(F.material.morphTargets&&T&&E){d.set(0,0,0),b.set(0,0,0);for(var C=0,L=T.length;C<L;C++){var I=E[C],x=T[C];I!==0&&(y.fromBufferAttribute(x,P),g.fromBufferAttribute(x,_),d.addScaledVector(y.sub(S),I),b.addScaledVector(g.sub(M),I))}S.add(d),M.add(b)}}w.prototype.isLine=!0},(o,l,u)=>{var c=u(4),f=new Image(128,128);f.src=u(15);var h=new c.Texture;h.image=f,h.needsUpdate=!0;var p=[.02,.03,1],v=new c.SpriteMaterial({map:h,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),m=u(5).createNewSpriteText,d=function(b){u(10).ZincObject.call(this),this.texture=h;var y=void 0,g=void 0,w=void 0,A=void 0,S=void 0,M=!0;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var F=!1;this.ndc=new c.Vector3;var R=void 0,T=void 0,P=()=>{y=new c.Sprite(v),y.center.set(.5,0),this.morph.add(y),this.morph.position.set(0,0,0),this.morph.renderOrder=1e4,y.scale.set(p[0],p[1],p[2]),y.userData=this};this.updateVisual=(_,E)=>{var C=1,L=0;_!==E&&(L=1-(this.ndc.z-_)/(E-_),C=.6+.4*L),this.setSpriteSize(C)},this.updateNDC=_=>(this.ndc.copy(this.morph.position),this.ndc.project(_),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(_,E,C)=>{this.morph.position.set(_,E,C)},this.setSpriteSize=_=>{y.scale.set(.015,.02,1),y.scale.multiplyScalar(_)},this.setUserSprite=()=>{A&&(this.morph.add(A),M&&(this.morph.remove(y),T&&this.morph.remove(T),M=!1))},this.setImageForUserSprite=(_,E)=>{A&&(this.morph.remove(A),A=void 0),g&&g.dispose(),w&&w.dispose(),g=new c.Texture,g.image=_,g.needsUpdate=!0,w=new c.SpriteMaterial({map:g,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),E||(E=[.05,.05,1]),A=new c.Sprite(w),A.center.set(.5,0),A.scale.set(E[0],E[1],E[2]),A.userData=this,this.setUserSprite()},this.setDefaultSprite=()=>{M||(M=!0,this.morph.add(y),A&&this.morph.remove(A),T&&this.morph.add(T))},this.loadUserSprite=(_,E)=>{if(_)if(_!==S){S=_;var C=new Image(128,128);C.crossOrigin="anonymous",C.onload=()=>{this.setImageForUserSprite(C,E)},C.src=_}else this.setUserSprite()},this.dispose=()=>{this.morph&&this.morph.clear(),y&&(y.clear(),y=void 0),T&&(T.material.map.dispose(),T.material.dispose(),T=void 0)},this.isEnabled=()=>F,this.setNumber=_=>{(!_||R!=_)&&T&&(this.morph.remove(T),T.material.map.dispose(),T.material.dispose(),T=void 0),!T&&_&&(T=m(_,.012,"black","Asap",120,700),this.morph.add(T)),R=_},this.getNumber=()=>R||1,this.setVisibility=function(_){_!==this.visible&&(this.visible=_,this.group.visible=_,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{F=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{F=!1,this.morph.visible=!1,this.visible=!1},P()};d.prototype=Object.create(u(10).ZincObject.prototype),l.Marker=d},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="},(o,l,u)=>{var c=u(4),f=function(h,p,v,m){u(10).ZincObject.call(this);var d;p&&(d=p.clone(),d.vertexColors=c.FaceColors),this.id=v;var b=void 0,y=void 0;this.isGlyph=!0;var g=[0,0,0];this.fromMesh=w=>!!(w&&w.isMesh)&&(this.morph=w.clone(),this.morph.userData=this,this.group.add(this.morph),!0),h&&d&&this.fromMesh(new c.Mesh(h,d)),this.getGlyphset=function(){return m},this.setLabel=w=>{w&&(typeof w=="string"||w instanceof String)&&(y=w,this.morph&&(this.morph.name=w))},this.showLabel=w=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),y&&(typeof y=="string"||y instanceof String)&&(b=new(u(17)).Label(y,w),b.setPosition(g[0],g[1],g[2]),this.group.add(b.getSprite()))},this.hideLabel=()=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0)},this.getLabel=()=>y,this.getMesh=()=>this.morph,this.setTransformation=(w,A,S,M)=>{this.morph&&(this.morph.matrix.elements[0]=A[0],this.morph.matrix.elements[1]=A[1],this.morph.matrix.elements[2]=A[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=S[0],this.morph.matrix.elements[5]=S[1],this.morph.matrix.elements[6]=S[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=M[0],this.morph.matrix.elements[9]=M[1],this.morph.matrix.elements[10]=M[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=w[0],this.morph.matrix.elements[13]=w[1],this.morph.matrix.elements[14]=w[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),g=[...w],b&&b.setPosition(w[0],w[1],w[2])},this.setColour=w=>{b&&b.setColour(w),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry&&(this.geometry.colorsNeedUpdate=!0)},this.dispose=()=>{this.material&&this.material.dispose(),this.morph=void 0}};f.prototype=Object.create(u(10).ZincObject.prototype),l.Glyph=f},(o,l,u)=>{var c=u(7).default;l.Label=function(f,h){var p=f,v=void 0;v=h?new c(p,.015,h.getStyle()):new c(p,.015),v.fontFace="Asap",v.fontWeight=700,v.material.map.generateMipmaps=!1,v.material.sizeAttenuation=!1,v.center.x=-.05,v.center.y=0,this.getPosition=()=>v?[v.position.x,v.position.y,v.position.z]:[0,0,0],this.setPosition=(m,d,b)=>{v&&v.position.set(m,d,b)},this.setColour=m=>{console.log(v),m&&(v.color=m.getStyle())},this.setScale=m=>{v&&0<m&&v.scale.set(m,m,1)},this.dispose=()=>{},this.getSprite=()=>v,this.getString=()=>p}},(o,l,u)=>{var c=u(4),f=u(19).JSONLoader,h=function(){u(10).ZincObject.call(this);var p=[],v=void 0,m=void 0,d=void 0,b=void 0,y=void 0,g=void 0,w=void 0,A=0,S=0,M=[0,0,0],F=[0,0,0],R=[0,0,0],T="NONE";this.ready=!1;var P=!1,_=!1;this.isGlyphset=!0;var E=new c.Matrix4,C=new c.Color,L=new c.Color,I=new c.Box3,x=new c.Box3,O=new c.Box3,B=[],D=[],k=[],V=[],G=[],J=[],j=[];this.globalScale=1;for(var te=0;8>te;te++)new c.Vector3;this.load=(z,W,q,le,oe)=>{v=z.axis1,m=z.axis2,d=z.axis3,b=z.positions,y=z.scale,g=z.colors,w=z.label,P=z.metadata.MorphColours,_=z.metadata.MorphVertices,A=z.metadata.number_of_time_steps,T=z.metadata.repeat_mode,S=z.metadata.number_of_vertices,T=="AXES_2D"||T=="MIRROR"?S*=2:T=="AXES_3D"&&(S*=3),M=z.metadata.base_size,F=z.metadata.offset,R=z.metadata.scale_factors;var U=new f;this.geometry=new c.BufferGeometry;var N=new c.InstancedMesh(this.geometry,void 0,S);if(this.setMorph(N),le){var X=U.parse(W);se(q,oe)(X.geometry,X.materials),X.geometry.dispose()}else U.crossOrigin="Anonymous",U.load(W,se(q,oe))};var ee=(z,W,q,le,oe,U)=>{if(T=="NONE"||T=="MIRROR"){for(var N,X=[0,0,0],Y=[0,0,0],ie=[0,0,0],ue=[0,0,0],me=[0,0,0],be=[0,0,0],ce=[0,0,0],ge=[0,0,0],re=[0,0,0],he=0;3>he;he++)N=0>oe[he]?-1:1,X[he]=(N*M[he]+oe[he]*R[he])*this.globalScale;for(var he=0;3>he;he++)Y[he]=W[he]*X[0],ie[he]=q[he]*X[1],ue[he]=le[he]*X[2],me[he]=z[he]+F[0]*Y[he]+F[1]*ie[he]+F[2]*ue[he],T=="MIRROR"&&(be[he]=-Y[he],ce[he]=-ie[he],ge[he]=-ue[he],re[he]=me[he],0>oe[0]&&(me[he]-=Y[he],re[he]-=be[he]));0>ue[0]*(Y[1]*ie[2]-Y[2]*ie[1])+ue[1]*(Y[2]*ie[0]-Y[0]*ie[2])+ue[2]*(Y[0]*ie[1]-Y[1]*ie[0])&&(ue[0]=-ue[0],ue[1]=-ue[1],ue[2]=-ue[2]),U[0]=[me,Y,ie,ue],T=="MIRROR"&&(0>ge[0]*(be[1]*ce[2]-be[2]*ce[1])+ge[1]*(be[2]*ce[0]-be[0]*ce[2])+ge[2]*(be[0]*ce[1]-be[1]*ce[0])&&(ge[0]=-ge[0],ge[1]=-ge[1],ge[2]=-ge[2]),U[1]=[re,be,ce,ge])}else if(T=="AXES_2D"||T=="AXES_3D"){for(var N,ve=[0,0,0],Ee=[0,0,0],he=0;3>he;he++)N=0>oe[he]?-1:1,ve[he]=(N*M[0]+oe[he]*R[0])*this.globalScale;for(var he=0;3>he;he++)Ee[he]=z[he]+F[0]*ve[0]*W[he]+F[1]*ve[1]*q[he]+F[2]*ve[2]*le[he];for(var _e=glyph_repeat_mode=="AXES_2D"?2:3,Ne=0;Ne<_e;Ne++){var Je=void 0,ze=void 0,st=oe[Ne],Ce=[0,0,0],je=[0,0,0],He=[0,0,0];Ne==0?(Je=W,ze=q):Ne==1?(Je=q,ze=glyph_repeat_mode=="AXES_2D"?W:le):(Je=le,ze=W);var Pt=(M[0]+st*R[0])*this.globalScale;Ce[0]=Je[0]*Pt,Ce[1]=Je[1]*Pt,Ce[2]=Je[2]*Pt,He[0]=Ce[1]*ze[2]-ze[1]*Ce[2],He[1]=Ce[2]*ze[0]-ze[2]*Ce[0],He[2]=Ce[0]*ze[1]-Ce[1]*ze[0];var It=Math.sqrt(He[0]*He[0]+He[1]*He[1]+He[2]*He[2]);if(0<It){var mt=(M[2]+st*R[2])*this.globalScale/It;T=="AXES_2D"&&0<Ne&&(mt*=-1),He[0]*=mt,He[1]*=mt,He[2]*=mt}if(je[0]=He[1]*Ce[2]-Ce[1]*He[2],je[1]=He[2]*Ce[0]-Ce[2]*He[0],je[2]=He[0]*Ce[1]-He[1]*Ce[0],It=Math.sqrt(je[0]*je[0]+je[1]*je[1]+je[2]*je[2]),0<It){var bt=(M[1]+st*R[1])*this.globalScale/It;je[0]*=bt,je[1]*=bt,je[2]*=bt}U[Ne]=[Ee,Ce,je,He]}}return U},ae=(z,W,q,le,oe)=>{var U=1;T=="AXES_2D"||T=="MIRROR"?U=2:T=="AXES_3D"&&(U=3);var N=z.length/3,X=0;j.length=U;for(var Y=0;Y<N;Y++){var ie=3*Y,ue=[z[ie],z[ie+1],z[ie+2]],me=[W[ie],W[ie+1],W[ie+2]],be=[q[ie],q[ie+1],q[ie+2]],ce=[le[ie],le[ie+1],le[ie+2]],ge=[oe[ie],oe[ie+1],oe[ie+2]],re=ee(ue,me,be,ce,ge,j);if(re.length==U)for(var he=0;he<U;he++){E.elements[0]=re[he][1][0],E.elements[1]=re[he][1][1],E.elements[2]=re[he][1][2],E.elements[3]=0,E.elements[4]=re[he][2][0],E.elements[5]=re[he][2][1],E.elements[6]=re[he][2][2],E.elements[7]=0,E.elements[8]=re[he][3][0],E.elements[9]=re[he][3][1],E.elements[10]=re[he][3][2],E.elements[11]=0,E.elements[12]=re[he][0][0],E.elements[13]=re[he][0][1],E.elements[14]=re[he][0][2],E.elements[15]=1,this.morph.setMatrixAt(X,E);var ve=p[X];ve&&ve.setTransformation(re[he][0],re[he][1],re[he][2],re[he][3]),X++}}this.morph.instanceMatrix.needsUpdate=!0},H=z=>{var W=1;T=="AXES_2D"||T=="MIRROR"?W=2:T=="AXES_3D"&&(W=3);for(var q,le=z.length,oe=0,U=0;U<le;U++){q=z[U];for(var N=0;N<W;N++){C.setHex(q),this.morph.setColorAt(oe,C);var X=p[oe];X&&X.setColour(C),oe++}}this.morph.instanceColor.needsUpdate=!0},Z=()=>{var z=B,W=D,q=k,le=V,oe=G,U=J,N=this.inbuildTime/this.duration*(A-1),X=Math.floor(N),Y=1-(N-X),ie=Math.ceil(N);if(_){var ue=b[X.toString()],me=b[ie.toString()],be=v[X.toString()],ce=v[ie.toString()],ge=m[X.toString()],re=m[ie.toString()],he=d[X.toString()],ve=d[ie.toString()],Ee=y[X.toString()],_e=y[ie.toString()];B.length=ue.length,D.length=ue.length,k.length=ue.length,V.length=ue.length,G.length=ue.length;for(var Ne=0;Ne<ue.length;Ne++)z[Ne]=Y*ue[Ne]+(1-Y)*me[Ne],W[Ne]=Y*be[Ne]+(1-Y)*ce[Ne],q[Ne]=Y*ge[Ne]+(1-Y)*re[Ne],le[Ne]=Y*he[Ne]+(1-Y)*ve[Ne],oe[Ne]=Y*Ee[Ne]+(1-Y)*_e[Ne]}else z=b[0],W=v[0],q=m[0],le=d[0],oe=y[0];if(ae(z,W,q,le,oe),this.boundingBoxUpdateRequired=!0,g!=null){if(P){var Je=g[X.toString()],ze=g[ie.toString()];U.length=Je.length;for(var st=0;st<Je.length;st++)C.setHex(Je[st]),L.setHex(ze[st]),C.setRGB(C.r*Y+L.r*(1-Y),C.g*Y+L.g*(1-Y),C.b*Y+L.b*(1-Y)),U[st]=C.getHex()}else U=g[0];H(U)}};this.showLabel=()=>{for(var z=0;z<p.length;z++)p[z].showLabel(this.morph.material?this.morph.material.color:void 0)},this.hideLabel=()=>{for(var z=0;z<p.length;z++)p[z].hideLabel()};var $=z=>{for(var W=0;W<S;W++){var q=new(u(16)).Glyph(void 0,void 0,W,this),le=w?w[W]:void 0;le=le||this.groupName,le&&q.setLabel(le),0<A&&q.setFrustumCulled(!1),p[W]=q,this.morph.add(q.getGroup())}z&&this.showLabel(),ae(b[0],v[0],m[0],d[0],y[0]),g!=null&&H(g[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};this.addCustomGlyph=z=>{z.isGlyph&&p.push(z),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(z,W)=>{if(z.isMesh){var q=new(u(16)).Glyph(void 0,void 0,W,this);return q.fromMesh(z),p.push(q),this.morph.add(q.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,q}},this.forEachGlyph=z=>{for(var W=0;W<p.length;W++)z(p[W])};var se=(z,W)=>(q,le)=>{var oe=q.toBufferGeometry();this.geometry.copy(oe),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),oe.dispose(),le&&le[0]&&(this.morph.material=le[0]),$(W),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),q.dispose(),z!=null&&typeof z=="function"&&z(this)};this.getClosestVertexIndex=function(){var z=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var W,q=b[0],le=q.length/3,oe=-1,U=0,N=0;N<le;N++)W=3*N,this._v2.set(q[W],q[W+1],q[W+2]),U=this._v1.distanceTo(this._v2),(oe==-1||oe>U)&&(oe=U,z=N)}return z},this.getClosestVertex=function(){if(this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph){var z=new c.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,E),z.setFromMatrixPosition(E),z}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){I.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var z=0;z<S;z++)this.morph.getMatrixAt(z,E),x.copy(I).applyMatrix4(E),z==0?O.copy(x):O.union(x);if(O)this.cachedBoundingBox.copy(O),this.morph.updateWorldMatrix(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1;else return}return this.cachedBoundingBox}},this.setMorphTime=z=>{this.inbuildTime=z>this.duration?this.duration:0>z?0:z,(P||_)&&(Z(),_&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0<A)&&(P||_)),this.getCurrentTime=()=>this.inbuildTime,this.setScaleAll=function(z){this.globalScale=z,Z()},this.dispose=()=>{for(var z=p.length-1;0<=z;z--)p[z].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),v=void 0,m=void 0,d=void 0,b=void 0,y=void 0,g=void 0,this.ready=!1,this.groupName=void 0},this.render=(z,W,q)=>{if(W==!0){var le=this.inbuildTime+z;le>this.duration&&(le-=this.duration),this.inbuildTime=le,(P||_)&&Z()}this.updateMarker(W,q)}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=h},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>M});var c=u(4),f=u(20).Loader,h=c.LoaderUtils,p=c.AnimationClip,v=c.Vector3,m=c.Vector4,d=c.Color,b=c.Vector2,y=u(6).Face3,g=u(6).Geometry,w=c.FileLoader,A=c.DefaultLoadingManager,S=u(21).VideoHandler;function M(F){typeof F=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),F=void 0),this.manager=F===void 0?A:F,this.withCredentials=!1,this.paramsString=""}Object.assign(M.prototype,{load:function(R,T,P,_){var E=this,C=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:h.extractUrlBase(R),L=new w(this.manager);R.split("?"),this.paramsString=R.length===2?paramsStrings[1]:"",L.setWithCredentials(this.withCredentials),L.load(R,function(I){var x;try{x=JSON.parse(I)}catch{if(console.error("The loader has encountered an error while parsing the content of a resource."),_)return void _({responseURL:R})}var O=x.metadata;if(O!==void 0){var B=O.type;if(B!==void 0&&B.toLowerCase()==="object")return void console.error("THREE.JSONLoader: "+R+" should be loaded with THREE.ObjectLoader instead.")}if(E&&E.parse)try{var D=E.parse(x,C);T(D.geometry,D.materials)}catch(k){if(console.error("The loader has encountered aon loading the geometry"),console.error(k),_)return void _({responseURL:R})}},P,_)},setTexturePath:function(R){this.texturePath=R},parse:function(){function F(_,E){function C(he,ve){return he&1<<ve}var L,I,x,O,B,D,k,V,G,J,j,te,ee,ae,H,Z,$,se,z,W,q,le,oe,U,N,X,Y,ie=_.faces,ue=_.vertices,me=_.normals,be=_.colors,ce=_.scale,ge=0;if(_.uvs!==void 0){for(L=0;L<_.uvs.length;L++)_.uvs[L].length&&ge++;for(L=0;L<ge;L++)E.faceVertexUvs[L]=[]}for(O=0,B=ue.length;O<B;)se=new v,se.x=ue[O++]*ce,se.y=ue[O++]*ce,se.z=ue[O++]*ce,E.vertices.push(se);if(O=0,B=ie.length,_.uvs)for(L=0;L<_.uvs.length;L++){E.uvs[L]=[];for(var re=0;re<_.uvs[L].length;re++)E.uvs[L][re]=_.uvs[L][re]}if(me)for(L=0;L<me.length;L++)E.normals[L]=me[L];if(be)for(L=0;L<be.length;L++)E.colors[L]=be[L];for(;O<B;)if(J=ie[O++],j=C(J,0),te=C(J,1),ee=C(J,3),ae=C(J,4),H=C(J,5),Z=C(J,6),$=C(J,7),j){if(W=new y,W.a=ie[O],W.b=ie[O+1],W.c=ie[O+3],q=new y,q.a=ie[O+1],q.b=ie[O+2],q.c=ie[O+3],O+=4,te&&(G=ie[O++],W.materialIndex=G,q.materialIndex=G),x=E.faces.length,ee)for(L=0;L<ge;L++)for(U=_.uvs[L],E.faceVertexUvs[L][x]=[],E.faceVertexUvs[L][x+1]=[],I=0;4>I;I++)V=ie[O++],X=U[2*V],Y=U[2*V+1],N=new b(X,Y),I!==2&&E.faceVertexUvs[L][x].push(N),I!==0&&E.faceVertexUvs[L][x+1].push(N);if(ae&&(k=3*ie[O++],W.normal.set(me[k++],me[k++],me[k]),q.normal.copy(W.normal)),H)for(L=0;4>L;L++)k=3*ie[O++],oe=new v(me[k++],me[k++],me[k]),L!==2&&W.vertexNormals.push(oe),L!==0&&q.vertexNormals.push(oe);if(Z&&(D=ie[O++],le=be[D],W.color.setHex(le),q.color.setHex(le)),$)for(L=0;4>L;L++)D=ie[O++],le=be[D],L!==2&&W.vertexColors.push(new d(le)),L!==0&&q.vertexColors.push(new d(le));E.faces.push(W),E.faces.push(q)}else{if(z=new y,z.a=ie[O++],z.b=ie[O++],z.c=ie[O++],te&&(G=ie[O++],z.materialIndex=G),x=E.faces.length,ee)for(L=0;L<ge;L++)for(U=_.uvs[L],E.faceVertexUvs[L][x]=[],I=0;3>I;I++)V=ie[O++],X=U[2*V],Y=U[2*V+1],N=new b(X,Y),E.faceVertexUvs[L][x].push(N);if(ae&&(k=3*ie[O++],z.normal.set(me[k++],me[k++],me[k])),H)for(L=0;3>L;L++)k=3*ie[O++],oe=new v(me[k++],me[k++],me[k]),z.vertexNormals.push(oe);if(Z&&(D=ie[O++],z.color.setHex(be[D])),$)for(L=0;3>L;L++)D=ie[O++],z.vertexColors.push(new d(be[D]));E.faces.push(z)}}function R(_,E){var C=_.influencesPerVertex===void 0?2:_.influencesPerVertex;if(_.skinWeights)for(var L=0,I=_.skinWeights.length;L<I;L+=C){var x=_.skinWeights[L],O=1<C?_.skinWeights[L+1]:0,B=2<C?_.skinWeights[L+2]:0,D=3<C?_.skinWeights[L+3]:0;E.skinWeights.push(new m(x,O,B,D))}if(_.skinIndices)for(var L=0,I=_.skinIndices.length;L<I;L+=C){var k=_.skinIndices[L],V=1<C?_.skinIndices[L+1]:0,G=2<C?_.skinIndices[L+2]:0,J=3<C?_.skinIndices[L+3]:0;E.skinIndices.push(new m(k,V,G,J))}E.bones=_.bones,E.bones&&0<E.bones.length&&(E.skinWeights.length!==E.skinIndices.length||E.skinIndices.length!==E.vertices.length)&&console.warn("When skinning, number of vertices ("+E.vertices.length+"), skinIndices ("+E.skinIndices.length+"), and skinWeights ("+E.skinWeights.length+") should match.")}function T(_,E){var C=_.scale;if(_.morphTargets!==void 0)for(var L=0,I=_.morphTargets.length;L<I;L++){E.morphTargets[L]={},E.morphTargets[L].name=_.morphTargets[L].name,E.morphTargets[L].vertices=[];for(var x,O=E.morphTargets[L].vertices,B=_.morphTargets[L].vertices,D=0,k=B.length;D<k;D+=3)x=new v,x.x=B[D]*C,x.y=B[D+1]*C,x.z=B[D+2]*C,O.push(x)}if(_.morphNormals!==void 0){for(var L=0,I=_.morphNormals.length;L<I;L++)if(E.morphTargets[L]){E.morphTargets[L].normals=[];for(var V,G=E.morphTargets[L].normals,J=_.morphNormals[L].normals,D=0,k=J.length;D<k;D+=3)V=new v,V.x=J[D],V.y=J[D+1],V.z=J[D+2],G.push(V);E.morphNormalsReady=!0}}if(_.morphColors!==void 0){var L,I,j,te,ee,ae,H;for(L=0,I=_.morphColors.length;L<I;L++)for(E.morphColors[L]={},E.morphColors[L].name=_.morphColors[L].name,E.morphColors[L].colors=[],ee=E.morphColors[L].colors,ae=_.morphColors[L].colors,j=0,te=ae.length;j<te;j+=3)H=new c.Color(16755200),H.setRGB(ae[j],ae[j+1],ae[j+2]),ee.push(H)}}function P(_,E){var C=[],L=[];_.animation!==void 0&&L.push(_.animation),_.animations!==void 0&&(_.animations.length?L=L.concat(_.animations):L.push(_.animations));for(var I,x=0;x<L.length;x++)I=p.parseAnimation(L[x],E.bones),I&&C.push(I);if(E.morphTargets){var O=p.CreateClipsFromMorphTargetSequences(E.morphTargets,10);C=C.concat(O)}0<C.length&&(E.animations=C)}return function(_,E){_.data!==void 0&&(_=_.data),_.scale=_.scale===void 0?1:1/_.scale;var C=new g;if(C.morphColors=[],F(_,C),R(_,C),T(_,C),P(_,C),C.computeFaceNormals(),C.computeBoundingSphere(),_.materials===void 0||_.materials.length===0)return{geometry:C};var L=f.prototype.initMaterials(_.materials,E,"Anonymous");if(_.materials[0].video){var I=E+_.materials[0].video;this.paramsString&&(I+="?".concat(this.paramsString));var x=new S(I);C._video=x}return L&&0<L.length&&(L[0].side=_.materials[0].singleSided?c.FrontSide:_.materials[0].flipSided?c.BackSide:c.DoubleSide,_.materials[0].specularCoef&&(L[0].shininess=Math.floor(_.materials[0].specularCoef/3))),{geometry:C,materials:L}}}()})},(o,l,u)=>{u.r(l),u.d(l,{Loader:()=>f});var c=u(4);u(4);function f(){}f.Handlers={handlers:[],add:function(p,v){this.handlers.push(p,v)},get:function(p){for(var v=this.handlers,m=0,d=v.length;m<d;m+=2){var b=v[m],y=v[m+1];if(b.test(p))return y}return null}},Object.assign(f.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(p,v,m){for(var d=[],b=0;b<p.length;++b)d[b]=this.createMaterial(p[b],v,m);return d},createMaterial:function(){var h={NoBlending:c.NoBlending,NormalBlending:c.NormalBlending,AdditiveBlending:c.AdditiveBlending,SubtractiveBlending:c.SubtractiveBlending,MultiplyBlending:c.MultiplyBlending,CustomBlending:c.CustomBlending},p=new c.Color,v=new c.TextureLoader,m=new c.MaterialLoader;return function(d,b,y){function g(F,R,T,P,_){var E,C=b+F,L=f.Handlers.get(C);L===null?(v.setCrossOrigin(y),E=v.load(C)):E=L.load(C),R!==void 0&&(E.repeat.fromArray(R),R[0]!==1&&(E.wrapS=c.RepeatWrapping),R[1]!==1&&(E.wrapT=c.RepeatWrapping)),T!==void 0&&E.offset.fromArray(T),P!==void 0&&(P[0]==="repeat"&&(E.wrapS=c.RepeatWrapping),P[0]==="mirror"&&(E.wrapS=c.MirroredRepeatWrapping),P[1]==="repeat"&&(E.wrapT=c.RepeatWrapping),P[1]==="mirror"&&(E.wrapT=c.MirroredRepeatWrapping)),_!==void 0&&(E.anisotropy=_);var I=c.MathUtils.generateUUID();return w[I]=E,I}var w={},A={uuid:c.MathUtils.generateUUID(),type:"MeshLambertMaterial"};for(var S in d){var M=d[S];switch(S){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":A.name=M;break;case"blending":A.blending=h[M];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",S,"is no longer supported.");break;case"colorDiffuse":A.color=p.fromArray(M).getHex();break;case"colorSpecular":A.specular=p.fromArray(M).getHex();break;case"colorEmissive":A.emissive=p.fromArray(M).getHex();break;case"specularCoef":A.shininess=M;break;case"shading":M.toLowerCase()==="basic"&&(A.type="MeshBasicMaterial"),M.toLowerCase()==="phong"&&(A.type="MeshPhongMaterial"),M.toLowerCase()==="standard"&&(A.type="MeshStandardMaterial");break;case"mapDiffuse":A.map=g(M,d.mapDiffuseRepeat,d.mapDiffuseOffset,d.mapDiffuseWrap,d.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":A.emissiveMap=g(M,d.mapEmissiveRepeat,d.mapEmissiveOffset,d.mapEmissiveWrap,d.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":A.lightMap=g(M,d.mapLightRepeat,d.mapLightOffset,d.mapLightWrap,d.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":A.aoMap=g(M,d.mapAORepeat,d.mapAOOffset,d.mapAOWrap,d.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":A.bumpMap=g(M,d.mapBumpRepeat,d.mapBumpOffset,d.mapBumpWrap,d.mapBumpAnisotropy);break;case"mapBumpScale":A.bumpScale=M;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":A.normalMap=g(M,d.mapNormalRepeat,d.mapNormalOffset,d.mapNormalWrap,d.mapNormalAnisotropy);break;case"mapNormalFactor":A.normalScale=M;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":A.specularMap=g(M,d.mapSpecularRepeat,d.mapSpecularOffset,d.mapSpecularWrap,d.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":A.metalnessMap=g(M,d.mapMetalnessRepeat,d.mapMetalnessOffset,d.mapMetalnessWrap,d.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":A.roughnessMap=g(M,d.mapRoughnessRepeat,d.mapRoughnessOffset,d.mapRoughnessWrap,d.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":A.alphaMap=g(M,d.mapAlphaRepeat,d.mapAlphaOffset,d.mapAlphaWrap,d.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":A.side=c.BackSide;break;case"doubleSided":A.side=c.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),A.opacity=M;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":A[S]=M;break;case"vertexColors":M===!0&&(A.vertexColors=c.VertexColors),M==="face"&&(A.vertexColors=c.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",S,M)}}return A.type==="MeshBasicMaterial"&&delete A.emissive,A.type!=="MeshPhongMaterial"&&delete A.specular,1>A.opacity&&(A.transparent=!0),m.setTextures(w),m.parse(A)}}()})},(o,l,u)=>{var c=u(4);l.VideoHandler=function(f){var h=this;this.video=void 0,this.videoTexture=void 0,this.setMorphTime=function(p,v){var m=p/v*h.video.duration;h.video.currentTime=m},this.getVideoDuration=function(){return h.video.duration},this.createCanvasVideoTexture=function(){return h.videoTexture=new c.VideoTexture(h.video),h.videoTexture.minFilter=c.LinearFilter,h.videoTexture.magFilter=c.LinearFilter,h.videoTexture.format=c.RGBFormat,h.video.currentTime=0,h.videoTexture},this.getCurrentTime=function(p){return h.video?p*(h.video.currentTime/h.video.duration):0},this.isReadyToPlay=function(){return!!(h.video&&3<=h.video.readyState)},function(){document&&(h.video=document.createElement("video"),h.video.crossOrigin="anonymous",h.video.src=f,h.video.load(),h.video.loop=!0)}()}},(o,l,u)=>{var c=u(4),f=u(23).Points,h=u(5).toBufferGeometry,p=u(5).getCircularTexture,v=u(17).Label,m=function(){u(10).ZincObject.call(this),this.isPointset=!0;var d=[];this.createMesh=(y,g,w)=>{if(y&&g){var A=h(y,w),S=p();g.map=S;var M=new f(A,g);this.setMesh(M,w.localTimeEnabled,w.localMorphColour)}};var b=(y,g,w,A)=>{if(w){var S=new c.Color(A),M=new v(w,S);M.setPosition(g[0],g[1],g[2]);var F=M.getSprite();F.material.sizeAttenuation=!1,F.material.alphaTest=.5,F.material.transparent=!0,F.material.depthWrite=!1,F.material.depthTest=!1,this.group.add(F),d[y]=M}};this.addPoints=(y,g,w)=>{if(y&&0<y.length){var A=this.drawRange-1,S=this.addVertices(y),M=this.getMorph();if(!M){var F=new c.PointsMaterial({alphaTest:.5,size:10,color:w,sizeAttenuation:!1});S.colorsNeedUpdate=!0,this.createMesh(S,F,{localTimeEnabled:!1,localMorphColour:!1})}var R=A+y.length,T=0;if(Array.isArray(g)&&g.length===y.length||typeof g=="string")for(A;A+T<R;){var P=typeof g=="string"?g:g[T];b(T,y[T],P,w),T++}this.region&&(this.region.pickableUpdateRequired=!0)}},this.setColourHex=function(y){this._lod._material.color.setHex(y),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(y);for(var g=0;g<d.length;g++)d[g]&&d[g].setColour(this._lod._material.color)},this.setColour=y=>{this._lod.setColour(y);for(var g=0;g<d.length;g++)d[g]&&d[g].setColour(this._lod._material.color)},this.setSize=y=>{this.morph&&this.morph.material&&(this.morph.material.size=y,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=y=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=y,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(y){if(0<=y&&this.drawRange>y){var g=this.getMorph().geometry.getAttribute("position");return[g.getX(y),g.getY(y),g.getZ(y)]}},this.editVertices=function(y,g){if(y&&y.length){var w=this.getMorph(),A=g+y.length-1;if(!w||0>g||A>=this.drawRange)return;var S=w.geometry.getAttribute("position"),M=g;y.forEach(F=>{var R=d[M];R&&R.setPosition(F[0],F[1],F[2]),S.setXYZ(M++,F[0],F[1],F[2])}),S.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(y,g,w,A)=>{this.morph&&w&&(this.morph.sizePerPixel=w.pixelHeight),m.prototype.render.call(this,y,g,w,A)}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Pointset=m},(o,l,u)=>{u.r(l),u.d(l,{Points:()=>b});var c=u(4),f=new c.Matrix4,h=new c.Ray,p=new c.Sphere,v=new c.Vector3,m=new c.Vector3,d=new c.Vector3;class b extends c.Object3D{constructor(){var A=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,S=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.PointsMaterial;super(),this.type="Points",this.geometry=A,this.material=S,this.sizePerPixel=1,this.updateMorphTargets()}copy(A){return super.copy(A),this.material=A.material,this.geometry=A.geometry,this}raycast(A,S){var M=this.geometry,F=this.matrixWorld,R=A.params.Points.threshold,T=M.drawRange;if(M.boundingSphere===null&&M.computeBoundingSphere(),p.copy(M.boundingSphere),p.applyMatrix4(F),p.radius+=R,A.ray.intersectsSphere(p)!==!1){f.copy(F).invert(),h.copy(A.ray).applyMatrix4(f);var P=R/((this.scale.x+this.scale.y+this.scale.z)/3)*this.material.size*this.sizePerPixel,_=P*P;if(M.isBufferGeometry){var E=M.index,C=M.attributes,L=C.position,I=M.morphAttributes.position;if(E!==null)for(var x,O=Math.max(0,T.start),B=Math.min(E.count,T.start+T.count),D=O;D<B;D++)x=E.getX(D),g(this,L,I,x),y(v,x,_,F,A,S,this);else for(var k=Math.max(0,T.start),V=Math.min(L.count,T.start+T.count),G=k;G<V;G++)g(this,L,I,G),y(v,G,_,F,A,S,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var A=this.geometry;if(A.isBufferGeometry){var S=A.morphAttributes,M=Object.keys(S);if(0<M.length){var F=S[M[0]];if(F!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var R,T=0,P=F.length;T<P;T++)R=F[T].name||T+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[R]=T}}}else{var _=A.morphTargets;_!==void 0&&0<_.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}b.prototype.isPoints=!0;function y(w,A,S,M,F,R,T){var P=h.distanceSqToPoint(w);if(P<S){var _=new c.Vector3;h.closestPointToPoint(w,_),_.applyMatrix4(M);var E=F.ray.origin.distanceTo(_);if(E<F.near||E>F.far)return;R.push({distance:E,distanceToRay:Math.sqrt(P),point:_,index:A,face:null,object:T})}}function g(w,A,S,M){v.fromBufferAttribute(A,M);var F=w.morphTargetInfluences;if(w.material.morphTargets&&S&&F){m.set(0,0,0);for(var R=0,T=S.length;R<T;R++){var P=F[R],_=S[R];P!==0&&(d.fromBufferAttribute(_,M),m.addScaledVector(d.sub(v),P))}v.add(m)}}},(o,l,u)=>{var c=u(4),f=u(5).toBufferGeometry,h=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(p,v,m)=>{if(p&&v){var d=f(p,m);m.localMorphColour&&d.morphAttributes.color&&(v.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(d,v);this.setMesh(b,m.localTimeEnabled,m.localMorphColour)}},this.setWidth=p=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=p,this.morph.material.needsUpdate=!0)},this.addLines=(p,v)=>{if(p&&0<p.length){var m=this.addVertices(p),d=this.getMorph();if(!d){var b=new c.LineBasicMaterial({color:v});m.colorsNeedUpdate=!0,this.createLineSegment(m,b,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Lines=h},(o,l,u)=>{function c(v,m,d,b,y,g,w){try{var A=v[g](w),S=A.value}catch(M){return void d(M)}A.done?m(S):Promise.resolve(S).then(b,y)}function f(v){return function(){var m=this,d=arguments;return new Promise(function(b,y){function g(S){c(A,b,y,g,w,"next",S)}function w(S){c(A,b,y,g,w,"throw",S)}var A=v.apply(m,d);g(void 0)})}}var h=u(4),p=function(){var v=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var m=f(function*(d){var b=1,y=1,g=0;if(d&&d.length){v.isLoading=!0;var w=new Image;w.crossOrigin="Anonymous";for(var A,S=document.createElement("canvas"),M=0,F=Array(d.length),R=0;R<d.length;R++)A=yield v.imageToUint8Array(v,w,d[R],S),A&&A.array&&(b=A.width,y=A.height,F[g]=A.array,M+=F[g].length,g++);var T=new Uint8Array(M);M=0,F.forEach(P=>{T.set(P,M),M+=P.length}),v.impl=new h.DataTexture2DArray(T,b,y,g),v.size={width:b,height:y,depth:g},v.isLoading=!1,v.impl.needsUpdate=!0}});return function(){return m.apply(this,arguments)}}(),this.getMaterial=m=>{if(this.impl){var d;if(!m)d=new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide});else if(m.vs&&m.fs){var b=!0;"transparent"in m&&(b=m.transparent);var y=h.FrontSide;m.side&&(y=m.side),d=new h.ShaderMaterial({transparent:b,uniforms:m.uniforms,vertexShader:m.vs,fragmentShader:m.fs,side:y}),m.glslVersion&&(d.glslVersion=m.glslVersion)}if(d)return d.needsUpdate=!0,d}}};p.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=p},(o,l,u)=>{function c(v,m,d,b,y,g,w){try{var A=v[g](w),S=A.value}catch(M){return void d(M)}A.done?m(S):Promise.resolve(S).then(b,y)}function f(v){return function(){var m=this,d=arguments;return new Promise(function(b,y){function g(S){c(A,b,y,g,w,"next",S)}function w(S){c(A,b,y,g,w,"throw",S)}var A=v.apply(m,d);g(void 0)})}}var h=u(4),p=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};p.prototype.loadImage=function(v,m){return new Promise((d,b)=>{v.onload=()=>d(v),v.onerror=b,v.src=m})},p.prototype.imageToUint8Array=function(){var v=f(function*(m,d,b,y){yield m.loadImage(d,b),y.width=d.width,y.height=d.height;var g=y.getContext("2d");return g.drawImage(d,0,0),{array:new Uint8Array(g.getImageData(0,0,y.width,y.height).data.buffer),width:y.width,height:y.height}});return function(){return v.apply(this,arguments)}}(),p.prototype.loadFromImages=function(){var v=f(function*(){});return function(){return v.apply(this,arguments)}}(),p.prototype.isReady=function(){return!(!this.impl||this.isLoading)},p.prototype.getMaterial=function(){if(this.impl)return new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide})},l.Texture=p},(o,l,u)=>{function c(y,g){var w=Object.keys(y);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(y);g&&(A=A.filter(function(S){return Object.getOwnPropertyDescriptor(y,S).enumerable})),w.push.apply(w,A)}return w}function f(y){for(var g,w=1;w<arguments.length;w++)g=arguments[w]==null?{}:arguments[w],w%2?c(Object(g),!0).forEach(function(A){h(y,A,g[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):c(Object(g)).forEach(function(A){Object.defineProperty(y,A,Object.getOwnPropertyDescriptor(g,A))});return y}function h(y,g,w){return(g=p(g))in y?Object.defineProperty(y,g,{value:w,enumerable:!0,configurable:!0,writable:!0}):y[g]=w,y}function p(y){var g=v(y,"string");return typeof g=="symbol"?g:g+""}function v(y,g){if(typeof y!="object"||!y)return y;var w=y[Symbol.toPrimitive];if(w!==void 0){var A=w.call(y,g||"default");if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(y)}var m=u(4),d=u(28),b=function(y){u(29).TexturePrimitive.call(this,y),this.isTextureSlides=!0;var g=[],w={};this.morph=new m.Group,this.group=this.morph,this.morph.userData=this;var A=void 0,S=!0;this.createSlides=R=>{R.forEach(T=>this.createSlide(T))};var M=(R,T)=>{var P=R.material,_=P.uniforms;switch(R.rotation.x=0,R.rotation.y=0,R.rotation.z=0,R.position.x=0,R.position.y=0,R.position.z=0,T.direction){case"x":var E=-Math.PI/2;R.rotation.y=E,_.direction.value=1,_.slide.value.set(T.value,0,0),R.position.x=T.value;break;case"y":R.rotation.x=Math.PI/2,_.direction.value=2,_.slide.value.set(0,T.value,0),R.position.y=T.value;break;case"z":_.direction.value=3,_.slide.value.set(0,0,T.value),R.position.z=T.value;break}P.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=R=>{R&&R.id&&R.id in w&&w[R.id]&&M(w[R.id],R)},this.createSlide=R=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&R&&R.direction&&R.value!==void 0){var T=new m.PlaneGeometry(1,1);T.translate(.5,.5,0);var P=d.getUniforms();P.diffuse.value=this.texture.impl,P.depth.value=this.texture.size.depth,P.flipY.value=S;var _={fs:d.fs,vs:d.vs,uniforms:P,glslVersion:d.glslVersion,side:m.DoubleSide,transparent:!1},E=this.texture.getMaterial(_);E.needsUpdate=!0;var C=new m.Mesh(T,E);C.name=this.groupName,C.userData=this;var L={value:R.value,direction:R.direction,id:C.id};return g.push(L),M(C,L),w[C.id]=C,this.morph.add(C),this.boundingBoxUpdateRequired=!0,L}},this.getTextureSettings=()=>[...g],this.getTextureSettingsWithId=R=>{for(var T=0;T<g.length;T++)if(R===g[T].id)return f({},g[T])},this.getSlides=()=>this.morph?[...this.morph.children]:[],this.removeSlide=R=>{R&&this.removeSlideWithId(R.id)},this.removeSlideWithId=R=>{if(this.morph&&R in w&&w[R]){if(this.morph.getObjectById(R)){var T=w[R];this.morph.remove(T),T.clear(),T.geometry&&T.geometry.dispose(),T.material&&T.material.dispose(),this.boundingBoxUpdateRequired=!0}var P=g.findIndex(_=>_.id===R);-1<P&&g.splice(P,1)}},this.dispose=()=>{this.morph.children.forEach(R=>{R.geometry&&R.geometry.dispose(),R.material&&R.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var F=(R,T,P)=>{if(T)switch(T.direction.value){case 1:P.copy(T.slide.value),R.expandByPoint(P),P.setY(1),P.setZ(1),R.expandByPoint(P);break;case 2:P.copy(T.slide.value),R.expandByPoint(P),P.setX(1),P.setZ(1),R.expandByPoint(P);break;case 3:P.copy(T.slide.value),R.expandByPoint(P),P.setX(1),P.setY(1),R.expandByPoint(P);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var R=new m.Vector3(0,0,0);this.morph.children.forEach(T=>{F(this.cachedBoundingBox,T.material.uniforms,R)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(R,T,P)=>{var _=new m.Matrix4;_.set(R[0],R[1],R[2],0,R[3],R[4],R[5],0,R[6],R[7],R[8],0,0,0,0,0);var E=new m.Quaternion().setFromRotationMatrix(_);this.morph.position.set(...T),this.morph.quaternion.copy(E),this.morph.scale.set(...P),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.setRenderOrder=R=>{this.morph.renderOrder=R},this.initialise=(R,T)=>{if(R){var P=R.locations;P&&0<P.length&&(this.applyTransformation(P[0].orientation,P[0].position,P[0].scale),"flipY"in P[0]&&(S=P[0].flipY)),this.createSlides(R.settings.slides),T!=null&&typeof T=="function"&&T(this)}},this.showEdges=R=>{if(A)A.material.color=R;else{var T=new m.BoxGeometry(1,1,1);T.translate(.5,.5,.5);var P=new m.EdgesGeometry(T);A=new m.LineSegments(P,new m.LineBasicMaterial({color:R})),this.group.add(A)}A.visible=!0},this.hideEdges=()=>{A&&(A.visible=!1)}};b.prototype=Object.create(u(29).TexturePrimitive.prototype),b.prototype.constructor=b,l.TextureSlides=b},(o,l,u)=>{var c=u(4),f=c.GLSL3,h=`
|
|
3184
|
+
`))}}},(o,l,u)=>{var c=u(4),f=u(5).createBufferGeometry,h=u(5).resolveURL,p=0,v=function(){return"pr"+p++},m=function(){this.isZincObject=!0,this.geometry=void 0,this.morph=void 0,this.group=new c.Group,this._lod=new(u(11)).LOD(this),this.groupName=void 0,this.timeEnabled=!1,this.morphColour=!1,this.inbuildTime=0,this.mixer=void 0,this.animationGroup=void 0,this.duration=6e3,this.clipAction=void 0,this.userData={},this.videoHandler=void 0,this.marker=void 0,this.markerNumber=void 0,this.markerUpdateRequired=!0,this.closestVertexIndex=-1,this.boundingBoxUpdateRequired=!0,this.cachedBoundingBox=new c.Box3,this.anatomicalId=void 0,this.region=void 0,this.animationClip=void 0,this.markerMode="inherited",this.uuid=v(),this._v1=new c.Vector3,this._v2=new c.Vector3,this._b1=new c.Box3,this.center=new c.Vector3,this.radius=0,this.visible=!0,this.drawRange=-1,this.origColour=void 0,this.origVertexColors=!1,this.isPickable=!0};m.prototype.setDuration=function(d){this.duration=d,this.clipAction&&this.clipAction.setDuration(this.duration)},m.prototype.getDuration=function(){return this.duration},m.prototype.setRegion=function(d){this.region=d},m.prototype.getRegion=function(){return this.region},m.prototype.getMorph=function(){var d=this._lod.getCurrentMorph();return d||this.morph},m.prototype.getGroup=function(){return this.group},m.prototype.setMorph=function(d){this.morph=d,this.group.add(this.morph);var b=this._lod.calculateDistance("far");this._lod.addLevel(d,b),this._lod.setMaterial(d.material)},m.prototype.checkTransparentMesh=function(){},m.prototype.setMesh=function(d,b,y){this.animationGroup=new c.AnimationObjectGroup(d),this.mixer=new c.AnimationMixer(this.animationGroup);var g=d.geometry;if(this.geometry=d.geometry,this.clipAction=void 0,g&&g.morphAttributes){var w=g.morphAttributes.position;w||(w=g.morphAttributes.color?g.morphAttributes.color:g.morphAttributes.normal),w&&(this.animationClip=c.AnimationClip.CreateClipsFromMorphTargetSequences(w,10,!0),this.animationClip&&this.animationClip[0]!=null&&(this.clipAction=this.mixer.clipAction(this.animationClip[0]).setDuration(this.duration),this.clipAction.loop=c.loopOnce,this.clipAction.clampWhenFinished=!0,this.clipAction.play()))}this.timeEnabled=b,this.morphColour=y,d.userData=this,d.matrixAutoUpdate=!1,this.setMorph(d),this.checkTransparentMesh(),this.timeEnabled?this.setFrustumCulled(!1):this.morphColour&&(g.setAttribute("morphTarget0",g.getAttribute("position")),g.setAttribute("morphTarget1",g.getAttribute("position"))),this.boundingBoxUpdateRequired=!0},m.prototype.setIsPickable=function(d){this.isPickable!==d&&(this.isPickable=d,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAnatomicalId=function(d){this.anatomicalId=d},m.prototype.setName=function(d){this.groupName=d,this._lod.setName(d)},m.prototype.getCurrentTime=function(){if(this.clipAction){var d=this.clipAction.time/this.clipAction._clip.duration;return this.duration*d}return this.inbuildTime},m.prototype.setMorphTime=function(d){var b=!1;if(this.clipAction){var y=d/this.duration,g=this.clipAction._clip.duration,w=y*g;w!=this.clipAction.time&&(this.clipAction.time=w,b=!0),b&&this.isTimeVarying()&&this.mixer.update(0)}else{var A=d;A=d>this.duration?this.duration:0>d?0:d,A!=this.inbuildTime&&(this.inbuildTime=A,b=!0)}b&&(this.boundingBoxUpdateRequired=!0,this._lod.updateMorphColorAttribute(!0),this.timeEnabled&&(this.markerUpdateRequired=!0))},m.prototype.isTimeVarying=function(){return!!(this.timeEnabled||this.morphColour)},m.prototype.getVisibility=function(){return this.visible},m.prototype.setVisibility=function(d){d!==this.visible&&(this.visible=d,this.group.visible=d,this.region&&(this.region.pickableUpdateRequired=!0))},m.prototype.setAlpha=function(d){var b=this._lod._material,y=!1;1>d&&(y=!0),b.opacity=d,b.transparent=y,this.checkTransparentMesh()},m.prototype.setFrustumCulled=function(d){this._lod.setFrustumCulled(d)},m.prototype.setVertexColors=function(d){this._lod.setVertexColors(d)},m.prototype.getColour=function(){return this._lod._material?this._lod._material.color:void 0},m.prototype.setColour=function(d){this._lod.setColour(d)},m.prototype.setGreyScale=function(d){if(d){if(!this.origColour&&this._lod._material)return this.origColour=this._lod._material.color,this.origVertexColors=this._lod._material.vertexColors,this._lod.setVertexColors(!1),this._lod.setColour(new c.Color().setHex(12303291)),!0}else if(this.origColour)return this._lod.setColour(this.origColour),this._lod.setVertexColors(this.origVertexColors),this.origColour=void 0,!0;return!1},m.prototype.getColourHex=function(){return!this.morphColour&&this._lod._material&&this._lod._material.color?this._lod._material.color.getHexString():void 0},m.prototype.setColourHex=function(d){this._lod._material.color.setHex(d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(d)},m.prototype.setEmissiveRGB=function(d){this._lod._material&&this._lod._material.emissive&&this._lod._material.emissive.setRGB(...d),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.emissive.setRGB(...d)},m.prototype.setMaterial=function(d){this._lod.setMaterial(d)},m.prototype.getClosestVertexIndex=function(){var d=-1,b=this.getMorph();if(b&&b.geometry){var y=b.geometry.attributes.position;if(y){this._b1.setFromBufferAttribute(y),this._b1.getCenter(this._v1);for(var g=-1,w=0,A=0;A<y.count;A++)this._v2.fromArray(y.array,3*A),w=this._v2.distanceTo(this._v1),g==-1?g=w:g>w&&(g=w,d=A)}}return d},m.prototype.getClosestVertex=function(d){var b=new c.Vector3;this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex());var y=this.getMorph();if(y&&y.geometry&&0<=this.closestVertexIndex){var g=y.morphTargetInfluences,w=y.geometry.morphAttributes;if(g&&w&&w.position){for(var A=!1,S=0;S<g.length;S++)0<g[S]&&(A=!0,this._v1.fromArray(w.position[S].array,3*this.closestVertexIndex),b.add(this._v1.multiplyScalar(g[S])));if(A)return d?b.applyMatrix4(y.matrixWorld):b}else return b.fromArray(y.geometry.attributes.position.array,3*this.closestVertexIndex),d?b.applyMatrix4(y.matrixWorld):b}return this.getBoundingBox(),b.copy(this.center),b},m.prototype.getBoundingBox=function(){if(this.visible){var d=this._lod.getCurrentMorph();if(d&&d.visible)return this.boundingBoxUpdateRequired&&(u(5).getBoundingBox(d,this.cachedBoundingBox,this._b1,this._v1,this._v2),this.cachedBoundingBox.getCenter(this.center),this.radius=this.center.distanceTo(this.cachedBoundingBox.max),this.boundingBoxUpdateRequired=!1),this.cachedBoundingBox}},m.prototype.dispose=function(){this._lod.dispose(),this.animationGroup=void 0,this.mixer=void 0,this.morph=void 0,this.group=void 0,this.clipAction=void 0,this.groupName=void 0},m.prototype.markerIsRequired=function(d){return!!(this.visible&&(this.markerMode==="on"||d&&d.displayMarkers&&this.markerMode==="inherited"))},m.prototype.updateMarker=function(d,b){if(d==!1&&this.markerIsRequired(b)){var y=b.ndcToBeUpdated;if(this.groupName){if(this.marker||(this.marker=new(u(14)).Marker(this),this.markerUpdateRequired=!0),this.markerUpdateRequired){var g=this.getClosestVertex(!1);g&&(this.marker.setPosition(g.x,g.y,g.z),this.markerUpdateRequired=!1)}this.marker.isEnabled()||(b.markersList&&!(this.marker.uuid in b.markersList)&&(y=!0,b.markersList[this.marker.uuid]=this.marker),this.marker.enable(),this.group.add(this.marker.morph)),this.marker.setNumber(this.markerNumber),this.markerImgURL?this.marker.loadUserSprite(this.markerImgURL):this.marker.setDefaultSprite(),b&&b.camera&&(y||b.markerCluster.markerUpdateRequired)&&(this.marker.updateNDC(b.camera.cameraObject),b.markerCluster.markerUpdateRequired=!0)}}else this.marker&&this.marker.isEnabled()&&(this.marker.disable(),this.group.remove(this.marker.morph),b.markersList&&this.marker.uuid in b.markersList&&(b.markerCluster.markerUpdateRequired=!0,delete b.markersList[this.marker.uuid])),this.markerUpdateRequired=!0},m.prototype.processMarkerVisual=function(d,b){this.marker&&this.marker.isEnabled()&&this.marker.updateVisual(d,b)},m.prototype.initiateMorphColor=function(){this.morphColour==1&&this._lod.updateMorphColorAttribute(!1)},m.prototype.setRenderOrder=function(d){this._lod.setRenderOrder(d)},m.prototype.getClosestVertexDOMElementCoords=function(d){if(d&&d.camera){var b=!0,y=this.getClosestVertex(!0);return y.project(d.camera),y.z=Math.min(Math.max(y.z,0),1),(1<y.x||-1>y.x||1<y.y||-1>y.y)&&(b=!1),d.getZincCameraControls().getRelativeCoordsFromNDC(y.x,y.y,y),{position:y,inView:b}}},m.prototype.setMarkerMode=function(d,b){d!==this.markerMode&&(this.markerMode=d==="on"||d==="off"?d:"inherited",this.region&&(this.region.pickableUpdateRequired=!0)),b&&(this.markerNumber=b.number,this.markerImgURL=b.imgURL)},m.prototype.render=function(d,b,y,g){if(this.visible&&!(this.timeEnabled&&b)&&this._lod.update(y,this.center),b==!0){if(this.clipAction&&this.isTimeVarying())this.mixer.update(d);else{var w=this.inbuildTime+d;w>this.duration&&(w-=this.duration),this.inbuildTime=w}this.visible&&d!=0&&(this.boundingBoxUpdateRequired=!0,this.morphColour==1&&this._lod.updateMorphColorAttribute(!0))}this.updateMarker(b,g)},m.prototype.addLOD=function(d,b,y,g,w){this._lod.addLevelFromURL(d,b,y,g,w)},m.prototype.addVertices=function(d){var b=this.getMorph(),y=void 0;if(!b)y=f(500,d),this.drawRange=d.length;else if(-1<this.drawRange){var g=b.geometry.getAttribute("position");d.forEach(w=>{g.setXYZ(this.drawRange,w[0],w[1],w[2]),++this.drawRange}),g.needsUpdate=!0,b.geometry.setDrawRange(0,this.drawRange),b.geometry.computeBoundingBox(),b.geometry.computeBoundingSphere(),y=b.geoemtry,this.boundingBoxUpdateRequired=!0}return y},m.prototype.setPosition=function(d,b,y){var g=this.getGroup();g&&(g.position.set(d,b,y),g.matrixWorldNeedsUpdate=!0,g.updateMatrix(),g.updateWorldMatrix(!0,!0),this.boundingBoxUpdateRequired=!0)},m.prototype.loadAdditionalSources=function(d){d.load(h(filename),meshloader(region,colour,opacity,localTimeEnabled,localMorphColour,void 0,void 0,void 0,void 0,finishCallback),this.onProgress(filename),this.onError(finishCallback))},m.prototype.setScaleAll=function(d){var b=this.getGroup();b&&(b.scale.set(d,d,d),b.updateMatrix(),this.boundingBoxUpdateRequired=!0)},l.ZincObject=m},(o,l,u)=>{var c=u(4),f=u(5).updateMorphColorAttribute,h=u(5).toBufferGeometry,p=function(v){this.levels=[],this._currentLevel=0,this._renderOrder=1,this._material=void 0,this._secondaryMaterial=void 0,this._loader=void 0,this._parent=v,this.addLevel=(d,b)=>{if(d){var y,g=Math.abs(b);for(y=0;y<this.levels.length&&!(g<this.levels[y].distance);y++);this.levels.splice(y,0,{distance:g,morph:d,loaded:!0,loading:!1,url:""}),d.renderOrder=this._renderOrder}},this.levelLoaded=(d,b)=>{if(d){for(var y=Math.abs(b),g=0;g<this.levels.length;g++)if(y===this.levels[g].distance){this._parent.group.add(d),this.levels[g].morph=d,this.levels[g].loaded=!0,this.levels[g].loading=!1;break}this.checkTransparentMesh()}},this.addLevelFromURL=(d,b,y,g,w)=>{this._loader=d;var A,S=this.calculateDistance(b);for(A=0;A<this.levels.length&&!(S<this.levels[A].distance);A++);this.levels.splice(A,0,{distance:S,morph:void 0,loaded:!1,loading:!1,url:y,index:g}),w&&this.loadLevel(A)},this.loadLevel=d=>{var b=this.levels[d];return b.morph||b.loaded||b.loading||(b.loading=!0,this._loader.load(b.url,this.lodLoader(b.distance),void 0,void 0,{index:b.index})),b.morph===void 0},this.calculateDistance=function(d){this._parent.getBoundingBox();var b=this._parent.radius,y=0;return d==="far"?y=4.5*b:d==="medium"?y=2.5*b:d=="close"&&(y=0),y},this.containsLevels=()=>!!(this.levels&&1<this.levels.length),this.checkTransparentMesh=()=>{var d=this.levels[this._currentLevel];this._material&&(this._material.transparent?(!this._secondaryMaterial&&(this._secondaryMaterial=this._material.clone(),this._secondaryMaterial.side=c.FrontSide),this._secondaryMaterial.opacity=this._material.opacity,this._secondaryMaterial.emissive&&this._secondaryMaterial.emissive.copy(this._material.emissive),this._secondaryMaterial.needsUpdate=!0,!d.secondaryMesh&&(d.secondaryMesh=new c.Mesh(d.morph.geometry,this._secondaryMaterial),d.secondaryMesh.renderOrder=d.morph.renderOrder+1,d.secondaryMesh.userData=d.morph.userData,d.secondaryMesh.name=d.morph.name),this._material.side=c.BackSide,this._material.needsUpdate=!0,!d.secondaryMesh.parent&&(d.morph.add(d.secondaryMesh),this._parent.animationGroup&&this._parent.animationGroup.add(d.secondaryMesh))):(d.secondaryMesh&&(d.morph.remove(d.secondaryMesh),this._parent.animationGroup&&(this._parent.animationGroup.uncache(d.secondaryMesh),this._parent.animationGroup.remove(d.secondaryMesh))),this._material.side=c.DoubleSide,this._material.needsUpdate=!0))},this.dispose=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&d.morph.geometry.dispose()}),this._material&&this._material.dispose(),this._secondaryMaterial&&this._secondaryMaterial.dispose()},this.getCurrentLevel=()=>this._currentLevel,this.getCurrentMorph=()=>{var d=this.levels[this._currentLevel];return d&&d.morph?d.morph:this._parent.morph},this.lodLoader=function(d){return b=>{var y=this._material,g={localTimeEnabled:this._parent.timeEnabled,localMorphColour:this._parent.morphColour},w=h(b,g),A=void 0;this._parent.isGeometry?A=new c.Mesh(w,y):this._parent.isLines&&(A=new(u(12)).LineSegments(w,y)),A.userData=this._parent,A.renderOrder=this._renderOrder,b.dispose(),this.levelLoaded(A,d)}},this.updateMorphColorAttribute=d=>{if(this._material&&(this._material.vertexColors==c.VertexColors||this._material.vertexColors==!0))if(d){var b=this.getCurrentMorph();f(b.geometry,b)}else this.levels.forEach(y=>{y.morph&&y.morph.geometry&&f(y.morph.geometry,y.morph)})},this.setColour=d=>{this._material.color=d,this._secondaryMaterial&&(this._secondaryMaterial.color=d),m()},this.setFrustumCulled=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.frustumCulled=d),b.secondaryMesh&&(b.secondaryMesh.frustumCulled=d)})},this.setMaterial=d=>{d&&(!this._material||this._material.id!==d.id)&&(this._material=d,this._secondaryMaterial&&this._secondaryMaterial.dispose(),this._secondaryMaterial=d.clone(),this._secondaryMaterial.side=c.FrontSide,this._secondaryMaterial.transparent=!0,this.levels.forEach(b=>{b.morph&&(b.morph.material=this._material,b.morph.geometry&&(b.morph.geometry.colorsNeedUpdate=!0)),b.secondaryMesh&&(b.secondaryMesh.material=this._secondaryMaterial)}))},this.setName=d=>{this.levels.forEach(b=>{b.morph&&(b.morph.name=d),b.secondaryMesh&&(b.secondaryMesh.name=d)})},this.setRenderOrder=d=>{this._renderOrder=d,this.levels.forEach(b=>{b.morph&&(b.morph.renderOrder=d),b.secondaryMesh&&(b.secondaryMesh.renderOrder=d)})},this.setVertexColors=d=>{this._material.vertexColors=d,m(),this._secondaryMaterial&&(this._secondaryMaterial.vertexColors=d)},this.update=(d,b)=>{var y=this.levels;if(1<y.length){var g,w,A=d.cameraObject.position.distanceTo(b),S=-1,M=-1;for(g=0,w=y.length;g<w&&A>=y[g].distance;g++)y[g].morph?(-1<S&&y[S].morph&&(y[S].morph.visible=!1),S=g,y[g].morph.visible=!0,M=-1):M=g;for(-1<M&&this.loadLevel(M);g<w;g++)y[g].morph&&(-1<S?y[g].morph.visible=!1:(y[g].morph.visible=!0,S=g));this._currentLevel!=S&&(this._currentLevel=S,this.checkTransparentMesh())}},this.toggleMarker=(d,b)=>{this.levels.forEach(y=>{y.morph&&(b?y.morph.add(d):y.morph.remove(d))})};var m=()=>{this.levels.forEach(d=>{d.morph&&d.morph.geometry&&(d.morph.geometry.colorsNeedUpdate=!0)})}};l.LOD=p},(o,l,u)=>{u.r(l),u.d(l,{LineSegments:()=>v});var c=u(13),f=u(4),h=new f.Vector3,p=new f.Vector3;class v extends c.Line{constructor(d,b){super(d,b),this.type="LineSegments"}computeLineDistances(){var d=this.geometry;if(!d.isBufferGeometry)d.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(d.index===null){for(var b=d.attributes.position,y=[],g=0,w=b.count;g<w;g+=2)h.fromBufferAttribute(b,g),p.fromBufferAttribute(b,g+1),y[g]=g==0?0:y[g-1],y[g+1]=y[g]+h.distanceTo(p);d.setAttribute("lineDistance",new f.Float32BufferAttribute(y,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}v.prototype.isLineSegments=!0},(o,l,u)=>{u.r(l),u.d(l,{Line:()=>w});var c=u(4),f=new c.Vector3,h=new c.Vector3,p=new c.Matrix4,v=new c.Ray,m=new c.Sphere,d=new c.Vector3,b=new c.Vector3,y=new c.Vector3,g=new c.Vector3;class w extends c.Object3D{constructor(){var M=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,F=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.LineBasicMaterial;super(),this.type="Line",this.geometry=M,this.material=F,this.updateMorphTargets()}copy(M){return super.copy(M),this.material=M.material,this.geometry=M.geometry,this}computeLineDistances(){var M=this.geometry;if(!M.isBufferGeometry)M.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");else if(M.index===null){for(var F=M.attributes.position,R=[0],T=1,P=F.count;T<P;T++)f.fromBufferAttribute(F,T-1),h.fromBufferAttribute(F,T),R[T]=R[T-1],R[T]+=f.distanceTo(h);M.setAttribute("lineDistance",new c.Float32BufferAttribute(R,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(M,F){var R=this.geometry,T=this.matrixWorld,P=M.params.Line.threshold,_=R.drawRange,E=R.morphAttributes.position;if(R.boundingSphere===null&&R.computeBoundingSphere(),m.copy(R.boundingSphere),m.applyMatrix4(T),m.radius+=P,M.ray.intersectsSphere(m)!==!1){p.copy(T).invert(),v.copy(M.ray).applyMatrix4(p);var C=P/((this.scale.x+this.scale.y+this.scale.z)/3),L=C*C,I=new c.Vector3,x=new c.Vector3,O=new c.Vector3,B=new c.Vector3,D=this.isLineSegments?2:1;if(R.isBufferGeometry){var k=R.index,V=R.attributes,G=V.position;if(k!==null)for(var J=Math.max(0,_.start),j=Math.min(k.count,_.start+_.count),te=J;te<j-1;te+=D){var ee=k.getX(te),ae=k.getX(te+1);A(I,x,this,G,E,ee,ae);var H=v.distanceSqToSegment(I,x,B,O);if(!(H>L)){B.applyMatrix4(this.matrixWorld);var Z=M.ray.origin.distanceTo(B);Z<M.near||Z>M.far||F.push({distance:Z,point:O.clone().applyMatrix4(this.matrixWorld),index:te,face:null,faceIndex:null,object:this})}}else for(var $=Math.max(0,_.start),se=Math.min(G.count,_.start+_.count),z=$;z<se-1;z+=D){A(I,x,this,G,E,z,z+1);var W=v.distanceSqToSegment(I,x,B,O);if(!(W>L)){B.applyMatrix4(this.matrixWorld);var q=M.ray.origin.distanceTo(B);q<M.near||q>M.far||F.push({distance:q,point:O.clone().applyMatrix4(this.matrixWorld),index:z,face:null,faceIndex:null,object:this})}}}else R.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var M=this.geometry;if(M.isBufferGeometry){var F=M.morphAttributes,R=Object.keys(F);if(0<R.length){var T=F[R[0]];if(T!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var P,_=0,E=T.length;_<E;_++)P=T[_].name||_+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[P]=_}}}else{var C=M.morphTargets;C!==void 0&&0<C.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function A(S,M,F,R,T,P,_){S.fromBufferAttribute(R,P),M.fromBufferAttribute(R,_);var E=F.morphTargetInfluences;if(F.material.morphTargets&&T&&E){d.set(0,0,0),b.set(0,0,0);for(var C=0,L=T.length;C<L;C++){var I=E[C],x=T[C];I!==0&&(y.fromBufferAttribute(x,P),g.fromBufferAttribute(x,_),d.addScaledVector(y.sub(S),I),b.addScaledVector(g.sub(M),I))}S.add(d),M.add(b)}}w.prototype.isLine=!0},(o,l,u)=>{var c=u(4),f=new Image(128,128);f.src=u(15);var h=new c.Texture;h.image=f,h.needsUpdate=!0;var p=[.02,.03,1],v=new c.SpriteMaterial({map:h,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),m=u(5).createNewSpriteText,d=function(b){u(10).ZincObject.call(this),this.texture=h;var y=void 0,g=void 0,w=void 0,A=void 0,S=void 0,M=!0;this.morph=new c.Group,this.group=this.morph,this.parent=b,this.isMarker=!0;var F=!1;this.ndc=new c.Vector3;var R=void 0,T=void 0,P=()=>{y=new c.Sprite(v),y.center.set(.5,0),this.morph.add(y),this.morph.position.set(0,0,0),this.morph.renderOrder=1e4,y.scale.set(p[0],p[1],p[2]),y.userData=this};this.updateVisual=(_,E)=>{var C=1,L=0;_!==E&&(L=1-(this.ndc.z-_)/(E-_),C=.6+.4*L),this.setSpriteSize(C)},this.updateNDC=_=>(this.ndc.copy(this.morph.position),this.ndc.project(_),this.ndc.z=Math.min(Math.max(this.ndc.z,0),1),this.ndc),this.setPosition=(_,E,C)=>{this.morph.position.set(_,E,C)},this.setSpriteSize=_=>{y.scale.set(.015,.02,1),y.scale.multiplyScalar(_)},this.setUserSprite=()=>{A&&(this.morph.add(A),M&&(this.morph.remove(y),T&&this.morph.remove(T),M=!1))},this.setImageForUserSprite=(_,E)=>{A&&(this.morph.remove(A),A=void 0),g&&g.dispose(),w&&w.dispose(),g=new c.Texture,g.image=_,g.needsUpdate=!0,w=new c.SpriteMaterial({map:g,alphaTest:.5,transparent:!0,depthTest:!1,depthWrite:!1,sizeAttenuation:!1}),E||(E=[.05,.05,1]),A=new c.Sprite(w),A.center.set(.5,0),A.scale.set(E[0],E[1],E[2]),A.userData=this,this.setUserSprite()},this.setDefaultSprite=()=>{M||(M=!0,this.morph.add(y),A&&this.morph.remove(A),T&&this.morph.add(T))},this.loadUserSprite=(_,E)=>{if(_)if(_!==S){S=_;var C=new Image(128,128);C.crossOrigin="anonymous",C.onload=()=>{this.setImageForUserSprite(C,E)},C.src=_}else this.setUserSprite()},this.dispose=()=>{this.morph&&this.morph.clear(),y&&(y.clear(),y=void 0),T&&(T.material.map.dispose(),T.material.dispose(),T=void 0)},this.isEnabled=()=>F,this.setNumber=_=>{(!_||R!=_)&&T&&(this.morph.remove(T),T.material.map.dispose(),T.material.dispose(),T=void 0),!T&&_&&(T=m(_,.012,"black","Asap",120,700),this.morph.add(T)),R=_},this.getNumber=()=>R||1,this.setVisibility=function(_){_!==this.visible&&(this.visible=_,this.group.visible=_,this.parent.region&&(this.parent.region.pickableUpdateRequired=!0))},this.enable=()=>{F=!0,this.morph.visible=!0,this.visible=!0},this.disable=()=>{F=!1,this.morph.visible=!1,this.visible=!1},P()};d.prototype=Object.create(u(10).ZincObject.prototype),l.Marker=d},o=>{o.exports="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIiA/Pg0KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMzY1IiBoZWlnaHQ9IjU2MCIgdmlld0JveD0iMCAwIDM2NSA1NjAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGRlc2M+Q3JlYXRlZCB3aXRoIEZhYnJpYy5qcyA1LjIuNDwvZGVzYz4NCjxkZWZzPg0KPC9kZWZzPg0KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idHJhbnNwYXJlbnQiPjwvcmVjdD4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCAwKSIgaWQ9IjgwOGVkMjgzLTI1MjQtNDQwZi04OGFlLTNiZGI0N2JiNTc0OSIgID4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIDEgMTgyLjUgMjgwKSIgaWQ9ImRiMzA0MTNkLTViZmYtNGI5OC1hYjU5LTQ2NDQ5N2VlMTk5ZSIgID4NCjxyZWN0IHN0eWxlPSJzdHJva2U6IG5vbmU7IHN0cm9rZS13aWR0aDogMTsgc3Ryb2tlLWRhc2hhcnJheTogbm9uZTsgc3Ryb2tlLWxpbmVjYXA6IGJ1dHQ7IHN0cm9rZS1kYXNob2Zmc2V0OiAwOyBzdHJva2UtbGluZWpvaW46IG1pdGVyOyBzdHJva2UtbWl0ZXJsaW1pdDogNDsgZmlsbDogcmdiKDI1NSwyNTUsMjU1KTsgZmlsbC1ydWxlOiBub256ZXJvOyBvcGFjaXR5OiAxOyB2aXNpYmlsaXR5OiBoaWRkZW47IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB4PSItMTgyLjUiIHk9Ii0yODAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjM2NSIgaGVpZ2h0PSI1NjAiIC8+DQo8L2c+DQo8ZyB0cmFuc2Zvcm09Im1hdHJpeCgwIDAgMCAwIDAgOTcuNSkiICA+DQo8ZyBzdHlsZT0iIiAgID4NCjwvZz4NCjwvZz4NCjxnIHRyYW5zZm9ybT0ibWF0cml4KDAgMCAwIDAgMCA5Ny41KSIgID4NCjxnIHN0eWxlPSIiICAgPg0KPC9nPg0KPC9nPg0KPGcgdHJhbnNmb3JtPSJtYXRyaXgoMC45OSAwIDAgMC45OSAxODIuNSAyODApIiAgPg0KPGcgc3R5bGU9IiIgdmVjdG9yLWVmZmVjdD0ibm9uLXNjYWxpbmctc3Ryb2tlIiAgID4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHJlY3Qgc3R5bGU9InN0cm9rZTogbm9uZTsgc3Ryb2tlLXdpZHRoOiAxOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMjU1LDI1NSwyNTUpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IHZpc2liaWxpdHk6IGhpZGRlbjsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIHg9Ii01NDAiIHk9Ii01NDAiIHJ4PSIwIiByeT0iMCIgd2lkdGg9IjEwODAiIGhlaWdodD0iMTA4MCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgMSAwIDApIiAgPg0KPHBhdGggc3R5bGU9InN0cm9rZTogcmdiKDAsMCwwKTsgc3Ryb2tlLXdpZHRoOiAwOyBzdHJva2UtZGFzaGFycmF5OiBub25lOyBzdHJva2UtbGluZWNhcDogYnV0dDsgc3Ryb2tlLWRhc2hvZmZzZXQ6IDA7IHN0cm9rZS1saW5lam9pbjogbWl0ZXI7IHN0cm9rZS1taXRlcmxpbWl0OiA0OyBmaWxsOiByZ2IoMCw4OSwxMTYpOyBmaWxsLXJ1bGU6IG5vbnplcm87IG9wYWNpdHk6IDE7IiB2ZWN0b3ItZWZmZWN0PSJub24tc2NhbGluZy1zdHJva2UiICB0cmFuc2Zvcm09IiB0cmFuc2xhdGUoLTE4Mi45LCAtMjc5Ljg1KSIgZD0iTSAxODIuOSA1NTEuNyBDIDE4Mi45IDU1MS44MDAwMDAwMDAwMDAxIDE4My4xIDU1MiAxODMuMSA1NTIgQyAxODMuMSA1NTIgMzU4LjMgMjgzIDM1OC4zIDE5NC42IEMgMzU4LjMgNjQuNSAyNjkuNSA3LjkwMDAwMDAwMDAwMDAwNiAxODIuOSA3LjY5OTk5OTk5OTk5OTk4OSBDIDk2LjMgNy45IDcuNSA2NC41IDcuNSAxOTQuNiBDIDcuNSAyODMgMTgyLjggNTUyIDE4Mi44IDU1MiBDIDE4Mi44IDU1MiAxODIuOSA1NTEuNyAxODIuOSA1NTEuNyB6IE0gMTIyLjIgMTg3LjIgQyAxMjIuMiAxNTMuNiAxNDkuNCAxMjYuMzk5OTk5OTk5OTk5OTkgMTgzIDEyNi4zOTk5OTk5OTk5OTk5OSBDIDIxNi42IDEyNi4zOTk5OTk5OTk5OTk5OSAyNDMuOCAxNTMuNiAyNDMuOCAxODcuMiBDIDI0My44IDIyMC43OTk5OTk5OTk5OTk5OCAyMTYuNSAyNDggMTgyLjkgMjQ4IEMgMTQ5LjQgMjQ4IDEyMi4yIDIyMC44IDEyMi4yIDE4Ny4yIHoiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgLz4NCjwvZz4NCgkJPGcgdHJhbnNmb3JtPSJtYXRyaXgoMy44MiAwIDAgMy44MiAwIC0xMDAuNzcpIiAgPg0KPGNpcmNsZSBzdHlsZT0ic3Ryb2tlOiByZ2IoMCwwLDApOyBzdHJva2Utd2lkdGg6IDA7IHN0cm9rZS1kYXNoYXJyYXk6IG5vbmU7IHN0cm9rZS1saW5lY2FwOiBidXR0OyBzdHJva2UtZGFzaG9mZnNldDogMDsgc3Ryb2tlLWxpbmVqb2luOiBtaXRlcjsgc3Ryb2tlLW1pdGVybGltaXQ6IDQ7IGZpbGw6IHJnYigyNTUsMjU1LDI1NSk7IGZpbGwtcnVsZTogbm9uemVybzsgb3BhY2l0eTogMTsiIHZlY3Rvci1lZmZlY3Q9Im5vbi1zY2FsaW5nLXN0cm9rZSIgIGN4PSIwIiBjeT0iMCIgcj0iMzUiIC8+DQo8L2c+DQo8L2c+DQo8L2c+DQo8L3N2Zz4="},(o,l,u)=>{var c=u(4),f=function(h,p,v,m){u(10).ZincObject.call(this);var d;p&&(d=p.clone(),d.vertexColors=c.FaceColors),this.id=v;var b=void 0,y=void 0;this.isGlyph=!0;var g=[0,0,0];this.fromMesh=w=>!!(w&&w.isMesh)&&(this.morph=w.clone(),this.morph.userData=this,this.group.add(this.morph),!0),h&&d&&this.fromMesh(new c.Mesh(h,d)),this.getGlyphset=function(){return m},this.setLabel=w=>{w&&(typeof w=="string"||w instanceof String)&&(y=w,this.morph&&(this.morph.name=w))},this.showLabel=w=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0),y&&(typeof y=="string"||y instanceof String)&&(b=new(u(17)).Label(y,w),b.setPosition(g[0],g[1],g[2]),this.group.add(b.getSprite()))},this.hideLabel=()=>{b&&(g=b.getPosition(),this.group.remove(b.getSprite()),b.dispose(),b=void 0)},this.getLabel=()=>y,this.getMesh=()=>this.morph,this.setTransformation=(w,A,S,M)=>{this.morph&&(this.morph.matrix.elements[0]=A[0],this.morph.matrix.elements[1]=A[1],this.morph.matrix.elements[2]=A[2],this.morph.matrix.elements[3]=0,this.morph.matrix.elements[4]=S[0],this.morph.matrix.elements[5]=S[1],this.morph.matrix.elements[6]=S[2],this.morph.matrix.elements[7]=0,this.morph.matrix.elements[8]=M[0],this.morph.matrix.elements[9]=M[1],this.morph.matrix.elements[10]=M[2],this.morph.matrix.elements[11]=0,this.morph.matrix.elements[12]=w[0],this.morph.matrix.elements[13]=w[1],this.morph.matrix.elements[14]=w[2],this.morph.matrix.elements[15]=1,this.morph.matrixAutoUpdate=!1),g=[...w],b&&b.setPosition(w[0],w[1],w[2])},this.setColour=w=>{b&&b.setColour(w),this.secondaryMesh&&this.secondaryMesh.material&&(this.secondaryMesh.material.color=colour),this.geometry&&(this.geometry.colorsNeedUpdate=!0)},this.dispose=()=>{this.material&&this.material.dispose(),this.morph=void 0}};f.prototype=Object.create(u(10).ZincObject.prototype),l.Glyph=f},(o,l,u)=>{var c=u(7).default;l.Label=function(f,h){var p=f,v=void 0;v=h?new c(p,.015,h.getStyle()):new c(p,.015),v.fontFace="Asap",v.fontWeight=700,v.material.map.generateMipmaps=!1,v.material.sizeAttenuation=!1,v.center.x=-.05,v.center.y=0,this.getPosition=()=>v?[v.position.x,v.position.y,v.position.z]:[0,0,0],this.setPosition=(m,d,b)=>{v&&v.position.set(m,d,b)},this.setColour=m=>{console.log(v),m&&(v.color=m.getStyle())},this.setScale=m=>{v&&0<m&&v.scale.set(m,m,1)},this.dispose=()=>{},this.getSprite=()=>v,this.getString=()=>p}},(o,l,u)=>{var c=u(4),f=u(19).JSONLoader,h=function(){u(10).ZincObject.call(this);var p=[],v=void 0,m=void 0,d=void 0,b=void 0,y=void 0,g=void 0,w=void 0,A=0,S=0,M=[0,0,0],F=[0,0,0],R=[0,0,0],T="NONE";this.ready=!1;var P=!1,_=!1;this.isGlyphset=!0;var E=new c.Matrix4,C=new c.Color,L=new c.Color,I=new c.Box3,x=new c.Box3,O=new c.Box3,B=[],D=[],k=[],V=[],G=[],J=[],j=[];this.globalScale=1;for(var te=0;8>te;te++)new c.Vector3;this.load=(z,W,q,le,oe)=>{v=z.axis1,m=z.axis2,d=z.axis3,b=z.positions,y=z.scale,g=z.colors,w=z.label,P=z.metadata.MorphColours,_=z.metadata.MorphVertices,A=z.metadata.number_of_time_steps,T=z.metadata.repeat_mode,S=z.metadata.number_of_vertices,T=="AXES_2D"||T=="MIRROR"?S*=2:T=="AXES_3D"&&(S*=3),M=z.metadata.base_size,F=z.metadata.offset,R=z.metadata.scale_factors;var U=new f;this.geometry=new c.BufferGeometry;var N=new c.InstancedMesh(this.geometry,void 0,S);if(this.setMorph(N),le){var X=U.parse(W);se(q,oe)(X.geometry,X.materials),X.geometry.dispose()}else U.crossOrigin="Anonymous",U.load(W,se(q,oe))};var ee=(z,W,q,le,oe,U)=>{if(T=="NONE"||T=="MIRROR"){for(var N,X=[0,0,0],Y=[0,0,0],ie=[0,0,0],ue=[0,0,0],me=[0,0,0],be=[0,0,0],ce=[0,0,0],ge=[0,0,0],re=[0,0,0],he=0;3>he;he++)N=0>oe[he]?-1:1,X[he]=(N*M[he]+oe[he]*R[he])*this.globalScale;for(var he=0;3>he;he++)Y[he]=W[he]*X[0],ie[he]=q[he]*X[1],ue[he]=le[he]*X[2],me[he]=z[he]+F[0]*Y[he]+F[1]*ie[he]+F[2]*ue[he],T=="MIRROR"&&(be[he]=-Y[he],ce[he]=-ie[he],ge[he]=-ue[he],re[he]=me[he],0>oe[0]&&(me[he]-=Y[he],re[he]-=be[he]));0>ue[0]*(Y[1]*ie[2]-Y[2]*ie[1])+ue[1]*(Y[2]*ie[0]-Y[0]*ie[2])+ue[2]*(Y[0]*ie[1]-Y[1]*ie[0])&&(ue[0]=-ue[0],ue[1]=-ue[1],ue[2]=-ue[2]),U[0]=[me,Y,ie,ue],T=="MIRROR"&&(0>ge[0]*(be[1]*ce[2]-be[2]*ce[1])+ge[1]*(be[2]*ce[0]-be[0]*ce[2])+ge[2]*(be[0]*ce[1]-be[1]*ce[0])&&(ge[0]=-ge[0],ge[1]=-ge[1],ge[2]=-ge[2]),U[1]=[re,be,ce,ge])}else if(T=="AXES_2D"||T=="AXES_3D"){for(var N,ve=[0,0,0],Ee=[0,0,0],he=0;3>he;he++)N=0>oe[he]?-1:1,ve[he]=(N*M[0]+oe[he]*R[0])*this.globalScale;for(var he=0;3>he;he++)Ee[he]=z[he]+F[0]*ve[0]*W[he]+F[1]*ve[1]*q[he]+F[2]*ve[2]*le[he];for(var _e=glyph_repeat_mode=="AXES_2D"?2:3,Ne=0;Ne<_e;Ne++){var Je=void 0,ze=void 0,st=oe[Ne],Ce=[0,0,0],je=[0,0,0],He=[0,0,0];Ne==0?(Je=W,ze=q):Ne==1?(Je=q,ze=glyph_repeat_mode=="AXES_2D"?W:le):(Je=le,ze=W);var Pt=(M[0]+st*R[0])*this.globalScale;Ce[0]=Je[0]*Pt,Ce[1]=Je[1]*Pt,Ce[2]=Je[2]*Pt,He[0]=Ce[1]*ze[2]-ze[1]*Ce[2],He[1]=Ce[2]*ze[0]-ze[2]*Ce[0],He[2]=Ce[0]*ze[1]-Ce[1]*ze[0];var It=Math.sqrt(He[0]*He[0]+He[1]*He[1]+He[2]*He[2]);if(0<It){var mt=(M[2]+st*R[2])*this.globalScale/It;T=="AXES_2D"&&0<Ne&&(mt*=-1),He[0]*=mt,He[1]*=mt,He[2]*=mt}if(je[0]=He[1]*Ce[2]-Ce[1]*He[2],je[1]=He[2]*Ce[0]-Ce[2]*He[0],je[2]=He[0]*Ce[1]-He[1]*Ce[0],It=Math.sqrt(je[0]*je[0]+je[1]*je[1]+je[2]*je[2]),0<It){var bt=(M[1]+st*R[1])*this.globalScale/It;je[0]*=bt,je[1]*=bt,je[2]*=bt}U[Ne]=[Ee,Ce,je,He]}}return U},ae=(z,W,q,le,oe)=>{var U=1;T=="AXES_2D"||T=="MIRROR"?U=2:T=="AXES_3D"&&(U=3);var N=z.length/3,X=0;j.length=U;for(var Y=0;Y<N;Y++){var ie=3*Y,ue=[z[ie],z[ie+1],z[ie+2]],me=[W[ie],W[ie+1],W[ie+2]],be=[q[ie],q[ie+1],q[ie+2]],ce=[le[ie],le[ie+1],le[ie+2]],ge=[oe[ie],oe[ie+1],oe[ie+2]],re=ee(ue,me,be,ce,ge,j);if(re.length==U)for(var he=0;he<U;he++){E.elements[0]=re[he][1][0],E.elements[1]=re[he][1][1],E.elements[2]=re[he][1][2],E.elements[3]=0,E.elements[4]=re[he][2][0],E.elements[5]=re[he][2][1],E.elements[6]=re[he][2][2],E.elements[7]=0,E.elements[8]=re[he][3][0],E.elements[9]=re[he][3][1],E.elements[10]=re[he][3][2],E.elements[11]=0,E.elements[12]=re[he][0][0],E.elements[13]=re[he][0][1],E.elements[14]=re[he][0][2],E.elements[15]=1,this.morph.setMatrixAt(X,E);var ve=p[X];ve&&ve.setTransformation(re[he][0],re[he][1],re[he][2],re[he][3]),X++}}this.morph.instanceMatrix.needsUpdate=!0},H=z=>{var W=1;T=="AXES_2D"||T=="MIRROR"?W=2:T=="AXES_3D"&&(W=3);for(var q,le=z.length,oe=0,U=0;U<le;U++){q=z[U];for(var N=0;N<W;N++){C.setHex(q),this.morph.setColorAt(oe,C);var X=p[oe];X&&X.setColour(C),oe++}}this.morph.instanceColor.needsUpdate=!0},Z=()=>{var z=B,W=D,q=k,le=V,oe=G,U=J,N=this.inbuildTime/this.duration*(A-1),X=Math.floor(N),Y=1-(N-X),ie=Math.ceil(N);if(_){var ue=b[X.toString()],me=b[ie.toString()],be=v[X.toString()],ce=v[ie.toString()],ge=m[X.toString()],re=m[ie.toString()],he=d[X.toString()],ve=d[ie.toString()],Ee=y[X.toString()],_e=y[ie.toString()];B.length=ue.length,D.length=ue.length,k.length=ue.length,V.length=ue.length,G.length=ue.length;for(var Ne=0;Ne<ue.length;Ne++)z[Ne]=Y*ue[Ne]+(1-Y)*me[Ne],W[Ne]=Y*be[Ne]+(1-Y)*ce[Ne],q[Ne]=Y*ge[Ne]+(1-Y)*re[Ne],le[Ne]=Y*he[Ne]+(1-Y)*ve[Ne],oe[Ne]=Y*Ee[Ne]+(1-Y)*_e[Ne]}else z=b[0],W=v[0],q=m[0],le=d[0],oe=y[0];if(ae(z,W,q,le,oe),this.boundingBoxUpdateRequired=!0,g!=null){if(P){var Je=g[X.toString()],ze=g[ie.toString()];U.length=Je.length;for(var st=0;st<Je.length;st++)C.setHex(Je[st]),L.setHex(ze[st]),C.setRGB(C.r*Y+L.r*(1-Y),C.g*Y+L.g*(1-Y),C.b*Y+L.b*(1-Y)),U[st]=C.getHex()}else U=g[0];H(U)}};this.showLabel=()=>{for(var z=0;z<p.length;z++)p[z].showLabel(this.morph.material?this.morph.material.color:void 0)},this.hideLabel=()=>{for(var z=0;z<p.length;z++)p[z].hideLabel()};var $=z=>{for(var W=0;W<S;W++){var q=new(u(16)).Glyph(void 0,void 0,W,this),le=w?w[W]:void 0;le=le||this.groupName,le&&q.setLabel(le),0<A&&q.setFrustumCulled(!1),p[W]=q,this.morph.add(q.getGroup())}z&&this.showLabel(),ae(b[0],v[0],m[0],d[0],y[0]),g!=null&&H(g[0]),this.ready=!0,this.boundingBoxUpdateRequired=!0};this.addCustomGlyph=z=>{z.isGlyph&&p.push(z),this.ready=!0,this.boundingBoxUpdateRequired=!0},this.addMeshAsGlyph=(z,W)=>{if(z.isMesh){var q=new(u(16)).Glyph(void 0,void 0,W,this);return q.fromMesh(z),p.push(q),this.morph.add(q.getGroup()),this.ready=!0,this.boundingBoxUpdateRequired=!0,q}},this.forEachGlyph=z=>{for(var W=0;W<p.length;W++)z(p[W])};var se=(z,W)=>(q,le)=>{var oe=q.toBufferGeometry();this.geometry.copy(oe),this.geometry.computeBoundingSphere(),this.geometry.computeBoundingBox(),oe.dispose(),le&&le[0]&&(this.morph.material=le[0]),$(W),this.morph.name=this.groupName,this.morph.userData=this,this.setMorph(this.morph),q.dispose(),z!=null&&typeof z=="function"&&z(this)};this.getClosestVertexIndex=function(){var z=-1;if(this.morph&&this.ready){this.getBoundingBox().getCenter(this._v1);for(var W,q=b[0],le=q.length/3,oe=-1,U=0,N=0;N<le;N++)W=3*N,this._v2.set(q[W],q[W+1],q[W+2]),U=this._v1.distanceTo(this._v2),(oe==-1||oe>U)&&(oe=U,z=N)}return z},this.getClosestVertex=function(){if(this.closestVertexIndex==-1&&(this.closestVertexIndex=this.getClosestVertexIndex()),0<=this.closestVertexIndex&&this.morph){var z=new c.Vector3;return this.morph.getMatrixAt(this.closestVertexIndex,E),z.setFromMatrixPosition(E),z}},this.getBoundingBox=()=>{if(this.morph&&this.ready&&this.morph.visible){if(this.boundingBoxUpdateRequired){I.setFromBufferAttribute(this.morph.geometry.attributes.position);for(var z=0;z<S;z++)this.morph.getMatrixAt(z,E),x.copy(I).applyMatrix4(E),z==0?O.copy(x):O.union(x);if(O)this.cachedBoundingBox.copy(O),this.morph.updateWorldMatrix(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1;else return}return this.cachedBoundingBox}},this.setMorphTime=z=>{this.inbuildTime=z>this.duration?this.duration:0>z?0:z,(P||_)&&(Z(),_&&(this.markerUpdateRequired=!0))},this.isTimeVarying=()=>!!((this.ready===!1||0<A)&&(P||_)),this.getCurrentTime=()=>this.inbuildTime,this.setScaleAll=function(z){this.globalScale=z,Z()},this.dispose=()=>{for(var z=p.length-1;0<=z;z--)p[z].dispose();this.geometry&&this.geometry.dispose(),this.morph&&this.morph.material.dispose(),v=void 0,m=void 0,d=void 0,b=void 0,y=void 0,g=void 0,this.ready=!1,this.groupName=void 0},this.render=(z,W,q)=>{if(W==!0){var le=this.inbuildTime+z;le>this.duration&&(le-=this.duration),this.inbuildTime=le,(P||_)&&Z()}this.updateMarker(W,q)}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Glyphset=h},(o,l,u)=>{u.r(l),u.d(l,{JSONLoader:()=>M});var c=u(4),f=u(20).Loader,h=c.LoaderUtils,p=c.AnimationClip,v=c.Vector3,m=c.Vector4,d=c.Color,b=c.Vector2,y=u(6).Face3,g=u(6).Geometry,w=c.FileLoader,A=c.DefaultLoadingManager,S=u(21).VideoHandler;function M(F){typeof F=="boolean"&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),F=void 0),this.manager=F===void 0?A:F,this.withCredentials=!1,this.paramsString=""}Object.assign(M.prototype,{load:function(R,T,P,_){var E=this,C=this.texturePath&&typeof this.texturePath=="string"?this.texturePath:h.extractUrlBase(R),L=new w(this.manager);R.split("?"),this.paramsString=R.length===2?paramsStrings[1]:"",L.setWithCredentials(this.withCredentials),L.load(R,function(I){var x;try{x=JSON.parse(I)}catch{if(console.error("The loader has encountered an error while parsing the content of a resource."),_)return void _({responseURL:R})}var O=x.metadata;if(O!==void 0){var B=O.type;if(B!==void 0&&B.toLowerCase()==="object")return void console.error("THREE.JSONLoader: "+R+" should be loaded with THREE.ObjectLoader instead.")}if(E&&E.parse)try{var D=E.parse(x,C);T(D.geometry,D.materials)}catch(k){if(console.error("The loader has encountered aon loading the geometry"),console.error(k),_)return void _({responseURL:R})}},P,_)},setTexturePath:function(R){this.texturePath=R},parse:function(){function F(_,E){function C(he,ve){return he&1<<ve}var L,I,x,O,B,D,k,V,G,J,j,te,ee,ae,H,Z,$,se,z,W,q,le,oe,U,N,X,Y,ie=_.faces,ue=_.vertices,me=_.normals,be=_.colors,ce=_.scale,ge=0;if(_.uvs!==void 0){for(L=0;L<_.uvs.length;L++)_.uvs[L].length&&ge++;for(L=0;L<ge;L++)E.faceVertexUvs[L]=[]}for(O=0,B=ue.length;O<B;)se=new v,se.x=ue[O++]*ce,se.y=ue[O++]*ce,se.z=ue[O++]*ce,E.vertices.push(se);if(O=0,B=ie.length,_.uvs)for(L=0;L<_.uvs.length;L++){E.uvs[L]=[];for(var re=0;re<_.uvs[L].length;re++)E.uvs[L][re]=_.uvs[L][re]}if(me)for(L=0;L<me.length;L++)E.normals[L]=me[L];if(be)for(L=0;L<be.length;L++)E.colors[L]=be[L];for(;O<B;)if(J=ie[O++],j=C(J,0),te=C(J,1),ee=C(J,3),ae=C(J,4),H=C(J,5),Z=C(J,6),$=C(J,7),j){if(W=new y,W.a=ie[O],W.b=ie[O+1],W.c=ie[O+3],q=new y,q.a=ie[O+1],q.b=ie[O+2],q.c=ie[O+3],O+=4,te&&(G=ie[O++],W.materialIndex=G,q.materialIndex=G),x=E.faces.length,ee)for(L=0;L<ge;L++)for(U=_.uvs[L],E.faceVertexUvs[L][x]=[],E.faceVertexUvs[L][x+1]=[],I=0;4>I;I++)V=ie[O++],X=U[2*V],Y=U[2*V+1],N=new b(X,Y),I!==2&&E.faceVertexUvs[L][x].push(N),I!==0&&E.faceVertexUvs[L][x+1].push(N);if(ae&&(k=3*ie[O++],W.normal.set(me[k++],me[k++],me[k]),q.normal.copy(W.normal)),H)for(L=0;4>L;L++)k=3*ie[O++],oe=new v(me[k++],me[k++],me[k]),L!==2&&W.vertexNormals.push(oe),L!==0&&q.vertexNormals.push(oe);if(Z&&(D=ie[O++],le=be[D],W.color.setHex(le),q.color.setHex(le)),$)for(L=0;4>L;L++)D=ie[O++],le=be[D],L!==2&&W.vertexColors.push(new d(le)),L!==0&&q.vertexColors.push(new d(le));E.faces.push(W),E.faces.push(q)}else{if(z=new y,z.a=ie[O++],z.b=ie[O++],z.c=ie[O++],te&&(G=ie[O++],z.materialIndex=G),x=E.faces.length,ee)for(L=0;L<ge;L++)for(U=_.uvs[L],E.faceVertexUvs[L][x]=[],I=0;3>I;I++)V=ie[O++],X=U[2*V],Y=U[2*V+1],N=new b(X,Y),E.faceVertexUvs[L][x].push(N);if(ae&&(k=3*ie[O++],z.normal.set(me[k++],me[k++],me[k])),H)for(L=0;3>L;L++)k=3*ie[O++],oe=new v(me[k++],me[k++],me[k]),z.vertexNormals.push(oe);if(Z&&(D=ie[O++],z.color.setHex(be[D])),$)for(L=0;3>L;L++)D=ie[O++],z.vertexColors.push(new d(be[D]));E.faces.push(z)}}function R(_,E){var C=_.influencesPerVertex===void 0?2:_.influencesPerVertex;if(_.skinWeights)for(var L=0,I=_.skinWeights.length;L<I;L+=C){var x=_.skinWeights[L],O=1<C?_.skinWeights[L+1]:0,B=2<C?_.skinWeights[L+2]:0,D=3<C?_.skinWeights[L+3]:0;E.skinWeights.push(new m(x,O,B,D))}if(_.skinIndices)for(var L=0,I=_.skinIndices.length;L<I;L+=C){var k=_.skinIndices[L],V=1<C?_.skinIndices[L+1]:0,G=2<C?_.skinIndices[L+2]:0,J=3<C?_.skinIndices[L+3]:0;E.skinIndices.push(new m(k,V,G,J))}E.bones=_.bones,E.bones&&0<E.bones.length&&(E.skinWeights.length!==E.skinIndices.length||E.skinIndices.length!==E.vertices.length)&&console.warn("When skinning, number of vertices ("+E.vertices.length+"), skinIndices ("+E.skinIndices.length+"), and skinWeights ("+E.skinWeights.length+") should match.")}function T(_,E){var C=_.scale;if(_.morphTargets!==void 0)for(var L=0,I=_.morphTargets.length;L<I;L++){E.morphTargets[L]={},E.morphTargets[L].name=_.morphTargets[L].name,E.morphTargets[L].vertices=[];for(var x,O=E.morphTargets[L].vertices,B=_.morphTargets[L].vertices,D=0,k=B.length;D<k;D+=3)x=new v,x.x=B[D]*C,x.y=B[D+1]*C,x.z=B[D+2]*C,O.push(x)}if(_.morphNormals!==void 0){for(var L=0,I=_.morphNormals.length;L<I;L++)if(E.morphTargets[L]){E.morphTargets[L].normals=[];for(var V,G=E.morphTargets[L].normals,J=_.morphNormals[L].normals,D=0,k=J.length;D<k;D+=3)V=new v,V.x=J[D],V.y=J[D+1],V.z=J[D+2],G.push(V);E.morphNormalsReady=!0}}if(_.morphColors!==void 0){var L,I,j,te,ee,ae,H;for(L=0,I=_.morphColors.length;L<I;L++)for(E.morphColors[L]={},E.morphColors[L].name=_.morphColors[L].name,E.morphColors[L].colors=[],ee=E.morphColors[L].colors,ae=_.morphColors[L].colors,j=0,te=ae.length;j<te;j+=3)H=new c.Color(16755200),H.setRGB(ae[j],ae[j+1],ae[j+2]),ee.push(H)}}function P(_,E){var C=[],L=[];_.animation!==void 0&&L.push(_.animation),_.animations!==void 0&&(_.animations.length?L=L.concat(_.animations):L.push(_.animations));for(var I,x=0;x<L.length;x++)I=p.parseAnimation(L[x],E.bones),I&&C.push(I);if(E.morphTargets){var O=p.CreateClipsFromMorphTargetSequences(E.morphTargets,10);C=C.concat(O)}0<C.length&&(E.animations=C)}return function(_,E){_.data!==void 0&&(_=_.data),_.scale=_.scale===void 0?1:1/_.scale;var C=new g;if(C.morphColors=[],F(_,C),R(_,C),T(_,C),P(_,C),C.computeFaceNormals(),C.computeBoundingSphere(),_.materials===void 0||_.materials.length===0)return{geometry:C};var L=f.prototype.initMaterials(_.materials,E,"Anonymous");if(_.materials[0].video){var I=E+_.materials[0].video;this.paramsString&&(I+="?".concat(this.paramsString));var x=new S(I);C._video=x}return L&&0<L.length&&(L[0].side=_.materials[0].singleSided?c.FrontSide:_.materials[0].flipSided?c.BackSide:c.DoubleSide,_.materials[0].specularCoef&&(L[0].shininess=Math.floor(_.materials[0].specularCoef/3))),{geometry:C,materials:L}}}()})},(o,l,u)=>{u.r(l),u.d(l,{Loader:()=>f});var c=u(4);u(4);function f(){}f.Handlers={handlers:[],add:function(p,v){this.handlers.push(p,v)},get:function(p){for(var v=this.handlers,m=0,d=v.length;m<d;m+=2){var b=v[m],y=v[m+1];if(b.test(p))return y}return null}},Object.assign(f.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(p,v,m){for(var d=[],b=0;b<p.length;++b)d[b]=this.createMaterial(p[b],v,m);return d},createMaterial:function(){var h={NoBlending:c.NoBlending,NormalBlending:c.NormalBlending,AdditiveBlending:c.AdditiveBlending,SubtractiveBlending:c.SubtractiveBlending,MultiplyBlending:c.MultiplyBlending,CustomBlending:c.CustomBlending},p=new c.Color,v=new c.TextureLoader,m=new c.MaterialLoader;return function(d,b,y){function g(F,R,T,P,_){var E,C=b+F,L=f.Handlers.get(C);L===null?(v.setCrossOrigin(y),E=v.load(C)):E=L.load(C),R!==void 0&&(E.repeat.fromArray(R),R[0]!==1&&(E.wrapS=c.RepeatWrapping),R[1]!==1&&(E.wrapT=c.RepeatWrapping)),T!==void 0&&E.offset.fromArray(T),P!==void 0&&(P[0]==="repeat"&&(E.wrapS=c.RepeatWrapping),P[0]==="mirror"&&(E.wrapS=c.MirroredRepeatWrapping),P[1]==="repeat"&&(E.wrapT=c.RepeatWrapping),P[1]==="mirror"&&(E.wrapT=c.MirroredRepeatWrapping)),_!==void 0&&(E.anisotropy=_);var I=c.MathUtils.generateUUID();return w[I]=E,I}var w={},A={uuid:c.MathUtils.generateUUID(),type:"MeshLambertMaterial"};for(var S in d){var M=d[S];switch(S){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":A.name=M;break;case"blending":A.blending=h[M];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",S,"is no longer supported.");break;case"colorDiffuse":A.color=p.fromArray(M).getHex();break;case"colorSpecular":A.specular=p.fromArray(M).getHex();break;case"colorEmissive":A.emissive=p.fromArray(M).getHex();break;case"specularCoef":A.shininess=M;break;case"shading":M.toLowerCase()==="basic"&&(A.type="MeshBasicMaterial"),M.toLowerCase()==="phong"&&(A.type="MeshPhongMaterial"),M.toLowerCase()==="standard"&&(A.type="MeshStandardMaterial");break;case"mapDiffuse":A.map=g(M,d.mapDiffuseRepeat,d.mapDiffuseOffset,d.mapDiffuseWrap,d.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":A.emissiveMap=g(M,d.mapEmissiveRepeat,d.mapEmissiveOffset,d.mapEmissiveWrap,d.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":A.lightMap=g(M,d.mapLightRepeat,d.mapLightOffset,d.mapLightWrap,d.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":A.aoMap=g(M,d.mapAORepeat,d.mapAOOffset,d.mapAOWrap,d.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":A.bumpMap=g(M,d.mapBumpRepeat,d.mapBumpOffset,d.mapBumpWrap,d.mapBumpAnisotropy);break;case"mapBumpScale":A.bumpScale=M;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":A.normalMap=g(M,d.mapNormalRepeat,d.mapNormalOffset,d.mapNormalWrap,d.mapNormalAnisotropy);break;case"mapNormalFactor":A.normalScale=M;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":A.specularMap=g(M,d.mapSpecularRepeat,d.mapSpecularOffset,d.mapSpecularWrap,d.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":A.metalnessMap=g(M,d.mapMetalnessRepeat,d.mapMetalnessOffset,d.mapMetalnessWrap,d.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":A.roughnessMap=g(M,d.mapRoughnessRepeat,d.mapRoughnessOffset,d.mapRoughnessWrap,d.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":A.alphaMap=g(M,d.mapAlphaRepeat,d.mapAlphaOffset,d.mapAlphaWrap,d.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":A.side=c.BackSide;break;case"doubleSided":A.side=c.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),A.opacity=M;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":A[S]=M;break;case"vertexColors":M===!0&&(A.vertexColors=c.VertexColors),M==="face"&&(A.vertexColors=c.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",S,M)}}return A.type==="MeshBasicMaterial"&&delete A.emissive,A.type!=="MeshPhongMaterial"&&delete A.specular,1>A.opacity&&(A.transparent=!0),m.setTextures(w),m.parse(A)}}()})},(o,l,u)=>{var c=u(4);l.VideoHandler=function(f){var h=this;this.video=void 0,this.videoTexture=void 0,this.setMorphTime=function(p,v){var m=p/v*h.video.duration;h.video.currentTime=m},this.getVideoDuration=function(){return h.video.duration},this.createCanvasVideoTexture=function(){return h.videoTexture=new c.VideoTexture(h.video),h.videoTexture.minFilter=c.LinearFilter,h.videoTexture.magFilter=c.LinearFilter,h.videoTexture.format=c.RGBFormat,h.video.currentTime=0,h.videoTexture},this.getCurrentTime=function(p){return h.video?p*(h.video.currentTime/h.video.duration):0},this.isReadyToPlay=function(){return!!(h.video&&3<=h.video.readyState)},function(){document&&(h.video=document.createElement("video"),h.video.crossOrigin="anonymous",h.video.src=f,h.video.load(),h.video.loop=!0)}()}},(o,l,u)=>{var c=u(4),f=u(23).Points,h=u(5).toBufferGeometry,p=u(5).getCircularTexture,v=u(17).Label,m=function(){u(10).ZincObject.call(this),this.isPointset=!0;var d=[];this.createMesh=(y,g,w)=>{if(y&&g){var A=h(y,w),S=p();g.map=S;var M=new f(A,g);this.setMesh(M,w.localTimeEnabled,w.localMorphColour)}};var b=(y,g,w,A)=>{if(w){var S=new c.Color(A),M=new v(w,S);M.setPosition(g[0],g[1],g[2]);var F=M.getSprite();F.material.sizeAttenuation=!1,F.material.alphaTest=.5,F.material.transparent=!0,F.material.depthWrite=!1,F.material.depthTest=!1,this.group.add(F),d[y]=M}};this.addPoints=(y,g,w)=>{if(y&&0<y.length){var A=this.drawRange-1,S=this.addVertices(y),M=this.getMorph();if(!M){var F=new c.PointsMaterial({alphaTest:.5,size:10,color:w,sizeAttenuation:!1});S.colorsNeedUpdate=!0,this.createMesh(S,F,{localTimeEnabled:!1,localMorphColour:!1})}var R=A+y.length,T=0;if(Array.isArray(g)&&g.length===y.length||typeof g=="string")for(A;A+T<R;){var P=typeof g=="string"?g:g[T];b(T,y[T],P,w),T++}this.region&&(this.region.pickableUpdateRequired=!0)}},this.setColourHex=function(y){this._lod._material.color.setHex(y),this._lod._secondaryMaterial&&this._lod._secondaryMaterial.color.setHex(y);for(var g=0;g<d.length;g++)d[g]&&d[g].setColour(this._lod._material.color)},this.setColour=y=>{this._lod.setColour(y);for(var g=0;g<d.length;g++)d[g]&&d[g].setColour(this._lod._material.color)},this.setSize=y=>{this.morph&&this.morph.material&&(this.morph.material.size=y,this.morph.material.needsUpdate=!0)},this.setSizeAttenuation=y=>{this.morph&&this.morph.material&&(this.morph.material.sizeAttenuation=y,this.morph.material.needsUpdate=!0)},this.getVerticesByIndex=function(y){if(0<=y&&this.drawRange>y){var g=this.getMorph().geometry.getAttribute("position");return[g.getX(y),g.getY(y),g.getZ(y)]}},this.editVertices=function(y,g){if(y&&y.length){var w=this.getMorph(),A=g+y.length-1;if(!w||0>g||A>=this.drawRange)return;var S=w.geometry.getAttribute("position"),M=g;y.forEach(F=>{var R=d[M];R&&R.setPosition(F[0],F[1],F[2]),S.setXYZ(M++,F[0],F[1],F[2])}),S.needsUpdate=!0,this.boundingBoxUpdateRequired=!0}},this.render=(y,g,w,A)=>{this.morph&&w&&(this.morph.sizePerPixel=w.pixelHeight),m.prototype.render.call(this,y,g,w,A)}};m.prototype=Object.create(u(10).ZincObject.prototype),l.Pointset=m},(o,l,u)=>{u.r(l),u.d(l,{Points:()=>b});var c=u(4),f=new c.Matrix4,h=new c.Ray,p=new c.Sphere,v=new c.Vector3,m=new c.Vector3,d=new c.Vector3;class b extends c.Object3D{constructor(){var A=0<arguments.length&&arguments[0]!==void 0?arguments[0]:new c.BufferGeometry,S=1<arguments.length&&arguments[1]!==void 0?arguments[1]:new c.PointsMaterial;super(),this.type="Points",this.geometry=A,this.material=S,this.sizePerPixel=1,this.updateMorphTargets()}copy(A){return super.copy(A),this.material=A.material,this.geometry=A.geometry,this}raycast(A,S){var M=this.geometry,F=this.matrixWorld,R=A.params.Points.threshold,T=M.drawRange;if(M.boundingSphere===null&&M.computeBoundingSphere(),p.copy(M.boundingSphere),p.applyMatrix4(F),p.radius+=R,A.ray.intersectsSphere(p)!==!1){f.copy(F).invert(),h.copy(A.ray).applyMatrix4(f);var P=R/((this.scale.x+this.scale.y+this.scale.z)/3)*this.material.size*this.sizePerPixel,_=P*P;if(M.isBufferGeometry){var E=M.index,C=M.attributes,L=C.position,I=M.morphAttributes.position;if(E!==null)for(var x,O=Math.max(0,T.start),B=Math.min(E.count,T.start+T.count),D=O;D<B;D++)x=E.getX(D),g(this,L,I,x),y(v,x,_,F,A,S,this);else for(var k=Math.max(0,T.start),V=Math.min(L.count,T.start+T.count),G=k;G<V;G++)g(this,L,I,G),y(v,G,_,F,A,S,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}updateMorphTargets(){var A=this.geometry;if(A.isBufferGeometry){var S=A.morphAttributes,M=Object.keys(S);if(0<M.length){var F=S[M[0]];if(F!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var R,T=0,P=F.length;T<P;T++)R=F[T].name||T+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[R]=T}}}else{var _=A.morphTargets;_!==void 0&&0<_.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}b.prototype.isPoints=!0;function y(w,A,S,M,F,R,T){var P=h.distanceSqToPoint(w);if(P<S){var _=new c.Vector3;h.closestPointToPoint(w,_),_.applyMatrix4(M);var E=F.ray.origin.distanceTo(_);if(E<F.near||E>F.far)return;R.push({distance:E,distanceToRay:Math.sqrt(P),point:_,index:A,face:null,object:T})}}function g(w,A,S,M){v.fromBufferAttribute(A,M);var F=w.morphTargetInfluences;if(w.material.morphTargets&&S&&F){m.set(0,0,0);for(var R=0,T=S.length;R<T;R++){var P=F[R],_=S[R];P!==0&&(d.fromBufferAttribute(_,M),m.addScaledVector(d.sub(v),P))}v.add(m)}}},(o,l,u)=>{var c=u(4),f=u(5).toBufferGeometry,h=function(){u(10).ZincObject.call(this),this.isLines=!0,this.createLineSegment=(p,v,m)=>{if(p&&v){var d=f(p,m);m.localMorphColour&&d.morphAttributes.color&&(v.onBeforeCompile=u(9).augmentMorphColor());var b=new(u(12)).LineSegments(d,v);this.setMesh(b,m.localTimeEnabled,m.localMorphColour)}},this.setWidth=p=>{this.morph&&this.morph.material&&(this.morph.material.linewidth=p,this.morph.material.needsUpdate=!0)},this.addLines=(p,v)=>{if(p&&0<p.length){var m=this.addVertices(p),d=this.getMorph();if(!d){var b=new c.LineBasicMaterial({color:v});m.colorsNeedUpdate=!0,this.createLineSegment(m,b,{localTimeEnabled:!1,localMorphColour:!1})}this.region&&(this.region.pickableUpdateRequired=!0)}}};h.prototype=Object.create(u(10).ZincObject.prototype),l.Lines=h},(o,l,u)=>{function c(v,m,d,b,y,g,w){try{var A=v[g](w),S=A.value}catch(M){return void d(M)}A.done?m(S):Promise.resolve(S).then(b,y)}function f(v){return function(){var m=this,d=arguments;return new Promise(function(b,y){function g(S){c(A,b,y,g,w,"next",S)}function w(S){c(A,b,y,g,w,"throw",S)}var A=v.apply(m,d);g(void 0)})}}var h=u(4),p=function(){var v=this;u(26).Texture.call(this),this.isTextureArray=!0,this.loadFromImages=function(){var m=f(function*(d){var b=1,y=1,g=0;if(d&&d.length){v.isLoading=!0;var w=new Image;w.crossOrigin="Anonymous";for(var A,S=document.createElement("canvas"),M=0,F=Array(d.length),R=0;R<d.length;R++)A=yield v.imageToUint8Array(v,w,d[R],S),A&&A.array&&(b=A.width,y=A.height,F[g]=A.array,M+=F[g].length,g++);var T=new Uint8Array(M);M=0,F.forEach(P=>{T.set(P,M),M+=P.length}),v.impl=new h.DataTexture2DArray(T,b,y,g),v.size={width:b,height:y,depth:g},v.isLoading=!1,v.impl.needsUpdate=!0}});return function(){return m.apply(this,arguments)}}(),this.getMaterial=m=>{if(this.impl){var d;if(!m)d=new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide});else if(m.vs&&m.fs){var b=!0;"transparent"in m&&(b=m.transparent);var y=h.FrontSide;m.side&&(y=m.side),d=new h.ShaderMaterial({transparent:b,uniforms:m.uniforms,vertexShader:m.vs,fragmentShader:m.fs,side:y}),m.glslVersion&&(d.glslVersion=m.glslVersion)}if(d)return d.needsUpdate=!0,d}}};p.prototype=Object.create(u(26).Texture.prototype),l.TextureArray=p},(o,l,u)=>{function c(v,m,d,b,y,g,w){try{var A=v[g](w),S=A.value}catch(M){return void d(M)}A.done?m(S):Promise.resolve(S).then(b,y)}function f(v){return function(){var m=this,d=arguments;return new Promise(function(b,y){function g(S){c(A,b,y,g,w,"next",S)}function w(S){c(A,b,y,g,w,"throw",S)}var A=v.apply(m,d);g(void 0)})}}var h=u(4),p=function(){this.isTexture=!0,this.impl=void 0,this.isLoading=!1,this.size={width:1,height:1,depth:0}};p.prototype.loadImage=function(v,m){return new Promise((d,b)=>{v.onload=()=>d(v),v.onerror=b,v.src=m})},p.prototype.imageToUint8Array=function(){var v=f(function*(m,d,b,y){yield m.loadImage(d,b),y.width=d.width,y.height=d.height;var g=y.getContext("2d");return g.drawImage(d,0,0),{array:new Uint8Array(g.getImageData(0,0,y.width,y.height).data.buffer),width:y.width,height:y.height}});return function(){return v.apply(this,arguments)}}(),p.prototype.loadFromImages=function(){var v=f(function*(){});return function(){return v.apply(this,arguments)}}(),p.prototype.isReady=function(){return!(!this.impl||this.isLoading)},p.prototype.getMaterial=function(){if(this.impl)return new h.MeshBasicMaterial({color:new h.Color(1,1,1),transparent:!1,opacity:1,map:this.impl,side:h.DoubleSide})},l.Texture=p},(o,l,u)=>{function c(y,g){var w=Object.keys(y);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(y);g&&(A=A.filter(function(S){return Object.getOwnPropertyDescriptor(y,S).enumerable})),w.push.apply(w,A)}return w}function f(y){for(var g,w=1;w<arguments.length;w++)g=arguments[w]==null?{}:arguments[w],w%2?c(Object(g),!0).forEach(function(A){h(y,A,g[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):c(Object(g)).forEach(function(A){Object.defineProperty(y,A,Object.getOwnPropertyDescriptor(g,A))});return y}function h(y,g,w){return(g=p(g))in y?Object.defineProperty(y,g,{value:w,enumerable:!0,configurable:!0,writable:!0}):y[g]=w,y}function p(y){var g=v(y,"string");return typeof g=="symbol"?g:g+""}function v(y,g){if(typeof y!="object"||!y)return y;var w=y[Symbol.toPrimitive];if(w!==void 0){var A=w.call(y,g||"default");if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(y)}var m=u(4),d=u(28),b=function(y){u(29).TexturePrimitive.call(this,y),this.isTextureSlides=!0;var g=[],w={};this.morph=new m.Group,this.group=this.morph,this.morph.userData=this;var A=void 0,S=!0;this.createSlides=R=>{R.forEach(T=>this.createSlide(T))};var M=(R,T)=>{var P=R.material,_=P.uniforms;switch(R.rotation.x=0,R.rotation.y=0,R.rotation.z=0,R.position.x=0,R.position.y=0,R.position.z=0,T.direction){case"x":var E=-Math.PI/2;R.rotation.y=E,_.direction.value=1,_.slide.value.set(T.value,0,0),R.position.x=T.value;break;case"y":R.rotation.x=Math.PI/2,_.direction.value=2,_.slide.value.set(0,T.value,0),R.position.y=T.value;break;case"z":_.direction.value=3,_.slide.value.set(0,0,T.value),R.position.z=T.value;break}P.needsUpdate=!0,this.boundingBoxUpdateRequired=!0};this.modifySlideSettings=R=>{R&&R.id&&R.id in w&&w[R.id]&&M(w[R.id],R)},this.createSlide=R=>{if(this.texture&&this.texture.isTextureArray&&this.texture.isReady()&&R&&R.direction&&R.value!==void 0){var T=new m.PlaneGeometry(1,1);T.translate(.5,.5,0);var P=d.getUniforms();P.diffuse.value=this.texture.impl,P.depth.value=this.texture.size.depth,P.flipY.value=S;var _={fs:d.fs,vs:d.vs,uniforms:P,glslVersion:d.glslVersion,side:m.DoubleSide,transparent:!1},E=this.texture.getMaterial(_);E.needsUpdate=!0;var C=new m.Mesh(T,E);C.name=this.groupName,C.userData=this;var L={value:R.value,direction:R.direction,id:C.id};return g.push(L),M(C,L),w[C.id]=C,this.morph.add(C),this.boundingBoxUpdateRequired=!0,L}},this.getTextureSettings=()=>[...g],this.getTextureSettingsWithId=R=>{for(var T=0;T<g.length;T++)if(R===g[T].id)return f({},g[T])},this.getSlides=()=>this.morph?[...this.morph.children]:[],this.removeSlide=R=>{R&&this.removeSlideWithId(R.id)},this.removeSlideWithId=R=>{if(this.morph&&R in w&&w[R]){if(this.morph.getObjectById(R)){var T=w[R];this.morph.remove(T),T.clear(),T.geometry&&T.geometry.dispose(),T.material&&T.material.dispose(),this.boundingBoxUpdateRequired=!0}var P=g.findIndex(_=>_.id===R);-1<P&&g.splice(P,1)}},this.dispose=()=>{this.morph.children.forEach(R=>{R.geometry&&R.geometry.dispose(),R.material&&R.material.dispose()}),u(29).TexturePrimitive.prototype.dispose.call(this),this.boundingBoxUpdateRequired=!0};var F=(R,T,P)=>{if(T)switch(T.direction.value){case 1:P.copy(T.slide.value),R.expandByPoint(P),P.setY(1),P.setZ(1),R.expandByPoint(P);break;case 2:P.copy(T.slide.value),R.expandByPoint(P),P.setX(1),P.setZ(1),R.expandByPoint(P);break;case 3:P.copy(T.slide.value),R.expandByPoint(P),P.setX(1),P.setY(1),R.expandByPoint(P);break}};this.getBoundingBox=()=>{if(this.morph&&this.morph.children&&this.morph.visible&&this.boundingBoxUpdateRequired){this.cachedBoundingBox.makeEmpty();var R=new m.Vector3(0,0,0);this.morph.children.forEach(T=>{F(this.cachedBoundingBox,T.material.uniforms,R)}),this.morph.updateMatrixWorld(!0,!0),this.cachedBoundingBox.applyMatrix4(this.morph.matrixWorld),this.boundingBoxUpdateRequired=!1}return this.cachedBoundingBox},this.applyTransformation=(R,T,P)=>{var _=new m.Matrix4;_.set(R[0],R[1],R[2],0,R[3],R[4],R[5],0,R[6],R[7],R[8],0,0,0,0,0);var E=new m.Quaternion().setFromRotationMatrix(_);this.morph.position.set(...T),this.morph.quaternion.copy(E),this.morph.scale.set(...P),this.morph.updateMatrix(),this.boundingBoxUpdateRequired=!0},this.setRenderOrder=R=>{this.morph.renderOrder=R},this.initialise=(R,T)=>{if(R){var P=R.locations;P&&0<P.length&&(this.applyTransformation(P[0].orientation,P[0].position,P[0].scale),"flipY"in P[0]&&(S=P[0].flipY)),this.createSlides(R.settings.slides),T!=null&&typeof T=="function"&&T(this)}},this.showEdges=R=>{if(A)A.material.color=R;else{var T=new m.BoxGeometry(1,1,1);T.translate(.5,.5,.5);var P=new m.EdgesGeometry(T);A=new m.LineSegments(P,new m.LineBasicMaterial({color:R})),this.group.add(A)}A.visible=!0},this.hideEdges=()=>{A&&(A.visible=!1)}};b.prototype=Object.create(u(29).TexturePrimitive.prototype),b.prototype.constructor=b,l.TextureSlides=b},(o,l,u)=>{var c=u(4),f=c.GLSL3,h=`
|
|
3185
3185
|
precision highp float;
|
|
3186
3186
|
precision highp int;
|
|
3187
3187
|
precision highp sampler2DArray;
|
|
@@ -3450,4 +3450,4 @@ void main() {
|
|
|
3450
3450
|
#include <fog_fragment>
|
|
3451
3451
|
#include <premultiplied_alpha_fragment>
|
|
3452
3452
|
|
|
3453
|
-
}`};class f extends c.ShaderMaterial{constructor(p){super({type:"LineMaterial",uniforms:c.UniformsUtils.clone(c.ShaderLib.line.uniforms),vertexShader:c.ShaderLib.line.vertexShader,fragmentShader:c.ShaderLib.line.fragmentShader,clipping:!0}),Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(m){this.uniforms.diffuse.value=m}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(m){this.uniforms.linewidth.value=m}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(v){!!v!="USE_DASH"in this.defines&&(this.needsUpdate=!0),v===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(m){this.uniforms.dashScale.value=m}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(m){this.uniforms.dashSize.value=m}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(m){this.uniforms.dashOffset.value=m}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(m){this.uniforms.gapSize.value=m}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(m){this.uniforms.opacity.value=m}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(m){this.uniforms.resolution.value.copy(m)}},alphaToCoverage:{enumerable:!0,get:function(){return"ALPHA_TO_COVERAGE"in this.defines},set:function(m){!!m!="ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),m===!0?(this.defines.ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(p)}}f.prototype.isLineMaterial=!0},(o,l,u)=>{var c=u(4);l.Minimap=function(f){var h=f;this.camera=new c.OrthographicCamera(-.5,.5,.5,-.5,.01,10),this.helper=void 0;var p=new c.BufferGeometry,v=new Float32Array([-1,-1,1,1,-1,1,1,1,1,1,1,1,-1,1,1,-1,-1,1]),m=new c.BufferAttribute(v,3);p.setAttribute("position",m);var d=new c.MeshBasicMaterial({color:3355443,depthTest:!1,depthWrite:!1,opacity:.5,transparent:!0});this.mask=new c.Mesh(p,d);var b=new c.Box3,y=new c.Vector3;this.getDiffFromNormalised=(w,A)=>{b.setFromBufferAttribute(m).getCenter(y);var S=y.clone().project(this.camera),M=new c.Vector3(w,A,S.z).unproject(this.camera);return M.sub(y)};var g=(w,A)=>{h.camera.near&&(this.camera.near=h.camera.near),A.farPlane&&(this.camera.far=A.farPlane),A.eyePosition&&this.camera.position.set(A.eyePosition[0],A.eyePosition[1],A.eyePosition[2]),A.upVector&&this.camera.up.set(A.upVector[0],A.upVector[1],A.upVector[2]),A.targetPosition&&this.camera.lookAt(new c.Vector3(A.targetPosition[0],A.targetPosition[1],A.targetPosition[2])),this.camera.zoom=1/w,this.camera.updateProjectionMatrix()};this.getBoundary=()=>{var w=new c.Vector3().copy(h.camera.target).project(h.camera),A=new c.Vector3(-1,-1,w.z).unproject(h.camera),S=new c.Vector3(1,-1,w.z).unproject(h.camera),M=new c.Vector3(1,1,w.z).unproject(h.camera),F=new c.Vector3(-1,1,w.z).unproject(h.camera);m.copyVector3sArray([A,S,M,M,F,A]),m.needsUpdate=!0},this.updateCamera=()=>{this.getBoundary();var w=h.getZincCameraControls(),A=h.getBoundingBox();if(A){var S=A.min.distanceTo(A.max),M=S/2,F=(A.min.x+A.max.x)/2,R=(A.min.y+A.max.y)/2,T=(A.min.z+A.max.z)/2,P=w.getViewportFromCentreAndRadius(F,R,T,M,40,M*4);g(S,P)}}}},(o,l,u)=>{var c=u(4),f=u(52)(c),h=u(3).Geometry,p=u(53),v=u(54).default,m=c.BufferGeometryLoader,d=function(b){var y;b&&b.isGeometry&&(y=b);var g=void 0,w=void 0,A=!1,S=void 0,M=_=>{var E=y.getMorph().material.clone();E.morphTargets=!1;var C=new h,L=new m,I=L.parse(_),x=new c.Mesh(I.geometry,E);return C.geometry=x.geometry,x.userData=C,C.setMorph(x),C},F=_=>{switch(_.data.action){case"message":console.log(_.data.message);break;case"result":var E=new d(M(_.data.object));S&&S(E),S=void 0,A=!1;break;default:throw"Cannot handle specified action."}},R=_=>{if(p!==void 0&&(w=p(55)),!w)g=new(u(56)).GeometryCSGInternal(_);else if(_&&_.isGeometry){var E=_.getMorph(),C=E.geometry.clone().applyMatrix(E.matrix).toJSON();w.addEventListener("message",function(L){F(L)}),w.postMessage({action:"initialise",object:C})}};this.getHostGeometry=()=>{var _=new f(y.getMorph());return new T(_)},this.getGeometry=()=>y;var T=_=>{var E=y.getMorph().material.clone();E.morphTargets=!1;var C=_.toMesh(E),L=new h;return L.geometry=C.geometry,C.userData=L,L.setMorph(C),L};this.setCSG=_=>{g.setCSG(_)};var P=(_,E,C,L)=>{if(A)L("On progress");else{var I=_.getMorph(),x=I.geometry.clone().applyMatrix(I.matrix).toJSON();S=C,A=!0,w.postMessage({action:E,object:x})}};this.intersect=_=>new v((E,C)=>{if(w)P(_,"intersect",E,C);else{var L=g.intersect(_),I=new d(T(L));I.setCSG(L),E(I)}}),this.subtract=_=>new v((E,C)=>{if(w)P(_,"intersect",E,C);else{var L=g.subtract(_),I=new d(T(L));I.setCSG(L),E(I)}}),this.union=_=>new v((E,C)=>{if(w)P(_,"intersect",E,C);else{var L=g.union(_),I=new d(T(L));I.setCSG(L),E(I)}}),this.terminateWorker=()=>{w&&w.terminate()},R(b)};l.GeometryCSG=d},o=>{var l=1e-5,u=0,c=1,f=2,h=3;o.exports=function(p){var v=function(m){var d,b,y,g,w,A,S,M=[];if(m.isBufferGeometry&&(m=new p.Geometry().fromBufferGeometry(m)),m instanceof p.Geometry)this.matrix=new p.Matrix4;else if(m.isMesh)m.updateMatrix(),this.matrix=m.matrix.clone(),m=m.geometry,m.isBufferGeometry&&(m=new p.Geometry().fromBufferGeometry(m)),m.mergeVertices(),m.computeVertexNormals(!1);else{if(m instanceof v.Node)return this.tree=m,this.matrix=new p.Matrix4,this;throw"ThreeBSP: Given geometry is unsupported"}for(d=0,b=m.faces.length;d<b;d++)y=m.faces[d],w=m.faceVertexUvs[0][d],S=new v.Polygon,y instanceof p.Face3?(g=m.vertices[y.a],A=w?new p.Vector2(w[0].x,w[0].y):null,g=new v.Vertex(g.x,g.y,g.z,y.vertexNormals[0],A),g.applyMatrix4(this.matrix),S.vertices.push(g),g=m.vertices[y.b],A=w?new p.Vector2(w[1].x,w[1].y):null,g=new v.Vertex(g.x,g.y,g.z,y.vertexNormals[2],A),g.applyMatrix4(this.matrix),S.vertices.push(g),g=m.vertices[y.c],A=w?new p.Vector2(w[2].x,w[2].y):null,g=new v.Vertex(g.x,g.y,g.z,y.vertexNormals[2],A),g.applyMatrix4(this.matrix),S.vertices.push(g)):(p.Face4,g=m.vertices[y.a],A=w?new p.Vector2(w[0].x,w[0].y):null,g=new v.Vertex(g.x,g.y,g.z,y.vertexNormals[0],A),g.applyMatrix4(this.matrix),S.vertices.push(g),g=m.vertices[y.b],A=w?new p.Vector2(w[1].x,w[1].y):null,g=new v.Vertex(g.x,g.y,g.z,y.vertexNormals[1],A),g.applyMatrix4(this.matrix),S.vertices.push(g),g=m.vertices[y.c],A=w?new p.Vector2(w[2].x,w[2].y):null,g=new v.Vertex(g.x,g.y,g.z,y.vertexNormals[2],A),g.applyMatrix4(this.matrix),S.vertices.push(g),g=m.vertices[y.d],A=w?new p.Vector2(w[3].x,w[3].y):null,g=new v.Vertex(g.x,g.y,g.z,y.vertexNormals[3],A),g.applyMatrix4(this.matrix),S.vertices.push(g)),S.calculateProperties(),M.push(S);this.tree=new v.Node(M)};return v.prototype.subtract=function(m){var d=this.tree.clone(),b=m.tree.clone();return d.invert(),d.clipTo(b),b.clipTo(d),b.invert(),b.clipTo(d),b.invert(),d.build(b.allPolygons()),d.invert(),d=new v(d),d.matrix=this.matrix,d},v.prototype.union=function(m){var d=this.tree.clone(),b=m.tree.clone();return d.clipTo(b),b.clipTo(d),b.invert(),b.clipTo(d),b.invert(),d.build(b.allPolygons()),d=new v(d),d.matrix=this.matrix,d},v.prototype.intersect=function(m){var d=this.tree.clone(),b=m.tree.clone();return d.invert(),b.clipTo(d),b.invert(),d.clipTo(b),b.clipTo(d),d.build(b.allPolygons()),d.invert(),d=new v(d),d.matrix=this.matrix,d},v.prototype.toGeometry=function(){var m,d,b,y,g,w,A,S,M,F,R=new p.Matrix4().getInverse(this.matrix),T=new p.Geometry,P=this.tree.allPolygons(),_=P.length,E={};for(m=0;m<_;m++)for(b=P[m],y=b.vertices.length,d=2;d<y;d++)F=[],S=b.vertices[0],F.push(new p.Vector2(S.uv.x,S.uv.y)),S=new p.Vector3(S.x,S.y,S.z),S.applyMatrix4(R),typeof E[S.x+","+S.y+","+S.z]>"u"?(T.vertices.push(S),g=E[S.x+","+S.y+","+S.z]=T.vertices.length-1):g=E[S.x+","+S.y+","+S.z],S=b.vertices[d-1],F.push(new p.Vector2(S.uv.x,S.uv.y)),S=new p.Vector3(S.x,S.y,S.z),S.applyMatrix4(R),typeof E[S.x+","+S.y+","+S.z]>"u"?(T.vertices.push(S),w=E[S.x+","+S.y+","+S.z]=T.vertices.length-1):w=E[S.x+","+S.y+","+S.z],S=b.vertices[d],F.push(new p.Vector2(S.uv.x,S.uv.y)),S=new p.Vector3(S.x,S.y,S.z),S.applyMatrix4(R),typeof E[S.x+","+S.y+","+S.z]>"u"?(T.vertices.push(S),A=E[S.x+","+S.y+","+S.z]=T.vertices.length-1):A=E[S.x+","+S.y+","+S.z],M=new p.Face3(g,w,A,new p.Vector3(b.normal.x,b.normal.y,b.normal.z)),T.faces.push(M),T.faceVertexUvs[0].push(F);return T},v.prototype.toBufferGeometry=function(){var m=this.toGeometry(),d=new p.BufferGeometry().fromGeometry(m);return d},v.prototype.toMesh=function(m){var d=this.toBufferGeometry(),b=new p.Mesh(d,m);return b.position.setFromMatrixPosition(this.matrix),b.rotation.setFromRotationMatrix(this.matrix),b},v.Polygon=function(m){m instanceof Array||(m=[]),this.vertices=m,0<m.length?this.calculateProperties():this.normal=this.w=void 0},v.Polygon.prototype.calculateProperties=function(){var m=this.vertices[0],d=this.vertices[1],b=this.vertices[2];return this.normal=d.clone().subtract(m).cross(b.clone().subtract(m)).normalize(),this.w=this.normal.clone().dot(m),this},v.Polygon.prototype.clone=function(){var m,d,b=new v.Polygon;for(m=0,d=this.vertices.length;m<d;m++)b.vertices.push(this.vertices[m].clone());return b.calculateProperties(),b},v.Polygon.prototype.flip=function(){var m,d=[];for(this.normal.multiplyScalar(-1),this.w*=-1,m=this.vertices.length-1;0<=m;m--)d.push(this.vertices[m]);return this.vertices=d,this},v.Polygon.prototype.classifyVertex=function(m){var d=this.normal.dot(m)-this.w;return d<-l?f:d>l?c:u},v.Polygon.prototype.classifySide=function(m){var d,b,y,g=0,w=0,A=m.vertices.length;for(d=0;d<A;d++)b=m.vertices[d],y=this.classifyVertex(b),y===c?g++:y===f&&w++;return 0<g&&w===0?c:g===0&&0<w?f:g===0&&w===0?u:h},v.Polygon.prototype.splitPolygon=function(m,d,b,y,g){var w=this.classifySide(m);if(w===u)(0<this.normal.dot(m.normal)?d:b).push(m);else if(w===c)y.push(m);else if(w===f)g.push(m);else{var A,S,M,F,R,T,P,_,E,C=[],L=[];for(S=0,A=m.vertices.length;S<A;S++)M=(S+1)%A,T=m.vertices[S],P=m.vertices[M],F=this.classifyVertex(T),R=this.classifyVertex(P),F!=f&&C.push(T),F!=c&&L.push(T),(F|R)==h&&(_=(this.w-this.normal.dot(T))/this.normal.dot(P.clone().subtract(T)),E=T.interpolate(P,_),C.push(E),L.push(E));3<=C.length&&y.push(new v.Polygon(C).calculateProperties()),3<=L.length&&g.push(new v.Polygon(L).calculateProperties())}},v.Vertex=function(m,d,b,y,g){this.x=m,this.y=d,this.z=b,this.normal=y||new p.Vector3,this.uv=g||new p.Vector2},v.Vertex.prototype.clone=function(){return new v.Vertex(this.x,this.y,this.z,this.normal.clone(),this.uv.clone())},v.Vertex.prototype.add=function(m){return this.x+=m.x,this.y+=m.y,this.z+=m.z,this},v.Vertex.prototype.subtract=function(m){return this.x-=m.x,this.y-=m.y,this.z-=m.z,this},v.Vertex.prototype.multiplyScalar=function(m){return this.x*=m,this.y*=m,this.z*=m,this},v.Vertex.prototype.cross=function(m){var d=this.x,b=this.y,y=this.z;return this.x=b*m.z-y*m.y,this.y=y*m.x-d*m.z,this.z=d*m.y-b*m.x,this},v.Vertex.prototype.normalize=function(){var m=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return this.x/=m,this.y/=m,this.z/=m,this},v.Vertex.prototype.dot=function(m){return this.x*m.x+this.y*m.y+this.z*m.z},v.Vertex.prototype.lerp=function(m,d){return this.add(m.clone().subtract(this).multiplyScalar(d)),this.normal.add(m.normal.clone().sub(this.normal).multiplyScalar(d)),this.uv.add(m.uv.clone().sub(this.uv).multiplyScalar(d)),this},v.Vertex.prototype.interpolate=function(m,d){return this.clone().lerp(m,d)},v.Vertex.prototype.applyMatrix4=function(m){var d=this.x,b=this.y,y=this.z,g=m.elements;return this.x=g[0]*d+g[4]*b+g[8]*y+g[12],this.y=g[1]*d+g[5]*b+g[9]*y+g[13],this.z=g[2]*d+g[6]*b+g[10]*y+g[14],this},v.Node=function(m){var d,b,y=[],g=[];if(this.polygons=[],this.front=this.back=void 0,m instanceof Array&&m.length!==0){for(this.divider=m[0].clone(),d=0,b=m.length;d<b;d++)this.divider.splitPolygon(m[d],this.polygons,this.polygons,y,g);0<y.length&&(this.front=new v.Node(y)),0<g.length&&(this.back=new v.Node(g))}},v.Node.isConvex=function(m){var d,b;for(d=0;d<m.length;d++)for(b=0;b<m.length;b++)if(d!==b&&m[d].classifySide(m[b])!==f)return!1;return!0},v.Node.prototype.build=function(m){var d,b,y=[],g=[];for(this.divider||(this.divider=m[0].clone()),d=0,b=m.length;d<b;d++)this.divider.splitPolygon(m[d],this.polygons,this.polygons,y,g);0<y.length&&(!this.front&&(this.front=new v.Node),this.front.build(y)),0<g.length&&(!this.back&&(this.back=new v.Node),this.back.build(g))},v.Node.prototype.allPolygons=function(){var m=this.polygons.slice();return this.front&&(m=m.concat(this.front.allPolygons())),this.back&&(m=m.concat(this.back.allPolygons())),m},v.Node.prototype.clone=function(){var m=new v.Node;return m.divider=this.divider.clone(),m.polygons=this.polygons.map(function(d){return d.clone()}),m.front=this.front&&this.front.clone(),m.back=this.back&&this.back.clone(),m},v.Node.prototype.invert=function(){var m,d,b;for(m=0,d=this.polygons.length;m<d;m++)this.polygons[m].flip();return this.divider.flip(),this.front&&this.front.invert(),this.back&&this.back.invert(),b=this.front,this.front=this.back,this.back=b,this},v.Node.prototype.clipPolygons=function(m){var d,b,y,g;if(!this.divider)return m.slice();for(y=[],g=[],d=0,b=m.length;d<b;d++)this.divider.splitPolygon(m[d],y,g,y,g);return this.front&&(y=this.front.clipPolygons(y)),g=this.back?this.back.clipPolygons(g):[],y.concat(g)},v.Node.prototype.clipTo=function(m){this.polygons=m.clipPolygons(this.polygons),this.front&&this.front.clipTo(m),this.back&&this.back.clipTo(m)},v}},o=>{o.exports=qB()},o=>{o.exports=oD},(o,l,u)=>{var c=u(3).Geometry,f=u(4),h=f.BufferGeometryLoader;o.exports=function(p){var v=void 0,m=function(A){var S=new h,M=S.parse(A),F=new f.MeshPhongMaterial,R=new f.Mesh(M.geometry,F),T=new c;return T.setMorph(R),T},d=function(A){var S=m(A);v=new(u(56)).GeometryCSGInternal(S),p.postMessage({action:"message",message:"Initialised"})},b=function(A){if(v){var S=m(A),M=v.intersect(S),F=M.toBufferGeometry().toJSON();p.postMessage({action:"result",object:F})}},y=function(A){if(v){var S=m(A),M=v.subtract(S),F=M.toBufferGeometry().toJSON();p.postMessage({action:"result",object:F})}},g=function(A){if(v){var S=m(A),M=v.union(S),F=M.toBufferGeometry().toJSON();p.postMessage({action:"result",object:F})}};p.addEventListener("message",function(w){switch(w.data.action){case"initialise":d(w.data.object);break;case"intersect":b(w.data.object);break;case"subtract":y(w.data.object);break;case"union":g(w.data.object);break;default:throw"Cannot handle specified action."}})}},(o,l,u)=>{var c=u(4),f=u(52)(c);u(3).Geometry,u(51).GeometryCSG;var h=function(p){var v;p&&p.isGeometry&&(v=p);var m;this.setGeometry=b=>{b&&b.isGeometry&&(v=b),m=void 0},this.setCSG=b=>{m=b};var d=b=>{if(v&&v.morph&&b&&b.morph){m===void 0&&(m=new f(v.morph));var y=new f(b.morph);return y}};this.intersect=b=>{var y=d(b);return m&&y?m.intersect(y):void 0},this.subtract=b=>{var y=d(b);return m&&y?m.subtract(y):void 0},this.union=b=>{var y=d(b);return m&&y?m.union(y):void 0}};l.GeometryCSGInternal=h},(o,l,u)=>{var c=u(4),f=u(52)(c);u(18).Glyphset;var h=function(p){var v;p&&p.isGlyphset&&(v=p);var m=[];this.setGlyphset=y=>{y&&y.isGlyphset&&(v=y),hostCSG=void 0},this.getGlyphset=()=>v;var d=()=>y=>{var g=y.getMesh(),w=y.getLabel();if(g){var A=new f(g.geometry.clone().applyMatrix(g.matrix)),S=[];S.csg=A,S.label=w,g.material&&(S.material=g.material.clone()),m.push(S)}},b=y=>{if(v&&y&&y.getMorph()){m.length==0&&v.forEachGlyph(d());var g=new f(y.getMorph());return g}};this.intersect=y=>{var g=b(y);if(0<m.length&&g){for(var w=new(u(18)).Glyphset,A=0;A<m.length;A++){var S=m[A],M=S.csg.intersect(g),F=M.toMesh();if(F&&F.geometry&&0<F.geometry.vertices.length){S.material&&(F.material=S.material,F.material.side=c.DoubleSide,F.material.clippingPlanes=null);var R=w.addMeshAsGlyph(F,A+1);R.setLabel(S.label)}}var T=new h(w);return T}}};l.GlyphsetCSG=h}],i={};function r(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return t[o].call(u.exports,u,u.exports,r),u.exports}r.n=o=>{var l=o&&o.__esModule?()=>o.default:()=>o;return r.d(l,{a:l}),l},r.d=(o,l)=>{for(var u in l)r.o(l,u)&&!r.o(o,u)&&Object.defineProperty(o,u,{enumerable:!0,get:l[u]})},r.o=(o,l)=>Object.prototype.hasOwnProperty.call(o,l),r.r=o=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})};var s=r(0);return s})())})(kg);var br=kg.exports;const Hc=xC(br),oi={SELECTED_COLOUR:"#00ff00",HIGHLIGHTED_COLOUR:"#ff0000",DEFAULT_RADIUS:1,DEFAULT_RADIAL_SEGMENTS:8,ZOOM_RADIUS:5,ZOOM_RADIAL_SEGMENTS:12},gx=(n,e)=>{if(n){let t="";n.forEach(i=>{t=i.uuid,i.region&&(t=i.region.uuid+"/"+t),i&&i.getVisibility()&&e.push(t)})}return e},gf=(n,e)=>{const t=n[0]-e[0],i=n[1]-e[1],r=n[2]-e[2];return Math.sqrt(t*t+i*i+r*r)},aD=n=>{const e=n.zincObjects;if(e.length>0&&e[0]){const t=e[0];if(t.isEditable&&t.isLines2){const i=n.identifiers[0].extraData.intersected;if(i&&i.faceIndex>-1){const r=t.getVerticesByFaceIndex(i.faceIndex),s=n.identifiers[0].extraData.intersected.pointOnLine;if(r.length>1){const o=gf(r[0],[s.x,s.y,s.z]),l=gf(r[1],[s.x,s.y,s.z]);return o>l?{zincObject:t,faceIndex:i.faceIndex,vertexIndex:i.faceIndex*2+1,point:r[0]}:{zincObject:t,faceIndex:i.faceIndex,vertexIndex:i.faceIndex*2,point:r[1]}}}}}},lD=n=>{const e=n.zincObjects;if(e.length>0&&e[0])return e[0]},cD=n=>{const e=n.zincObjects;if(e.length>0&&e[0]){const t=e[0];if(t.isEditable)return t}},uD=(n,e,t)=>{if(n!=null&&n.isEditable&&(n!=null&&n.isPointset)){let i=!1;for(let r=0;r<3&&!i;r++)t[r]!==0&&(i=!0);if(i&&e>-1){const r=n.getVerticesByIndex(e);return r&&(r[0]=r[0]+t[0],r[1]=r[1]+t[1],r[2]=r[2]+t[2]),n.editVertices([r],e),n.boundingBoxUpdateRequired=!0,!0}}return!1},Wc=(n,e)=>{if(n!=null&&n.isEditable&&(n!=null&&n.isLines2)&&e>-1){const t=n.getVerticesByFaceIndex(e);if(t&&t.length>1)return gf(t[1],t[0])}return 0},vf=(n,e,t,i)=>{if(n&&t!==0&&n.isEditable&&n.isLines2&&e>-1){const r=n.getVerticesByFaceIndex(e);let s=[r[1][0]-r[0][0],r[1][1]-r[0][1],r[1][2]-r[0][2]];const o=Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);for(let l=0;l<3;l++)s[l]=s[l]/o*t,i?r[1][l]=r[0][l]+s[l]:(r[0][l]=r[0][l]+s[l],r[1][l]=r[1][l]+s[l]);return n.editVertices(r,e*2),n.boundingBoxUpdateRequired=!0,!0}return!1},dD=(n,e)=>{const t=e.getBoundingBox(),i=new br.THREE.Vector3().subVectors(t.max,t.min),r=new br.THREE.BoxGeometry(i.x,i.y,i.z);i.addVectors(t.min,t.max).multiplyScalar(.5);const s=r.getAttribute("position"),o=s.count,l=[];for(let u=0;u<o;u++)l[u]=[s.array[u*3],s.array[u*3+1],s.array[u*3+2]];n.editVertices(l,0),n.setPosition(i.x,i.y,i.z),r.dispose()},vx=(n,e)=>{let t="";n.isRegion&&(t=`__r${n.regionPath}`),n.isPrimitives&&(t=`${n.regionPath}/${n.label}`),e.push(t),n.children&&n.children.forEach(i=>vx(i,e))},Ao=(n,e,t,i)=>{let r=n;const s=[];if(t&&(r=n.findChildFromPath(t)),r){const o=Array.isArray(e);let l=e;o||(l=[l]),l.forEach(u=>{const c=r.findObjectsWithGroupName(u,i);s.push(...c)})}return s},yf=(n,e,t)=>{const i=n.findIndex(s=>s.uuid===e);let r;return i>-1&&(r=n[i],t&&n.splice(i,1)),r},hD=(n,e)=>{const t=[];if(n&&e&&e.length>0){const i={},r={},s=[n,...n.getChildRegions(!0)];let o,l,u;e.forEach(c=>{const f=c.split("/");u=f[0],o=yf(s,u,!1),o&&(r[u]||(r[u]=o.getFullPath()),f[1]?(i[u]||(i[u]=o.getAllObjects(!1)),l=yf(i[u],f[1],!0),l&&t.push(`${r[u]}/${l.groupName}`)):t.push(`__r/${r[u]}`))})}return t},fD=n=>{if(n){const e=[];return n.forEach(i=>{i.isZincObject?e.push(i):i.isRegion&&e.push(...i.getAllObjects(!0))}),Object.values(e.reduce((i,r)=>({...i,[r.uuid]:r}),{}))}return[]},yx=(n,e)=>{const t={label:"Multiple selections",regionPath:"",objects:[]};if(e&&n){const i={},r=n.getRootRegion();e.length>0&&(t.regionPath=e[0].data.region,t.label=e[0].data.group),e.forEach(s=>{s.data.region.includes(t.regionPath)||(t.regionPath=""),t.label!==s.data.group&&(t.label="Multiple selections");const o=r.findChildFromPath(s.data.region);i[o.uuid]||(i[o.uuid]=o.getAllObjects(!1));const l=yf(i[o.uuid],s.data.uuid);l&&t.objects.push(l)})}return t},pD=n=>{const e=n.getMorph();let t="position";n.isLines2&&(t="instanceStart");const i=[];let r=0;const s=e.geometry.getAttribute(t);for(let o=0;o<n.drawRange;o++)i.push([s.array[r++],s.array[r++],s.array[r++]]);return i},bx=(n,e,t,i,r)=>{let s;n.isPointset?s="MultiPoint":n.isLines2?s="MultiLineString":s="Feature";const o=s!=="Feature",l=s==="Feature"?"Feature annotation":"Drawn annotation";if(s){const u=pD(n);let c=e.slice(-1)==="/"?e:e+"/";c=c+t;const f=c,h={resource:i,item:{id:f},body:{evidence:[],comment:r},feature:{id:f,properties:{drawn:o,label:l},geometry:{coordinates:u,type:s}}};return r==="Deleted"&&(h.feature=void 0),h}},xx=(n,e,t,i,r,s,o)=>{const l=bx(t,i,r,s,o);if(l)return n&&n.currentUser&&(l.creator={...n.currentUser},l.creator.orcid||(l.creator.orcid="0000-0000-0000-0000"),n.addAnnotation(e,l).then(u=>{u.annotationId||console.log("There is a problem with the submission, please try again later")}).catch(()=>{console.log("There is a problem with the submission, please try again later")})),l},wx=async(n,e,t)=>{const i=t;return await n.drawnFeatures(e,i)},Mx=(n,e)=>{n&&e.forEach(t=>{const i=t.geometry,r=decodeURIComponent(t.id),s=r.lastIndexOf("/"),o=r.substring(0,s),l=r.substring(s+1);let u;i.type==="MultiPoint"?u=n.createPoints(o,l,i.coordinates,l,8942):i.type==="MultiLineString"&&(u=n.createLines(o,l,i.coordinates,60962)),u&&(u.zincObject.isEditable=!0)})},bf=function(n){const e=[];for(let t=0;t<n.length;t++){let i=n[t].userData;if(i)if(i.isGlyph||i.isGlyphset){let r=i;i.isGlyph&&(r=i.getGlyphset()),e.push(r)}else e.push(i)}return e},mD={name:"LinesControls",components:{Button:ws,Col:Fn,Container:Jn,InputNumber:yi,Main:vi,Slider:An,ElIconArrowLeft:ki,ElIconArrowRight:zi},props:{createData:{type:Object},usageConfig:{type:Object}},data:function(){return{adjust:0,pAdjust:0,lengthScale:0,distance:0,newDistance:0,width:1,radius:oi.DEFAULT_RADIUS,radialSegments:oi.DEFAULT_RADIAL_SEGMENTS,currentIndex:0,ElIconArrowLeft:a.shallowRef(ki),ElIconArrowRight:a.shallowRef(zi),edited:!1,zincObject:void 0,isTubeLines:!1}},computed:{showTubeLinesControls(){return this.usageConfig.showTubeLinesControls}},watch:{"createData.faceIndex":{handler:function(n){var e;(e=this.zincObject)!=null&&e.isLines2&&(this.currentIndex=n,this.distance=Wc(this.zincObject,this.currentIndex))},immediate:!0}},methods:{changeIndex:function(n){n?Wc(this.zincObject,this.currentIndex+1)>0&&(this.currentIndex++,this.reset()):(this.currentIndex--,this.reset())},onLengthInput:function(){this.newDistance!==0?(this.distance=this.newDistance,this.edited=vf(this.zincObject,this.currentIndex,this.newDistance,!0)||this.edited):this.newDistance=this.distance},onLengthSliding:function(){this.newDistance=Math.pow(10,this.lengthScale)*this.distance,this.edited=vf(this.zincObject,this.currentIndex,this.newDistance,!0)||this.edited},onMoveSliding:function(){const n=(this.adjust-this.pAdjust)*this.distance;this.edited=vf(this.zincObject,this.currentIndex,n,!1)||this.edited,this.pAdjust=this.adjust},reset:function(){this.adjust=0,this.pAdjust=0,this.lengthScale=0,this.distance=Wc(this.zincObject,this.currentIndex),this.newDistance=this.distance,this.edited&&(this.$emit("primitivesUpdated",this.zincObject),this.edited=!1)},setObject:function(n){var e;this.currentIndex=-1,this.distance=0,n.isLines2||n.isTubeLines?(this.zincObject=a.markRaw(n),this.width=this.zincObject.getMorph().material.linewidth,this.isTubeLines=n.isTubeLines,n.isEditable?(this.currentIndex=0,this.distance=Wc(n,this.currentIndex)):(e=n.userData)!=null&&e.isNerves&&(this.radius=oi.ZOOM_RADIUS,this.radialSegments=oi.ZOOM_RADIAL_SEGMENTS)):(this.zincObject=void 0,this.width=10)},modifyWidth:function(){this.zincObject.setWidth(this.width)},modifyTubeLines:function(){this.zincObject.setTubeLines(this.radius,this.radius*this.radialSegments)}}};function gD(n,e,t,i,r,s){const o=Fn,l=An,u=yi,c=Yn,f=ws,h=vi,p=Jn;return a.openBlock(),a.createBlock(p,{class:"lines-container"},{default:a.withCtx(()=>[a.createVNode(h,{class:"slides-block"},{default:a.withCtx(()=>[n.isTubeLines&&s.showTubeLinesControls?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[15]||(e[15]=[a.createTextVNode(" Radius: ")])),_:1}),a.createVNode(o,{offset:0,span:12},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.radius,"onUpdate:modelValue":e[0]||(e[0]=v=>n.radius=v),class:"my-slider",step:1,min:1,max:32,"show-tooltip":!1,onInput:s.modifyTubeLines},null,8,["modelValue","onInput"])]),_:1}),a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.radius,"onUpdate:modelValue":e[1]||(e[1]=v=>n.radius=v),step:1,min:1,max:32,controls:!1,onChange:s.modifyTubeLines,class:"input-box number-input"},null,8,["modelValue","onChange"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[16]||(e[16]=[a.createTextVNode(" Radial Segments: ")])),_:1}),a.createVNode(o,{offset:0,span:12},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.radialSegments,"onUpdate:modelValue":e[2]||(e[2]=v=>n.radialSegments=v),class:"my-slider",step:1,min:8,max:32,"show-tooltip":!1,onInput:s.modifyTubeLines},null,8,["modelValue","onInput"])]),_:1}),a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.radialSegments,"onUpdate:modelValue":e[3]||(e[3]=v=>n.radialSegments=v),step:1,min:8,max:32,controls:!1,onChange:s.modifyTubeLines,class:"input-box number-input"},null,8,["modelValue","onChange"])]),_:1})]),_:1})],64)):n.isTubeLines?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(c,{key:1},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[17]||(e[17]=[a.createTextVNode(" Width: ")])),_:1}),a.createVNode(o,{offset:0,span:12},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.width,"onUpdate:modelValue":e[4]||(e[4]=v=>n.width=v),class:"my-slider",step:1,min:1,max:100,"show-tooltip":!1,onInput:s.modifyWidth},null,8,["modelValue","onInput"])]),_:1}),a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.width,"onUpdate:modelValue":e[5]||(e[5]=v=>n.width=v),step:1,min:1,max:100,controls:!1,class:"input-box number-input"},null,8,["modelValue"])]),_:1})]),_:1})),n.currentIndex>-1&&n.distance>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(f,{size:"small",disabled:n.currentIndex===0,icon:n.ElIconArrowLeft,onClick:e[6]||(e[6]=v=>s.changeIndex(!1))},null,8,["disabled","icon"])]),_:1}),a.createVNode(o,{offset:4,span:9},{default:a.withCtx(()=>[a.createTextVNode(" Editing Line "+a.toDisplayString(n.currentIndex+1),1)]),_:1}),a.createVNode(o,{offset:2,span:2},{default:a.withCtx(()=>[a.createVNode(f,{size:"small",icon:n.ElIconArrowRight,onClick:e[7]||(e[7]=v=>s.changeIndex(!0))},null,8,["icon"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[18]||(e[18]=[a.createTextVNode(" Move: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.adjust,"onUpdate:modelValue":e[8]||(e[8]=v=>n.adjust=v),step:.01,min:-3,max:3,"show-tooltip":!1,onInput:e[9]||(e[9]=v=>s.onMoveSliding()),onChange:e[10]||(e[10]=v=>s.reset())},null,8,["modelValue"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[19]||(e[19]=[a.createTextVNode(" Length: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.lengthScale,"onUpdate:modelValue":e[11]||(e[11]=v=>n.lengthScale=v),step:.01,min:-1,max:1,"show-tooltip":!1,onInput:e[12]||(e[12]=v=>s.onLengthSliding()),onChange:e[13]||(e[13]=v=>s.reset())},null,8,["modelValue"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.newDistance,"onUpdate:modelValue":e[14]||(e[14]=v=>n.newDistance=v),controls:!1,class:"input-box number-input",onChange:s.onLengthInput},null,8,["modelValue","onChange"])]),_:1})]),_:1})],64)):a.createCommentVNode("",!0)]),_:1})]),_:1})}const Ax=Kn(mD,[["render",gD],["__scopeId","data-v-0deb177d"]]),vD={name:"PointsControls",components:{Col:Fn,Container:Jn,InputNumber:yi,Main:vi,Select:Ms,Slider:An,Row:Yn,Option:As,ElIconArrowLeft:ki,ElIconArrowRight:zi},inject:["boundingDims"],data:function(){return{attenuation:!1,size:10,choices:[{value:!0,label:"On"},{value:!1,label:"off"}],min:[0,0,0],max:[1,1,1],translation:[0,0,0],pTranslation:[0,0,0],currentIndex:-1,ElIconArrowLeft:a.shallowRef(ki),ElIconArrowRight:a.shallowRef(zi),edited:!1,zincObject:void 0}},watch:{boundingDims:{handler:function(n){const e=n.size;this.min=[-e[0]/2,-e[1]/2,-e[2]/2],this.max=[e[0]/2,e[1]/2,e[2]/2]},immediate:!0,deep:!0}},methods:{changeIndex:function(n){n?this.zincObject.drawRange>this.currentIndex+1&&(this.currentIndex++,this.reset()):(this.currentIndex--,this.reset())},onMoveSliding:function(){const n=[this.translation[0]-this.pTranslation[0],this.translation[1]-this.pTranslation[1],this.translation[2]-this.pTranslation[2]];this.edited=uD(this.zincObject,this.currentIndex,n)||this.edited;for(let e=0;e<3;e++)this.pTranslation[e]=this.translation[e]},reset:function(){this.translation=[0,0,0],this.pTranslation=[0,0,0],this.edited&&(this.$emit("primitivesUpdated",this.zincObject),this.edited=!1)},setObject:function(n){this.currentIndex=-1,n.isPointset?(this.zincObject=a.markRaw(n),this.size=this.zincObject.morph.material.size,this.attenuation=this.zincObject.morph.material.sizeAttenuation,n.isEditable&&this.zincObject.drawRange>0&&(this.currentIndex=0)):(this.zincObject=void 0,this.size=10,this.attenuation=!1)},modifyAttenuation:function(n){this.attenuation=n,this.zincObject.setSizeAttenuation(n)},modifySize:function(){this.zincObject.setSize(this.size)}}};function yD(n,e,t,i,r,s){const o=Fn,l=An,u=yi,c=Yn,f=As,h=Ms,p=ws,v=vi,m=Jn;return a.openBlock(),a.createBlock(m,{class:"pointset-container"},{default:a.withCtx(()=>[a.createVNode(v,{class:"slides-block"},{default:a.withCtx(()=>[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[15]||(e[15]=[a.createTextVNode(" Size: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.size,"onUpdate:modelValue":e[0]||(e[0]=d=>n.size=d),class:"my-slider",step:1,min:0,max:100,"show-tooltip":!1,onInput:e[1]||(e[1]=d=>s.modifySize())},null,8,["modelValue"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.size,"onUpdate:modelValue":e[2]||(e[2]=d=>n.size=d),step:1,min:0,max:100,controls:!1,class:"input-box number-input"},null,8,["modelValue"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>e[16]||(e[16]=[a.createTextVNode(" Size attenuation: ")])),_:1}),a.createVNode(o,{offset:0,span:5},{default:a.withCtx(()=>[a.createVNode(h,{teleported:!1,"model-value":n.attenuation,placeholder:"Select",class:"input-box","popper-class":"viewer_dropdown",onChange:e[3]||(e[3]=d=>s.modifyAttenuation(d,n.slide))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.choices,d=>(a.openBlock(),a.createBlock(f,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])]),_:1})]),_:1}),n.currentIndex>-1?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(p,{size:"small",disabled:n.currentIndex===0,icon:n.ElIconArrowLeft,onClick:e[4]||(e[4]=d=>s.changeIndex(!1))},null,8,["disabled","icon"])]),_:1}),a.createVNode(o,{offset:4,span:9},{default:a.withCtx(()=>[a.createTextVNode(" Editing Point "+a.toDisplayString(n.currentIndex+1),1)]),_:1}),a.createVNode(o,{offset:2,span:2},{default:a.withCtx(()=>[a.createVNode(p,{size:"small",icon:n.ElIconArrowRight,onClick:e[5]||(e[5]=d=>s.changeIndex(!0))},null,8,["icon"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[17]||(e[17]=[a.createTextVNode(" x: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.translation[0],"onUpdate:modelValue":e[6]||(e[6]=d=>n.translation[0]=d),step:.01,min:n.min[0],max:n.max[0],"show-tooltip":!1,onInput:e[7]||(e[7]=d=>s.onMoveSliding()),onChange:e[8]||(e[8]=d=>s.reset())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[18]||(e[18]=[a.createTextVNode(" y: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.translation[1],"onUpdate:modelValue":e[9]||(e[9]=d=>n.translation[1]=d),step:.01,min:n.min[1],max:n.max[1],"show-tooltip":!1,onInput:e[10]||(e[10]=d=>s.onMoveSliding()),onChange:e[11]||(e[11]=d=>s.reset())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[19]||(e[19]=[a.createTextVNode(" z: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.translation[2],"onUpdate:modelValue":e[12]||(e[12]=d=>n.translation[2]=d),step:.01,min:n.min[2],max:n.max[2],"show-tooltip":!1,onInput:e[13]||(e[13]=d=>s.onMoveSliding()),onChange:e[14]||(e[14]=d=>s.reset())},null,8,["modelValue","min","max"])]),_:1})]),_:1})],64)):a.createCommentVNode("",!0)]),_:1})]),_:1})}const Sx=Kn(vD,[["render",yD],["__scopeId","data-v-d1de9c65"]]),bD={name:"TextureSlidesControls",components:{Col:Fn,Container:Jn,Footer:Ag,Icon:ht,InputNumber:yi,Main:vi,Row:Yn,Select:Ms,Slider:An,Option:As,ElIconDelete:tl,ElIconPlus:nl},data:function(){return{settings:[],directions:[{value:"x",label:"x"},{value:"y",label:"y"},{value:"z",label:"z"}],zincObject:void 0}},methods:{setObject:function(n){n.isTextureSlides?(this.zincObject=a.markRaw(n),this.settings=this.zincObject.getTextureSettings()):(this.zincObject=void 0,this.settings=[])},addNewSlide:function(){const n={direction:"x",value:0},e=this.zincObject.createSlide(n);this.settings.push(e)},modifyDirection:function(n,e){e&&(e.direction=n,this.zincObject.modifySlideSettings(e))},modifySlide:function(n){n&&this.zincObject.modifySlideSettings(n)},removeSlide:function(n,e){this.zincObject.removeSlideWithId(e.id),this.settings.splice(n,1)}}};function xD(n,e,t,i,r,s){const o=As,l=Ms,u=Fn,c=An,f=yi,h=tl,p=ht,v=Yn,m=vi,d=nl,b=Ag,y=Jn;return a.openBlock(),a.createBlock(y,{class:"t-slides-container"},{default:a.withCtx(()=>[a.createVNode(m,{class:"slides-block"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.settings,(g,w)=>(a.openBlock(),a.createBlock(v,{key:g.id,class:"slide-row"},{default:a.withCtx(()=>[a.createVNode(u,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(l,{teleported:!1,"model-value":g.direction,placeholder:"Select",class:"input-box","popper-class":"viewer_dropdown",onChange:A=>s.modifyDirection(A,g)},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.directions,A=>(a.openBlock(),a.createBlock(o,{key:A.value,label:A.label,value:A.value},null,8,["label","value"]))),128))]),_:2},1032,["model-value","onChange"])]),_:2},1024),a.createVNode(u,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(c,{modelValue:g.value,"onUpdate:modelValue":A=>g.value=A,class:"my-slider",step:.01,min:0,max:1,"show-tooltip":!1,onInput:A=>s.modifySlide(g)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:2},1024),a.createVNode(u,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(f,{modelValue:g.value,"onUpdate:modelValue":A=>g.value=A,step:.01,min:0,max:1,controls:!1,class:"input-box number-input"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),a.createVNode(u,{offset:0,span:2},{default:a.withCtx(()=>[a.createVNode(p,{class:"delete-icon",onClick:A=>s.removeSlide(w,g)},{default:a.withCtx(()=>[a.createVNode(h)]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1}),a.createVNode(b,{height:"30px",class:"add-slides-text",onClick:s.addNewSlide},{default:a.withCtx(()=>[a.createVNode(v,null,{default:a.withCtx(()=>[a.createVNode(u,{span:2},{default:a.withCtx(()=>[a.createVNode(p,null,{default:a.withCtx(()=>[a.createVNode(d)]),_:1})]),_:1}),a.createVNode(u,{span:20},{default:a.withCtx(()=>e[0]||(e[0]=[a.createTextVNode(" Add a new slide ")])),_:1})]),_:1})]),_:1},8,["onClick"])]),_:1})}const _x=Kn(bD,[["render",xD],["__scopeId","data-v-12185b7f"]]),wD={name:"TransformationControls",components:{Col:Fn,Container:Jn,InputNumber:yi,Main:vi,Slider:An},inject:["boundingDims"],data:function(){return{x:0,y:0,z:0,scale:1,min:[0,0,0],max:[1,1,1],zincObject:void 0,enableScaling:!0}},watch:{boundingDims:{handler:function(n){const e=n.centre,t=n.size;this.min=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],this.max=[e[0]+t[0],e[1]+t[1],e[2]+t[2]]},immediate:!0,deep:!0}},methods:{setObject:function(n){if(n.isZincObject){this.zincObject=a.markRaw(n);const e=this.zincObject.getGroup(),t=this.zincObject.userData.originalPos;e&&e.position&&(this.x=e.position.x,this.y=e.position.y,this.z=e.position.z,this.zincObject.isGlyphset?this.scale=this.zincObject.globalScale:this.scale=e.scale.x,this.enableScaling=!this.zincObject.isTextureSlides,t&&this.boundingDims&&(this.min=[t[0]-this.boundingDims.size[0],t[1]-this.boundingDims.size[1],t[2]-this.boundingDims.size[2]],this.max=[t[0]+this.boundingDims.size[0],t[1]+this.boundingDims.size[1],t[2]+this.boundingDims.size[2]]))}else this.zincObject=void 0,this.x=0,this.y=0,this.z=0,this.scale=1},modifyPosition:function(){this.zincObject&&this.zincObject.setPosition(this.x,this.y,this.z)},modifyScale:function(){this.zincObject.setScaleAll(this.scale)}}};function MD(n,e,t,i,r,s){const o=Fn,l=An,u=yi,c=Yn,f=vi,h=Jn;return a.openBlock(),a.createBlock(h,{class:"transformation-container"},{default:a.withCtx(()=>[a.createVNode(f,{class:"slides-block"},{default:a.withCtx(()=>[a.createVNode(c,{class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[16]||(e[16]=[a.createTextVNode(" x: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.x,"onUpdate:modelValue":e[0]||(e[0]=p=>n.x=p),step:.01,min:n.min[0],max:n.max[0],"show-tooltip":!1,onInput:e[1]||(e[1]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.x,"onUpdate:modelValue":e[2]||(e[2]=p=>n.x=p),step:.01,min:n.min[0],max:n.max[0],controls:!1,class:"input-box number-input",onChange:e[3]||(e[3]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,{class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[17]||(e[17]=[a.createTextVNode(" y: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.y,"onUpdate:modelValue":e[4]||(e[4]=p=>n.y=p),step:.01,min:n.min[1],max:n.max[1],"show-tooltip":!1,onInput:e[5]||(e[5]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.y,"onUpdate:modelValue":e[6]||(e[6]=p=>n.y=p),step:.01,min:n.min[1],max:n.max[1],controls:!1,class:"input-box number-input",onChange:e[7]||(e[7]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,{class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[18]||(e[18]=[a.createTextVNode(" z: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.z,"onUpdate:modelValue":e[8]||(e[8]=p=>n.z=p),step:.01,min:n.min[2],max:n.max[2],"show-tooltip":!1,onInput:e[9]||(e[9]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.z,"onUpdate:modelValue":e[10]||(e[10]=p=>n.z=p),step:.01,min:n.min[2],max:n.max[2],controls:!1,class:"input-box number-input",onChange:e[11]||(e[11]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),n.enableScaling?(a.openBlock(),a.createBlock(c,{key:0,class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[19]||(e[19]=[a.createTextVNode(" Scale: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.scale,"onUpdate:modelValue":e[12]||(e[12]=p=>n.scale=p),step:.01,min:0,max:5,"show-tooltip":!1,onInput:e[13]||(e[13]=p=>s.modifyScale())},null,8,["modelValue"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.scale,"onUpdate:modelValue":e[14]||(e[14]=p=>n.scale=p),step:.01,min:0,max:5,controls:!1,class:"input-box number-input",onChange:e[15]||(e[15]=p=>s.modifyScale())},null,8,["modelValue"])]),_:1})]),_:1})):a.createCommentVNode("",!0)]),_:1})]),_:1})}const Tx=Kn(wD,[["render",MD],["__scopeId","data-v-cd88ead8"]]),AD={name:"OpacityControls",components:{Container:Jn,Header:w2,Main:vi,Slider:An},props:{material:void 0,zincObject:void 0},data:function(){return{displayString:"100%"}},watch:{"material.opacity":function(){this.material&&this.zincObject&&this.zincObject.setAlpha(this.material.opacity)}},methods:{formatTooltip(n){return this.displayString=Math.floor(100*n+.5)+"%",this.displayString}}},SD={class:"block"},_D={class:"display"};function TD(n,e,t,i,r,s){const o=An,l=Jn;return t.material?(a.openBlock(),a.createBlock(l,{key:0,class:"opacity-container"},{default:a.withCtx(()=>[a.createElementVNode("div",SD,[a.createElementVNode("span",_D,a.toDisplayString(n.displayString),1),a.createVNode(o,{modelValue:t.material.opacity,"onUpdate:modelValue":e[0]||(e[0]=u=>t.material.opacity=u),class:"my-slider",step:.01,min:0,max:1,"format-tooltip":s.formatTooltip,"show-tooltip":!1},null,8,["modelValue","format-tooltip"])])]),_:1})):a.createCommentVNode("",!0)}const Ex=Kn(AD,[["render",TD],["__scopeId","data-v-cbfc46a5"]]),ED={name:"PrimitiveControls",components:{Collapse:vg,CollapseItem:yg,LinesControls:Ax,OpacityControls:Ex,PointsControls:Sx,TextureSlidesControls:_x,TransformationControls:Tx,ElIconArrowRight:zi},props:{createData:{type:Object},viewingMode:{type:String,default:"Exploration"},usageConfig:{type:Object}},data:function(){return{activeName:"oControls",material:void 0,isTextureSlides:!1,isPointset:!1,isLines:!1,drawerOpen:!0,zincObject:void 0,isEditable:!1,displayString:"100%"}},computed:{hasValidPrimitive:function(){return this.viewingMode==="Exploration"||this.viewingMode==="Annotation"?this.material!==void 0||this.isTextureSlides===!0:!1}},methods:{formatTooltip:function(n){return this.displayString=Math.floor(100*n+.5)+"%",this.displayString},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setObject:function(n){var e,t;n?this.zincObject=a.markRaw(n):this.zincObject=void 0,this.isEditable=!!((e=this.zincObject)!=null&&e.isEditable),this.isPointset=!1,this.isTextureSlides=!1,this.isLines=!1,this.activeName="trControls",n&&(n.isTextureSlides?(this.isTextureSlides=!0,this.$refs.tSlidesControls.setObject(n),this.activeName="tsControls"):n.isPointset?(this.isPointset=!0,this.$refs.pointsetControls.setObject(n),this.activeName="pControls"):(n.isLines2||n.isTubeLines&&((t=this.usageConfig)!=null&&t.showTubeLinesControls))&&(this.isLines=!0,this.$refs.linesControls.setObject(n),this.activeName="lControls"),this.$refs.transformationControls.setObject(n)),n&&n.getMorph()?this.material=n.getMorph().material:this.material=void 0}}};function CD(n,e,t,i,r,s){const o=Ex,l=yg,u=Tx,c=_x,f=Sx,h=Ax,p=vg,v=zi,m=ht;return a.withDirectives((a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["primitive-controls",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createElementVNode("div",{class:a.normalizeClass(["my-drawer",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createVNode(p,{class:"collapse",modelValue:n.activeName,"onUpdate:modelValue":e[2]||(e[2]=d=>n.activeName=d),accordion:""},{default:a.withCtx(()=>[a.withDirectives(a.createVNode(l,{title:"Opacity",name:"oControls"},{default:a.withCtx(()=>[a.createVNode(o,{material:n.material,zincObject:n.zincObject,ref:"opacityControls"},null,8,["material","zincObject"])]),_:1},512),[[a.vShow,!n.isTextureSlides]]),a.withDirectives(a.createVNode(l,{title:"Transformation",name:"trControls"},{default:a.withCtx(()=>[a.createVNode(u,{class:"transformation-controls",ref:"transformationControls"},null,512)]),_:1},512),[[a.vShow,!n.isEditable]]),a.withDirectives(a.createVNode(l,{title:"Texture Slides",name:"tsControls"},{default:a.withCtx(()=>[a.createVNode(c,{class:"texture-controls",ref:"tSlidesControls"},null,512)]),_:1},512),[[a.vShow,n.isTextureSlides]]),a.withDirectives(a.createVNode(l,{title:"Points",name:"pControls"},{default:a.withCtx(()=>[a.createVNode(f,{class:"pointset-controls",ref:"pointsetControls",onPrimitivesUpdated:e[0]||(e[0]=d=>n.$emit("primitivesUpdated",d))},null,512)]),_:1},512),[[a.vShow,n.isPointset]]),a.withDirectives(a.createVNode(l,{title:"Lines",name:"lControls"},{default:a.withCtx(()=>[a.createVNode(h,{class:"lines-controls",ref:"linesControls",createData:t.createData,usageConfig:t.usageConfig,onPrimitivesUpdated:e[1]||(e[1]=d=>n.$emit("primitivesUpdated",d))},null,8,["createData","usageConfig"])]),_:1},512),[[a.vShow,n.isLines]])]),_:1},8,["modelValue"])],2),a.createElementVNode("div",{class:a.normalizeClass(["drawer-button",{open:n.drawerOpen,close:!n.drawerOpen}]),onClick:e[3]||(e[3]=(...d)=>s.toggleDrawer&&s.toggleDrawer(...d))},[a.createVNode(m,null,{default:a.withCtx(()=>[a.createVNode(v)]),_:1})],2)],2)),[[a.vShow,s.hasValidPrimitive]])}const Cx=Kn(ED,[["render",CD],["__scopeId","data-v-83d11562"]]),LD=(n,e)=>{const t=n.label.toUpperCase(),i=e.label.toUpperCase();return t<i?-1:t>i?1:0},RD={name:"ScaffoldTreeControls",components:{ElIconArrowLeft:ki,TreeControls:Ua.TreeControls},props:{showColourPicker:Boolean,isReady:Boolean},data:function(){return{treeData:[{label:"Root",regionPath:"",id:void 0,children:[]}],active:[],hover:[],drawerOpen:!0,nodeNumbers:0,module:void 0}},computed:{treeDataEntry:function(){return this.treeData[0].children}},watch:{treeDataEntry:{deep:!0,handler:function(n){this.isReady&&this.setColourField(n)}}},methods:{addTreeItem:function(n,e,t){n.some(i=>i.label===e.label)||(Object.assign(e,{activeColour:this.getColour(e)}),n.push(e),n.sort((i,r)=>LD(i,r)),this.nodeNumbers++,this.$nextTick(()=>{!this.$refs.treeControls.$refs.regionTree.getCheckedKeys().includes(e.id)&&t.getVisibility()&&this.$refs.treeControls.$refs.regionTree.setChecked(e.id,!0)}))},findOrCreateRegion:function(n,e,t){if(this.module&&this.module.scene&&(this.treeData[0].id=this.module.scene.getRootRegion().uuid,this.treeData[0].isRegion=!0),e.length>0){const i=[...e];let r=n.children.find(l=>l.label==i[0]);const s=t+"/"+e[0],o=this.module.scene.getRootRegion().findChildFromPath(s);return r||(r={label:i[0],id:o.uuid,children:[],regionPath:s,isRegion:!0},this.addTreeItem(n.children,r,o),s==="/_helper"&&this.$nextTick(()=>{this.$refs.treeControls.$refs.regionTree.setChecked(r.id,!1)})),i.shift(),this.findOrCreateRegion(r,i,s)}else return n},removeRegion:function(n){if(this.treeData[0].children){for(let e=0;e<this.treeData[0].children.length;e++)if(this.treeData[0].children[e].label===n){this.treeData[0].children.splice(e,1),this.nodeNumbers--;return}}},zincObjectAdded:function(n){const e=n.region;if(e){const t=e.getFullSeparatedPath(),i=this.findOrCreateRegion(this.treeData[0],t,"");if(n.groupName&&i){i.children||(i.children=[]);const r={disabled:!1,label:n.groupName,id:e.uuid+"/"+n.uuid,isPrimitives:!0,regionPath:n.region.getFullPath(),isTextureSlides:!!n.isTextureSlides};this.addTreeItem(i.children,r,n)}}},zincObjectRemoved:function(n){const e=n.groupName;if(n.region.findObjectsWithGroupName(e,!1).length===0){const i=n.region.getFullSeparatedPath(),r=this.findOrCreateRegion(this.treeData[0],i,"");if(r.children){for(let s=0;s<r.children.length;s++)if(r.children[s].label===e){r.children.splice(s,1),this.nodeNumbers--;return}}}},checkChanged:function(n,e){const t=n.isRegion,i=n.isPrimitives,r=e.checkedKeys.includes(n.id),s=this.module.scene.getRootRegion().findChildFromPath(n.regionPath);t&&(r?s.showAllPrimitives():s.hideAllPrimitives()),i&&s.findObjectsWithGroupName(n.label).forEach(l=>{const u=r&&!n.disabled;l.setVisibility(u)})},updateActiveUI:function(n){this.active.length=0,gx(n,this.active)},changeActiveByPrimitives:function(n,e){n&&n.length>0?(this.updateActiveUI(n),this.$emit("object-selected",n,e)):this.removeActive(e),this.removeHover(e)},updateHoverUI:function(n){this.hover.length=0,gx(n,this.hover)},changeHoverByPrimitives:function(n,e){n&&n.length>0?(this.updateHoverUI(n),this.$emit("object-hovered",n,e)):this.removeHover(e)},changeActiveByNames:function(n,e,t){const i=this.module.scene.getRootRegion(),r=Ao(i,n,e,!0);this.changeActiveByPrimitives(r,t)},changeHoverByNames:function(n,e,t){const i=this.module.scene.getRootRegion(),r=Ao(i,n,e,!0);this.changeHoverByPrimitives(r,t)},changeActiveByNode:function(n,e){if(n.isPrimitives||n.isRegion){const t=!!n.isRegion,i=this.getZincObjectsFromNode(n,t);this.changeActiveByPrimitives(i,e)}},changeHoverByNode:function(n,e){if(n.isPrimitives){const t=this.getZincObjectsFromNode(n,!1);this.changeHoverByPrimitives(t,e)}},removeActive:function(n){this.active=[],this.$emit("object-selected",[],n)},removeHover:function(n){this.hover=[],this.$emit("object-hovered",[],n)},clear:function(){this.active.length=0,this.hover.length=0,this.nodeNumbers=0,this.$refs.treeControls.$refs.regionTree.updateKeyChildren(this.treeData[0].id,[]),this.treeData[0].children.length=0,this.treeData[0].id=void 0,this.$emit("object-selected",[])},forEachChildInNode:function(n,e,t,i,r){if(n.isRegion){if(n.children){const s=t===""||e.includes(n.id);n.children.forEach(o=>this.forEachChildInNode(o,e,n.regionPath,i&&s,r))}}else n.isPrimitives&&r(n,t,i)},getColour:function(n){if(n){let t=this.getZincObjectsFromNode(n,!1)[0];if(t){let i=t.getColourHex();if(i)return"#"+i}}return"#FFFFFF"},getNodeDataByRegionAndGroup:function(n,e){for(const t of this.treeDataEntry)if(t.isRegion&&t.label===n){const i=t.children;for(const r of i)if(r.isPrimitives&&r.label===e)return r}},getZincObjectsFromNode:function(n,e){const t=this.module.scene.getRootRegion();if(n.isPrimitives)return Ao(t,n.label,n.regionPath,e);if(n.isRegion&&n.regionPath){let i=t.findChildFromPath(n.regionPath);if(i)return i.getAllObjects(e)}return[]},setModule:function(n){this.module=a.markRaw(n),this.nodeNumbers=0,this.module.scene.getRootRegion().getAllObjects(!0).forEach(t=>{this.zincObjectAdded(t)}),this.module.addOrganPartAddedCallback(this.zincObjectAdded),this.module.addOrganPartRemovedCallback(this.zincObjectRemoved)},setColourField:function(n,e=void 0){n.filter(t=>e&&!t.children?t.id===e.id:!0).map(t=>{if(t.children)this.setColourField(t.children,e);else{const i=this.getColour(t);t.defaultColour||(t.defaultColour=i),t.activeColour=i}})},setColour:function(n,e){n&&n.isPrimitives&&this.getZincObjectsFromNode(n,!1).forEach(i=>{let s=(e||n.defaultColour).replace("#","0x");i.setColourHex(s),this.setColourField(this.treeData[0].children,n)})},updateAllNodeColours:function(){const n=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();this.forEachChildInNode(this.treeData[0],n,"",!0,(e,t,i)=>{e.isPrimitives&&(e.activeColour=this.getColour(e))})},setOutlines:function(n){const e=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();this.forEachChildInNode(this.treeData[0],e,"",!0,(t,i,r)=>{const o=this.module.scene.getRootRegion().findChildFromPath(i).findObjectsWithGroupName(t.label);n?o.forEach(l=>{l.isLines&&(e.includes(t.id)&&r&&l.setVisibility(!0),t.disabled=!1)}):t.isPrimitives&&o.forEach(l=>{l.isLines&&(l.setVisibility(!1),t.disabled=!0)})})},visibilityToggle:function(n,e){this.module.changeOrganPartsVisibility(n,e),e==!1&&(this.activeRegion===n&&this.removeActive(!0),this.hoverRegion===n&&this.removeHover(!0))},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen,this.$emit("drawer-toggled",this.drawerOpen)},setTreeVisibilityWithFullPaths:function(n,e,t,i){let r=!1,s="";n.isRegion&&(s=`__r${n.regionPath}`),n.isPrimitives&&(s=`${n.regionPath}/${n.label}`);const o=e.indexOf(s);o>-1&&(r=!0,e.splice(o,1),t.push(n.id));const l=this.module.scene.getRootRegion().findChildFromPath(n.regionPath);s&&s!=="__r"&&n.isPrimitives&&l.findObjectsWithGroupName(n.label).forEach(c=>c.setVisibility(r)),n.children&&n.children.forEach(u=>{this.setTreeVisibilityWithFullPaths(u,e,t,!0)})},setCheckedKeys:function(n,e){this.$nextTick(()=>{e&&this.$refs.treeControls.$refs.regionTree.setCheckedKeys([]),n.forEach(t=>{this.$refs.treeControls.$refs.regionTree.setChecked(t,!0,!0)})})},checkAllKeys:function(n=[]){const e=[],t=[];vx(this.treeData[0],e);const i=e.filter(r=>!n.some(s=>r.includes(s)));this.setTreeVisibilityWithFullPaths(this.treeData[0],i,t,!0),this.$refs.treeControls.$refs.regionTree.setCheckedKeys(t)},getState:function(){let n=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();return n.length===this.nodeNumbers?{checkAll:!0,version:"2.0"}:{checkedItems:hD(this.module.scene.getRootRegion(),n),version:"2.0"}},setState:function(n){if(n){if(n.checkAll)this.checkAllKeys();else if(n.checkedItems){let e=[];n.version!=="2.0"?(e=n.checkedItems.map(i=>"/"+i),e.shift("__r/")):e.push(...n.checkedItems);const t=[];this.setTreeVisibilityWithFullPaths(this.treeData[0],e,t,!0),this.$refs.treeControls.$refs.regionTree.setCheckedKeys(t)}}}}},FD={class:"traditional-container"};function PD(n,e,t,i,r,s){const o=a.resolveComponent("TreeControls"),l=ki,u=ht;return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["tree-controls",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createElementVNode("div",FD,[a.createVNode(o,{mapType:"scaffold",title:"Regions",isReady:t.isReady,treeData:s.treeDataEntry,active:n.active,hover:n.hover,showColourPicker:t.showColourPicker,onSetColour:s.setColour,onCheckChanged:s.checkChanged,onChangeActive:s.changeActiveByNode,onChangeHover:s.changeHoverByNode,ref:"treeControls",onMouseleave:e[0]||(e[0]=c=>s.removeHover(!0))},null,8,["isReady","treeData","active","hover","showColourPicker","onSetColour","onCheckChanged","onChangeActive","onChangeHover"])]),a.createElementVNode("div",{class:a.normalizeClass(["drawer-button",{open:n.drawerOpen,close:!n.drawerOpen}]),onClick:e[1]||(e[1]=(...c)=>s.toggleDrawer&&s.toggleDrawer(...c))},[a.createVNode(u,null,{default:a.withCtx(()=>[a.createVNode(l)]),_:1})],2)],2)}const Lx=Kn(RD,[["render",PD],["__scopeId","data-v-5394b615"]]),xf=Ga.defineStore("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(n){return n.userProfile.token}},actions:{setUserToken(n){this.userProfile.token=n}}}),ID={name:"ScaffoldTooltip",components:{Col:Fn,CreateTooltipContent:Ua.CreateTooltipContent,ElIconDelete:tl,Icon:ht,Popover:Ml,Row:Yn,Tooltip:Ua.Tooltip},props:{createData:{type:Object,default:{toBeConfirmed:!1,points:[],shape:"",x:0,y:0}},label:{type:String,default:""},annotationDisplay:{type:Boolean,default:!1},annotationFeature:{type:Object,default:{}},offlineAnnotationEnabled:{type:Boolean,default:!1},region:{type:String,default:""},visible:{type:Boolean,default:!1},x:{type:Number,default:200},y:{type:Number,default:200}},inject:["scaffoldUrl"],provide(){return{userApiKey:this.userToken}},data:function(){return{display:!1,annotationEntry:[],ElIconDelete:a.shallowRef(tl)}},computed:{...Ga.mapState(xf,["userToken"]),position:function(){let n=40;return this.region&&(n=55),{left:this.x-40+"px",top:this.y-n+"px"}}},methods:{checkForDisplay:function(){if(this.visible&&this.label&&this.label!==""){if(this.display=!0,this.annotationDisplay){const n=this.region?this.region+"/":"";this.annotationEntry=[{featureId:n+this.label,resourceId:this.scaffoldUrl,resource:this.scaffoldUrl,feature:this.annotationFeature,offline:this.offlineAnnotationEnabled}]}}else this.display=!1,this.annotationEntry=[]},hideTriggered:function(){this.$emit("tooltip-hide")}},watch:{label:{handler:function(){this.checkForDisplay()},immediate:!0},visible:{handler:function(){this.checkForDisplay()},immediate:!0},annotationDisplay:{handler:function(){this.checkForDisplay()},immediate:!0}}},OD={class:"tooltip-text"},ND={key:0,class:"tooltip-text"},BD={key:1,class:"delete-container"};function DD(n,e,t,i,r,s){const o=a.resolveComponent("CreateTooltipContent"),l=a.resolveComponent("Tooltip"),u=Fn,c=ws,f=Yn,h=Ml;return a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(s.position),class:"region-tooltip"},[a.createVNode(h,{ref:"tooltip",visible:t.visible,placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tooltip-popper non-selectable","virtual-triggering":"",onHide:s.hideTriggered},{default:a.withCtx(()=>[a.createElementVNode("div",OD,a.toDisplayString(t.label),1),t.region?(a.openBlock(),a.createElementBlock("div",ND,"Region: "+a.toDisplayString(t.region),1)):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(o,{createData:t.createData,onConfirmCreate:e[0]||(e[0]=p=>n.$emit("confirm-create",p)),onCancelCreate:e[1]||(e[1]=p=>n.$emit("cancel-create"))},null,8,["createData"]),[[a.vShow,t.createData.toBeConfirmed]]),a.withDirectives(a.createVNode(l,{class:"p-tooltip",ref:"annotationTooltip",annotationDisplay:!0,annotationEntry:n.annotationEntry,onAnnotation:e[2]||(e[2]=p=>n.$emit("confirm-comment",p))},null,8,["annotationEntry"]),[[a.vShow,t.annotationDisplay&&!t.createData.toBeConfirmed]]),t.createData.toBeDeleted?(a.openBlock(),a.createElementBlock("div",BD,[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(u,{span:10},{default:a.withCtx(()=>e[5]||(e[5]=[a.createTextVNode("Delete this feature?")])),_:1}),a.createVNode(u,{span:7},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",icon:n.ElIconDelete,onClick:e[3]||(e[3]=p=>n.$emit("confirm-delete"))},{default:a.withCtx(()=>e[6]||(e[6]=[a.createTextVNode(" Delete ")])),_:1},8,["icon"])]),_:1}),a.createVNode(u,{span:6},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",onClick:e[4]||(e[4]=p=>n.$emit("cancel-create"))},{default:a.withCtx(()=>e[7]||(e[7]=[a.createTextVNode(" Dismiss ")])),_:1})]),_:1})]),_:1})])):a.createCommentVNode("",!0)]),_:1},8,["visible","onHide"])],4)}const Rx=Kn(ID,[["render",DD],["__scopeId","data-v-d3f76b72"]]),Va={ALL:0,SELECTED:1,HIGHLIGHTED:2,MOVE:3},VD=function(n,e,t){this.eventType=n,this.identifiers=e,this.zincObjects=t},kD=function(n,e,t){this.targetedID=[];const i=n,r=e;this.targetEventType=t;const s=this;t===void 0&&(this.targetEventType=Va.ALL),this.getEventType=function(){return t},this.notify=function(o,l,u,c){if(o!==i&&(s.targetEventType===Va.ALL||s.targetEventType===l)){const f=new VD(l,u,c);r(f)}}},zD=function(){const n=[];this.publish=function(e,t,i,r){for(let s=0;s<n.length;s++)n[s].notify(e,t,i,r)},this.subscribe=function(e,t,i){if(typeof t=="function"){const r=new kD(e,t,i);return n.push(r),r}},this.unsubscribe=function(e){for(let t=0;t<n.length;t++)if(e===n[t]){n.splice(t,1);return}}},Fx={isWebGLAvailable:function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch{return!1}},isWebGL2Available:function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch{return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(n){var e={1:"WebGL",2:"WebGL 2"},t={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},i='This module requires <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#008">$1</a> support but your $0 does not seem to support it.',r=document.createElement("div");return r.id="webglmessage",r.style.fontFamily="monospace",r.style.fontSize="20px",r.style.fontWeight="normal",r.style.textAlign="center",r.style.background="#fff",r.style.color="#000",r.style.padding="1.5em",r.style.width="400px",r.style.margin="5em auto 0",t[n]?i=i.replace("$0","graphics card"):i=i.replace("$0","browser"),i=i.replace("$1",e[n]),r.innerHTML=i,r}},wf={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},yn=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};yn.prototype.setName=function(n){if(n&&this.instanceName!==n){this.instanceName=n;const e=this.onChangedCallbacks.slice();for(let t=0;t<e.length;t++)e[t](this,wf.NAME_CHANGED)}},yn.prototype.settingsChanged=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,wf.SETTINGS_CHANGED)},yn.prototype.exportSettings=function(){const n={};return n.dialog=this.typeName,n.name=this.instanceName,n},yn.prototype.importSettings=function(n){return n.dialog==this.typeName?(this.setName(n.name),!0):!1},yn.prototype.publishChanges=function(n,e,t){for(let i=0;i<this.eventNotifiers.length;i++)this.eventNotifiers[i].publish(this,e,n,t)},yn.prototype.getName=function(){return this.instanceName},yn.prototype.destroy=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,wf.DESTROYED);delete this},yn.prototype.addChangedCallback=function(n){this.onChangedCallbacks.includes(n)==!1&&this.onChangedCallbacks.push(n)},yn.prototype.removeChangedCallback=function(n){const e=this.onChangedCallbacks.indexOf(n);e>-1&&this.onChangedCallbacks.splice(e,1)},yn.prototype.addNotifier=function(n){this.eventNotifiers.push(n)};const jc=(n,e,t)=>{for(let i=0;i<n.length;i++)if(n[i]&&n[i].material&&n[i].material.emissive){let r=n[i].userData;r&&r.isZincObject?r.setEmissiveRGB(e):n[i].material&&n[i].material.emissive&&n[i].material.emissive.setRGB(...e),t&&n[i].material.depthFunc&&(n[i].material.depthFunc=br.THREE.LessEqualDepth),n[i].children.forEach(s=>{const o=s.userData;o&&o.isZincObject&&s.material&&s.material.emissive&&s.material.emissive.setRGB(...e)})}},UD=function(){let n=[],e=[];this.highlightColour=[1,0,0],this.selectColour=[0,1,0],this.originalColour=[0,0,0];const t=[],i=[],r=this,s=function(u,c){if(u.length==0&&c.length==0)return!1;for(let f=0;f<u.length;f++){let h=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(h=!0);if(!h)return!0}for(let f=0;f<c.length;f++){let h=!1;for(let p=0;p<u.length;p++)c[f]===u[p]&&(h=!0);if(!h)return!0}return!1},o=function(u,c){if(t.length=0,c.length==0)return u;for(let f=0;f<u.length;f++){let h=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(h=!0);h||t.push(u[f])}return t};this.setHighlighted=function(u){const c=[...n];this.setNervesStyle(c),r.resetHighlighted();const f=o(u,e),h=l(f);return this.setNervesStyle(f,oi.HIGHLIGHTED_COLOUR),jc(h,r.highlightColour,!1),n=f,s(n,c)},this.setSelected=function(u){const c=[...e];this.setNervesStyle(c),r.resetHighlighted(),r.resetSelected();const f=l(u);return this.setNervesStyle(u,oi.SELECTED_COLOUR),jc(f,r.selectColour,!1),e=u,s(e,c)};const l=function(u){i.length=0;for(let c=0;c<u.length;c++)u[c].material&&i.push(u[c]);return i};this.setNervesStyle=function(u,c){const f=bf(u);if(f&&f.length){const h=c?oi.ZOOM_RADIUS:oi.DEFAULT_RADIUS,p=c?oi.ZOOM_RADIAL_SEGMENTS:oi.DEFAULT_RADIAL_SEGMENTS;f.forEach(v=>{var m,d,b;if(v.isTubeLines&&((m=v.userData)!=null&&m.isNerves)&&!((d=v.userData)!=null&&d.isGreyScale)){v.setTubeLines(h,p);let y=c||((b=v.userData)==null?void 0:b.defaultColour);y=y.replace("#","0x"),v.setColourHex(y)}})}},this.resetHighlighted=function(){const u=l(n);this.setNervesStyle(n),jc(u,r.originalColour,!0),n=[]},this.resetSelected=function(){const u=l(e);this.setNervesStyle(n),jc(u,r.originalColour,!0),e=[]},this.getSelected=function(){return e},this.reset=function(){r.resetSelected(),r.resetHighlighted()}},Mf=Hc.THREE,GD=function(){const n=document.createElement("div");let e;if(n.style.height="100%",Fx.isWebGLAvailable())e=new Hc.Renderer(n,window),Hc.defaultMaterialColor=16777116,e.initialiseVisualisation(),e.playAnimation=!1;else{const t=Fx.getWebGLErrorMessage();n.appendChild(t)}return{Zinc:Hc,renderer:e,container:n}},Et=function(){yn.call(this),this.scene=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new UD,this.selectObjectOnPick=!0,this.zincRenderer=null,this.selectedScreenCoordinates=new Mf.Vector3,this.selectedCenter=void 0,this.liveUpdatesObjects=void 0,this.ignorePreviousSelected=!1};Et.prototype=Object.create(yn.prototype),Et.prototype.getIntersectedObject=function(n){if(n){const e=n.map(i=>{if(i&&i.object&&i.object.userData){if(i.object.userData.isMarker)return 1;if(i.object.name&&i.object.userData.isZincObject)return i.object.name==="_Unnamed"?3:2}return 0});let t=e.indexOf(1);return t>-1||(t=e.indexOf(2),t=t>-1?t:e.indexOf(3)),n[t]}},Et.prototype.getAnnotationsFromObjects=function(n){const e=[];for(var t=0;t<n.length;t++){const i=n[t].userData;let r;if(i){if(i.isGlyph||i.isGlyphset){let s=i;i.isGlyph&&(s=i.getGlyphset()),r=s.userData?s.userData.annotation:void 0,r&&r.data&&(n[t].name&&n[t].name!=""?r.data.id=n[t].name:r.data.id=s.groupName)}else r=i.userData?i.userData.annotation:void 0,r&&r.data&&(r.data.id=n[t].name);r&&(r.data.anatomicalId=i.anatomicalId,r.data.isNerves=i.userData.isNerves,r.data.zincObject=i)}r&&e.push(r)}return e},Et.prototype.setHighlightedByObjects=function(n,e,t,i){const r=bf(n),s=this.graphicsHighlight.setHighlighted(n);if(i){let o=Va.MOVE;s&&(o=Va.HIGHLIGHTED);const l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,r)}return s},Et.prototype.setHighlightedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{s&&s.getMorph()&&r.push(s.getMorph())}),this.setHighlightedByObjects(r,e,t,i)},Et.prototype.setupLiveCoordinates=function(n){if(this.liveUpdatesObjects=n,n&&n.length>0){const e=this.scene.getBoundingBoxOfZincObjects(n);let t=new Mf.Vector3;e?(e.getCenter(t),this.selectedCenter==null?this.selectedCenter=t:this.selectedCenter.copy(t)):this.selectedCenter=void 0}else this.selectedCenter=void 0},Et.prototype.setSelectedByObjects=function(n,e,t,i){let r=!1;if(this.selectObjectOnPick?r=this.graphicsHighlight.setSelected(n):r=!0,r||this.ignorePreviousSelected){const s=bf(n);if(this.selectObjectOnPick&&this.setupLiveCoordinates(s),i){const o=Va.SELECTED,l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}}return r},Et.prototype.setSelectedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{if(s){const o=s.getMorph();o&&r.push(o)}}),this.setSelectedByObjects(r,e,t,i)},Et.prototype.findObjectsByGroupName=function(n){return this.scene.findObjectsWithGroupName(n)},Et.prototype.setHighlightedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setHighlightedByObjects(t,void 0,{},e)},Et.prototype.setSelectedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setSelectedByObjects(t,void 0,{},e)},Et.prototype.changeBackgroundColour=function(n){const e=new Mf.Color(n);this.zincRenderer&&this.zincRenderer.getThreeJSRenderer().setClearColor(e,1)},Et.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},Et.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},Et.prototype.playAnimation=function(n){this.zincRenderer&&(this.zincRenderer.playAnimation=n)},Et.prototype.setPlayRate=function(n){this.zincRenderer&&this.zincRenderer.setPlayRate(n)},Et.prototype.getPlayRate=function(n){return this.zincRenderer?this.zincRenderer.getPlayRate():0},Et.prototype.initialiseRenderer=function(n){if(this.zincRenderer===void 0||this.rendererContainer===void 0){let e=GD();this.Zinc=e.Zinc,this.zincRenderer=e.renderer,this.rendererContainer=e.container}n&&(this.displayArea=n,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&this.zincRenderer.animate())},Et.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),yn.prototype.destroy.call(this)};const HD=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0},WD=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.timeVarying=!1,this.currentTime=0},Px=function(n){Et.call(this);const e=this;let t;this.sceneData=new WD;const i=new Array,r=new Array,s=new Array,o=new Array;let l,u;const c=n;this.NDCCameraControl=void 0,e.typeName="Organ Viewer";let f=!1;this.isIgnorePicking=function(){return f},this.setIgnorePicking=function(_){f=_},this.getSceneData=function(){return e.sceneData},this.updateTime=function(_){let E=6e3;e.scene&&(E=e.scene.getDuration());const C=_/100*E;e.sceneData.nerveMapIsActive||e.scene&&e.scene.setMorphsTime(C),e.sceneData.currentTime=_};const h=function(){let _=3e3;e.scene&&(_=e.scene.getDuration());const E=e.zincRenderer.getCurrentTime();for(let C=0;C<i.length;C++)i[C](E);!e.sceneData.nerveMapIsActive&&t&&t.setMorphsTime(E),e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setTime(E/_),e.sceneData.currentTime=E/_*100};this.getCurrentTime=function(){return e.sceneData.currentTime},this.toggleSyncControl=(_,E)=>{let C=this.scene.getZincCameraControls();_?(C.resetView(),this.NDCCameraControl=C.enableSyncControl(),C.setRotationMode(E)):(C.disableSyncControl(),this.NDCCameraControl=void 0,C.setRotationMode("free"))},this.isSyncControl=()=>this.NDCCameraControl!==void 0,this.setSyncControlZoomToBox=_=>{this.NDCCameraControl&&this.NDCCameraControl.zoomToBox(_,2)},this.setSyncControlCallback=_=>{this.NDCCameraControl&&this.NDCCameraControl.setEventCallback(_)},this.setSyncControlCenterZoom=(_,E)=>{this.NDCCameraControl&&this.NDCCameraControl.setCenterZoom(_,E)};const p=function(){if(e.zincRenderer.playAnimation&&e.liveUpdatesObjects&&e.setupLiveCoordinates(e.liveUpdatesObjects),e.selectedCenter){const _=new br.THREE.Vector3;_.copy(e.selectedCenter);const E=e.scene.vectorToScreenXY(_);e.selectedScreenCoordinates.x=E.x,e.selectedScreenCoordinates.y=E.y}},v=function(){return function(){h()}},m=function(){return function(){p()}};this.addTimeChangedCallback=function(_){i.push(_)},this.setTexturePos=function(_){e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setSliderPos(_)},this.addSceneChangedCallback=function(_){r.push(_)},this.addOrganPartAddedCallback=function(_){s.push(_)},this.addOrganPartRemovedCallback=function(_){o.push(_)},this.setFinishDownloadCallback=function(_){l=_},this.unsetFinishDownloadCallback=function(){l=void 0},this.setDownloadErrorCallback=function(_){u=_},this.unsetDownloadErrorCallback=function(){u=void 0},this.getNamedObjectsToScreenCoordinates=function(_,E){const C=new br.THREE.Vector3;C.setFromMatrixPosition(obj.matrixWorld);const L=width/2,I=height/2;return C.project(E),C.x=C.x*L+L,C.y=-(C.y*I)+I,C};const d=function(_){let E,C;if(_!==void 0){let L=!1;_.object.userData&&_.object.userData.isMarker?(L=!0,C=_.object.userData.parent.getMorph()):C=_.object;try{C.userData.userData.annotation.data.lastActionOnMarker=L}finally{}if(C)if(C.name)E=C.name;else{const I=e.getAnnotationsFromObjects([C]);I&&I[0]&&(E=I[0].data.group)}}return{id:E,object:C}},b=function(){return function(_,E,C){var B;const L=e.getIntersectedObject(_),I=d(L),x={worldCoords:[L?L.point.x:0,L?L.point.y:0,L?L.point.z:0],intersected:L,intersects:_},O={x:E,y:C};if(I.id){x.threeID=(B=I.object)==null?void 0:B.id,I.object.userData.isGlyph?I.object.name?e.setSelectedByObjects([I.object],O,x,!0):e.setSelectedByZincObjects(I.object.userData.getGlyphset(),O,x,!0):e.setSelectedByObjects([I.object],O,x,!0);return}else{if(f)return;e.setSelectedByObjects([],O,x,!0)}}},y=function(){return function(_,E,C){var B;const L=e.getIntersectedObject(_),I=d(L),x={worldCoords:[L?L.point.x:0,L?L.point.y:0,L?L.point.z:0]},O={x:E,y:C};if(I.id){x.threeID=(B=I.object)==null?void 0:B.id,e.displayArea.style.cursor="pointer",e.setHighlightedByObjects([I.object],O,x,!0);return}else e.displayArea.style.cursor="auto",e.setHighlightedByObjects([],O,x,!0)}},g=function(_,E,C,L){if(L=="all"||L=="geometries"){const I=_.findGeometriesWithGroupName(E);for(let x=0;x<I.length;x++)I[x].setVisibility(C)}if(L=="all"||L=="glyphsets"){const I=_.findGlyphsetsWithGroupName(E);for(let x=0;x<I.length;x++)I[x].setVisibility(C)}if(L=="all"||L=="pointsets"){const I=_.findPointsetsWithGroupName(E);for(let x=0;x<I.length;x++)I[x].setVisibility(C)}if(L=="all"||L=="lines"){const I=_.findLinesWithGroupName(E);for(let x=0;x<I.length;x++)I[x].setVisibility(C)}};this.changeGeometriesVisibility=function(_,E){g(e.scene,_,E,"geometries")},this.changeGlyphsetsVisibility=function(_,E){g(e.scene,_,E,"glyphsets")},this.changeLinesVisibility=function(_,E){g(e.scene,_,E,"lines")},this.changePointsetsVisibility=function(_,E){g(e.scene,_,E,"pointsets")},this.changeOrganPartsVisibility=function(_,E,C){let L="all";C!==void 0&&(L=C),g(e.scene,_,E,L)},this.changeOrganPartsVisibilityCallback=function(_){return function(E){e.changeOrganPartsVisibility(_,E)}},this.changeBackgroundColour=function(_){const E=new br.THREE.Color(_);e.zincRenderer&&e.zincRenderer.getThreeJSRenderer().setClearColor(E,1)};const w=function(_,E,C,L){for(let O=0;O<s.length;O++)s[O](L,e.scene.isTimeVarying());const I=new HD,x=L.region.getFullPath();I.data={species:e.sceneData.currentSpecies,system:_,part:E,group:L.groupName,region:x,uuid:L.uuid,lastActionOnMarker:!1},L.userData.annotation=I},A=function(_,E,C,L){for(let I=0;I<o.length;I++)o[I](L)},S=function(_,E,C){return function(L){w(_,E,C,L)}},M=function(_,E,C){return function(L){A(_,E,C,L)}},F=function(){return function(){e.settingsChanged(),e.sceneData.timeVarying=e.scene.isTimeVarying(),l&&l()}},R=function(){return function(_){if((_==null?void 0:_.type)==="Error"&&u){const E={xhr:_.xhr,type:"download-error"};u(E)}}};this.updateFieldvisibility=function(_,E){for(let C=0;C<_.length;C++)if(E!=C){const L=_[C].PartName;e.changeOrganPartsVisibility(L,!1)}if(E>-1){const C=_[E].PartName;if(e.scene.findGeometriesWithGroupName(C).length>0||e.scene.findGlyphsetsWithGroupName(C).length>0)e.changeOrganPartsVisibility(C,!0);else{const L=getOrganDetails(_[E].SystemName,C);L!=null&&e.scene.loadMetadataURL(c.getOrgansDirectoryPrefix()+"/"+L.meta)}}},this.getAvailableSpecies=function(_,E,C){const L=new Array;L.push("none");const I=Object.keys(organsFileMap);for(index in I){const x=I[index];x!=_&&organsFileMap[x].hasOwnProperty(E)&&organsFileMap[x][E].hasOwnProperty(C)&&L.push(x)}return L},this.getCentreAndSize=function(){const _=new br.THREE.Vector3,E=this.scene.getBoundingBox();E.getCenter(_);const C=[_.x,_.y,_.z];E.getSize(_);const L=[_.x,_.y,_.z];return{centre:C,size:L}};const T=function(_,E,C,L){e.sceneData.nerveMapIsActive=!1,e.sceneData.nerveMap=void 0,e.sceneData.metaURL="",e.sceneData.viewURL="",e.sceneData.currentSpecies=_,e.sceneData.currentSystem=E,e.sceneData.currentPart=C,e.sceneData.currentTime=0,e.sceneData.timeVarying=!1;let I="";_&&(I=_+"/"),E&&(I=E+"/"),C&&(I=C),e.sceneData.currentName=I};this.loadOrgansFromURL=function(_,E,C,L,I,x,O){if(e.zincRenderer&&L&&e.sceneData.metaURL!==_){T(E,C,L);const B=e.sceneData.currentName;let D=e.zincRenderer.getSceneByName(B);D?x&&D.clearAll():D=e.zincRenderer.createScene(B),e.selectObjectOnPick=!0;for(let V=0;V<r.length;V++)r[V](e.sceneData);I&&I!=""?(e.sceneData.viewURL=I,D.loadViewURL(e.sceneData.viewURL)):e.sceneData.viewURL=void 0,e.sceneData.metaURL=_,D.addZincObjectAddedCallbacks(S(C,L,!1)),D.addZincObjectRemovedCallbacks(M(void 0,L,!1)),D.loadMetadataURL(_,R(),F(),O),e.scene=D,e.zincRenderer.setCurrentScene(D),e.graphicsHighlight.reset();const k=D.getZincCameraControls();k.enableRaycaster(D,b(),y()),k.setMouseButtonAction("AUXILIARY","ZOOM"),k.setMouseButtonAction("SECONDARY","PAN")}},this.loadGLTFFromURL=function(_,E,C){if(e.zincRenderer&&E&&e.sceneData.metaURL!==_){T(void 0,void 0,E);const L=e.sceneData.currentName;let I=e.zincRenderer.getSceneByName(L);I?C&&I.clearAll():I=e.zincRenderer.createScene(L);for(let O=0;O<r.length;O++)r[O](e.sceneData);e.sceneData.viewURL=void 0,e.sceneData.metaURL=_,I.addZincObjectAddedCallbacks(S(void 0,E,!1)),I.addZincObjectRemovedCallbacks(M(void 0,E,!1)),I.loadGLTF(_,void 0,F()),e.scene=I,e.zincRenderer.setCurrentScene(I),e.graphicsHighlight.reset();const x=I.getZincCameraControls();x.enableRaycaster(I,b(),y()),x.setMouseButtonAction("AUXILIARY","ZOOM"),x.setMouseButtonAction("SECONDARY","PAN")}},this.alignCameraWithSelectedObject=function(_){const E=e.graphicsHighlight.getSelected();E&&E[0]&&E[0].userData&&e.scene.alignObjectToCameraView(E[0].userData,_)},this.exportSettings=function(){const _={};return _.name=e.instanceName,e.sceneData.currentSystem&&(_.system=e.sceneData.currentSystem),e.sceneData.currentSpecies&&(_.species=e.sceneData.currentSpecies),e.sceneData.currentPart&&(_.part=e.sceneData.currentPart),_.metaURL=e.sceneData.metaURL,e.sceneData.viewURL&&(_.viewURL=e.sceneData.viewURL),_.dialog="Organ Viewer",_},this.importSettings=function(_){return _&&_.dialog==this.typeName?(e.setName(_.name),_.metaURL!==void 0&&_.metaURL!=""?e.loadOrgansFromURL(_.metaURL,_.species,_.system,_.part,_.viewURL,!0):e.loadOrgans(_.species,_.system,_.part),!0):!1},function(){e.initialiseRenderer(void 0),e.zincRenderer&&(e.zincRenderer.addPreRenderCallbackFunction(v()),e.zincRenderer.addPostRenderCallbackFunction(m()))}()};Px.prototype=Object.create(Et.prototype);var lt=function(){return lt=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},lt.apply(this,arguments)};function jD(n,e,t,i){function r(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function l(f){try{c(i.next(f))}catch(h){o(h)}}function u(f){try{c(i.throw(f))}catch(h){o(h)}}function c(f){f.done?s(f.value):r(f.value).then(l,u)}c((i=i.apply(n,[])).next())})}function $D(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(c){return function(f){return u([c,f])}}function u(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(i=1,r&&(s=c[0]&2?r.return:c[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;switch(r=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,r=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(f){c=[6,f],r=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Ye(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ct(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var i=t.call(n),r,s=[],o;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}typeof SuppressedError=="function"&&SuppressedError;var ZD="ENTRIES",Ix="KEYS",Ox="VALUES",Yt="",Af=function(){function n(e,t){var i=e._tree,r=Array.from(i.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:i,keys:r}]:[]}return n.prototype.next=function(){var e=this.dive();return this.backtrack(),e},n.prototype.dive=function(){if(this._path.length===0)return{done:!0,value:void 0};var e=So(this._path),t=e.node,i=e.keys;if(So(i)===Yt)return{done:!1,value:this.result()};var r=t.get(So(i));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},n.prototype.backtrack=function(){if(this._path.length!==0){var e=So(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},n.prototype.key=function(){return this.set._prefix+this._path.map(function(e){var t=e.keys;return So(t)}).filter(function(e){return e!==Yt}).join("")},n.prototype.value=function(){return So(this._path).node.get(Yt)},n.prototype.result=function(){switch(this._type){case Ox:return this.value();case Ix:return this.key();default:return[this.key(),this.value()]}},n.prototype[Symbol.iterator]=function(){return this},n}(),So=function(n){return n[n.length-1]},XD=function(n,e,t){var i=new Map;if(e===void 0)return i;for(var r=e.length+1,s=r+t,o=new Uint8Array(s*r).fill(t+1),l=0;l<r;++l)o[l]=l;for(var u=1;u<s;++u)o[u*r]=u;return Nx(n,e,t,i,o,1,r,""),i},Nx=function(n,e,t,i,r,s,o,l){var u,c,f=s*o;try{e:for(var h=Ye(n.keys()),p=h.next();!p.done;p=h.next()){var v=p.value;if(v===Yt){var m=r[f-1];m<=t&&i.set(l,[n.get(v),m])}else{for(var d=s,b=0;b<v.length;++b,++d){for(var y=v[b],g=o*d,w=g-o,A=r[g],S=Math.max(0,d-t-1),M=Math.min(o-1,d+t),F=S;F<M;++F){var R=y!==e[F],T=r[w+F]+ +R,P=r[w+F+1]+1,_=r[g+F]+1,E=r[g+F+1]=Math.min(T,P,_);E<A&&(A=E)}if(A>t)continue e}Nx(n.get(v),e,t,i,r,d,o,l+v)}}}catch(C){u={error:C}}finally{try{p&&!p.done&&(c=h.return)&&c.call(h)}finally{if(u)throw u.error}}},Sf=function(){function n(e,t){e===void 0&&(e=new Map),t===void 0&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return n.prototype.atPrefix=function(e){var t,i;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var r=Ct($c(this._tree,e.slice(this._prefix.length)),2),s=r[0],o=r[1];if(s===void 0){var l=Ct(Ef(o),2),u=l[0],c=l[1];try{for(var f=Ye(u.keys()),h=f.next();!h.done;h=f.next()){var p=h.value;if(p!==Yt&&p.startsWith(c)){var v=new Map;return v.set(p.slice(c.length),u.get(p)),new n(v,e)}}}catch(m){t={error:m}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(t)throw t.error}}}return new n(s,e)},n.prototype.clear=function(){this._size=void 0,this._tree.clear()},n.prototype.delete=function(e){return this._size=void 0,YD(this._tree,e)},n.prototype.entries=function(){return new Af(this,ZD)},n.prototype.forEach=function(e){var t,i;try{for(var r=Ye(this),s=r.next();!s.done;s=r.next()){var o=Ct(s.value,2),l=o[0],u=o[1];e(l,u,this)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.fuzzyGet=function(e,t){return XD(this._tree,e,t)},n.prototype.get=function(e){var t=_f(this._tree,e);return t!==void 0?t.get(Yt):void 0},n.prototype.has=function(e){var t=_f(this._tree,e);return t!==void 0&&t.has(Yt)},n.prototype.keys=function(){return new Af(this,Ix)},n.prototype.set=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Tf(this._tree,e);return i.set(Yt,t),this},Object.defineProperty(n.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),n.prototype.update=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Tf(this._tree,e);return i.set(Yt,t(i.get(Yt))),this},n.prototype.fetch=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Tf(this._tree,e),r=i.get(Yt);return r===void 0&&i.set(Yt,r=t()),r},n.prototype.values=function(){return new Af(this,Ox)},n.prototype[Symbol.iterator]=function(){return this.entries()},n.from=function(e){var t,i,r=new n;try{for(var s=Ye(e),o=s.next();!o.done;o=s.next()){var l=Ct(o.value,2),u=l[0],c=l[1];r.set(u,c)}}catch(f){t={error:f}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},n.fromObject=function(e){return n.from(Object.entries(e))},n}(),$c=function(n,e,t){var i,r;if(t===void 0&&(t=[]),e.length===0||n==null)return[n,t];try{for(var s=Ye(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value;if(l!==Yt&&e.startsWith(l))return t.push([n,l]),$c(n.get(l),e.slice(l.length),t)}}catch(u){i={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return t.push([n,e]),$c(void 0,"",t)},_f=function(n,e){var t,i;if(e.length===0||n==null)return n;try{for(var r=Ye(n.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;if(o!==Yt&&e.startsWith(o))return _f(n.get(o),e.slice(o.length))}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},Tf=function(n,e){var t,i,r=e.length;e:for(var s=0;n&&s<r;){try{for(var o=(t=void 0,Ye(n.keys())),l=o.next();!l.done;l=o.next()){var u=l.value;if(u!==Yt&&e[s]===u[0]){for(var c=Math.min(r-s,u.length),f=1;f<c&&e[s+f]===u[f];)++f;var h=n.get(u);if(f===u.length)n=h;else{var p=new Map;p.set(u.slice(f),h),n.set(e.slice(s,s+f),p),n.delete(u),n=p}s+=f;continue e}}}catch(m){t={error:m}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}var v=new Map;return n.set(e.slice(s),v),v}return n},YD=function(n,e){var t=Ct($c(n,e),2),i=t[0],r=t[1];if(i!==void 0){if(i.delete(Yt),i.size===0)Bx(r);else if(i.size===1){var s=Ct(i.entries().next().value,2),o=s[0],l=s[1];Dx(r,o,l)}}},Bx=function(n){if(n.length!==0){var e=Ct(Ef(n),2),t=e[0],i=e[1];if(t.delete(i),t.size===0)Bx(n.slice(0,-1));else if(t.size===1){var r=Ct(t.entries().next().value,2),s=r[0],o=r[1];s!==Yt&&Dx(n.slice(0,-1),s,o)}}},Dx=function(n,e,t){if(n.length!==0){var i=Ct(Ef(n),2),r=i[0],s=i[1];r.set(s+e,t),r.delete(s)}},Ef=function(n){return n[n.length-1]},ka,Cf="or",Vx="and",JD="and_not",KD=function(){function n(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');var t=e.autoVacuum==null||e.autoVacuum===!0?If:e.autoVacuum;this._options=lt(lt(lt({},Rf),e),{autoVacuum:t,searchOptions:lt(lt({},kx),e.searchOptions||{}),autoSuggestOptions:lt(lt({},n4),e.autoSuggestOptions||{})}),this._index=new Sf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Pf,this.addFields(this._options.fields)}return n.prototype.add=function(e){var t,i,r,s,o,l,u=this._options,c=u.extractField,f=u.tokenize,h=u.processTerm,p=u.fields,v=u.idField,m=c(e,v);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(v,'"'));if(this._idToShortId.has(m))throw new Error("MiniSearch: duplicate ID ".concat(m));var d=this.addDocumentId(m);this.saveStoredFields(d,e);try{for(var b=Ye(p),y=b.next();!y.done;y=b.next()){var g=y.value,w=c(e,g);if(w!=null){var A=f(w.toString(),g),S=this._fieldIds[g],M=new Set(A).size;this.addFieldLength(d,S,this._documentCount-1,M);try{for(var F=(r=void 0,Ye(A)),R=F.next();!R.done;R=F.next()){var T=R.value,P=h(T,g);if(Array.isArray(P))try{for(var _=(o=void 0,Ye(P)),E=_.next();!E.done;E=_.next()){var C=E.value;this.addTerm(S,d,C)}}catch(L){o={error:L}}finally{try{E&&!E.done&&(l=_.return)&&l.call(_)}finally{if(o)throw o.error}}else P&&this.addTerm(S,d,P)}}catch(L){r={error:L}}finally{try{R&&!R.done&&(s=F.return)&&s.call(F)}finally{if(r)throw r.error}}}}}catch(L){t={error:L}}finally{try{y&&!y.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}},n.prototype.addAll=function(e){var t,i;try{for(var r=Ye(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.add(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.addAllAsync=function(e,t){var i=this;t===void 0&&(t={});var r=t.chunkSize,s=r===void 0?10:r,o={chunk:[],promise:Promise.resolve()},l=e.reduce(function(f,h,p){var v=f.chunk,m=f.promise;return v.push(h),(p+1)%s===0?{chunk:[],promise:m.then(function(){return new Promise(function(d){return setTimeout(d,0)})}).then(function(){return i.addAll(v)})}:{chunk:v,promise:m}},o),u=l.chunk,c=l.promise;return c.then(function(){return i.addAll(u)})},n.prototype.remove=function(e){var t,i,r,s,o,l,u=this._options,c=u.tokenize,f=u.processTerm,h=u.extractField,p=u.fields,v=u.idField,m=h(e,v);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(v,'"'));var d=this._idToShortId.get(m);if(d==null)throw new Error("MiniSearch: cannot remove document with ID ".concat(m,": it is not in the index"));try{for(var b=Ye(p),y=b.next();!y.done;y=b.next()){var g=y.value,w=h(e,g);if(w!=null){var A=c(w.toString(),g),S=this._fieldIds[g],M=new Set(A).size;this.removeFieldLength(d,S,this._documentCount,M);try{for(var F=(r=void 0,Ye(A)),R=F.next();!R.done;R=F.next()){var T=R.value,P=f(T,g);if(Array.isArray(P))try{for(var _=(o=void 0,Ye(P)),E=_.next();!E.done;E=_.next()){var C=E.value;this.removeTerm(S,d,C)}}catch(L){o={error:L}}finally{try{E&&!E.done&&(l=_.return)&&l.call(_)}finally{if(o)throw o.error}}else P&&this.removeTerm(S,d,P)}}catch(L){r={error:L}}finally{try{R&&!R.done&&(s=F.return)&&s.call(F)}finally{if(r)throw r.error}}}}}catch(L){t={error:L}}finally{try{y&&!y.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}this._storedFields.delete(d),this._documentIds.delete(d),this._idToShortId.delete(m),this._fieldLength.delete(d),this._documentCount-=1},n.prototype.removeAll=function(e){var t,i;if(e)try{for(var r=Ye(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.remove(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Sf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},n.prototype.discard=function(e){var t=this,i=this._idToShortId.get(e);if(i==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(i),this._storedFields.delete(i),(this._fieldLength.get(i)||[]).forEach(function(r,s){t.removeFieldLength(i,s,t._documentCount,r)}),this._fieldLength.delete(i),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},n.prototype.maybeAutoVacuum=function(){if(this._options.autoVacuum!==!1){var e=this._options.autoVacuum,t=e.minDirtFactor,i=e.minDirtCount,r=e.batchSize,s=e.batchWait;this.conditionalVacuum({batchSize:r,batchWait:s},{minDirtCount:i,minDirtFactor:t})}},n.prototype.discardAll=function(e){var t,i,r=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var s=Ye(e),o=s.next();!o.done;o=s.next()){var l=o.value;this.discard(l)}}catch(u){t={error:u}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}}finally{this._options.autoVacuum=r}this.maybeAutoVacuum()},n.prototype.replace=function(e){var t=this._options,i=t.idField,r=t.extractField,s=r(e,i);this.discard(s),this.add(e)},n.prototype.vacuum=function(e){return e===void 0&&(e={}),this.conditionalVacuum(e)},n.prototype.conditionalVacuum=function(e,t){var i=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(function(){var r=i._enqueuedVacuumConditions;return i._enqueuedVacuumConditions=Pf,i.performVacuuming(e,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)},n.prototype.performVacuuming=function(e,t){return jD(this,void 0,void 0,function(){var i,r,s,o,l,u,c,f,h,p,v,m,d,b,y,g,w,A,S,M,F,R,T,P,_;return $D(this,function(E){switch(E.label){case 0:if(i=this._dirtCount,!this.vacuumConditionsMet(t))return[3,10];r=e.batchSize||Ff.batchSize,s=e.batchWait||Ff.batchWait,o=1,E.label=1;case 1:E.trys.push([1,7,8,9]),l=Ye(this._index),u=l.next(),E.label=2;case 2:if(u.done)return[3,6];c=Ct(u.value,2),f=c[0],h=c[1];try{for(p=(R=void 0,Ye(h)),v=p.next();!v.done;v=p.next()){m=Ct(v.value,2),d=m[0],b=m[1];try{for(y=(P=void 0,Ye(b)),g=y.next();!g.done;g=y.next())w=Ct(g.value,1),A=w[0],!this._documentIds.has(A)&&(b.size<=1?h.delete(d):b.delete(A))}catch(C){P={error:C}}finally{try{g&&!g.done&&(_=y.return)&&_.call(y)}finally{if(P)throw P.error}}}}catch(C){R={error:C}}finally{try{v&&!v.done&&(T=p.return)&&T.call(p)}finally{if(R)throw R.error}}return this._index.get(f).size===0&&this._index.delete(f),o%r!==0?[3,4]:[4,new Promise(function(C){return setTimeout(C,s)})];case 3:E.sent(),E.label=4;case 4:o+=1,E.label=5;case 5:return u=l.next(),[3,2];case 6:return[3,9];case 7:return S=E.sent(),M={error:S},[3,9];case 8:try{u&&!u.done&&(F=l.return)&&F.call(l)}finally{if(M)throw M.error}return[7];case 9:this._dirtCount-=i,E.label=10;case 10:return[4,null];case 11:return E.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}})})},n.prototype.vacuumConditionsMet=function(e){if(e==null)return!0;var t=e.minDirtCount,i=e.minDirtFactor;return t=t||If.minDirtCount,i=i||If.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=i},Object.defineProperty(n.prototype,"isVacuuming",{get:function(){return this._currentVacuum!=null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),n.prototype.has=function(e){return this._idToShortId.has(e)},n.prototype.getStoredFields=function(e){var t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)},n.prototype.search=function(e,t){var i,r;t===void 0&&(t={});var s=this.executeQuery(e,t),o=[];try{for(var l=Ye(s),u=l.next();!u.done;u=l.next()){var c=Ct(u.value,2),f=c[0],h=c[1],p=h.score,v=h.terms,m=h.match,d=v.length||1,b={id:this._documentIds.get(f),score:p*d,terms:Object.keys(m),queryTerms:v,match:m};Object.assign(b,this._storedFields.get(f)),(t.filter==null||t.filter(b))&&o.push(b)}}catch(y){i={error:y}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}return e===n.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||o.sort(Ux),o},n.prototype.autoSuggest=function(e,t){var i,r,s,o;t===void 0&&(t={}),t=lt(lt({},this._options.autoSuggestOptions),t);var l=new Map;try{for(var u=Ye(this.search(e,t)),c=u.next();!c.done;c=u.next()){var f=c.value,h=f.score,p=f.terms,v=p.join(" "),m=l.get(v);m!=null?(m.score+=h,m.count+=1):l.set(v,{score:h,terms:p,count:1})}}catch(S){i={error:S}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}var d=[];try{for(var b=Ye(l),y=b.next();!y.done;y=b.next()){var g=Ct(y.value,2),m=g[0],w=g[1],h=w.score,p=w.terms,A=w.count;d.push({suggestion:m,terms:p,score:h/A})}}catch(S){s={error:S}}finally{try{y&&!y.done&&(o=b.return)&&o.call(b)}finally{if(s)throw s.error}}return d.sort(Ux),d},Object.defineProperty(n.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),n.loadJSON=function(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)},n.getDefault=function(e){if(Rf.hasOwnProperty(e))return Lf(Rf,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},n.loadJS=function(e,t){var i,r,s,o,l,u,c=e.index,f=e.documentCount,h=e.nextId,p=e.documentIds,v=e.fieldIds,m=e.fieldLength,d=e.averageFieldLength,b=e.storedFields,y=e.dirtCount,g=e.serializationVersion;if(g!==1&&g!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var w=new n(t);w._documentCount=f,w._nextId=h,w._documentIds=Zc(p),w._idToShortId=new Map,w._fieldIds=v,w._fieldLength=Zc(m),w._avgFieldLength=d,w._storedFields=Zc(b),w._dirtCount=y||0,w._index=new Sf;try{for(var A=Ye(w._documentIds),S=A.next();!S.done;S=A.next()){var M=Ct(S.value,2),F=M[0],R=M[1];w._idToShortId.set(R,F)}}catch(D){i={error:D}}finally{try{S&&!S.done&&(r=A.return)&&r.call(A)}finally{if(i)throw i.error}}try{for(var T=Ye(c),P=T.next();!P.done;P=T.next()){var _=Ct(P.value,2),E=_[0],C=_[1],L=new Map;try{for(var I=(l=void 0,Ye(Object.keys(C))),x=I.next();!x.done;x=I.next()){var O=x.value,B=C[O];g===1&&(B=B.ds),L.set(parseInt(O,10),Zc(B))}}catch(D){l={error:D}}finally{try{x&&!x.done&&(u=I.return)&&u.call(I)}finally{if(l)throw l.error}}w._index.set(E,L)}}catch(D){s={error:D}}finally{try{P&&!P.done&&(o=T.return)&&o.call(T)}finally{if(s)throw s.error}}return w},n.prototype.executeQuery=function(e,t){var i=this;if(t===void 0&&(t={}),e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){var r=lt(lt(lt({},t),e),{queries:void 0}),s=e.queries.map(function(b){return i.executeQuery(b,r)});return this.combineResults(s,r.combineWith)}var o=this._options,l=o.tokenize,u=o.processTerm,c=o.searchOptions,f=lt(lt({tokenize:l,processTerm:u},c),t),h=f.tokenize,p=f.processTerm,v=h(e).flatMap(function(b){return p(b)}).filter(function(b){return!!b}),m=v.map(t4(f)),d=m.map(function(b){return i.executeQuerySpec(b,f)});return this.combineResults(d,f.combineWith)},n.prototype.executeQuerySpec=function(e,t){var i,r,s,o,l=lt(lt({},this._options.searchOptions),t),u=(l.fields||this._options.fields).reduce(function(O,B){var D;return lt(lt({},O),(D={},D[B]=Lf(l.boost,B)||1,D))},{}),c=l.boostDocument,f=l.weights,h=l.maxFuzzy,p=l.bm25,v=lt(lt({},kx.weights),f),m=v.fuzzy,d=v.prefix,b=this._index.get(e.term),y=this.termResults(e.term,e.term,1,b,u,c,p),g,w;if(e.prefix&&(g=this._index.atPrefix(e.term)),e.fuzzy){var A=e.fuzzy===!0?.2:e.fuzzy,S=A<1?Math.min(h,Math.round(e.term.length*A)):A;S&&(w=this._index.fuzzyGet(e.term,S))}if(g)try{for(var M=Ye(g),F=M.next();!F.done;F=M.next()){var R=Ct(F.value,2),T=R[0],P=R[1],_=T.length-e.term.length;if(_){w==null||w.delete(T);var E=d*T.length/(T.length+.3*_);this.termResults(e.term,T,E,P,u,c,p,y)}}}catch(O){i={error:O}}finally{try{F&&!F.done&&(r=M.return)&&r.call(M)}finally{if(i)throw i.error}}if(w)try{for(var C=Ye(w.keys()),L=C.next();!L.done;L=C.next()){var T=L.value,I=Ct(w.get(T),2),x=I[0],_=I[1];if(_){var E=m*T.length/(T.length+_);this.termResults(e.term,T,E,x,u,c,p,y)}}}catch(O){s={error:O}}finally{try{L&&!L.done&&(o=C.return)&&o.call(C)}finally{if(s)throw s.error}}return y},n.prototype.executeWildcardQuery=function(e){var t,i,r=new Map,s=lt(lt({},this._options.searchOptions),e);try{for(var o=Ye(this._documentIds),l=o.next();!l.done;l=o.next()){var u=Ct(l.value,2),c=u[0],f=u[1],h=s.boostDocument?s.boostDocument(f,"",this._storedFields.get(c)):1;r.set(c,{score:h,terms:[],match:{}})}}catch(p){t={error:p}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return r},n.prototype.combineResults=function(e,t){if(t===void 0&&(t=Cf),e.length===0)return new Map;var i=t.toLowerCase();return e.reduce(qD[i])||new Map},n.prototype.toJSON=function(){var e,t,i,r,s=[];try{for(var o=Ye(this._index),l=o.next();!l.done;l=o.next()){var u=Ct(l.value,2),c=u[0],f=u[1],h={};try{for(var p=(i=void 0,Ye(f)),v=p.next();!v.done;v=p.next()){var m=Ct(v.value,2),d=m[0],b=m[1];h[d]=Object.fromEntries(b)}}catch(y){i={error:y}}finally{try{v&&!v.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}s.push([c,h])}}catch(y){e={error:y}}finally{try{l&&!l.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:s,serializationVersion:2}},n.prototype.termResults=function(e,t,i,r,s,o,l,u){var c,f,h,p,v;if(u===void 0&&(u=new Map),r==null)return u;try{for(var m=Ye(Object.keys(s)),d=m.next();!d.done;d=m.next()){var b=d.value,y=s[b],g=this._fieldIds[b],w=r.get(g);if(w!=null){var A=w.size,S=this._avgFieldLength[g];try{for(var M=(h=void 0,Ye(w.keys())),F=M.next();!F.done;F=M.next()){var R=F.value;if(!this._documentIds.has(R)){this.removeTerm(g,R,t),A-=1;continue}var T=o?o(this._documentIds.get(R),t,this._storedFields.get(R)):1;if(T){var P=w.get(R),_=this._fieldLength.get(R)[g],E=e4(P,A,this._documentCount,_,S,l),C=i*y*T*E,L=u.get(R);if(L){L.score+=C,i4(L.terms,e);var I=Lf(L.match,t);I?I.push(b):L.match[t]=[b]}else u.set(R,{score:C,terms:[e],match:(v={},v[t]=[b],v)})}}}catch(x){h={error:x}}finally{try{F&&!F.done&&(p=M.return)&&p.call(M)}finally{if(h)throw h.error}}}}}catch(x){c={error:x}}finally{try{d&&!d.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}return u},n.prototype.addTerm=function(e,t,i){var r=this._index.fetch(i,Gx),s=r.get(e);if(s==null)s=new Map,s.set(t,1),r.set(e,s);else{var o=s.get(t);s.set(t,(o||0)+1)}},n.prototype.removeTerm=function(e,t,i){if(!this._index.has(i)){this.warnDocumentChanged(t,e,i);return}var r=this._index.fetch(i,Gx),s=r.get(e);s==null||s.get(t)==null?this.warnDocumentChanged(t,e,i):s.get(t)<=1?s.size<=1?r.delete(e):s.delete(t):s.set(t,s.get(t)-1),this._index.get(i).size===0&&this._index.delete(i)},n.prototype.warnDocumentChanged=function(e,t,i){var r,s;try{for(var o=Ye(Object.keys(this._fieldIds)),l=o.next();!l.done;l=o.next()){var u=l.value;if(this._fieldIds[u]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(i,'" was not present in field "').concat(u,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}}catch(c){r={error:c}}finally{try{l&&!l.done&&(s=o.return)&&s.call(o)}finally{if(r)throw r.error}}},n.prototype.addDocumentId=function(e){var t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},n.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},n.prototype.addFieldLength=function(e,t,i,r){var s=this._fieldLength.get(e);s==null&&this._fieldLength.set(e,s=[]),s[t]=r;var o=this._avgFieldLength[t]||0,l=o*i+r;this._avgFieldLength[t]=l/(i+1)},n.prototype.removeFieldLength=function(e,t,i,r){if(i===1){this._avgFieldLength[t]=0;return}var s=this._avgFieldLength[t]*i-r;this._avgFieldLength[t]=s/(i-1)},n.prototype.saveStoredFields=function(e,t){var i,r,s=this._options,o=s.storeFields,l=s.extractField;if(!(o==null||o.length===0)){var u=this._storedFields.get(e);u==null&&this._storedFields.set(e,u={});try{for(var c=Ye(o),f=c.next();!f.done;f=c.next()){var h=f.value,p=l(t,h);p!==void 0&&(u[h]=p)}}catch(v){i={error:v}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(i)throw i.error}}}},n.wildcard=Symbol("*"),n}(),Lf=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0},qD=(ka={},ka[Cf]=function(n,e){var t,i;try{for(var r=Ye(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value,l=n.get(o);if(l==null)n.set(o,e.get(o));else{var u=e.get(o),c=u.score,f=u.terms,h=u.match;l.score=l.score+c,l.match=Object.assign(l.match,h),zx(l.terms,f)}}}catch(p){t={error:p}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},ka[Vx]=function(n,e){var t,i,r=new Map;try{for(var s=Ye(e.keys()),o=s.next();!o.done;o=s.next()){var l=o.value,u=n.get(l);if(u!=null){var c=e.get(l),f=c.score,h=c.terms,p=c.match;zx(u.terms,h),r.set(l,{score:u.score+f,terms:u.terms,match:Object.assign(u.match,p)})}}}catch(v){t={error:v}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},ka[JD]=function(n,e){var t,i;try{for(var r=Ye(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;n.delete(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},ka),QD={k:1.2,b:.7,d:.5},e4=function(n,e,t,i,r,s){var o=s.k,l=s.b,u=s.d,c=Math.log(1+(t-e+.5)/(e+.5));return c*(u+n*(o+1)/(n+o*(1-l+l*i/r)))},t4=function(n){return function(e,t,i){var r=typeof n.fuzzy=="function"?n.fuzzy(e,t,i):n.fuzzy||!1,s=typeof n.prefix=="function"?n.prefix(e,t,i):n.prefix===!0;return{term:e,fuzzy:r,prefix:s}}},Rf={idField:"id",extractField:function(n,e){return n[e]},tokenize:function(n){return n.split(r4)},processTerm:function(n){return n.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[],logger:function(n,e){typeof(console==null?void 0:console[n])=="function"&&console[n](e)},autoVacuum:!0},kx={combineWith:Cf,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:QD},n4={combineWith:Vx,prefix:function(n,e,t){return e===t.length-1}},Ff={batchSize:1e3,batchWait:10},Pf={minDirtFactor:.1,minDirtCount:20},If=lt(lt({},Ff),Pf),i4=function(n,e){n.includes(e)||n.push(e)},zx=function(n,e){var t,i;try{for(var r=Ye(e),s=r.next();!s.done;s=r.next()){var o=s.value;n.includes(o)||n.push(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},Ux=function(n,e){var t=n.score,i=e.score;return i-t},Gx=function(){return new Map},Zc=function(n){var e,t,i=new Map;try{for(var r=Ye(Object.keys(n)),s=r.next();!s.done;s=r.next()){var o=s.value;i.set(parseInt(o,10),n[o])}}catch(l){e={error:l}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return i},r4=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;class s4{constructor(){this._searchEngine=new KD({fields:["path","name"],storeFields:["path"],tokenize:(e,t)=>e.split(/[\s/]+/)}),this.idMaps={}}addZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.add(o),this.idMaps[t]={path:s,zincObject:e}}removeZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.remove(o),delete this.idMaps[t]}addRegion(e,t){let i=e.getFullPath(),r=e.getName();i=i.replaceAll('"',""),r=r.replaceAll('"',"");const s={path:i,name:r,id:t};this._searchEngine.add(s),this.idMaps[t]={path:i,zincObject:e}}clearResults(){this._}removeAll(){this._searchEngine.removeAll(),this.idMaps={}}auto_suggest(e){let t=[];e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];t.forEach(o=>{o.id in this.idMaps&&i.push(this.idMaps[o.id].path)});const r=[...new Set(i)],s=[];return r.forEach(o=>s.push({suggestion:'"'+o+'"'})),s}processResults(e,t){const i={regionPath:void 0,label:'Search Results for "'};return Array.isArray(t)?i.label+=",".join(t):i.label+=t,i.label+='"',e.length===1&&(e[0].isRegion?i.regionPath=e[0].getFullPath():e[0].isZincObject&&(i.regionPath=e[0].getRegion().getFullPath(),i.label=e[0].groupName)),i.zincObjects=fD(e),i}search(e){let t;e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];return t.forEach(r=>{r.id in this.idMaps&&i.push(this.idMaps[r.id].zincObject)}),i}searchTerms(e){let t=[];return e.forEach(i=>{const r=this.search(i);t.push(...r)}),t}searchAndProcessResult(e){let t=[];return Array.isArray(e)?t=this.searchTerms(e):t=this.search(e),this.processResults(t,e)}}const o4=[{id:0,nerve_id:"ILX:0793723",label:"Auriculotemporal nerve","FMA subclasses (in human nerves)":["FMA:53002","FMA:53001"],"subclass labels":["Left auriculotemporal nerve","Right auriculotemporal nerve"]},{id:1,nerve_id:"ILX:0792409",label:"gray communicating ramus of tenth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6895","FMA:6894"],"subclass labels":["Left T10 grey ramus communicans","Right T10 grey ramus communicans"]},{id:2,nerve_id:"UBERON:0011326",label:"superior laryngeal nerve","FMA subclasses (in human nerves)":["FMA:53530","FMA:53536"],"subclass labels":["Right superior laryngeal nerve","Left superior laryngeal nerve"]},{id:3,nerve_id:"ILX:0793220",label:"white communicating ramus of first lumbar spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:4,nerve_id:"ILX:0787082",label:"gray communicating ramus of the first thoracic nerve","FMA subclasses (in human nerves)":["FMA:6082","FMA:6084"],"subclass labels":["Right T1 grey ramus communicans","Left T1 grey ramus communicans"]},{id:5,nerve_id:"ILX:0793809",label:"Clitoral cavernous nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:6,nerve_id:"UBERON:0011096",label:"lacrimal nerve","FMA subclasses (in human nerves)":["FMA:52630","FMA:52629"],"subclass labels":["Left lacrimal nerve","Right lacrimal nerve"]},{id:7,nerve_id:"ILX:0793215",label:"white communicating ramus of ninth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:8,nerve_id:"ILX:0795005",label:"Posterior cutaneous nerve of arm","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:9,nerve_id:"UBERON:0001649",label:"glossopharyngeal nerve","FMA subclasses (in human nerves)":["FMA:50894","FMA:50892"],"subclass labels":[]},{id:10,nerve_id:"UBERON:0022302",label:"short ciliary nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:11,nerve_id:"ILX:0785932",label:"gray communicating ramus of third lumbar nerve","FMA subclasses (in human nerves)":["FMA:65920","FMA:65919"],"subclass labels":["Left L3 grey ramus communicans","Right L3 grey ramus communicans"]},{id:12,nerve_id:"ILX:0738293",label:"Ganglioglomerular nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:13,nerve_id:"ILX:0739298",label:"gray communicating ramus of twelfth thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:14,nerve_id:"UBERON:0001492",label:"radial nerve","FMA subclasses (in human nerves)":["FMA:37070","FMA:37071"],"subclass labels":["Right radial nerve","Left radial nerve"]},{id:15,nerve_id:"ILX:0793214",label:"white communicating ramus of eighth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:16,nerve_id:"UBERON:0018681",label:"lesser splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6957","FMA:6958"],"subclass labels":["Right lesser splanchnic nerve","Left lesser splanchnic nerve"]},{id:17,nerve_id:"ILX:0794476",label:"abdominal branch of vagus nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:18,nerve_id:"ILX:0791105",label:"gray communicating ramus of the second thoracic nerve","FMA subclasses (in human nerves)":["FMA:6122","FMA:6757"],"subclass labels":["Right T2 grey ramus communicans","Left T2 grey ramus communicans"]},{id:19,nerve_id:"ILX:0794853",label:"esophageal vagus trunk","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:20,nerve_id:"ILX:0793210",label:"white communicating ramus of fourth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:21,nerve_id:"UBERON:0001759",label:"vagus nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:22,nerve_id:"UBERON:0009675",label:"chorda tympani branch of facial nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:23,nerve_id:"ILX:0794949",label:"recurrent branch of the median nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:24,nerve_id:"ILX:0789339",label:"Pharyngeal branch of glossopharyngeal nerve","FMA subclasses (in human nerves)":["FMA:53495","FMA:53494"],"subclass labels":["Pharyngeal branch of left glossopharyngeal nerve","Pharyngeal branch of right glossopharyngeal nerve"]},{id:25,nerve_id:"ILX:0793712",label:"Zygomatic nerve","FMA subclasses (in human nerves)":["FMA:52968","FMA:52969"],"subclass labels":["Right zygomatic nerve","Left zygomatic nerve"]},{id:26,nerve_id:"ILX:0788536",label:"gray communicating ramus of fourth lumbar nerve","FMA subclasses (in human nerves)":["FMA:65917","FMA:65918"],"subclass labels":["Right L4 grey ramus communicans","Left L4 grey ramus communicans"]},{id:27,nerve_id:"UBERON:0018680",label:"greater splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6956","FMA:6955"],"subclass labels":["Right greater splanchnic nerve","Left greater splanchnic nerve"]},{id:28,nerve_id:"UBERON:0001322",label:"sciatic nerve","FMA subclasses (in human nerves)":["FMA:22111","FMA:22112"],"subclass labels":["Right sciatic nerve","Left sciatic nerve"]},{id:29,nerve_id:"ILX:0793209",label:"white communicating ramus of third thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:30,nerve_id:"UBERON:0011391",label:"perineal nerve","FMA subclasses (in human nerves)":["FMA:21874","FMA:21873"],"subclass labels":["Left perineal nerve","Right perineal nerve"]},{id:31,nerve_id:"ILX:0788945",label:"gray communicating ramus of the fourth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6759","FMA:6758"],"subclass labels":["Right T4 grey ramus communicans","Left T4 grey ramus communicans"]},{id:32,nerve_id:"ILX:0790497",label:"Gray communicating ramus of cervicothoracic ganglion to first thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:33,nerve_id:"UBERON:0001323",label:"tibial nerve","FMA subclasses (in human nerves)":["FMA:22109","FMA:22110"],"subclass labels":["Right tibial nerve","Left tibial nerve"]},{id:34,nerve_id:"ILX:0794969",label:"deep branch of ulnar nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:35,nerve_id:"ILX:0793227",label:"gray communicating ramus of thirteenth thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:36,nerve_id:"ILX:0793228",label:"gray communicating ramus of first sacral nerve","FMA subclasses (in human nerves)":["FMA:65992","FMA:65991"],"subclass labels":["Left S1 grey ramus communicans","Right S1 grey ramus communicans"]},{id:37,nerve_id:"UBERON:0035111",label:"medial plantar nerve","FMA subclasses (in human nerves)":["FMA:45435","FMA:45434"],"subclass labels":["Left medial plantar nerve","Right medial plantar nerve"]},{id:38,nerve_id:"UBERON:0001780",label:"spinal nerve","FMA subclasses (in human nerves)":["FMA:6117","FMA:6435","FMA:6295","FMA:6422","FMA:6417","FMA:6421","FMA:6038","FMA:6292","FMA:6439","FMA:6313","FMA:6410","FMA:6412","FMA:6088","FMA:6298","FMA:6433","FMA:6411","FMA:6438","FMA:6314","FMA:6291","FMA:6420","FMA:6116","FMA:6413","FMA:6310","FMA:6432","FMA:6305","FMA:6182","FMA:6297","FMA:6436","FMA:6418","FMA:6039","FMA:6089","FMA:6301","FMA:6294","FMA:6303","FMA:6183","FMA:6434","FMA:6429","FMA:6308","FMA:6300","FMA:6430","FMA:6428","FMA:6419","FMA:6437","FMA:6307","FMA:6311","FMA:6431"],"subclass labels":["Left T3 spinal nerve","Left S4 spinal nerve","Left T5 spinal nerve","Left L5 spinal nerve","Right L3 spinal nerve","Right L5 spinal nerve","Right T1 spinal nerve","Left T4 spinal nerve","Left coccygeal spinal nerve","Right T11 spinal nerve","Right L1 spinal nerve","Right L2 spinal nerve","Right T2 spinal nerve","Left T6 spinal nerve","Left S3 spinal nerve","Left L1 spinal nerve","Right coccygeal spinal nerve","Left T11 spinal nerve","Right T4 spinal nerve","Left L4 spinal nerve","Right T3 spinal nerve","Left L2 spinal nerve","Right T10 spinal nerve","Right S3 spinal nerve","Left T8 spinal nerve","Right T12 spinal nerve","Right T6 spinal nerve","Right S5 spinal nerve","Left L3 spinal nerve","Left T1 spinal nerve","Left T2 spinal nerve","Left T7 spinal nerve","Right T5 spinal nerve","Right T8 spinal nerve","Left T12 spinal nerve","Right S4 spinal nerve","Left S1 spinal nerve","Left T9 spinal nerve","Right T7 spinal nerve","Right S2 spinal nerve","Right S1 spinal nerve","Right L4 spinal nerve","Left S5 spinal nerve","Right T9 spinal nerve","Left T10 spinal nerve","Left S2 spinal nerve"]},{id:39,nerve_id:"UBERON:0018683",label:"lumbar splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6924","FMA:6928","FMA:6929","FMA:6931","FMA:6925","FMA:6930","FMA:6927","FMA:6926"],"subclass labels":["Right first lumbar splanchnic nerve","Right third lumbar splanchnic nerve","Left third lumbar splanchnic nerve","Left fourth lumbar splanchnic nerve","Left first lumbar splanchnic nerve","Right fourth lumbar splanchnic nerve","Left second lumbar splanchnic nerve","Right second lumbar splanchnic nerve"]},{id:40,nerve_id:"UBERON:0001643",label:"oculomotor nerve","FMA subclasses (in human nerves)":["FMA:50880","FMA:50879"],"subclass labels":["Left oculomotor nerve","Right oculomotor nerve"]},{id:41,nerve_id:"ILX:0793212",label:"white communicating ramus of sixth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:42,nerve_id:"UBERON:0003724",label:"musculocutaneous nerve","FMA subclasses (in human nerves)":["FMA:37066","FMA:37065"],"subclass labels":["Left musculocutaneous nerve","Right musculocutaneous nerve"]},{id:43,nerve_id:"ILX:0738372",label:"white communicating ramus of first thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:44,nerve_id:"ILX:0793563",label:"splenic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:45,nerve_id:"UBERON:0035526",label:"superficial fibular nerve","FMA subclasses (in human nerves)":["FMA:45363","FMA:45364"],"subclass labels":["Right superficial fibular nerve","Left superficial fibular nerve"]},{id:46,nerve_id:"ILX:0791560",label:"gray communicating ramus of eighth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6891","FMA:6890"],"subclass labels":["Left T8 grey ramus communicans","Right T8 grey ramus communicans"]},{id:47,nerve_id:"ILX:0793827",label:"posterior abdominal vagal trunk","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:48,nerve_id:"ILX:0794141",label:"right cervical vagus nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:49,nerve_id:"ILX:0793714",label:"Mesenteric nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:50,nerve_id:"UBERON:0001964",label:"least splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6960","FMA:6959"],"subclass labels":["Left least splanchnic nerve","Right least splanchnic nerve"]},{id:51,nerve_id:"UBERON:0001267",label:"femoral nerve","FMA subclasses (in human nerves)":["FMA:16499","FMA:16500"],"subclass labels":["Right femoral nerve","Left femoral nerve"]},{id:52,nerve_id:"UBERON:0034984",label:"nerve to quadratus femoris","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:53,nerve_id:"UBERON:0003721",label:"lingual nerve","FMA subclasses (in human nerves)":["FMA:53219","FMA:53220"],"subclass labels":["Right lingual nerve","Left lingual nerve"]},{id:54,nerve_id:"UBERON:0036216",label:"tympanic nerve","FMA subclasses (in human nerves)":["FMA:53481","FMA:53482"],"subclass labels":["Right tympanic nerve","Left tympanic nerve"]},{id:55,nerve_id:"ILX:0793216",label:"white communicating ramus of tenth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:56,nerve_id:"ILX:0793362",label:"White communicating ramus of fourth lumbar anterior ramus","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:57,nerve_id:"ILX:0793561",label:"Internal branch of superior laryngeal nerve","FMA subclasses (in human nerves)":["FMA:53539","FMA:53540"],"subclass labels":["Right internal laryngeal nerve","Left internal laryngeal nerve"]},{id:58,nerve_id:"ILX:0738312",label:"Aortic arch depressor nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:59,nerve_id:"ILX:0793218",label:"white communicating ramus of twelfth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:60,nerve_id:"ILX:0738308",label:"External branch of inferior laryngeal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:61,nerve_id:"ILX:0739299",label:"gray communicating ramus of sixth lumbar nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:62,nerve_id:"ILX:0793559",label:"bladder nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:63,nerve_id:"ILX:0793822",label:"Superior ovarian nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:64,nerve_id:"ILX:0793807",label:"Penile cavernous nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:65,nerve_id:"UBERON:0011390",label:"pudendal nerve","FMA subclasses (in human nerves)":["FMA:21863","FMA:21864"],"subclass labels":["Right pudendal nerve","Left pudendal nerve"]},{id:66,nerve_id:"UBERON:0008810",label:"nasopalatine nerve","FMA subclasses (in human nerves)":["FMA:52799","FMA:52798"],"subclass labels":["Left nasopalatine nerve","Right nasopalatine nerve"]},{id:67,nerve_id:"ILX:0793219",label:"white communicating ramus of thirteenth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:68,nerve_id:"ILX:0793632",label:"lumbar colonic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:69,nerve_id:"ILX:0784439",label:"gray communicating ramus of the fifth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6760","FMA:6761"],"subclass labels":["Left T5 grey ramus communicans","Right T5 grey ramus communicans"]},{id:70,nerve_id:"ILX:0794977",label:"deep branch of radial nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:71,nerve_id:"UBERON:0001884",label:"phrenic nerve","FMA subclasses (in human nerves)":["FMA:6193","FMA:6192"],"subclass labels":["Left phrenic nerve","Right phrenic nerve"]},{id:72,nerve_id:"UBERON:0035110",label:"lateral plantar nerve","FMA subclasses (in human nerves)":["FMA:45450","FMA:45451"],"subclass labels":["Right lateral plantar nerve","Left lateral plantar nerve"]},{id:73,nerve_id:"ILX:0793711",label:"Communicating branch of zygomatic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:74,nerve_id:"ILX:0793560",label:"External branch of superior laryngeal nerve","FMA subclasses (in human nerves)":["FMA:53537","FMA:53538"],"subclass labels":["Right external laryngeal nerve","Left external laryngeal nerve"]},{id:75,nerve_id:"ILX:0738309",label:"Internal branch of inferior laryngeal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:76,nerve_id:"UBERON:0001021",label:"nerve","FMA subclasses (in human nerves)":["FMA:6775","FMA:6894","FMA:6784","FMA:6728","FMA:65325","FMA:21873","FMA:45429","FMA:6844","FMA:53609","FMA:7116","FMA:44770","FMA:8916","FMA:52995","FMA:6071","FMA:45309","FMA:6122","FMA:6892","FMA:6767","FMA:16405","FMA:53560","FMA:6092","FMA:65343","FMA:37066","FMA:8894","FMA:8868","FMA:65341","FMA:53559","FMA:8897","FMA:82956","FMA:20633","FMA:6763","FMA:65339","FMA:8829","FMA:16493","FMA:8817","FMA:8821","FMA:11757","FMA:45456","FMA:45422","FMA:11261","FMA:65388","FMA:6192","FMA:65347","FMA:37068","FMA:65995","FMA:6764","FMA:39081","FMA:45338","FMA:53402","FMA:11210","FMA:52644","FMA:37067","FMA:65313","FMA:11153","FMA:6155","FMA:8797","FMA:53302","FMA:8883","FMA:53067","FMA:52939","FMA:53301","FMA:292889","FMA:45423","FMA:8791","FMA:45380","FMA:11759","FMA:7305","FMA:8830","FMA:78650","FMA:65389","FMA:45387","FMA:8827","FMA:8912","FMA:52941","FMA:6743","FMA:7126","FMA:53485","FMA:16492","FMA:53399","FMA:65337","FMA:11209","FMA:6772","FMA:52726","FMA:6121","FMA:52627","FMA:52974","FMA:53571","FMA:6729","FMA:8729","FMA:53606","FMA:80025","FMA:53481","FMA:53575","FMA:45451","FMA:11218","FMA:22109","FMA:6852","FMA:8909","FMA:11751","FMA:65991","FMA:8836","FMA:65350","FMA:53423","FMA:65569","FMA:65314","FMA:82957","FMA:65438","FMA:39146","FMA:8911","FMA:22111","FMA:65916","FMA:65739","FMA:65917","FMA:6779","FMA:8889","FMA:65924","FMA:65316","FMA:53002","FMA:16887","FMA:53366","FMA:6890","FMA:8790","FMA:6730","FMA:45358","FMA:52716","FMA:53494","FMA:7115","FMA:53561","FMA:78655","FMA:45366","FMA:11219","FMA:11555","FMA:7092","FMA:53220","FMA:45428","FMA:6193","FMA:20604","FMA:45433","FMA:21874","FMA:21875","FMA:53244","FMA:45432","FMA:6770","FMA:52640","FMA:11249","FMA:20630","FMA:53308","FMA:11216","FMA:65399","FMA:78649","FMA:11084","FMA:6897","FMA:53633","FMA:6085","FMA:6851","FMA:45457","FMA:6757","FMA:8732","FMA:8824","FMA:20632","FMA:6137","FMA:52730","FMA:7301","FMA:52699","FMA:53607","FMA:7300","FMA:53576","FMA:44904","FMA:65342","FMA:7127","FMA:6737","FMA:52669","FMA:21876","FMA:45425","FMA:65999","FMA:8728","FMA:21871","FMA:55172","FMA:6149","FMA:45453","FMA:44932","FMA:292832","FMA:6744","FMA:6781","FMA:44769","FMA:45326","FMA:6760","FMA:53634","FMA:53605","FMA:53530","FMA:6821","FMA:52968","FMA:53001","FMA:11552","FMA:45264","FMA:8835","FMA:6888","FMA:55160","FMA:44899","FMA:52979","FMA:45333","FMA:45310","FMA:6084","FMA:11781","FMA:82962","FMA:53280","FMA:52715","FMA:53311","FMA:16491","FMA:21880","FMA:44952","FMA:11687","FMA:11212","FMA:65335","FMA:52940","FMA:6774","FMA:8823","FMA:45388","FMA:6666","FMA:6072","FMA:16886","FMA:53312","FMA:65915","FMA:45357","FMA:11262","FMA:65921","FMA:0328826","FMA:81290","FMA:53279","FMA:11551","FMA:7293","FMA:6677","FMA:11756","FMA:53598","FMA:52732","FMA:44902","FMA:53545","FMA:6740","FMA:53502","FMA:53562","FMA:52700","FMA:7122","FMA:6118","FMA:65918","FMA:8814","FMA:16403","FMA:65346","FMA:6667","FMA:52630","FMA:52629","FMA:8871","FMA:16500","FMA:52725","FMA:6108","FMA:45363","FMA:65340","FMA:8872","FMA:11760","FMA:53604","FMA:11214","FMA:52777","FMA:21864","FMA:53503","FMA:6738","FMA:66000","FMA:6776","FMA:6777","FMA:6765","FMA:6111","FMA:8890","FMA:20607","FMA:52643","FMA:8908","FMA:65437","FMA:6762","FMA:11154","FMA:65344","FMA:52937","FMA:8919","FMA:45354","FMA:6766","FMA:53424","FMA:6145","FMA:65568","FMA:20634","FMA:6732","FMA:8893","FMA:11758","FMA:6889","FMA:11554","FMA:65922","FMA:7118","FMA:16884","FMA:45308","FMA:7290","FMA:6758","FMA:65743","FMA:11063","FMA:16885","FMA:8882","FMA:65286","FMA:291238","FMA:53482","FMA:52976","FMA:11308","FMA:53432","FMA:53540","FMA:45379","FMA:44871","FMA:6714","FMA:82955","FMA:65993","FMA:45452","FMA:52626","FMA:6083","FMA:53582","FMA:65919","FMA:52936","FMA:53506","FMA:8918","FMA:44901","FMA:6073","FMA:65315","FMA:53219","FMA:11194","FMA:6792","FMA:7119","FMA:52785","FMA:7296","FMA:53068","FMA:6845","FMA:52677","FMA:53504","FMA:53548","FMA:52698","FMA:53570","FMA:6771","FMA:7078","FMA:65997","FMA:65338","FMA:52969","FMA:16401","FMA:65416","FMA:6835","FMA:39082","FMA:8726","FMA:45254","FMA:8879","FMA:11250","FMA:53049","FMA:45382","FMA:8795","FMA:53495","FMA:45434","FMA:82963","FMA:0328827","FMA:52656","FMA:82961","FMA:11753","FMA:39147","FMA:45339","FMA:20605","FMA:20631","FMA:8898","FMA:6070","FMA:44892","FMA:16404","FMA:52942","FMA:6082","FMA:8861","FMA:82953","FMA:8808","FMA:8805","FMA:52994","FMA:65348","FMA:55173","FMA:7129","FMA:52674","FMA:44894","FMA:55159","FMA:65327","FMA:37320","FMA:6761","FMA:65349","FMA:11253","FMA:53507","FMA:11213","FMA:7307","FMA:6769","FMA:6759","FMA:55155","FMA:53675","FMA:53599","FMA:65282","FMA:53251","FMA:6731","FMA:11111","FMA:16497","FMA:8878","FMA:11211","FMA:65740","FMA:45367","FMA:53588","FMA:45365","UBERON:0011766","FMA:16502","FMA:6891","FMA:6091","FMA:11018","FMA:6090","FMA:292887","FMA:65401","FMA:65326","FMA:11215","FMA:44735","FMA:8735","FMA:53538","FMA:6849","FMA:53608","FMA:11217","FMA:8860","FMA:6134","FMA:6893","FMA:53534","FMA:45361","FMA:37321","FMA:82734","FMA:22112","FMA:7294","FMA:52987","FMA:65247","FMA:53535","FMA:6895","FMA:52787","FMA:53635","FMA:65920","FMA:55156","FMA:16498","FMA:53569","FMA:6739","FMA:8807","FMA:22110","FMA:81294","FMA:45450","FMA:8922","FMA:8725","FMA:20608","FMA:7308","FMA:65281","FMA:39084","FMA:78656","FMA:6133","FMA:53581","FMA:16494","FMA:53252","FMA:11789","FMA:45364","FMA:65345","FMA:44870","FMA:39083","FMA:45355","FMA:11193","FMA:16400","FMA:81287","FMA:52776","FMA:65747","FMA:8900","UBERON:0011767","FMA:45424","FMA:292830","FMA:44734","FMA:45381","FMA:82960","FMA:0328831","FMA:6689","FMA:7077","FMA:291236","FMA:8886","FMA:276381","FMA:6124","FMA:65336","FMA:65328","FMA:52670","FMA:53537","FMA:53636","FMA:6896","FMA:21879","FMA:8798","FMA:81288","FMA:53542","FMA:45368","FMA:53547","FMA:55157","FMA:65415","FMA:53309","FMA:65744","FMA:53367","FMA:53590","FMA:65923","FMA:53048","FMA:16499","FMA:53610","FMA:44951","FMA:44953","FMA:8832","FMA:45426","FMA:6114","FMA:52799","FMA:11039","FMA:53546","FMA:53589","FMA:8901","FMA:11681","FMA:52639","FMA:8905","FMA:52733","FMA:65992","FMA:52807","FMA:45435","FMA:53484","FMA:52975","FMA:7289","FMA:44905","FMA:37071","FMA:7130","FMA:65996","FMA:6132","FMA:8826","FMA:6741","FMA:11252","FMA:8917","FMA:82954","FMA:6832","FMA:37073","FMA:37074","FMA:44893","FMA:82959","FMA:20635","FMA:6093","FMA:65248","FMA:45362","FMA:52622","FMA:53508","FMA:11755","FMA:82958","FMA:52997","FMA:16501","FMA:65402","FMA:45427","FMA:52803","FMA:16402","FMA:8734","FMA:52784","FMA:45454","FMA:6736","FMA:7304","FMA:6742","FMA:52998","FMA:52804","FMA:11788","FMA:6713","FMA:52623","FMA:53536","FMA:11780","FMA:45334","FMA:52701","FMA:65998","FMA:11092","FMA:6684","FMA:52779","FMA:52778","FMA:78652","FMA:0328830","FMA:6733","FMA:44950","FMA:78653","FMA:45455","FMA:8864","FMA:8833","FMA:8876","FMA:8867","FMA:11752","FMA:53541","FMA:53611","FMA:8904","FMA:6745","FMA:21863","FMA:7297","FMA:52676","FMA:52798","FMA:8818","FMA:82735","FMA:52657","FMA:52786","FMA:6773","FMA:45253","FMA:6127","FMA:45263","FMA:8875","FMA:81295","FMA:11754","FMA:8812","FMA:45311","FMA:53568","FMA:276379","FMA:6842","FMA:8794","FMA:8820","FMA:53572","FMA:53409","FMA:37070","FMA:6119","FMA:53433","FMA:7123","FMA:8811","FMA:65444","FMA:52806","FMA:53245","FMA:65285","FMA:6768","FMA:8731","FMA:11220","FMA:6778","FMA:53509","FMA:55158","FMA:53567","FMA:65994","FMA:53539","FMA:45327","FMA:8865","FMA:44898","FMA:52673","FMA:80026","FMA:52980","FMA:53505","FMA:82952","FMA:21872","FMA:37065","FMA:52988","FMA:8815","FMA:53398","FMA:52729","FMA:81289","FMA:65398","FMA:52977","FMA:8887"],"subclass labels":["Left T9 white ramus communicans","Right T10 grey ramus communicans","Right T4 spinal nerve posterior ramus","Right fourth intercostal nerve","Right anterior interosseous nerve","Right perineal nerve","Left lateral calcaneal branch A of left sural nerve","Right C3 spinal nerve posterior ramus medial branch","Oesophageal branch of left recurrent laryngeal nerve","Anterior branch of lateral cutaneous branch of left third intercostal nerve","Left common plantar digital nerve F","Anterior cutaneous branch of right subcostal nerve","Left superior labial branch of infraorbital nerve","Left T1 spinal nerve posterior ramus","Anterior branch of left obturator nerve","Right T2 grey ramus communicans","Right T9 grey ramus communicans","Left T5 white ramus communicans","Left L3 spinal nerve posterior ramus lateral branch","Communicating branch of left vagus nerve with left glossopharyngeal nerve","Right second intercostal nerve","Right proper palmar digital nerve G","Left musculocutaneous nerve","Anterior cutaneous branch of left ninth intercostal nerve","Posterior branch of lateral cutaneous branch of left sixth intercostal nerve","Right proper palmar digital nerve H","Communicating branch of right vagus nerve with right glossopharyngeal nerve","Anterior branch of lateral cutaneous branch of right ninth intercostal nerve","Right proper plantar digital nerve C","Left genital branch of genitofemoral nerve","Left T6 grey ramus communicans","Right proper palmar digital nerve I","Right T12 spinal nerve posterior ramus","Right ilioinguinal nerve","Right T8 spinal nerve posterior ramus","Left T9 spinal nerve posterior ramus","Right T11 spinal nerve posterior ramus lateral branch","Right proper plantar digital nerve J","Right medial sural cutaneous nerve","Right T6 spinal nerve posterior ramus medial branch","Right lesser occipital nerve","Right phrenic nerve","Right proper palmar digital nerve E","Left median nerve","Right S3 grey ramus communicans","Right T4 white ramus communicans","Right medial cutaneous nerve of forearm","Right posterior femoral cutaneous nerve","Right vestibular nerve","Lateral cutaneous branch of left sixth intercostal nerve","Left supratrochlear nerve","Right median nerve","Anterior branch of right medial cutaneous nerve of forearm","Right T5 spinal nerve posterior ramus medial branch","Anterior cutaneous branch of right third intercostal nerve","Right C6 spinal nerve posterior ramus","Temporal branch of left facial nerve","Anterior cutaneous branch of left eighth intercostal nerve","Right buccal nerve","Right middle superior alveolar nerve","Temporal branch of right facial nerve","Left superficial branch of radial nerve","Left medial sural cutaneous nerve","Left C4 spinal nerve posterior ramus","Left lateral dorsal digital nerve of the third toe","Right T12 spinal nerve posterior ramus lateral branch","Anterior branch of lateral cutaneous branch of left eleventh intercostal nerve","Left T12 spinal nerve posterior ramus","Left anterior supraclavicular nerve","Left lesser occipital nerve","Right deep fibular nerve","Left T11 spinal nerve posterior ramus","Posterior branch of lateral cutaneous branch of left tenth intercostal nerve","Right anterior superior alveolar nerve","Left tenth intercostal nerve","Anterior branch of lateral cutaneous branch of right fourth intercostal nerve","Communicating branch of left glossopharyngeal nerve with auricular branch of left vagus nerve","Left iliohypogastric nerve","Cervical branch of left facial nerve","Right proper palmar digital nerve J","Lateral cutaneous branch of right sixth intercostal nerve","Right T8 white ramus communicans","Left maxillary nerve","Left intercostobrachial nerve","Left tentorial nerve","Right zygomaticotemporal nerve","Communicating branch of right internal laryngeal nerve with right recurrent laryngeal nerve","Left fourth intercostal nerve","Brachial plexus left C7 root","Vagal branch to right carotid body","Right proper plantar digital nerve G","Right tympanic nerve","Left lateral plantar nerve","Lateral cutaneous branch of left tenth intercostal nerve","Right tibial nerve","Left third occipital nerve","Anterior branch of lateral cutaneous branch of left tenth intercostal nerve","Right T8 spinal nerve posterior ramus lateral branch","Right S1 grey ramus communicans","Left L3 spinal nerve posterior ramus","Palmar cutaneous branch of left ulnar nerve","Right greater petrosal nerve","Left subcostal nerve","Anterior branch of left medial cutaneous nerve of forearm","Left proper plantar digital nerve C","Left C3 spinal nerve branch to left supraclavicular nerve","Right posterior cutaneous nerve of forearm","Posterior branch of lateral cutaneous branch of right tenth intercostal nerve","Right sciatic nerve","Left L5 grey ramus communicans","Right C4 spinal nerve posterior ramus medial branch","Right L4 grey ramus communicans","Left T11 white ramus communicans","Posterior branch of lateral cutaneous branch of right eighth intercostal nerve","Left L1 grey ramus communicans","Posterior branch of left medial cutaneous nerve of forearm","Left auriculotemporal nerve","Left L2 white ramus communicans","Marginal mandibular branch of right facial nerve","Right T8 grey ramus communicans","Right C4 spinal nerve posterior ramus","Right fifth intercostal nerve","Left common fibular nerve","Left posterior ethmoidal nerve","Pharyngeal branch of right glossopharyngeal nerve","Anterior branch of lateral cutaneous branch of right third intercostal nerve","Communicating branch of right external laryngeal nerve with right superior cardiac nerve","Right posterior supraclavicular nerve","Left medial dorsal cutaneous nerve","Lateral cutaneous branch of right eleventh intercostal nerve","Posterior branch of lateral cutaneous branch of left subcostal nerve","Anterior cutaneous branch of left second intercostal nerve","Left lingual nerve","Right lateral calcaneal branch A of right sural nerve","Left phrenic nerve","Right hypogastric nerve","Medial calcaneal branch A of left tibial nerve","Left perineal nerve","Right posterior scrotal nerve","Right inferior alveolar nerve","Medial calcaneal branch A of right tibial nerve","Right T7 white ramus communicans","Left frontal nerve","Right T1 spinal nerve posterior ramus medial branch","Right genitofemoral nerve","Zygomatic branch of right facial nerve","Lateral cutaneous branch of left ninth intercostal nerve","Left C2 spinal nerve branch to left great auricular nerve","Right anterior supraclavicular nerve","Lateral cutaneous branch of right fourth intercostal nerve","Left T11 grey ramus communicans","Lingual branch of right vagus nerve","Left T1 white ramus communicans","Left C3 spinal nerve posterior ramus medial branch","Left proper plantar digital nerve J","Left T2 grey ramus communicans","Brachial plexus left C6 root","Left T10 spinal nerve posterior ramus","Right genital branch of genitofemoral nerve","Anterior cutaneous branch of right first intercostal nerve","Left middle meningeal nerve","Anterior cutaneous branch of left eleventh intercostal nerve","Left infratrochlear nerve","Vagal branch to left carotid body","Anterior cutaneous branch of right eleventh intercostal nerve","Right proper palmar digital nerve B","Left proper palmar digital nerve H","Anterior branch of lateral cutaneous branch of left fourth intercostal nerve","Left seventh intercostal nerve","Right nasociliary nerve","Left posterior scrotal nerve","Left sural nerve","Right S5 grey ramus communicans","Brachial plexus right C7 root","Right inferior rectal nerve","Right transverse cervical nerve","Anterior cutaneous branch of left third intercostal nerve","Left proper plantar digital nerve H","Superficial branch of left ulnar nerve","Dorsal branch of left ulnar nerve","Right eleventh intercostal nerve","Right T2 white ramus communicans","Right common plantar digital nerve F","Infrapatellar branch of right saphenous nerve","Left T5 grey ramus communicans","Lingual branch of left vagus nerve","Thoracic cardiac branch of left vagus nerve","Right superior laryngeal nerve","Right C2 spinal nerve posterior ramus","Right zygomatic nerve","Right auriculotemporal nerve","Anterior branch of lateral cutaneous branch of left subcostal nerve","Left saphenous nerve","Right L3 spinal nerve posterior ramus","Right T7 grey ramus communicans","Left great auricular nerve posterior branch","Left proper palmar digital nerve A","Right infraorbital nerve","Cutaneous branch of right obturator nerve","Posterior branch of right obturator nerve","Left T1 grey ramus communicans","Right T12 white ramus communicans","Right proper plantar digital nerve F","Left posterior auricular nerve","Right posterior ethmoidal nerve","Buccal branch of right facial nerve","Right iliohypogastric nerve","Left dorsal nerve of penis","Right inferior lateral cutaneous nerve of arm","Left T7 spinal nerve posterior ramus lateral branch","Lateral cutaneous branch of left seventh intercostal nerve","Right posterior interosseous nerve","Left middle superior alveolar nerve","Right T9 white ramus communicans","Right T10 spinal nerve posterior ramus","Left deep fibular nerve","Hepatic branch of anterior vagal trunk","Left first intercostal nerve","Right L2 white ramus communicans","Buccal branch of left facial nerve","Right L5 grey ramus communicans","Right common fibular nerve","Left T6 spinal nerve posterior ramus medial branch","Right L2 grey ramus communicans","Right deep petrosal nerve","Left axillary nerve posterior branch","Right posterior auricular nerve","Anterior branch of lateral cutaneous branch of right subcostal nerve","Anterior branch of lateral cutaneous branch of right fifth intercostal nerve","Pyloric branch of greater posterior gastric nerve","Left T10 spinal nerve posterior ramus lateral branch","Superior cervical cardiac branch of right vagus nerve","Ganglionic branch of right maxillary nerve to pterygopalatine ganglion","Left proper palmar digital nerve C","Right superior cervical cardiac nerve","Right ninth intercostal nerve","Right lesser petrosal nerve","Communicating branch of left external laryngeal nerve with left superior cardiac nerve","Right long ciliary nerve B","Anterior cutaneous branch of right fourth intercostal nerve","Right third intercostal nerve","Left L4 grey ramus communicans","Right T7 spinal nerve posterior ramus","Left L2 spinal nerve posterior ramus lateral branch","Left proper palmar digital nerve F","Coeliac branch of posterior vagal trunk","Left lacrimal nerve","Right lacrimal nerve","Anterior cutaneous branch of right seventh intercostal nerve","Left femoral nerve","Right maxillary nerve","Lateral cutaneous branch of right third intercostal nerve","Right superficial fibular nerve","Left proper palmar digital nerve I","Anterior cutaneous branch of left seventh intercostal nerve","Left T12 spinal nerve posterior ramus lateral branch","Thoracic cardiac branch of right vagus nerve","Lateral cutaneous branch of left eighth intercostal nerve","Orbital branch of left maxillary nerve to left ethmoidal sinus","Left pudendal nerve","Left lesser petrosal nerve","Right eighth intercostal nerve","Left S5 grey ramus communicans","Right T10 white ramus communicans","Left T10 white ramus communicans","Left T4 white ramus communicans","Lateral cutaneous branch of left third intercostal nerve","Posterior branch of lateral cutaneous branch of left eighth intercostal nerve","Lateral cutaneous branch of right iliohypogastric nerve","Right supratrochlear nerve","Anterior branch of lateral cutaneous branch of right tenth intercostal nerve","Right C3 spinal nerve branch to right supraclavicular nerve","Right T6 grey ramus communicans","Left T5 spinal nerve posterior ramus medial branch","Left proper palmar digital nerve G","Left posterior superior alveolar nerve","Lateral cutaneous branch of left subcostal nerve","Gluteal branch A of right posterior femoral cutaneous nerve","Right T5 white ramus communicans","Left greater petrosal nerve","Left T3 spinal nerve posterior ramus","Right subcostal nerve","Right femoral branch of genitofemoral nerve","Right sixth intercostal nerve","Anterior cutaneous branch of right ninth intercostal nerve","Left T11 spinal nerve posterior ramus lateral branch","Left T7 grey ramus communicans","Posterior branch of lateral cutaneous branch of right subcostal nerve","Left L2 grey ramus communicans","Posterior branch of lateral cutaneous branch of right third intercostal nerve","Right L1 white ramus communicans","Anterior branch of right obturator nerve","Anterior cutaneous branch of left fifth intercostal nerve","Left T4 grey ramus communicans","Right C5 spinal nerve posterior ramus medial branch","Right T4 spinal nerve posterior ramus medial branch","Left L1 white ramus communicans","Anterior cutaneous branch of right eighth intercostal nerve","Left subclavian nerve","Pericardial branch of left phrenic nerve","Left tympanic nerve","Right zygomaticofacial nerve","Right intercostobrachial nerve","Right cochlear nerve","Left internal laryngeal nerve","Right lateral dorsal digital nerve of the third toe","Left proper palmar digital nerve D","Inferior cervical cardiac branch of left vagus nerve","Left proper plantar digital nerve B","Right S2 grey ramus communicans","Right proper plantar digital nerve H","Right tentorial nerve","Right T1 white ramus communicans","Inferior ramus of left internal laryngeal nerve","Right L3 grey ramus communicans","Right posterior superior alveolar nerve","Tonsillar branch of right glossopharyngeal nerve","Lateral cutaneous branch of right subcostal nerve","Right proper palmar digital nerve C","Right first intercostal nerve","Posterior branch of right medial cutaneous nerve of forearm","Right lingual nerve","Lateral cutaneous branch of right fifth intercostal nerve","Left T4 spinal nerve posterior ramus","Posterior branch of lateral cutaneous branch of left third intercostal nerve","Right posterior superior lateral nasal branch of maxillary nerve","Posterior branch of lateral cutaneous branch of right fifth intercostal nerve","Left buccal nerve","Right third occipital nerve","Left anterior ethmoidal nerve","Right lingual branch of glossopharyngeal nerve","Left laryngopharyngeal branch of superior cervical ganglion","Right infratrochlear nerve","Left external laryngeal nerve branch to pharyngeal plexus","Left T7 white ramus communicans","Left L1 spinal nerve posterior ramus","Right S4 grey ramus communicans","Left proper palmar digital nerve J","Left zygomatic nerve","Left L1 spinal nerve posterior ramus lateral branch","Left greater occipital nerve","Left medial cutaneous nerve of forearm","Brachial plexus left C8 root","Left anterior femoral cutaneous branch A","Posterior branch of lateral cutaneous branch of left seventh intercostal nerve","Left T1 spinal nerve posterior ramus medial branch","Left meningeal branch of mandibular nerve","Left medial dorsal digital nerve of the fourth toe","Left C5 spinal nerve posterior ramus","Pharyngeal branch of left glossopharyngeal nerve","Right medial plantar nerve","Left proper plantar digital nerve F","Left deep petrosal nerve","Right supraorbital nerve","Left proper plantar digital nerve E","Right T9 spinal nerve posterior ramus lateral branch","Left posterior cutaneous nerve of forearm","Left posterior femoral cutaneous nerve","Left hypogastric nerve","Left genitofemoral nerve","Anterior branch of lateral cutaneous branch of left ninth intercostal nerve","Right T1 spinal nerve posterior ramus","Right common palmar digital nerve A","Right L3 spinal nerve posterior ramus lateral branch","Left anterior superior alveolar nerve","Right T1 grey ramus communicans","Anterior cutaneous branch of left sixth intercostal nerve","Left proper plantar digital nerve A","Left T5 spinal nerve posterior ramus","Right T3 spinal nerve posterior ramus","Right superior labial branch of infraorbital nerve","Left proper palmar digital nerve E","Left transverse cervical nerve","Posterior branch of lateral cutaneous branch of right fourth intercostal nerve","Left communicating branch of nasociliary nerve with ciliary ganglion","Superficial branch of right ulnar nerve","Right great auricular nerve posterior branch","Palmar branch of right median nerve","Right ulnar nerve","Right T5 grey ramus communicans","Palmar cutaneous branch of right ulnar nerve","Left T2 spinal nerve posterior ramus medial branch","Tonsillar branch of left glossopharyngeal nerve","Lateral cutaneous branch of right eighth intercostal nerve","Posterior branch of lateral cutaneous branch of right eleventh intercostal nerve","Left T6 white ramus communicans","Right T4 grey ramus communicans","Branch of right vagus nerve to oesophageal nerve plexus","Superior cervical cardiac branch of left vagus nerve","Left long thoracic nerve","Right mental nerve","Left fifth intercostal nerve","Lateral cutaneous branch of left fourth intercostal nerve","Right lateral femoral cutaneous nerve","Posterior branch of lateral cutaneous branch of right seventh intercostal nerve","Lateral cutaneous branch of right seventh intercostal nerve","Left C4 spinal nerve posterior ramus medial branch","Right intermediate dorsal cutaneous nerve","Right medial dorsal cutaneous nerve","Left recurrent laryngeal nerve","Left obturator nerve","Left T8 grey ramus communicans","Right T2 spinal nerve posterior ramus","Right T3 spinal nerve posterior ramus medial branch","Left T2 spinal nerve posterior ramus","Right superficial branch of radial nerve","Right C3 spinal nerve branch to right great auricular nerve","Left anterior interosseous nerve","Lateral cutaneous branch of right ninth intercostal nerve","Left common plantar digital nerve E","Brachial plexus left C5 root","Left external laryngeal nerve","Left C3 spinal nerve posterior ramus","Oesophageal branch of right recurrent laryngeal nerve","Lateral cutaneous branch of right tenth intercostal nerve","Anterior cutaneous branch of right sixth intercostal nerve","Right T3 white ramus communicans","Left T9 grey ramus communicans","Auricular branch of right vagus nerve","Right lateral sural cutaneous nerve","Left ulnar nerve","Right long ciliary nerve A","Left sciatic nerve","Anterior branch of lateral cutaneous branch of left fifth intercostal nerve","Right inferior palpebral branch of infraorbital nerve","Right medial cutaneous nerve of arm","Auricular branch of left vagus nerve","Left T10 grey ramus communicans","Left medial posterior superior nasal nerve","Pharyngeal branch of right vagus nerve to pharyngeal nerve plexus","Left L3 grey ramus communicans","Left lateral femoral cutaneous nerve","Right external laryngeal nerve branch to pharyngeal plexus","Left eighth intercostal nerve","Right T5 spinal nerve posterior ramus","Left tibial nerve","Right superior lateral cutaneous nerve of arm","Right lateral plantar nerve","Anterior cutaneous branch of left first intercostal nerve","Brachial plexus right C8 root","Lateral cutaneous branch of left iliohypogastric nerve","Posterior branch of lateral cutaneous branch of left eleventh intercostal nerve","Right long thoracic nerve","Left lateral cutaneous nerve of forearm","Left posterior supraclavicular nerve","Left T3 grey ramus communicans","Left ilioinguinal nerve","Left mental nerve","Left T12 white ramus communicans","Left superficial fibular nerve","Right proper palmar digital nerve F","Right proper palmar digital nerve D","Right lateral cutaneous nerve of forearm","Gluteal branch A of left posterior femoral cutaneous nerve","Lateral cutaneous branch of left fifth intercostal nerve","Right L1 spinal nerve posterior ramus lateral branch","Right axillary nerve anterior branch","Orbital branch of right maxillary nerve to right ethmoidal sinus","Right C6 spinal nerve posterior ramus medial branch","Posterior branch of lateral cutaneous branch of right ninth intercostal nerve","Right recurrent laryngeal nerve","Right sural nerve","Dorsal branch of right ulnar nerve","Right common plantar digital nerve E","Right medial dorsal digital nerve of the fourth toe","Right proper plantar digital nerve E","Left caroticotympanic nerve","Greater posterior gastric nerve","Right L1 spinal nerve posterior ramus","Pericardial branch of right phrenic nerve","Anterior branch of lateral cutaneous branch of right eighth intercostal nerve","Left incisive branch of inferior alveolar nerve","Right T3 grey ramus communicans","Left posterior interosseous nerve","Palmar branch of left median nerve","Left nasociliary nerve","Right external laryngeal nerve","Pharyngeal branch of left vagus nerve to pharyngeal nerve plexus","Right T11 grey ramus communicans","Right dorsal nerve of penis","Left C6 spinal nerve posterior ramus","Left axillary nerve anterior branch","Meningeal branch of left vagus nerve","Left intermediate dorsal cutaneous nerve","Right laryngopharyngeal branch of superior cervical ganglion","Right great auricular nerve anterior branch","Zygomatic branch of left facial nerve","Left C5 spinal nerve posterior ramus medial branch","Marginal mandibular branch of left facial nerve","Right L1 grey ramus communicans","Right meningeal branch of mandibular nerve","Right femoral nerve","Tracheal branch of right recurrent laryngeal nerve","Left posterior cutaneous nerve of arm","Left inferior lateral cutaneous nerve of arm","Right L2 spinal nerve posterior ramus","Right lateral dorsal cutaneous nerve","Anterior cutaneous branch of right second intercostal nerve","Left nasopalatine nerve","Left T3 spinal nerve posterior ramus medial branch","Left superior cervical cardiac nerve","Posterior branch of lateral cutaneous branch of left ninth intercostal nerve","Right T7 spinal nerve posterior ramus lateral branch","Right frontal nerve","Anterior cutaneous branch of left tenth intercostal nerve","Ganglionic branch of left maxillary nerve to pterygopalatine ganglion","Left S1 grey ramus communicans","Left lesser palatine nerve","Left medial plantar nerve","Communicating branch of right glossopharyngeal nerve with auricular branch of right vagus nerve","Left zygomaticotemporal nerve","Anterior cutaneous branch of right fifth intercostal nerve","Left proper palmar digital nerve B","Left radial nerve","Posterior branch of lateral cutaneous branch of left fourth intercostal nerve","Left S3 grey ramus communicans","Left T3 white ramus communicans","Right T11 spinal nerve posterior ramus","Left ninth intercostal nerve","Right T2 spinal nerve posterior ramus medial branch","Anterior cutaneous branch of left subcostal nerve","Right proper plantar digital nerve B","Left C2 spinal nerve posterior ramus","Right axillary nerve","Left axillary nerve","Left common palmar digital nerve A","Left proper plantar digital nerve D","Left femoral branch of genitofemoral nerve","Left second intercostal nerve","Left medial cutaneous nerve of arm","Left lateral sural cutaneous nerve","Right ophthalmic nerve","Right carotid sinus nerve","Right T10 spinal nerve posterior ramus lateral branch","Right proper plantar digital nerve D","Right mandibular nerve","Right obturator nerve","Left C3 spinal nerve branch to left great auricular nerve","Left lateral dorsal cutaneous nerve","Right greater palatine nerve","Right L2 spinal nerve posterior ramus lateral branch","Brachial plexus right C5 root","Left posterior superior lateral nasal branch of maxillary nerve","Right proper plantar digital nerve I","Right seventh intercostal nerve","Anterior branch of lateral cutaneous branch of right eleventh intercostal nerve","Right tenth intercostal nerve","Left mandibular nerve","Left greater palatine nerve","Left T12 grey ramus communicans","Inferior cervical cardiac branch of right vagus nerve","Left ophthalmic nerve","Left superior laryngeal nerve","Right T12 grey ramus communicans","Cutaneous branch of left obturator nerve","Left long ciliary nerve B","Left S4 grey ramus communicans","Left T4 spinal nerve posterior ramus medial branch","Greater anterior gastric nerve","Orbital branch of left maxillary nerve to left sphenoidal sinus","Orbital branch of right maxillary nerve to right sphenoidal sinus","Right middle supraclavicular nerve","Right caroticotympanic nerve","Left sixth intercostal nerve","Right posterior cutaneous nerve of arm","Left middle supraclavicular nerve","Left proper plantar digital nerve I","Anterior branch of lateral cutaneous branch of right sixth intercostal nerve","Left L2 spinal nerve posterior ramus","Anterior branch of lateral cutaneous branch of left seventh intercostal nerve","Posterior branch of lateral cutaneous branch of right sixth intercostal nerve","Left T8 spinal nerve posterior ramus lateral branch","Meningeal branch of right vagus nerve","Tracheal branch of left recurrent laryngeal nerve","Anterior cutaneous branch of right tenth intercostal nerve","Left eleventh intercostal nerve","Right pudendal nerve","Posterior branch of lateral cutaneous branch of left fifth intercostal nerve","Right anterior ethmoidal nerve","Right nasopalatine nerve","Left T8 spinal nerve posterior ramus","Left long ciliary nerve A","Left supraorbital nerve","Right medial posterior superior nasal nerve","Left T8 white ramus communicans","Right anterior femoral cutaneous branch A","Left T2 white ramus communicans","Right saphenous nerve","Anterior branch of lateral cutaneous branch of right seventh intercostal nerve","Left superior lateral cutaneous nerve of arm","Left T9 spinal nerve posterior ramus lateral branch","Left T6 spinal nerve posterior ramus","Posterior branch of left obturator nerve","Left external laryngeal nerve branch to inferior pharyngeal constrictor","Right incisive branch of inferior alveolar nerve","Right C3 spinal nerve posterior ramus","Right C5 spinal nerve posterior ramus","Right T9 spinal nerve posterior ramus","Communicating branch of left internal laryngeal nerve with left recurrent laryngeal nerve","Left vestibular nerve","Right radial nerve","Left third intercostal nerve","Left cochlear nerve","Anterior cutaneous branch of left fourth intercostal nerve","Right T6 spinal nerve posterior ramus","Right greater occipital nerve","Right lesser palatine nerve","Left inferior alveolar nerve","Right subclavian nerve","Right T6 white ramus communicans","Brachial plexus right C6 root","Lateral cutaneous branch of left eleventh intercostal nerve","Right T11 white ramus communicans","Left carotid sinus nerve","Left great auricular nerve anterior branch","Right external laryngeal nerve branch to inferior pharyngeal constrictor","Left S2 grey ramus communicans","Right internal laryngeal nerve","Infrapatellar branch of left saphenous nerve","Anterior branch of lateral cutaneous branch of left sixth intercostal nerve","Right proper palmar digital nerve A","Right communicating branch of nasociliary nerve with ciliary ganglion","Left proper plantar digital nerve G","Left infraorbital nerve","Left lingual branch of glossopharyngeal nerve","Right proper plantar digital nerve A","Left inferior rectal nerve","Right musculocutaneous nerve","Left inferior palpebral branch of infraorbital nerve","Left T7 spinal nerve posterior ramus","Cervical branch of right facial nerve","Right middle meningeal nerve","Right axillary nerve posterior branch","Right C2 spinal nerve branch to right great auricular nerve","Left zygomaticofacial nerve","Anterior branch of lateral cutaneous branch of left eighth intercostal nerve"]},{id:77,nerve_id:"UBERON:0001647",label:"facial nerve","FMA subclasses (in human nerves)":["FMA:50888","FMA:50889"],"subclass labels":["Right facial nerve","Left facial nerve"]},{id:78,nerve_id:"UBERON:0001148",label:"median nerve","FMA subclasses (in human nerves)":["FMA:37067","FMA:37068"],"subclass labels":["Right median nerve","Left median nerve"]},{id:79,nerve_id:"UBERON:0009009",label:"carotid sinus nerve","FMA subclasses (in human nerves)":["FMA:53508","FMA:53509"],"subclass labels":["Right carotid sinus nerve","Left carotid sinus nerve"]},{id:80,nerve_id:"UBERON:0003715",label:"splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6924","FMA:6928","FMA:6929","FMA:6931","FMA:6930","FMA:6960","FMA:6958","FMA:6959","FMA:6925","FMA:6956","FMA:6927","FMA:6955","FMA:6926","FMA:6957"],"subclass labels":["Right first lumbar splanchnic nerve","Right third lumbar splanchnic nerve","Left third lumbar splanchnic nerve","Left fourth lumbar splanchnic nerve","Right fourth lumbar splanchnic nerve","Left least splanchnic nerve","Left lesser splanchnic nerve","Right least splanchnic nerve","Left first lumbar splanchnic nerve","Right greater splanchnic nerve","Left second lumbar splanchnic nerve","Left greater splanchnic nerve","Right second lumbar splanchnic nerve","Right lesser splanchnic nerve"]},{id:81,nerve_id:"ILX:0793826",label:"anterior abdominal vagal trunk","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:82,nerve_id:"UBERON:0001650",label:"hypoglossal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:83,nerve_id:"ILX:0794967",label:"posterior interosseous nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:84,nerve_id:"ILX:0793713",label:"Deep petrosal nerve","FMA subclasses (in human nerves)":["FMA:0328827","FMA:0328826"],"subclass labels":["Left deep petrosal nerve","Right deep petrosal nerve"]},{id:85,nerve_id:"ILX:0793361",label:"white communicating ramus of third lumbar spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:86,nerve_id:"ILX:0787562",label:"gray communicating ramus of the third thoracic nerve","FMA subclasses (in human nerves)":["FMA:6133","FMA:6124"],"subclass labels":["Left T3 grey ramus communicans","Right T3 grey ramus communicans"]},{id:87,nerve_id:"ILX:0793211",label:"white communicating ramus of fifth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:88,nerve_id:"UBERON:0018679",label:"thoracic splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6958","FMA:6960","FMA:6955","FMA:6959","FMA:6957","FMA:6956"],"subclass labels":["Left lesser splanchnic nerve","Left least splanchnic nerve","Left greater splanchnic nerve","Right least splanchnic nerve","Right lesser splanchnic nerve","Right greater splanchnic nerve"]},{id:89,nerve_id:"ILX:0731969",label:"least splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6960","FMA:6959"],"subclass labels":["Left least splanchnic nerve","Right least splanchnic nerve"]},{id:90,nerve_id:"ILX:0788771",label:"gray communicating ramus of seventh thoracic nerve","FMA subclasses (in human nerves)":["FMA:6888","FMA:6889"],"subclass labels":["Right T7 grey ramus communicans","Left T7 grey ramus communicans"]},{id:91,nerve_id:"UBERON:0022301",label:"long ciliary nerve","FMA subclasses (in human nerves)":["FMA:52701","FMA:52700","FMA:82734","FMA:82735"],"subclass labels":["Left long ciliary nerve B","Right long ciliary nerve B","Right long ciliary nerve A","Left long ciliary nerve A"]},{id:92,nerve_id:"ILX:0793221",label:"white communicating ramus of second lumbar spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:93,nerve_id:"ILX:0785825",label:"gray communicating ramus of first lumbar nerve","FMA subclasses (in human nerves)":["FMA:65924","FMA:65923"],"subclass labels":["Left L1 grey ramus communicans","Right L1 grey ramus communicans"]},{id:94,nerve_id:"ILX:0793208",label:"white communicating ramus of second thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:95,nerve_id:"UBERON:0018412",label:"vidian nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:96,nerve_id:"ILX:0739303",label:"gray communicating ramus of second thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:97,nerve_id:"ILX:0795006",label:"Suboccipital nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:98,nerve_id:"ILX:0785733",label:"gray communicating ramus of second lumbar nerve","FMA subclasses (in human nerves)":["FMA:65921","FMA:65922"],"subclass labels":["Right L2 grey ramus communicans","Left L2 grey ramus communicans"]},{id:99,nerve_id:"UBERON:0035207",label:"deep fibular nerve","FMA subclasses (in human nerves)":["FMA:45387","FMA:45388"],"subclass labels":["Right deep fibular nerve","Left deep fibular nerve"]},{id:100,nerve_id:"ILX:0739304",label:"gray communicating ramus of third thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:101,nerve_id:"UBERON:0002019",label:"accessory XI nerve","FMA subclasses (in human nerves)":["FMA:50899","FMA:50897"],"subclass labels":["Left accessory nerve","Right accessory nerve"]},{id:102,nerve_id:"ILX:0793217",label:"white communicating ramus of eleventh thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:103,nerve_id:"ILX:0793722",label:"Lesser petrosal nerve","FMA subclasses (in human nerves)":["FMA:53503","FMA:53502"],"subclass labels":["Left lesser petrosal nerve","Right lesser petrosal nerve"]},{id:104,nerve_id:"UBERON:0018675",label:"pelvic splanchnic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:105,nerve_id:"ILX:0793702",label:"Greater petrosal nerve","FMA subclasses (in human nerves)":["FMA:53423","FMA:53424"],"subclass labels":["Right greater petrosal nerve","Left greater petrosal nerve"]},{id:106,nerve_id:"ILX:0794916",label:"white ramus communicans","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:107,nerve_id:"UBERON:0003716",label:"Recurrent Laryngeal Nerve","FMA subclasses (in human nerves)":["UBERON:0011766","UBERON:0011767"],"subclass labels":["Left recurrent laryngeal nerve","Right recurrent laryngeal nerve"]},{id:108,nerve_id:"UBERON:0005465",label:"obturator nerve","FMA subclasses (in human nerves)":["FMA:16501","FMA:16502"],"subclass labels":["Right obturator nerve","Left obturator nerve"]},{id:109,nerve_id:"ILX:0793213",label:"white communicating ramus of seventh thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:110,nerve_id:"ILX:0785067",label:"gray communicating ramus of eleventh thoracic nerve","FMA subclasses (in human nerves)":["FMA:6897","FMA:6896"],"subclass labels":["Left T11 grey ramus communicans","Right T11 grey ramus communicans"]},{id:111,nerve_id:"UBERON:0001494",label:"ulnar nerve","FMA subclasses (in human nerves)":["FMA:37320","FMA:37321"],"subclass labels":["Right ulnar nerve","Left ulnar nerve"]},{id:112,nerve_id:"ILX:0794959",label:"posterior rami lower cervical nerves","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:113,nerve_id:"UBERON:0001493",label:"axillary nerve","FMA subclasses (in human nerves)":["FMA:37074","FMA:37073"],"subclass labels":["Left axillary nerve","Right axillary nerve"]},{id:114,nerve_id:"ILX:0787946",label:"gray communicating ramus of sixth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6762","FMA:6763"],"subclass labels":["Right T6 grey ramus communicans","Left T6 grey ramus communicans"]},{id:115,nerve_id:"ILX:0785542",label:"gray communicating ramus of ninth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6892","FMA:6893"],"subclass labels":["Right T9 grey ramus communicans","Left T9 grey ramus communicans"]}],a4=()=>{const n={};return o4.forEach(e=>{e.nerve_id&&e.label!=="nerve"&&e["subclass labels"].forEach(t=>{t in n||(n[t.toLowerCase()]=e.nerve_id)})}),n},l4=[{label:"urinary bladder",anatomicalId:"UBERON:0001255"},{label:"brainstem",anatomicalId:"UBERON:0002298"},{label:"caecum",anatomicalId:"UBERON:0001153"},{label:"colon",anatomicalId:"UBERON:0001155"},{label:"esophagus",anatomicalId:"UBERON:0001043"},{label:"small intestine",anatomicalId:"UBERON:0002108"},{label:"stomach",anatomicalId:"UBERON:0000945"},{label:"heart",anatomicalId:"UBERON:0000948"},{label:"lung",anatomicalId:"UBERON:0002048"}],c4=()=>{const n={};return l4.forEach(e=>{const t=e.label.toLowerCase();t in n||(n[t.toLowerCase()]=e.anatomicalId)}),n},Hx=a4(),Wx=c4(),u4={name:"ScaffoldVuer",components:{Button:ws,Col:Fn,Loading:ZL,Option:As,Popover:Ml,Radio:dg,RadioGroup:hg,Row:Yn,ScaffoldOverlay:Vg,Select:Ms,Slider:An,TabPane:Ng,Tabs:Og,MapSvgIcon:Of.MapSvgIcon,MapSvgSpriteColor:Of.MapSvgSpriteColor,PrimitiveControls:Cx,ScaffoldTooltip:Rx,ElIconWarningFilled:Hp,ElIconArrowDown:gu,ElIconArrowLeft:ki,DrawToolbar:Ua.DrawToolbar,ScaffoldTreeControls:Lx},setup(n){let e=a.inject("$annotator");return e||(e=a.markRaw(new jx.AnnotationService(`${n.flatmapAPI}annotator`)),a.provide("$annotator",e)),{annotator:e}},props:{annotationSidebar:{type:Boolean,default:!1},url:{type:String,default:""},showColourPicker:{type:Boolean,default:!1},displayUI:{type:Boolean,default:!0},displayAtStartUp:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},displayWarning:{type:Boolean,default:!0},warningMessage:{type:String,default:"Beta feature - under active development"},displayLatestChanges:{type:Boolean,default:!1},latestChangesMessage:{type:String,default:"New feature - Local search is now available"},displayMarkers:{type:Boolean,default:!1},markerCluster:{type:Boolean,default:!1},markerLabels:{type:Object,default:function(){return{}}},displayMinimap:{type:Boolean,default:!1},format:{type:String,default:"metadata"},minimapSettings:{type:Object,default:function(){return{x_offset:16,y_offset:16,width:128,height:128,align:"top-right"}}},enableOpenMapUI:{type:Boolean,default:!1},positionalRotation:{type:Boolean,default:!1},isNerves:{type:Object,default:function(){return{regions:["nerves"]}}},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},state:{type:Object,default:void 0},region:{type:String,default:""},viewURL:{type:String,default:""},render:{type:Boolean,default:!0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},showLocalSettings:{type:Boolean,default:!0},showOpenMapButton:{type:Boolean,default:!0},usageConfig:{type:Object,default:function(){return{showTubeLinesControls:!0,tubeLines:!1}}}},provide(){return{flatmapAPI:this.flatmapAPI,scaffoldUrl:this.url,boundingDims:this.boundingDims}},data:function(){return{annotator:void 0,colourRadio:!0,createData:{drawingBox:!1,toBeConfirmed:!1,points:[],shape:"",x:0,y:0,editingIndex:-1,faceIndex:-1,toBeDeleted:!1},currentTime:0,timeVarying:!1,isPlaying:!1,isReady:!1,isTransitioning:!1,tooltipAppendToBody:!1,hoverVisibilities:[{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"sliderPopover"},{value:!1,ref:"regionVisibilityPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"}],inHelp:!1,helpModeActiveIndex:this.helpModeInitialIndex,loading:!1,duration:3e3,drawerOpen:!0,currentBackground:"white",availableBackground:["white","lightskyblue","black"],minimisedSlider:!1,sliderPosition:"",timeMax:100,orginalDuration:"",animateDuration:"6secs",playSpeed:[{value:.1,label:"0.1x"},{value:.5,label:"0.5x"},{value:1,label:"1x"},{value:2,label:"2x"},{value:5,label:"5x"},{value:10,label:"10x"}],currentSpeed:1,timeStamps:{},defaultCheckedKeys:[],outlinesRadio:!0,tData:{label:"",region:"",visible:!1,x:200,y:200,active:!1},fileFormat:"metadata",previousMarkerLabels:a.markRaw({}),viewingMode:"Exploration",viewingModes:{Exploration:"View and explore detailed visualization of 3D scaffolds","Neuron Connection":"Discover nerve connections by selecting a nerve and viewing its associated connections",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},openMapRef:void 0,backgroundIconRef:void 0,annotationFeature:{},offlineAnnotationEnabled:!1,offlineAnnotations:a.markRaw([]),authorisedUser:void 0,toolbarOptions:["Delete","Edit","Point","LineString"],existDrawnFeatures:a.markRaw([]),activeDrawTool:void 0,activeDrawMode:void 0,boundingDims:{centre:[0,0,0],size:[1,1,1]},lastSelected:a.markRaw({region:"",group:"",isSearch:!1})}},watch:{format:{handler:function(n){this.fileFormat=n},immediate:!0},url:{handler:function(n){(this.state===void 0||this.state.url===void 0)&&this.setURL(n)},immediate:!0},region:{handler:function(n){this.state||this.viewURL||this.setFocusedRegion(n)},immediate:!0},state:{handler:function(n){this.setState(n)},immediate:!0,deep:!0},viewURL:{handler:function(n){this.updateViewURL(n)},immediate:!0},helpMode:function(n,e){n!==e&&this.setHelpMode(n)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},displayMarkers:function(n){this.$module.scene.displayMarkers=n,this.$module.scene.forcePickableObjectsUpdate=!0},displayMinimap:function(n){this.$module.scene.displayMinimap=n},currentTime:{handler:function(){this.$emit("timeChanged",this.currentTime)}},duration:function(){this.$module.scene.setDuration(this.duration)},minimapSettings:{deep:!0,handler:"updateMinimapScissor"},render:function(n){this.toggleRendering(n)},markerCluster:{handler:function(n){this.$module.scene.enableMarkerCluster(n)},immediate:!0},markerLabels:function(n){for(const[e,t]of Object.entries(this.previousMarkerLabels))this.setMarkerModeForObjectsWithName(e,t,"off");for(const[e,t]of Object.entries(n))this.setMarkerModeForObjectsWithName(e,t,"on");this.previousMarkerLabels=a.markRaw({...n})}},beforeCreate:function(){this.$module=new Px,this.selectedObjects=[],this.hoveredObjects=[],this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"],this.$_searchIndex=new s4},mounted:function(){this.openMapRef=a.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=a.shallowRef(this.$refs.backgroundIconRef),this.$refs.scaffoldTreeControls.setModule(this.$module);let n=new zD;n.subscribe(this,this.eventNotifierCallback),this.$module.addNotifier(n),this.$module.addOrganPartAddedCallback(this.zincObjectAdded),this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved),this.$module.initialiseRenderer(this.$refs.display),this.toggleRendering(this.render),this.ro=new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer.$el),this.helpTextWait=[],this.helpTextWait.length=this.hoverVisibilities.length,this.defaultRate=this.$module.getPlayRate(),this.$module.zincRenderer.addPreRenderCallbackFunction(()=>{this.currentTime=this.$module.getCurrentTime()}),this.$module.zincRenderer.addContextRestoredCallbackFunction(()=>{this.backgroundChangeCallback(this.currentBackground)})},beforeUnmount:function(){this.ro&&this.ro.disconnect(),this.$module.destroy(),this.$module=void 0},computed:{...Ga.mapStores(xf),...Ga.mapState(xf,["userToken"]),annotationDisplay:function(){return this.viewingMode==="Annotation"&&this.tData.active===!0&&this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"},enableColourPicker:function(){return this.showColourPicker&&this.colourRadio},modeDescription:function(){let n=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.authorisedUser?n[1]:n[0]:n}},methods:{zoomToNerves:function(n,e=!1){if(this.$module.scene){this.$module.setIgnorePicking(e);const t=[];this.$module.scene.getRootRegion().getChildRegions().forEach(r=>{r.getName()==="Nerves"&&e&&n.forEach(o=>{const l=this.findObjectsWithGroupName(o);t.push(...l)})}),this.$module.setSelectedByZincObjects(t,void 0,{},!0),this.$module.scene.viewAll()}},enableAxisDisplay:function(n,e){this.$module.scene&&this.$module.scene.enableAxisDisplay(n,e)},createAxisDisplay:function(n){this.$module.scene&&this.$module.scene.createAxisDisplay(n)},addZincObject:function(n){this.$module.scene&&this.$module.scene.addZincObject(n)},zincObjectAdded:function(n){var r;this.loading=!1,this.$_searchIndex.addZincObject(n,n.uuid),this.timeVarying===!1&&n.isTimeVarying()&&(this.timeVarying=!0);const e=n.groupName.toLowerCase();e in Wx&&n.setAnatomicalId(Wx[e]);const t=n.getGroup();t&&t.position?n.userData.originalPos=[t.position.x,t.position.y,t.position.z]:n.userData.originalPos=[0,0,0];const i=(r=this.isNerves)==null?void 0:r.regions;if(i){const s=n.getRegion().getFullPath().toLowerCase();for(let o=0;o<i.length;o++)s.includes(i[o].toLowerCase())?(n.userData.isNerves=!0,n.userData.defaultColour=`#${n.getColourHex()}`,n.userData.isGreyScale=!1,e in Hx&&n.setAnatomicalId(Hx[e])):n.userData.isNerves=!1}this.$emit("zinc-object-added",n)},removeFromOfflineAnnotation:function(n,e){for(let t=0;t<this.offlineAnnotations.length;t++){const i=this.offlineAnnotations[t];if(i.region===n&&i.group===e){this.offlineAnnotations.splice(t,1);return}}},zincObjectRemoved:function(n){if(this.$module.scene){const e=n.groupName;n.region.findObjectsWithGroupName(e,!1).length===0&&this.$_searchIndex.removeZincObject(n,n.uuid)}},addRegionsToSearchIndex:function(){this.$module.scene.getRootRegion().getChildRegions(!0).forEach(t=>{this.$_searchIndex.addRegion(t,t.uuid)})},backgroundChangeCallback:function(n){this.currentBackground=n,this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground,1)},captureScreenshotCallback:function(){this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);let n=this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"),e=document.createElement("a");document.body.append(e),this.captureFilename?e.download=this.captureFilename:e.download="screenshot.png",e.href=n,e.click(),e.remove()},captureScreenshot:function(n){this.captureFilename=n,this.captureID=this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback)},clearScene:function(){this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.$_searchIndex&&this.$_searchIndex.removeAll(),this.$module.scene&&this.$module.scene.clearAll()},addAndEditAnnotations:function(n,e,t,i){const r=xx(this.annotator,this.userToken,t,n,e,this.url,i);if(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(s=>s.id!==r.item.id)),this.existDrawnFeatures.push(r.feature),this.offlineAnnotationEnabled){r.group=e;let s=n;s.slice(-1)==="/"&&(s=s.slice(0,-1)),r.region=s,this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations.push(r),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))}this.$emit("userPrimitivesUpdated",{region:n,group:e,zincObject:t})},primitivesUpdated:function(n){if(n.isZincObject&&n.isEditable){const e=n.groupName,t=n.region.getFullPath();this.addAndEditAnnotations(t,e,n,"Position Updated")}},confirmCreate:function(n){if(n){let e;if(n.shape==="Point")e=this.$module.scene.createPoints(n.region,n.group,this.createData.points,n.group,8942);else if(n.shape==="LineString")e=this.$module.scene.createLines(n.region,n.group,[this.createData.points[0],this.createData.points[1]],60962);else if(n.editingIndex>-1&&this._editingZincObject){this._editingZincObject.editVertices([this.createData.points[1]],n.editingIndex);const t=this._editingZincObject.region.getFullPath()+"/",i=this._editingZincObject.groupName;this.addAndEditAnnotations(t,i,this._editingZincObject,"Position Updated")}e&&(this.addAndEditAnnotations(n.region,n.group,e.zincObject,"Create"),e.zincObject.isEditable=!0,this.tData.region=n.region,this.tData.label=n.group,this.changeActiveByName([n.group],n.region,!1))}this.cancelCreate()},cancelCreate:function(){this.createData.points.length=0,this.createData.toBeConfirmed=!1,this._editingZincObject=void 0,this.createData.editingIndex=-1,this.createData.faceIndex=-1,this.tData.visible=!1,this.createData.toBeDeleted=!1,this._tempLine&&(this.$module.scene.removeTemporaryPrimitive(this._tempLine),this._tempLine=void 0),this._tempPoint&&(this.$module.scene.removeTemporaryPrimitive(this._tempPoint),this._tempPoint=void 0),this.annotationSidebar&&this.$emit("annotation-close")},confirmComment:function(n){if(this._editingZincObject){let e=n;this._editingZincObject.isEditable&&(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(t=>t.id!==e.item.id)),this.existDrawnFeatures.push(n.feature)),this.offlineAnnotationEnabled&&(e.group=this._editingZincObject.groupName,e.region=this._editingZincObject.region.getFullPath(),this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations.push(e),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations)))}},confirmDelete:function(){var n;if((n=this._editingZincObject)!=null&&n.isEditable){const e=this._editingZincObject.region.getFullPath()+"/",t=this._editingZincObject.groupName,i=xx(this.annotator,this.userToken,this._editingZincObject,e,t,this.url,"Deleted");i&&(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(s=>s.id!==i.item.id)),this.$module.scene.getRootRegion().findChildFromPath(e).removeZincObject(this._editingZincObject),this.offlineAnnotationEnabled&&(this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations=this.offlineAnnotations.filter(s=>s.item.id!==i.item.id),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))))}this.cancelCreate()},onTooltipHide:function(){this.createData.toBeConfirmed&&!this.annotationSidebar&&this.cancelCreate()},formatTooltip(n){if(this.timeMax>=1e3&&n){let e=(n%6e4/1e3).toFixed(2)+"s";return(n>6e4?(n/6e4).toFixed(0)+"m ":"")+e}return n?n.toFixed(2)+" ms":"0 ms"},fitWindow:function(){if(this.$module.scene){let n=!1;this._boundingBoxGeo&&(n=this._boundingBoxGeo.getVisibility(),this._boundingBoxGeo.setVisibility(!1)),this.$module.scene.viewAll(),this._boundingBoxGeo&&(dD(this._boundingBoxGeo,this.$module.scene),this._boundingBoxGeo.setVisibility(n))}},zoomIn:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(-1)},zoomOut:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(1)},speedChanged:function(n){this.currentSpeed=n,this.$module.setPlayRate(this.defaultRate*this.currentSpeed)},stopFreeSpin:function(){this.$module.scene.getZincCameraControls().stopAutoTumble(),this.isTransitioning=!1},findObjectsWithGroupName:function(n){let e=[];return n&&n!=""&&this.$module.scene&&(e=this.$module.scene.findObjectsWithGroupName(n)),e},toggleDrawing:function(n,e){this.createData.toBeDeleted=!1,n==="mode"?(this.cancelCreate(),this.activeDrawMode=e,this.createData.shape="",this.$module.selectObjectOnPick=!0):n==="tool"&&(this.activeDrawTool=e,this.createData.shape=this.activeDrawTool?this.activeDrawTool:"",this.$module.selectObjectOnPick=!1)},toggleDrawingBox:function(){this.createData.drawingBox=!this.createData.drawingBox},viewRegion:function(n){const e=this.$module.scene.getRootRegion(),t=Array.isArray(n)?n:[n],i=Ao(e,t,"",!0);let r=this.$module.scene.getBoundingBoxOfZincObjects(i);if(r){if(this.$module.isSyncControl())this.$module.setSyncControlZoomToBox(r);else{const s=this.$module.scene.camera.far-this.$module.scene.camera.near;this.$module.scene.viewAllWithBoundingBox(r),this.$module.scene.camera.far=this.$module.scene.camera.near+s,this.$module.scene.camera.updateProjectionMatrix()}return!0}return!1},setFocusedRegion:function(n){n&&(this.isReady?this.viewRegion(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({region:n})))},setRotationMode:function(n){this.$module.scene&&this.$module.scene.getZincCameraControls().setRotationMode(n)},updateViewURL:function(n){if(n)if(this.isReady){const e=new URL(n,this.url);this.$module.scene.loadViewURL(e)}else this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewURL:n}))},createEditTemporaryLines:function(n){const e=n[0].extraData.worldCoords;if(e&&(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.createData.points.length===1)if(this.showRegionTooltipWithAnnotations(n,!0,!1),this.tData.x=50,this.tData.y=200,this._tempLine){const t=this._tempLine.geometry.getAttribute("position");t.setXYZ(1,e[0],e[1],e[2]),t.needsUpdate=!0}else this._tempLine=this.$module.scene.addTemporaryLines([this.createData.points[0],e],65535)},draw:function(n){n&&n.length>0&&n[0].data.group&&n[0].extraData.worldCoords&&(this.createData.shape==="Point"?this.drawPoint(n[0].extraData.worldCoords,n):(this.createData.shape==="LineString"||this.createData.editingIndex>-1)&&this.drawLine(n[0].extraData.worldCoords,n))},drawPoint:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length=0,this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200,this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960))},drawLine:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length===1?(this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200):(this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960),this.createData.points.push(n)))},getRendererInfo:function(){if(this.$module.zincRenderer)return this.$module.zincRenderer.getThreeJSRenderer().info},freeSpin:function(){if(this.$module.scene){let n=this.$module.scene.getZincCameraControls();this.isTransitioning=!0,n.enableAutoTumble(),n.autoTumble([1,0],Math.PI,!0),setTimeout(this.stopFreeSpin,4e3)}},activateAnnotationMode:function(n,e){if(this.authorisedUser||this.offlineAnnotationEnabled)if(this.createData.toBeDeleted=!1,this.createData.shape!==""||this.createData.editingIndex>-1)n.length>0&&e.identifiers[0].coords&&(this.createData.x=e.identifiers[0].coords.x,this.createData.y=e.identifiers[0].coords.y,this.draw(e.identifiers));else{if(this.activeDrawMode==="Edit"){const t=aD(e);t&&this.activateEditingMode(t.zincObject,t.faceIndex,t.vertexIndex,t.point)}else if(this.activeDrawMode==="Delete"){const t=cD(e);t&&(this.createData.toBeDeleted=!0,this._editingZincObject=t)}this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"?this.showRegionTooltipWithAnnotations(e.identifiers,!0,!1):this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)}else this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)},activateEditingMode:function(n,e,t,i){this._editingZincObject=n,this.createData.faceIndex=e,this.createData.editingIndex=t,this.drawLine(i,void 0)},eventNotifierCallback:function(n){if(!(this.createData.toBeConfirmed||this.createData.toBeDeleted)){const e=[];let t=[];(n.eventType==1||n.eventType==2)&&(n.identifiers.forEach(s=>{if(s){let o=s.data.id?s.data.id:s.data.group;e.push(o)}}),t=n.zincObjects);let i,r;if(n.identifiers.length>0&&n.identifiers[0]&&(i=n.identifiers[0].data.id?n.identifiers[0].data.id:n.identifiers[0].data.group,n.identifiers[0].data.region&&(r=n.identifiers[0].data.region)),n.eventType==1)if(this.viewingMode==="Annotation"){this.tData.label=i,this.tData.region=r;const s=lD(n);if(this._editingZincObject=s,s){const o=this._editingZincObject.region.getFullPath()+"/",l=this._editingZincObject.groupName;this.annotationFeature=bx(this._editingZincObject,o,l,this.url,"").feature}this.activateAnnotationMode(e,n)}else this.$refs.scaffoldTreeControls&&(e.length>0?(this.$refs.scaffoldTreeControls.updateActiveUI(t),this.updatePrimitiveControls(t)):(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls.removeActive(!1))),n.identifiers.length===1?this.lastSelected={isSearch:!1,region:r,group:n.identifiers[0].data.group}:n.identifiers.length===0&&(this.lastSelected={isSearch:!1,region:"",group:""}),this.$emit("scaffold-selected",n.identifiers);else if(n.eventType==2)this.hideRegionTooltip(),this.$refs.scaffoldTreeControls&&(e.length>0?this.$refs.scaffoldTreeControls.updateHoverUI(t):this.$refs.scaffoldTreeControls.removeHover(!0)),n.identifiers.length>0&&n.identifiers[0]&&n.identifiers[0].coords&&(this.tData.active=!1,(this.viewingMode!=="Annotation"||!this.annotationSidebar)&&(this.tData.visible=!0),this.tData.label=i,this.tData.region=r,this.tData.x=n.identifiers[0].coords.x,this.tData.y=n.identifiers[0].coords.y,this.createEditTemporaryLines(n.identifiers)),this.$emit("scaffold-highlighted",n.identifiers);else if(n.eventType==3&&n.identifiers.length>0&&n.identifiers[0]){if(n.identifiers[0].coords){const s=this.$refs.scaffoldContainer.$el.getBoundingClientRect();this.tData.x=n.identifiers[0].coords.x-s.left,this.tData.y=n.identifiers[0].coords.y-s.top}this.createEditTemporaryLines(n.identifiers)}}},getCoordinatesOfSelected:function(){if(this.selectedObjects&&this.selectedObjects.length>0)return this.$module.scene.getObjectsScreenXY(this.selectedObjects)},getDynamicSelectedCoordinates:function(){return this.$module.selectedScreenCoordinates},timeChange:function(n){let e=n/this.timeMax*100;e!=this.currentTime&&this.$module.updateTime(e)},updatePrimitiveControls:function(n){(this.viewingMode==="Exploration"||this.viewingMode==="Annotation")&&(this.selectedObjects=n,this.selectedObjects&&this.selectedObjects.length>0?this.$refs.primitiveControls.setObject(this.selectedObjects[0]):this.$refs.primitiveControls.setObject(void 0))},objectSelected:function(n,e){this.$module.isIgnorePicking()||(this.updatePrimitiveControls(n),this.$module.setSelectedByZincObjects(n,void 0,{},e))},objectHovered:function(n,e){this.hoveredObjects=n,this.$module.setHighlightedByZincObjects(n,void 0,{},e)},changeActiveByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeActive(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeActiveByNames(r,e,t)}},changeHighlightedByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeHover(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeHoverByNames(r,e,t)}},play:function(n){this.$module.playAnimation(n),this.isPlaying=n},setHelpMode:function(n){const e=this.hoverVisibilities.length,t=e-1,i=this.hoverVisibilities[this.helpModeActiveIndex];if(i){const r=i==null?void 0:i.refs,s=i==null?void 0:i.ref;this.$refs[r||s]||(this.helpModeActiveIndex+=1)}n||(this.helpModeActiveIndex=this.helpModeInitialIndex),n&&this.helpModeActiveIndex>=t&&this.$emit("help-mode-last-item",!0),n&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(r=>{r.value=!0})):n&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1&&setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}),this.showHelpText(this.helpModeActiveIndex,200)},300):(this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}))},displayTooltipOfObjectsCallback:function(n,e,t,i,r){const s=this;return function(){s.$module.zincRenderer.removePostRenderCallbackFunction(s.$_regionTooltipCallback),s.$_regionTooltipCallback=void 0,s.displayTooltipOfObjects(n,e,t,i,r)}},liveUpdateTooltipPosition:function(){this.$module.selectedCenter&&(this.tData.x=this.$module.selectedScreenCoordinates.x,this.tData.y=this.$module.selectedScreenCoordinates.y)},displayTooltipOfObjects:function(n,e,t,i,r){if(e.length>0){let s=e[0].getClosestVertexDOMElementCoords(this.$module.scene);if(s)return s.inView?(n.includes("Search Results for")?this.tData.active=!1:this.tData.active=!0,this.tData.visible=!0,this.tData.label=n,this.tData.x=s.position.x,this.tData.y=s.position.y,this.tData.region=t,this.$_liveCoordinatesUpdated&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),r&&(this.$module.setupLiveCoordinates(e),this.$_liveCoordinatesUpdated=this.$module.zincRenderer.addPostRenderCallbackFunction(this.liveUpdateTooltipPosition))):(this.hideRegionTooltip(),i&&(this.$module.scene.viewAll(),this.$_regionTooltipCallback&&this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_regionTooltipCallback),this.$_regionTooltipCallback=this.$module.zincRenderer.addPostRenderCallbackFunction(this.displayTooltipOfObjectsCallback(n,e,t,i,r)))),!0}return this.hideRegionTooltip(),!1},showRegionTooltipWithObjects:function(n,e,t,i,r){return n&&e&&e.length>0&&this.$module.scene?this.displayTooltipOfObjects(n,e,t,i,r):(this.hideRegionTooltip(),!1)},showRegionTooltip:function(n,e,t){if(n&&this.$module.scene){const i=this.$module.scene.getRootRegion(),s=Ao(i,[n],"",!0);let o;return s&&s.length>0&&(o=s[0].getRegion().getFullPath()),this.showRegionTooltipWithObjects(n,s,o,e,t)}return this.hideRegionTooltip(),!1},showRegionTooltipWithAnnotations:function(n,e,t){if(this.$module.scene){const i=yx(this.$module.scene,n);if(i&&i.objects.length>0)if(this.annotationSidebar){const s=[{featureId:(this.tData.region?this.tData.region+"/":"")+this.tData.label,resourceId:this.url,resource:this.url,feature:this.annotationFeature,offline:this.offlineAnnotationEnabled}];this.$emit("annotation-open",{annotationEntry:s,createData:this.createData,confirmCreate:this.confirmCreate,cancelCreate:this.cancelCreate,confirmDelete:this.confirmDelete,confirmComment:this.confirmComment});return}else return this.showRegionTooltipWithObjects(i.label,i.objects,i.regionPath,e,t)}return this.hideRegionTooltip(),!1},clearAnnotationFeature:function(){const n=this.getOfflineAnnotations();this.existDrawnFeatures.map(t=>decodeURIComponent(t.id).split("/").pop()).forEach(t=>{const i=this.$module.scene.findObjectsWithGroupName(t,!1);if(i&&i.length){const r=i[0].region.getFullPath()+"/";this.$module.scene.getRootRegion().findChildFromPath(r).removeZincObject(i[0])}}),this.$refs.scaffoldTreeControls.removeRegion("__annotation"),this.offlineAnnotations=n},addAnnotationFeature:async function(){let n;if(this.offlineAnnotationEnabled)this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],n=this.offlineAnnotations.filter(e=>e.resource===this.url&&e.feature.properties.drawn).map(e=>e.feature);else{n=[];const e=await wx(this.annotator,this.userToken,this.url);e&&e.features&&(n=[...e.features]);const t=await wx(this.annotator,this.userToken,encodeURIComponent(this.url));t&&t.features&&(n=[...n,...t.features])}this.existDrawnFeatures=a.markRaw(n),Mx(this.$module.scene,n)},changeViewingMode:function(n){let e=!0;this.$module&&(n&&(this.viewingMode=n),this.clearAnnotationFeature(),this.viewingMode==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(t=>{t.name&&t.email&&t.canUpdate?(this.authorisedUser=t,this.offlineAnnotationEnabled=!1):(this.authorisedUser=void 0,this.offlineAnnotationEnabled=!0),this.emitOfflineAnnotationUpdate(),this.addAnnotationFeature(),this.loading=!1})):this.viewingMode==="Exploration"?(this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.createData.shape=""):this.viewingMode==="Neuron Connection"&&(e=!1),this.viewingMode==="Exploration"||this.viewingMode==="Neuron Connection"||this.viewingMode==="Annotation"&&this.createData.shape===""?this.$module.selectObjectOnPick=!0:this.$module.selectObjectOnPick=!1,this.cancelCreate(),n&&this.setObjectIsPickable(e))},emitOfflineAnnotationUpdate:function(){this.$emit("update-offline-annotation-enabled",this.offlineAnnotationEnabled)},forceContextRestore:function(){this.$module.zincRenderer.forceContextRestore()},forceContextLoss:function(){this.$module.zincRenderer.forceContextLoss()},hideRegionTooltip:function(){this.$_liveCoordinatesUpdated&&(this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),this.$module.setupLiveCoordinates(void 0)),this.tData.active=!1,this.tData.visible=!1,this.tData.region=void 0},setObjectIsPickable:function(n){this.$module.scene.getRootRegion().getAllObjects(!0).forEach(t=>{var i;!((i=t.userData)!=null&&i.isNerves)&&!t.anatomicalId&&t.setIsPickable(n)})},setGreyScale:function(n,e=[]){this.$module.scene.getRootRegion().getAllObjects(!0).forEach(i=>{var l;const r=i.groupName.toLowerCase(),s=(l=i.userData)==null?void 0:l.isNerves;(e.length>0&&s&&!e.includes(r)||e.length===0&&!s)&&(i.setGreyScale(n),i.userData.isGreyScale=n)}),this.$refs.scaffoldTreeControls.updateAllNodeColours()},setColour:function(n,e=!1){this.isReady&&this.$module.scene&&typeof n=="boolean"&&(e||n!==this.colourRadio)&&(this.loading=!0,setTimeout(()=>{this.setGreyScale(!n),this.loading=!1,this.colourRadio=n},100))},setOutlines:function(n,e=!1){this.isReady&&this.$module.scene&&typeof n=="boolean"&&(e||n!==this.outlinesRadio)&&(this.outlinesRadio=n,this.$nextTick(()=>this.$refs.scaffoldTreeControls.setOutlines(n)))},setMarkerModeForObjectsWithName:function(n,e,t){if(n&&this.$module.scene){let i=e;typeof e=="number"&&(i={number:e,imgURL:void 0});const r=this.$module.scene.getRootRegion();Ao(r,[n],"",!0).forEach(l=>l.setMarkerMode(t,i))}},setMarkerModeWithAnnotations:function(n,e){if(this.$module.scene){const t=yx(this.$module.scene,n);t&&t.objects.length>0&&t.objects.forEach(i=>i.setMarkerMode(e))}},showHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!0,this.$emit("shown-tooltip")},e))},hideHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!1},e))},search:function(n,e){if(this.$_searchIndex){if(n===void 0||n===""||Array.isArray(n)&&n.length===0)return this.lastSelected={region:"",group:"",isSearch:!0},this.objectSelected([],!0),!1;{this.lastSelected={region:"",group:n,isSearch:!0};const t=this.$_searchIndex.searchAndProcessResult(n),i=t.zincObjects;if(i.length>0){if(this.objectSelected(i,!0),e)for(let r=0;r<i.length;r++)i[r]&&i[r].groupName&&this.showRegionTooltipWithObjects(t.label,i,t.regionPath,!0,!0);return!0}else this.objectSelected([],!0)}}return!1},fetchSuggestions:function(n){return this.$_searchIndex===void 0?[]:this.$_searchIndex.auto_suggest(n)},updateMinimapScissor:function(){Object.keys(this.minimapSettings).forEach(n=>{this.$module.scene.minimapScissor[n]=this.minimapSettings[n]}),this.$module.scene.minimapScissor.updateRequired=!0},updateSettingsfromScene:function(){this.currentSpeed=1,this.$module.setPlayRate(this.defaultRate),this.orginalDuration=this.$module.scene.getMetadataTag("OriginalDuration"),this.animateDuration=this.$module.scene.getMetadataTag("Duration");let n=this.$module.scene.getMetadataTag("TimeStamps");this.timeStamps={};for(const e in n)this.timeStamps[n[e]]=e;this.timeMax=this.$module.scene.getDuration()},restoreSettings:function(n){if(n){if(n.viewport)this.$module.scene.getZincCameraControls().setCurrentCameraSettings(n.viewport);else if(n.viewURL&&n.viewURL!==""){const t=new URL(n.viewURL,this.url);this.$module.scene.loadViewURL(t)}else n.region&&n.region!==""&&this.viewRegion(n.region);n.visibility&&this.$nextTick(()=>{this.$refs.scaffoldTreeControls.setState(n.visibility)}),n.background&&this.backgroundChangeCallback(n.background),"colour"in n&&this.setColour(n.colour),n.offlineAnnotations&&sessionStorage.setItem("anonymous-annotation",n.offlineAnnotations),"outlines"in n&&this.setOutlines(n.outlines),n.viewingMode&&this.changeViewingMode(n.viewingMode);const e=n.search;e&&e.group&&(e.isSearch?this.search(e.group,!0):this.changeActiveByName(e.group,e.region,!0))}},downloadErrorCallback:function(){return n=>{this.$emit("on-error",n)}},setURLFinishCallback:function(n){return()=>{this.offlineAnnotations.length=0,this.updateSettingsfromScene(),this.$module.updateTime(.01),this.$module.updateTime(0),this.$module.unsetFinishDownloadCallback(),this.addRegionsToSearchIndex(),this.setMarkers(),this._boundingBoxGeo=this.$module.scene.addBoundingBoxPrimitive("_helper","boundingBox",4251856,.15),this._slides=this.$module.scene.addSlicesPrimitive("_helper",["x-plane","y-plane","z-plane"],[16733525,5635925,5592575],.5);const{centre:e,size:t}=this.$module.getCentreAndSize();this.boundingDims.centre=e,this.boundingDims.size=t,this.isReady=!0,this.$nextTick(()=>{this.restoreSettings(n),this.$emit("on-ready")})}},getState:function(){let n={format:this.fileFormat,url:this._currentURL,viewport:void 0,visibility:void 0,background:this.currentBackground,colour:this.colourRadio,outlines:this.outlinesRadio,viewingMode:this.viewingMode,usageConfig:this.usageConfig};if(this.$refs.scaffoldTreeControls&&(n.visibility=this.$refs.scaffoldTreeControls.getState()),this.$module.scene){let e=this.$module.scene.getZincCameraControls();n.viewport=e.getCurrentViewport()}return this.lastSelected&&this.lastSelected.group&&(n.search={...this.lastSelected}),this.offlineAnnotationEnabled&&(n.offlineAnnotations=sessionStorage.getItem("anonymous-annotation")),n},setState:function(n){n&&(n.url&&n.url!==this._currentURL?this.setURLAndState(n.url,{fileFormat:n.fileFormat,viewport:n.viewport,visibility:n.visibility,background:n.background,colour:n.colour,outlines:n.outlines,viewingMode:n.viewingMode,search:n.search,offlineAnnotations:n.offlineAnnotations}):(n.background||n.colour||n.search||n.outlines||n.viewport||n.viewingMode||n.visibility)&&(this.isReady&&this.$module.scene?this.restoreSettings(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:n.background,colour:n.colour,search:n.search,offlineAnnotations:n.offlineAnnotations,outlines:n.outlines,viewingMode:n.viewingMode,viewport:n.viewport,visibility:n.visibility}))))},exportGLTF:function(n){return this.$module.scene.exportGLTF(n)},getOfflineAnnotations:function(){return[...this.offlineAnnotations]},importOfflineAnnotations:function(n){if(this.offlineAnnotationEnabled){n.forEach(t=>{const i=t.group,r=t.region;let s=r.slice(-1)==="/"?r:r+"/";const o=s.slice(0,-1);t.region=o,s=s+i;const l=s;t.item.id=l,t.feature.id=l});const e=n.map(t=>t.feature);Mx(this.$module.scene,e),n.forEach(t=>{this.offlineAnnotations.push({...t})}),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))}},setURLAndState:function(n,e){var t,i;if(n!=this._currentURL){const r={};e!=null&&e.format&&(this.fileFormat=e.format),this._currentURL=n,this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.loading=!0,this.timeVarying=!1,this.isReady=!1,this.$_searchIndex.removeAll(),this.hideRegionTooltip(),this.$module.setDownloadErrorCallback(this.downloadErrorCallback()),this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:e==null?void 0:e.background,colour:e==null?void 0:e.colour,outlines:e==null?void 0:e.outlines,region:this.region,search:e==null?void 0:e.search,viewingMode:e==null?void 0:e.viewingMode,viewURL:this.viewURL,viewport:e==null?void 0:e.viewport,visibility:e==null?void 0:e.visibility,offlineAnnotations:e==null?void 0:e.offlineAnnotations})),this.fileFormat==="gltf"?this.$module.loadGLTFFromURL(n,"scene",!0):(((t=this==null?void 0:this.usageConfig)!=null&&t.tubeLines||(i=e==null?void 0:e.usageConfig)!=null&&i.tubeLines)&&(r.tubeLines=!0),this.$module.loadOrgansFromURL(n,void 0,void 0,"scene",void 0,!0,r)),this.$module&&this.$module.scene&&(this.$module.scene.displayMarkers=this.displayMarkers,this.$module.scene.forcePickableObjectsUpdate=!0,this.$module.scene.displayMinimap=this.displayMinimap,this.updateMinimapScissor())}},setURL:function(n){this.setURLAndState(n,void 0)},drawerToggled:function(n){this.drawerOpen=n,this.adjustLayout()},adjustLayout:function(){var n;if((n=this.$refs.scaffoldContainer)!=null&&n.$el){let e=this.$refs.scaffoldContainer.$el.clientWidth;this.minimisedSlider=e<812,this.minimisedSlider?this.sliderPosition=this.drawerOpen?"right":"left":this.sliderPosition=""}},toggleRendering:function(n){this.$module.zincRenderer&&(n?(this.forceContextRestore(),this.$module.zincRenderer.animate()):(this.$module.zincRenderer.stopAnimate(),this.forceContextLoss()))},forceResize:function(){this.$module.zincRenderer&&this.$module.zincRenderer.onWindowResize()},syncControlCallback:function(){const n=this.$module.NDCCameraControl.getPanZoom();this.tData.visible&&this.showRegionTooltip(this.tData.label,!0,!0),this.$emit("scaffold-navigated",n)},toggleSyncControl:function(n,e){this.$module.toggleSyncControl(n,e),this.$module.setSyncControlCallback(this.syncControlCallback)},setMarkers:function(){for(const[n,e]of Object.entries(this.markerLabels))this.setMarkerModeForObjectsWithName(n,e,"on")}}},d4={class:"primitive-controls-box"},h4={class:"animation-data"},f4={class:"purple"},p4={class:"animation-data"},m4={class:"purple"},g4={class:"animation-data"},v4={class:"bottom-right-control control-layer"},y4={class:"control-layer"},b4={style:{"margin-bottom":"2px"}},x4={key:0,class:"viewing-mode-title"},w4=["onClick"],M4=["onClick"];function A4(n,e,t,i,r,s){const o=a.resolveComponent("map-svg-sprite-color"),l=Rx,u=a.resolveComponent("DrawToolbar"),c=Hp,f=ht,h=Ml,p=Lx,v=Cx,m=a.resolveComponent("map-svg-icon"),d=An,b=Yn,y=Ng,g=As,w=Ms,A=Og,S=ws,M=dg,F=hg,R=Vg,T=ed;return a.withDirectives((a.openBlock(),a.createBlock(R,{ref:"scaffoldContainer",class:"scaffold-container","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)",positionalRotation:t.positionalRotation,onOnRotationModeChange:s.setRotationMode},{default:a.withCtx(()=>[a.createVNode(o),a.createVNode(l,{createData:n.createData,label:n.tData.label,region:n.tData.region,visible:n.tData.visible,x:n.tData.x,y:n.tData.y,annotationDisplay:s.annotationDisplay,annotationFeature:n.annotationFeature,offlineAnnotationEnabled:n.offlineAnnotationEnabled,onConfirmCreate:e[0]||(e[0]=P=>s.confirmCreate(P)),onCancelCreate:e[1]||(e[1]=P=>s.cancelCreate()),onConfirmComment:e[2]||(e[2]=P=>s.confirmComment(P)),onConfirmDelete:e[3]||(e[3]=P=>s.confirmDelete()),onTooltipHide:e[4]||(e[4]=P=>s.onTooltipHide())},null,8,["createData","label","region","visible","x","y","annotationDisplay","annotationFeature","offlineAnnotationEnabled"]),a.createElementVNode("div",{id:"organsDisplayArea",ref:"display",tabindex:"-1",style:{height:"100%",width:"100%"},onKeydown:e[5]||(e[5]=a.withKeys((...P)=>s.backgroundChangeCallback&&s.backgroundChangeCallback(...P),["66"]))},null,544),a.withDirectives(a.createElementVNode("div",null,[n.viewingMode==="Annotation"&&(n.authorisedUser||n.offlineAnnotationEnabled)?(a.openBlock(),a.createBlock(u,{key:0,class:"control-layer",toolbarOptions:n.toolbarOptions,activeDrawTool:n.activeDrawTool,activeDrawMode:n.activeDrawMode,hoverVisibilities:n.hoverVisibilities,onClickToolbar:s.toggleDrawing,onShowTooltip:s.showHelpText,onHideTooltip:s.hideHelpText,ref:"toolbarPopover"},null,8,["toolbarOptions","activeDrawTool","activeDrawMode","hoverVisibilities","onClickToolbar","onShowTooltip","onHideTooltip"])):a.createCommentVNode("",!0),t.displayWarning?(a.openBlock(),a.createBlock(h,{key:1,ref:"warningPopover",visible:n.hoverVisibilities[7].value,content:t.warningMessage,placement:"right",width:"max-content",teleported:!1,"popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:a.withCtx(()=>[t.displayWarning?(a.openBlock(),a.createElementBlock("div",{key:0,class:"message-icon warning-icon control-layer",onMouseover:e[6]||(e[6]=P=>s.showHelpText(7)),onMouseout:e[7]||(e[7]=P=>s.hideHelpText(7))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),e[31]||(e[31]=a.createElementVNode("span",{class:"message-text"},"Beta",-1))],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),t.displayLatestChanges?(a.openBlock(),a.createBlock(h,{key:2,visible:n.hoverVisibilities[8].value,content:t.latestChangesMessage,placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper message-popper right-popper non-selectable",ref:"whatsNewPopover"},{reference:a.withCtx(()=>[t.displayLatestChanges&&t.latestChangesMessage?(a.openBlock(),a.createElementBlock("div",{key:0,class:"el-icon-warning message-icon latest-changesicon control-layer",onMouseover:e[8]||(e[8]=P=>s.showHelpText(8)),onMouseout:e[9]||(e[9]=P=>s.hideHelpText(8))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),e[32]||(e[32]=a.createElementVNode("span",{class:"message-text"},"What's new?",-1))],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),a.createVNode(h,{visible:n.hoverVisibilities[6].value,content:"Change region visibility",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"regionVisibilityPopover"},{reference:a.withCtx(()=>[a.createVNode(p,{class:"control-layer",ref:"scaffoldTreeControls",isReady:n.isReady,"show-colour-picker":s.enableColourPicker,onObjectSelected:s.objectSelected,onObjectHovered:s.objectHovered,onDrawerToggled:s.drawerToggled},null,8,["isReady","show-colour-picker","onObjectSelected","onObjectHovered","onDrawerToggled"])]),_:1},8,["visible"]),a.createElementVNode("div",d4,[a.createVNode(v,{class:"control-layer",ref:"primitiveControls",createData:n.createData,viewingMode:n.viewingMode,usageConfig:t.usageConfig,onPrimitivesUpdated:s.primitivesUpdated},null,8,["createData","viewingMode","usageConfig","onPrimitivesUpdated"])]),n.timeVarying?(a.openBlock(),a.createBlock(h,{key:3,ref:"sliderPopover",width:"max-content",visible:n.hoverVisibilities[5].value,content:"Move the slider to animate the region",placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper top-popper non-selectable"},{reference:a.withCtx(()=>[n.timeVarying?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["time-slider-container control-layer",[n.minimisedSlider?"minimised":"",n.sliderPosition]])},[a.createVNode(A,{type:"card"},{default:a.withCtx(()=>[a.createVNode(y,{label:"Animate scaffold"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[n.isPlaying?(a.openBlock(),a.createBlock(m,{key:0,icon:"pause",class:"icon-button video-button",onClick:e[10]||(e[10]=P=>s.play(!1))})):(a.openBlock(),a.createBlock(m,{key:1,icon:"play",class:"video-button icon-button",onClick:e[11]||(e[11]=P=>s.play(!0))})),a.createVNode(d,{min:0,max:n.timeMax,"model-value":n.currentTime/100*n.timeMax,step:.1,"tooltip-class":"time-slider-tooltip",class:"slider","format-tooltip":s.formatTooltip,marks:n.timeStamps,onInput:e[12]||(e[12]=P=>s.timeChange(P))},null,8,["max","model-value","format-tooltip","marks"])]),_:1})]),_:1}),a.createVNode(y,{label:"Animation data"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[a.createElementVNode("div",h4,[e[33]||(e[33]=a.createTextVNode(" Original duration: ")),a.createElementVNode("div",f4,a.toDisplayString(n.orginalDuration),1)]),a.createElementVNode("div",p4,[e[34]||(e[34]=a.createTextVNode(" Animation duration: ")),a.createElementVNode("div",m4,a.toDisplayString(n.animateDuration),1)]),a.createElementVNode("div",g4,[e[35]||(e[35]=a.createTextVNode(" Playback speed ")),a.createVNode(w,{teleported:!0,"model-value":n.currentSpeed,placeholder:"Select",class:"scaffold-select-box speed","popper-class":"scaffold_viewer_dropdown",onChange:e[13]||(e[13]=P=>s.speedChanged(P))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.playSpeed,P=>(a.openBlock(),a.createBlock(g,{key:P.value,label:P.label,value:P.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})],2)):a.createCommentVNode("",!0)]),_:1},8,["visible"])):a.createCommentVNode("",!0),a.createElementVNode("div",v4,[a.createVNode(h,{visible:n.hoverVisibilities[0].value,content:"Zoom in",width:"max-content",placement:"left",teleported:!1,trigger:"manual","popper-class":"scaffold-popper left-popper non-selectable",ref:"zoomInPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[14]||(e[14]=P=>s.zoomIn()),onMouseover:e[15]||(e[15]=P=>s.showHelpText(0)),onMouseout:e[16]||(e[16]=P=>s.hideHelpText(0))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[1].value,content:"Zoom out",placement:"top-end",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper popper-zoomout non-selectable",ref:"zoomOutPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[17]||(e[17]=P=>s.zoomOut()),onMouseover:e[18]||(e[18]=P=>s.showHelpText(1)),onMouseout:e[19]||(e[19]=P=>s.hideHelpText(1))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[2].value,placement:"top",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper non-selectable",ref:"zoomFitPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[20]||(e[20]=P=>s.fitWindow()),onMouseover:e[21]||(e[21]=P=>s.showHelpText(2)),onMouseout:e[22]||(e[22]=P=>s.hideHelpText(2))})]),default:a.withCtx(()=>[e[36]||(e[36]=a.createElementVNode("div",null,[a.createTextVNode(" Fit to "),a.createElementVNode("br"),a.createTextVNode(" window ")],-1))]),_:1},8,["visible"])]),n.openMapRef?(a.openBlock(),a.createBlock(h,{key:4,ref:"open-map-popover","virtual-ref":n.openMapRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"open-map-popper","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.openMapOptions,P=>(a.openBlock(),a.createBlock(b,{key:P.key},{default:a.withCtx(()=>[a.createVNode(S,{type:"primary",plain:"",onClick:_=>n.$emit("open-map",P.key)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(P.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(h,{ref:"backgroundPopover","virtual-ref":n.backgroundIconRef,placement:"top-start",width:"320",teleported:!1,trigger:"click","popper-class":"background-popper non-selectable h-auto","virtual-triggering":""},{default:a.withCtx(()=>[a.createElementVNode("div",y4,[a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[37]||(e[37]=[a.createTextVNode("Viewing Mode")])),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createElementVNode("div",b4,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.viewingModes,(P,_,E)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:_},[_===n.viewingMode?(a.openBlock(),a.createElementBlock("span",x4,[a.createElementVNode("b",null,a.toDisplayString(_),1)])):(a.openBlock(),a.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:C=>s.changeViewingMode(_)},a.toDisplayString(_),9,w4))],64))),128))]),a.createVNode(b,{class:"viewing-mode-description"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(s.modeDescription),1)]),_:1}),n.viewingMode==="Annotation"&&n.offlineAnnotationEnabled?(a.openBlock(),a.createBlock(b,{key:0,class:"viewing-mode-description"},{default:a.withCtx(()=>e[38]||(e[38]=[a.createTextVNode(" (Anonymous annotate) ")])),_:1})):a.createCommentVNode("",!0)]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[39]||(e[39]=[a.createTextVNode("Organs display")])),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createVNode(F,{modelValue:n.colourRadio,"onUpdate:modelValue":e[23]||(e[23]=P=>n.colourRadio=P),class:"scaffold-radio",onChange:e[24]||(e[24]=P=>s.setColour(n.colourRadio,!0))},{default:a.withCtx(()=>[a.createVNode(M,{value:!0},{default:a.withCtx(()=>e[40]||(e[40]=[a.createTextVNode("Colour")])),_:1}),a.createVNode(M,{value:!1},{default:a.withCtx(()=>e[41]||(e[41]=[a.createTextVNode("Greyscale")])),_:1})]),_:1},8,["modelValue"])]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[42]||(e[42]=[a.createTextVNode("Outlines display")])),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createVNode(F,{modelValue:n.outlinesRadio,"onUpdate:modelValue":e[25]||(e[25]=P=>n.outlinesRadio=P),class:"scaffold-radio",onChange:e[26]||(e[26]=P=>s.setOutlines(n.outlinesRadio,!0))},{default:a.withCtx(()=>[a.createVNode(M,{value:!0},{default:a.withCtx(()=>e[43]||(e[43]=[a.createTextVNode("Show")])),_:1}),a.createVNode(M,{value:!1},{default:a.withCtx(()=>e[44]||(e[44]=[a.createTextVNode("Hide")])),_:1})]),_:1},8,["modelValue"])]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[45]||(e[45]=[a.createTextVNode(" Change background ")])),_:1}),a.createVNode(b,{class:"backgroundChooser"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.availableBackground,P=>(a.openBlock(),a.createElementBlock("div",{key:P,class:a.normalizeClass(["backgroundChoice",P,P==n.currentBackground?"active":""]),onClick:_=>s.backgroundChangeCallback(P)},null,10,M4))),128))]),_:1})])]),_:1},8,["virtual-ref"]),a.createElementVNode("div",{class:a.normalizeClass(["settings-group control-layer",{open:n.drawerOpen,close:!n.drawerOpen}])},[t.showOpenMapButton?(a.openBlock(),a.createBlock(b,{key:0},{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[3].value,content:"Open new map",placement:"right",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper right-popper non-selectable",ref:"openMapPopover"},{reference:a.withCtx(()=>[t.enableOpenMapUI&&t.openMapOptions.length>0?(a.openBlock(),a.createBlock(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[27]||(e[27]=P=>s.showHelpText(3)),onMouseout:e[28]||(e[28]=P=>s.hideHelpText(3))},null,512)):a.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1})):a.createCommentVNode("",!0),t.showLocalSettings?(a.openBlock(),a.createBlock(b,{key:1},{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[4].value,content:"Change background color",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"settingsPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[29]||(e[29]=P=>s.showHelpText(4)),onMouseout:e[30]||(e[30]=P=>s.hideHelpText(4))},null,512)]),_:1},8,["visible"])]),_:1})):a.createCommentVNode("",!0)],2)],512),[[a.vShow,t.displayUI&&!n.isTransitioning]])]),_:1},8,["positionalRotation","onOnRotationModeChange"])),[[T,n.loading]])}const S4=Kn(u4,[["render",A4],["__scopeId","data-v-75641bca"]]);Ot.ScaffoldVuer=S4,Object.defineProperty(Ot,Symbol.toStringTag,{value:"Module"})});
|
|
3453
|
+
}`};class f extends c.ShaderMaterial{constructor(p){super({type:"LineMaterial",uniforms:c.UniformsUtils.clone(c.ShaderLib.line.uniforms),vertexShader:c.ShaderLib.line.vertexShader,fragmentShader:c.ShaderLib.line.fragmentShader,clipping:!0}),Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(m){this.uniforms.diffuse.value=m}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(m){this.uniforms.linewidth.value=m}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(v){!!v!="USE_DASH"in this.defines&&(this.needsUpdate=!0),v===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(m){this.uniforms.dashScale.value=m}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(m){this.uniforms.dashSize.value=m}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(m){this.uniforms.dashOffset.value=m}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(m){this.uniforms.gapSize.value=m}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(m){this.uniforms.opacity.value=m}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(m){this.uniforms.resolution.value.copy(m)}},alphaToCoverage:{enumerable:!0,get:function(){return"ALPHA_TO_COVERAGE"in this.defines},set:function(m){!!m!="ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),m===!0?(this.defines.ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(p)}}f.prototype.isLineMaterial=!0},(o,l,u)=>{var c=u(4);l.Minimap=function(f){var h=f;this.camera=new c.OrthographicCamera(-.5,.5,.5,-.5,.01,10),this.helper=void 0;var p=new c.BufferGeometry,v=new Float32Array([-1,-1,1,1,-1,1,1,1,1,1,1,1,-1,1,1,-1,-1,1]),m=new c.BufferAttribute(v,3);p.setAttribute("position",m);var d=new c.MeshBasicMaterial({color:3355443,depthTest:!1,depthWrite:!1,opacity:.5,transparent:!0});this.mask=new c.Mesh(p,d);var b=new c.Box3,y=new c.Vector3;this.getDiffFromNormalised=(w,A)=>{b.setFromBufferAttribute(m).getCenter(y);var S=y.clone().project(this.camera),M=new c.Vector3(w,A,S.z).unproject(this.camera);return M.sub(y)};var g=(w,A)=>{h.camera.near&&(this.camera.near=h.camera.near),A.farPlane&&(this.camera.far=A.farPlane),A.eyePosition&&this.camera.position.set(A.eyePosition[0],A.eyePosition[1],A.eyePosition[2]),A.upVector&&this.camera.up.set(A.upVector[0],A.upVector[1],A.upVector[2]),A.targetPosition&&this.camera.lookAt(new c.Vector3(A.targetPosition[0],A.targetPosition[1],A.targetPosition[2])),this.camera.zoom=1/w,this.camera.updateProjectionMatrix()};this.getBoundary=()=>{var w=new c.Vector3().copy(h.camera.target).project(h.camera),A=new c.Vector3(-1,-1,w.z).unproject(h.camera),S=new c.Vector3(1,-1,w.z).unproject(h.camera),M=new c.Vector3(1,1,w.z).unproject(h.camera),F=new c.Vector3(-1,1,w.z).unproject(h.camera);m.copyVector3sArray([A,S,M,M,F,A]),m.needsUpdate=!0},this.updateCamera=()=>{this.getBoundary();var w=h.getZincCameraControls(),A=h.getBoundingBox();if(A){var S=A.min.distanceTo(A.max),M=S/2,F=(A.min.x+A.max.x)/2,R=(A.min.y+A.max.y)/2,T=(A.min.z+A.max.z)/2,P=w.getViewportFromCentreAndRadius(F,R,T,M,40,M*4);g(S,P)}}}},(o,l,u)=>{var c=u(4),f=u(52)(c),h=u(3).Geometry,p=u(53),v=u(54).default,m=c.BufferGeometryLoader,d=function(b){var y;b&&b.isGeometry&&(y=b);var g=void 0,w=void 0,A=!1,S=void 0,M=_=>{var E=y.getMorph().material.clone();E.morphTargets=!1;var C=new h,L=new m,I=L.parse(_),x=new c.Mesh(I.geometry,E);return C.geometry=x.geometry,x.userData=C,C.setMorph(x),C},F=_=>{switch(_.data.action){case"message":console.log(_.data.message);break;case"result":var E=new d(M(_.data.object));S&&S(E),S=void 0,A=!1;break;default:throw"Cannot handle specified action."}},R=_=>{if(p!==void 0&&(w=p(55)),!w)g=new(u(56)).GeometryCSGInternal(_);else if(_&&_.isGeometry){var E=_.getMorph(),C=E.geometry.clone().applyMatrix(E.matrix).toJSON();w.addEventListener("message",function(L){F(L)}),w.postMessage({action:"initialise",object:C})}};this.getHostGeometry=()=>{var _=new f(y.getMorph());return new T(_)},this.getGeometry=()=>y;var T=_=>{var E=y.getMorph().material.clone();E.morphTargets=!1;var C=_.toMesh(E),L=new h;return L.geometry=C.geometry,C.userData=L,L.setMorph(C),L};this.setCSG=_=>{g.setCSG(_)};var P=(_,E,C,L)=>{if(A)L("On progress");else{var I=_.getMorph(),x=I.geometry.clone().applyMatrix(I.matrix).toJSON();S=C,A=!0,w.postMessage({action:E,object:x})}};this.intersect=_=>new v((E,C)=>{if(w)P(_,"intersect",E,C);else{var L=g.intersect(_),I=new d(T(L));I.setCSG(L),E(I)}}),this.subtract=_=>new v((E,C)=>{if(w)P(_,"intersect",E,C);else{var L=g.subtract(_),I=new d(T(L));I.setCSG(L),E(I)}}),this.union=_=>new v((E,C)=>{if(w)P(_,"intersect",E,C);else{var L=g.union(_),I=new d(T(L));I.setCSG(L),E(I)}}),this.terminateWorker=()=>{w&&w.terminate()},R(b)};l.GeometryCSG=d},o=>{var l=1e-5,u=0,c=1,f=2,h=3;o.exports=function(p){var v=function(m){var d,b,y,g,w,A,S,M=[];if(m.isBufferGeometry&&(m=new p.Geometry().fromBufferGeometry(m)),m instanceof p.Geometry)this.matrix=new p.Matrix4;else if(m.isMesh)m.updateMatrix(),this.matrix=m.matrix.clone(),m=m.geometry,m.isBufferGeometry&&(m=new p.Geometry().fromBufferGeometry(m)),m.mergeVertices(),m.computeVertexNormals(!1);else{if(m instanceof v.Node)return this.tree=m,this.matrix=new p.Matrix4,this;throw"ThreeBSP: Given geometry is unsupported"}for(d=0,b=m.faces.length;d<b;d++)y=m.faces[d],w=m.faceVertexUvs[0][d],S=new v.Polygon,y instanceof p.Face3?(g=m.vertices[y.a],A=w?new p.Vector2(w[0].x,w[0].y):null,g=new v.Vertex(g.x,g.y,g.z,y.vertexNormals[0],A),g.applyMatrix4(this.matrix),S.vertices.push(g),g=m.vertices[y.b],A=w?new p.Vector2(w[1].x,w[1].y):null,g=new v.Vertex(g.x,g.y,g.z,y.vertexNormals[2],A),g.applyMatrix4(this.matrix),S.vertices.push(g),g=m.vertices[y.c],A=w?new p.Vector2(w[2].x,w[2].y):null,g=new v.Vertex(g.x,g.y,g.z,y.vertexNormals[2],A),g.applyMatrix4(this.matrix),S.vertices.push(g)):(p.Face4,g=m.vertices[y.a],A=w?new p.Vector2(w[0].x,w[0].y):null,g=new v.Vertex(g.x,g.y,g.z,y.vertexNormals[0],A),g.applyMatrix4(this.matrix),S.vertices.push(g),g=m.vertices[y.b],A=w?new p.Vector2(w[1].x,w[1].y):null,g=new v.Vertex(g.x,g.y,g.z,y.vertexNormals[1],A),g.applyMatrix4(this.matrix),S.vertices.push(g),g=m.vertices[y.c],A=w?new p.Vector2(w[2].x,w[2].y):null,g=new v.Vertex(g.x,g.y,g.z,y.vertexNormals[2],A),g.applyMatrix4(this.matrix),S.vertices.push(g),g=m.vertices[y.d],A=w?new p.Vector2(w[3].x,w[3].y):null,g=new v.Vertex(g.x,g.y,g.z,y.vertexNormals[3],A),g.applyMatrix4(this.matrix),S.vertices.push(g)),S.calculateProperties(),M.push(S);this.tree=new v.Node(M)};return v.prototype.subtract=function(m){var d=this.tree.clone(),b=m.tree.clone();return d.invert(),d.clipTo(b),b.clipTo(d),b.invert(),b.clipTo(d),b.invert(),d.build(b.allPolygons()),d.invert(),d=new v(d),d.matrix=this.matrix,d},v.prototype.union=function(m){var d=this.tree.clone(),b=m.tree.clone();return d.clipTo(b),b.clipTo(d),b.invert(),b.clipTo(d),b.invert(),d.build(b.allPolygons()),d=new v(d),d.matrix=this.matrix,d},v.prototype.intersect=function(m){var d=this.tree.clone(),b=m.tree.clone();return d.invert(),b.clipTo(d),b.invert(),d.clipTo(b),b.clipTo(d),d.build(b.allPolygons()),d.invert(),d=new v(d),d.matrix=this.matrix,d},v.prototype.toGeometry=function(){var m,d,b,y,g,w,A,S,M,F,R=new p.Matrix4().getInverse(this.matrix),T=new p.Geometry,P=this.tree.allPolygons(),_=P.length,E={};for(m=0;m<_;m++)for(b=P[m],y=b.vertices.length,d=2;d<y;d++)F=[],S=b.vertices[0],F.push(new p.Vector2(S.uv.x,S.uv.y)),S=new p.Vector3(S.x,S.y,S.z),S.applyMatrix4(R),typeof E[S.x+","+S.y+","+S.z]>"u"?(T.vertices.push(S),g=E[S.x+","+S.y+","+S.z]=T.vertices.length-1):g=E[S.x+","+S.y+","+S.z],S=b.vertices[d-1],F.push(new p.Vector2(S.uv.x,S.uv.y)),S=new p.Vector3(S.x,S.y,S.z),S.applyMatrix4(R),typeof E[S.x+","+S.y+","+S.z]>"u"?(T.vertices.push(S),w=E[S.x+","+S.y+","+S.z]=T.vertices.length-1):w=E[S.x+","+S.y+","+S.z],S=b.vertices[d],F.push(new p.Vector2(S.uv.x,S.uv.y)),S=new p.Vector3(S.x,S.y,S.z),S.applyMatrix4(R),typeof E[S.x+","+S.y+","+S.z]>"u"?(T.vertices.push(S),A=E[S.x+","+S.y+","+S.z]=T.vertices.length-1):A=E[S.x+","+S.y+","+S.z],M=new p.Face3(g,w,A,new p.Vector3(b.normal.x,b.normal.y,b.normal.z)),T.faces.push(M),T.faceVertexUvs[0].push(F);return T},v.prototype.toBufferGeometry=function(){var m=this.toGeometry(),d=new p.BufferGeometry().fromGeometry(m);return d},v.prototype.toMesh=function(m){var d=this.toBufferGeometry(),b=new p.Mesh(d,m);return b.position.setFromMatrixPosition(this.matrix),b.rotation.setFromRotationMatrix(this.matrix),b},v.Polygon=function(m){m instanceof Array||(m=[]),this.vertices=m,0<m.length?this.calculateProperties():this.normal=this.w=void 0},v.Polygon.prototype.calculateProperties=function(){var m=this.vertices[0],d=this.vertices[1],b=this.vertices[2];return this.normal=d.clone().subtract(m).cross(b.clone().subtract(m)).normalize(),this.w=this.normal.clone().dot(m),this},v.Polygon.prototype.clone=function(){var m,d,b=new v.Polygon;for(m=0,d=this.vertices.length;m<d;m++)b.vertices.push(this.vertices[m].clone());return b.calculateProperties(),b},v.Polygon.prototype.flip=function(){var m,d=[];for(this.normal.multiplyScalar(-1),this.w*=-1,m=this.vertices.length-1;0<=m;m--)d.push(this.vertices[m]);return this.vertices=d,this},v.Polygon.prototype.classifyVertex=function(m){var d=this.normal.dot(m)-this.w;return d<-l?f:d>l?c:u},v.Polygon.prototype.classifySide=function(m){var d,b,y,g=0,w=0,A=m.vertices.length;for(d=0;d<A;d++)b=m.vertices[d],y=this.classifyVertex(b),y===c?g++:y===f&&w++;return 0<g&&w===0?c:g===0&&0<w?f:g===0&&w===0?u:h},v.Polygon.prototype.splitPolygon=function(m,d,b,y,g){var w=this.classifySide(m);if(w===u)(0<this.normal.dot(m.normal)?d:b).push(m);else if(w===c)y.push(m);else if(w===f)g.push(m);else{var A,S,M,F,R,T,P,_,E,C=[],L=[];for(S=0,A=m.vertices.length;S<A;S++)M=(S+1)%A,T=m.vertices[S],P=m.vertices[M],F=this.classifyVertex(T),R=this.classifyVertex(P),F!=f&&C.push(T),F!=c&&L.push(T),(F|R)==h&&(_=(this.w-this.normal.dot(T))/this.normal.dot(P.clone().subtract(T)),E=T.interpolate(P,_),C.push(E),L.push(E));3<=C.length&&y.push(new v.Polygon(C).calculateProperties()),3<=L.length&&g.push(new v.Polygon(L).calculateProperties())}},v.Vertex=function(m,d,b,y,g){this.x=m,this.y=d,this.z=b,this.normal=y||new p.Vector3,this.uv=g||new p.Vector2},v.Vertex.prototype.clone=function(){return new v.Vertex(this.x,this.y,this.z,this.normal.clone(),this.uv.clone())},v.Vertex.prototype.add=function(m){return this.x+=m.x,this.y+=m.y,this.z+=m.z,this},v.Vertex.prototype.subtract=function(m){return this.x-=m.x,this.y-=m.y,this.z-=m.z,this},v.Vertex.prototype.multiplyScalar=function(m){return this.x*=m,this.y*=m,this.z*=m,this},v.Vertex.prototype.cross=function(m){var d=this.x,b=this.y,y=this.z;return this.x=b*m.z-y*m.y,this.y=y*m.x-d*m.z,this.z=d*m.y-b*m.x,this},v.Vertex.prototype.normalize=function(){var m=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);return this.x/=m,this.y/=m,this.z/=m,this},v.Vertex.prototype.dot=function(m){return this.x*m.x+this.y*m.y+this.z*m.z},v.Vertex.prototype.lerp=function(m,d){return this.add(m.clone().subtract(this).multiplyScalar(d)),this.normal.add(m.normal.clone().sub(this.normal).multiplyScalar(d)),this.uv.add(m.uv.clone().sub(this.uv).multiplyScalar(d)),this},v.Vertex.prototype.interpolate=function(m,d){return this.clone().lerp(m,d)},v.Vertex.prototype.applyMatrix4=function(m){var d=this.x,b=this.y,y=this.z,g=m.elements;return this.x=g[0]*d+g[4]*b+g[8]*y+g[12],this.y=g[1]*d+g[5]*b+g[9]*y+g[13],this.z=g[2]*d+g[6]*b+g[10]*y+g[14],this},v.Node=function(m){var d,b,y=[],g=[];if(this.polygons=[],this.front=this.back=void 0,m instanceof Array&&m.length!==0){for(this.divider=m[0].clone(),d=0,b=m.length;d<b;d++)this.divider.splitPolygon(m[d],this.polygons,this.polygons,y,g);0<y.length&&(this.front=new v.Node(y)),0<g.length&&(this.back=new v.Node(g))}},v.Node.isConvex=function(m){var d,b;for(d=0;d<m.length;d++)for(b=0;b<m.length;b++)if(d!==b&&m[d].classifySide(m[b])!==f)return!1;return!0},v.Node.prototype.build=function(m){var d,b,y=[],g=[];for(this.divider||(this.divider=m[0].clone()),d=0,b=m.length;d<b;d++)this.divider.splitPolygon(m[d],this.polygons,this.polygons,y,g);0<y.length&&(!this.front&&(this.front=new v.Node),this.front.build(y)),0<g.length&&(!this.back&&(this.back=new v.Node),this.back.build(g))},v.Node.prototype.allPolygons=function(){var m=this.polygons.slice();return this.front&&(m=m.concat(this.front.allPolygons())),this.back&&(m=m.concat(this.back.allPolygons())),m},v.Node.prototype.clone=function(){var m=new v.Node;return m.divider=this.divider.clone(),m.polygons=this.polygons.map(function(d){return d.clone()}),m.front=this.front&&this.front.clone(),m.back=this.back&&this.back.clone(),m},v.Node.prototype.invert=function(){var m,d,b;for(m=0,d=this.polygons.length;m<d;m++)this.polygons[m].flip();return this.divider.flip(),this.front&&this.front.invert(),this.back&&this.back.invert(),b=this.front,this.front=this.back,this.back=b,this},v.Node.prototype.clipPolygons=function(m){var d,b,y,g;if(!this.divider)return m.slice();for(y=[],g=[],d=0,b=m.length;d<b;d++)this.divider.splitPolygon(m[d],y,g,y,g);return this.front&&(y=this.front.clipPolygons(y)),g=this.back?this.back.clipPolygons(g):[],y.concat(g)},v.Node.prototype.clipTo=function(m){this.polygons=m.clipPolygons(this.polygons),this.front&&this.front.clipTo(m),this.back&&this.back.clipTo(m)},v}},o=>{o.exports=qB()},o=>{o.exports=oD},(o,l,u)=>{var c=u(3).Geometry,f=u(4),h=f.BufferGeometryLoader;o.exports=function(p){var v=void 0,m=function(A){var S=new h,M=S.parse(A),F=new f.MeshPhongMaterial,R=new f.Mesh(M.geometry,F),T=new c;return T.setMorph(R),T},d=function(A){var S=m(A);v=new(u(56)).GeometryCSGInternal(S),p.postMessage({action:"message",message:"Initialised"})},b=function(A){if(v){var S=m(A),M=v.intersect(S),F=M.toBufferGeometry().toJSON();p.postMessage({action:"result",object:F})}},y=function(A){if(v){var S=m(A),M=v.subtract(S),F=M.toBufferGeometry().toJSON();p.postMessage({action:"result",object:F})}},g=function(A){if(v){var S=m(A),M=v.union(S),F=M.toBufferGeometry().toJSON();p.postMessage({action:"result",object:F})}};p.addEventListener("message",function(w){switch(w.data.action){case"initialise":d(w.data.object);break;case"intersect":b(w.data.object);break;case"subtract":y(w.data.object);break;case"union":g(w.data.object);break;default:throw"Cannot handle specified action."}})}},(o,l,u)=>{var c=u(4),f=u(52)(c);u(3).Geometry,u(51).GeometryCSG;var h=function(p){var v;p&&p.isGeometry&&(v=p);var m;this.setGeometry=b=>{b&&b.isGeometry&&(v=b),m=void 0},this.setCSG=b=>{m=b};var d=b=>{if(v&&v.morph&&b&&b.morph){m===void 0&&(m=new f(v.morph));var y=new f(b.morph);return y}};this.intersect=b=>{var y=d(b);return m&&y?m.intersect(y):void 0},this.subtract=b=>{var y=d(b);return m&&y?m.subtract(y):void 0},this.union=b=>{var y=d(b);return m&&y?m.union(y):void 0}};l.GeometryCSGInternal=h},(o,l,u)=>{var c=u(4),f=u(52)(c);u(18).Glyphset;var h=function(p){var v;p&&p.isGlyphset&&(v=p);var m=[];this.setGlyphset=y=>{y&&y.isGlyphset&&(v=y),hostCSG=void 0},this.getGlyphset=()=>v;var d=()=>y=>{var g=y.getMesh(),w=y.getLabel();if(g){var A=new f(g.geometry.clone().applyMatrix(g.matrix)),S=[];S.csg=A,S.label=w,g.material&&(S.material=g.material.clone()),m.push(S)}},b=y=>{if(v&&y&&y.getMorph()){m.length==0&&v.forEachGlyph(d());var g=new f(y.getMorph());return g}};this.intersect=y=>{var g=b(y);if(0<m.length&&g){for(var w=new(u(18)).Glyphset,A=0;A<m.length;A++){var S=m[A],M=S.csg.intersect(g),F=M.toMesh();if(F&&F.geometry&&0<F.geometry.vertices.length){S.material&&(F.material=S.material,F.material.side=c.DoubleSide,F.material.clippingPlanes=null);var R=w.addMeshAsGlyph(F,A+1);R.setLabel(S.label)}}var T=new h(w);return T}}};l.GlyphsetCSG=h}],i={};function r(o){var l=i[o];if(l!==void 0)return l.exports;var u=i[o]={exports:{}};return t[o].call(u.exports,u,u.exports,r),u.exports}r.n=o=>{var l=o&&o.__esModule?()=>o.default:()=>o;return r.d(l,{a:l}),l},r.d=(o,l)=>{for(var u in l)r.o(l,u)&&!r.o(o,u)&&Object.defineProperty(o,u,{enumerable:!0,get:l[u]})},r.o=(o,l)=>Object.prototype.hasOwnProperty.call(o,l),r.r=o=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})};var s=r(0);return s})())})(kg);var br=kg.exports;const Hc=xC(br),oi={SELECTED_COLOUR:"#00ff00",HIGHLIGHTED_COLOUR:"#ff0000",DEFAULT_RADIUS:1,DEFAULT_RADIAL_SEGMENTS:8,ZOOM_RADIUS:5,ZOOM_RADIAL_SEGMENTS:12},gx=(n,e)=>{if(n){let t="";n.forEach(i=>{t=i.uuid,i.region&&(t=i.region.uuid+"/"+t),i&&i.getVisibility()&&e.push(t)})}return e},gf=(n,e)=>{const t=n[0]-e[0],i=n[1]-e[1],r=n[2]-e[2];return Math.sqrt(t*t+i*i+r*r)},aD=n=>{var t;const e=(t=n[0].data)==null?void 0:t.zincObject;if(e&&e.isEditable&&e.isPointset){const i=n[0].extraData.intersected;if(i&&i.index>-1){const r=e.getVerticesByIndex(i.index);if(r)return{zincObject:e,index:i.index,point:r}}}},lD=n=>{var t;const e=(t=n[0].data)==null?void 0:t.zincObject;if(e&&e.isEditable&&e.isLines2){const i=n[0].extraData.intersected;if(i&&i.faceIndex>-1){const r=e.getVerticesByFaceIndex(i.faceIndex),s=n[0].extraData.intersected.pointOnLine;if(r.length>1){const o=gf(r[0],[s.x,s.y,s.z]),l=gf(r[1],[s.x,s.y,s.z]);return o>l?{zincObject:e,faceIndex:i.faceIndex,vertexIndex:i.faceIndex*2+1,point:r[0]}:{zincObject:e,faceIndex:i.faceIndex,vertexIndex:i.faceIndex*2,point:r[1]}}}}},cD=n=>{const e=n.zincObjects;if(e.length>0&&e[0])return e[0]},uD=n=>{const e=n.zincObjects;if(e.length>0&&e[0]){const t=e[0];if(t.isEditable)return t}},dD=(n,e,t)=>{if(n!=null&&n.isEditable&&(n!=null&&n.isPointset)){let i=!1;for(let r=0;r<3&&!i;r++)t[r]!==0&&(i=!0);if(i&&e>-1){const r=n.getVerticesByIndex(e);return r&&(r[0]=r[0]+t[0],r[1]=r[1]+t[1],r[2]=r[2]+t[2]),n.editVertices([r],e),n.boundingBoxUpdateRequired=!0,!0}}return!1},Wc=(n,e)=>{if(n!=null&&n.isEditable&&(n!=null&&n.isLines2)&&e>-1){const t=n.getVerticesByFaceIndex(e);if(t&&t.length>1)return gf(t[1],t[0])}return 0},vf=(n,e,t,i)=>{if(n&&t!==0&&n.isEditable&&n.isLines2&&e>-1){const r=n.getVerticesByFaceIndex(e);let s=[r[1][0]-r[0][0],r[1][1]-r[0][1],r[1][2]-r[0][2]];const o=Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);for(let l=0;l<3;l++)s[l]=s[l]/o*t,i?r[1][l]=r[0][l]+s[l]:(r[0][l]=r[0][l]+s[l],r[1][l]=r[1][l]+s[l]);return n.editVertices(r,e*2),n.boundingBoxUpdateRequired=!0,!0}return!1},hD=(n,e)=>{const t=e.getBoundingBox(),i=new br.THREE.Vector3().subVectors(t.max,t.min),r=new br.THREE.BoxGeometry(i.x,i.y,i.z);i.addVectors(t.min,t.max).multiplyScalar(.5);const s=r.getAttribute("position"),o=s.count,l=[];for(let u=0;u<o;u++)l[u]=[s.array[u*3],s.array[u*3+1],s.array[u*3+2]];n.editVertices(l,0),n.setPosition(i.x,i.y,i.z),r.dispose()},vx=(n,e)=>{let t="";n.isRegion&&(t=`__r${n.regionPath}`),n.isPrimitives&&(t=`${n.regionPath}/${n.label}`),e.push(t),n.children&&n.children.forEach(i=>vx(i,e))},Ao=(n,e,t,i)=>{let r=n;const s=[];if(t&&(r=n.findChildFromPath(t)),r){const o=Array.isArray(e);let l=e;o||(l=[l]),l.forEach(u=>{const c=r.findObjectsWithGroupName(u,i);s.push(...c)})}return s},yf=(n,e,t)=>{const i=n.findIndex(s=>s.uuid===e);let r;return i>-1&&(r=n[i],t&&n.splice(i,1)),r},fD=(n,e)=>{const t=[];if(n&&e&&e.length>0){const i={},r={},s=[n,...n.getChildRegions(!0)];let o,l,u;e.forEach(c=>{const f=c.split("/");u=f[0],o=yf(s,u,!1),o&&(r[u]||(r[u]=o.getFullPath()),f[1]?(i[u]||(i[u]=o.getAllObjects(!1)),l=yf(i[u],f[1],!0),l&&t.push(`${r[u]}/${l.groupName}`)):t.push(`__r/${r[u]}`))})}return t},pD=n=>{if(n){const e=[];return n.forEach(i=>{i.isZincObject?e.push(i):i.isRegion&&e.push(...i.getAllObjects(!0))}),Object.values(e.reduce((i,r)=>({...i,[r.uuid]:r}),{}))}return[]},yx=(n,e)=>{const t={label:"Multiple selections",regionPath:"",objects:[]};if(e&&n){const i={},r=n.getRootRegion();e.length>0&&(t.regionPath=e[0].data.region,t.label=e[0].data.group),e.forEach(s=>{s.data.region.includes(t.regionPath)||(t.regionPath=""),t.label!==s.data.group&&(t.label="Multiple selections");const o=r.findChildFromPath(s.data.region);i[o.uuid]||(i[o.uuid]=o.getAllObjects(!1));const l=yf(i[o.uuid],s.data.uuid);l&&t.objects.push(l)})}return t},mD=n=>{const e=n.getMorph();let t="position";n.isLines2&&(t="instanceStart");const i=[];let r=0;const s=e.geometry.getAttribute(t);for(let o=0;o<n.drawRange;o++)i.push([s.array[r++],s.array[r++],s.array[r++]]);return i},bx=(n,e,t,i,r)=>{let s;n.isPointset?s="MultiPoint":n.isLines2?s="MultiLineString":s="Feature";const o=s!=="Feature",l=s==="Feature"?"Feature annotation":"Drawn annotation";if(s){const u=mD(n);let c=e.slice(-1)==="/"?e:e+"/";c=c+t;const f=c,h={resource:i,item:{id:f},body:{evidence:[],comment:r},feature:{id:f,properties:{drawn:o,label:l},geometry:{coordinates:u,type:s}}};return r==="Deleted"&&(h.feature=void 0),h}},xx=(n,e,t,i,r,s,o)=>{const l=bx(t,i,r,s,o);if(l)return n&&n.currentUser&&(l.creator={...n.currentUser},l.creator.orcid||(l.creator.orcid="0000-0000-0000-0000"),n.addAnnotation(e,l).then(u=>{u.annotationId||console.log("There is a problem with the submission, please try again later")}).catch(()=>{console.log("There is a problem with the submission, please try again later")})),l},wx=async(n,e,t)=>{const i=t;return await n.drawnFeatures(e,i)},Mx=(n,e)=>{n&&e.forEach(t=>{const i=t.geometry,r=decodeURIComponent(t.id),s=r.lastIndexOf("/"),o=r.substring(0,s),l=r.substring(s+1);let u;i.type==="MultiPoint"?u=n.createPoints(o,l,i.coordinates,l,8942):i.type==="MultiLineString"&&(u=n.createLines(o,l,i.coordinates,60962)),u&&(u.zincObject.isEditable=!0)})},bf=function(n){const e=[];for(let t=0;t<n.length;t++){let i=n[t].userData;if(i)if(i.isGlyph||i.isGlyphset){let r=i;i.isGlyph&&(r=i.getGlyphset()),e.push(r)}else e.push(i)}return e},gD={name:"LinesControls",components:{Button:ws,Col:Fn,Container:Jn,InputNumber:yi,Main:vi,Slider:An,ElIconArrowLeft:ki,ElIconArrowRight:zi},props:{createData:{type:Object},usageConfig:{type:Object}},data:function(){return{adjust:0,pAdjust:0,lengthScale:0,distance:0,newDistance:0,width:1,radius:oi.DEFAULT_RADIUS,radialSegments:oi.DEFAULT_RADIAL_SEGMENTS,currentIndex:0,ElIconArrowLeft:a.shallowRef(ki),ElIconArrowRight:a.shallowRef(zi),edited:!1,zincObject:void 0,isTubeLines:!1}},computed:{showTubeLinesControls(){return this.usageConfig.showTubeLinesControls}},watch:{"createData.faceIndex":{handler:function(n){var e;(e=this.zincObject)!=null&&e.isLines2&&(this.currentIndex=n,this.distance=Wc(this.zincObject,this.currentIndex))},immediate:!0}},methods:{changeIndex:function(n){n?Wc(this.zincObject,this.currentIndex+1)>0&&(this.currentIndex++,this.reset()):(this.currentIndex--,this.reset())},onLengthInput:function(){this.newDistance!==0?(this.distance=this.newDistance,this.edited=vf(this.zincObject,this.currentIndex,this.newDistance,!0)||this.edited):this.newDistance=this.distance},onLengthSliding:function(){this.newDistance=Math.pow(10,this.lengthScale)*this.distance,this.edited=vf(this.zincObject,this.currentIndex,this.newDistance,!0)||this.edited},onMoveSliding:function(){const n=(this.adjust-this.pAdjust)*this.distance;this.edited=vf(this.zincObject,this.currentIndex,n,!1)||this.edited,this.pAdjust=this.adjust},reset:function(){this.adjust=0,this.pAdjust=0,this.lengthScale=0,this.distance=Wc(this.zincObject,this.currentIndex),this.newDistance=this.distance,this.edited&&(this.$emit("primitivesUpdated",this.zincObject),this.edited=!1)},setObject:function(n){var e;this.currentIndex=-1,this.distance=0,n.isLines2||n.isTubeLines?(this.zincObject=a.markRaw(n),this.width=this.zincObject.getMorph().material.linewidth,this.isTubeLines=n.isTubeLines,n.isEditable?(this.currentIndex=0,this.distance=Wc(n,this.currentIndex)):(e=n.userData)!=null&&e.isNerves&&(this.radius=oi.ZOOM_RADIUS,this.radialSegments=oi.ZOOM_RADIAL_SEGMENTS)):(this.zincObject=void 0,this.width=10)},modifyWidth:function(){this.zincObject.setWidth(this.width)},modifyTubeLines:function(){this.zincObject.setTubeLines(this.radius,this.radius*this.radialSegments)}}};function vD(n,e,t,i,r,s){const o=Fn,l=An,u=yi,c=Yn,f=ws,h=vi,p=Jn;return a.openBlock(),a.createBlock(p,{class:"lines-container"},{default:a.withCtx(()=>[a.createVNode(h,{class:"slides-block"},{default:a.withCtx(()=>[n.isTubeLines&&s.showTubeLinesControls?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[15]||(e[15]=[a.createTextVNode(" Radius: ")])),_:1}),a.createVNode(o,{offset:0,span:12},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.radius,"onUpdate:modelValue":e[0]||(e[0]=v=>n.radius=v),class:"my-slider",step:1,min:1,max:32,"show-tooltip":!1,onInput:s.modifyTubeLines},null,8,["modelValue","onInput"])]),_:1}),a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.radius,"onUpdate:modelValue":e[1]||(e[1]=v=>n.radius=v),step:1,min:1,max:32,controls:!1,onChange:s.modifyTubeLines,class:"input-box number-input"},null,8,["modelValue","onChange"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[16]||(e[16]=[a.createTextVNode(" Radial Segments: ")])),_:1}),a.createVNode(o,{offset:0,span:12},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.radialSegments,"onUpdate:modelValue":e[2]||(e[2]=v=>n.radialSegments=v),class:"my-slider",step:1,min:8,max:32,"show-tooltip":!1,onInput:s.modifyTubeLines},null,8,["modelValue","onInput"])]),_:1}),a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.radialSegments,"onUpdate:modelValue":e[3]||(e[3]=v=>n.radialSegments=v),step:1,min:8,max:32,controls:!1,onChange:s.modifyTubeLines,class:"input-box number-input"},null,8,["modelValue","onChange"])]),_:1})]),_:1})],64)):n.isTubeLines?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(c,{key:1},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[17]||(e[17]=[a.createTextVNode(" Width: ")])),_:1}),a.createVNode(o,{offset:0,span:12},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.width,"onUpdate:modelValue":e[4]||(e[4]=v=>n.width=v),class:"my-slider",step:1,min:1,max:100,"show-tooltip":!1,onInput:s.modifyWidth},null,8,["modelValue","onInput"])]),_:1}),a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.width,"onUpdate:modelValue":e[5]||(e[5]=v=>n.width=v),step:1,min:1,max:100,controls:!1,class:"input-box number-input"},null,8,["modelValue"])]),_:1})]),_:1})),n.currentIndex>-1&&n.distance>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(f,{size:"small",disabled:n.currentIndex===0,icon:n.ElIconArrowLeft,onClick:e[6]||(e[6]=v=>s.changeIndex(!1))},null,8,["disabled","icon"])]),_:1}),a.createVNode(o,{offset:4,span:9},{default:a.withCtx(()=>[a.createTextVNode(" Editing Line "+a.toDisplayString(n.currentIndex+1),1)]),_:1}),a.createVNode(o,{offset:2,span:2},{default:a.withCtx(()=>[a.createVNode(f,{size:"small",icon:n.ElIconArrowRight,onClick:e[7]||(e[7]=v=>s.changeIndex(!0))},null,8,["icon"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[18]||(e[18]=[a.createTextVNode(" Move: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.adjust,"onUpdate:modelValue":e[8]||(e[8]=v=>n.adjust=v),step:.01,min:-3,max:3,"show-tooltip":!1,onInput:e[9]||(e[9]=v=>s.onMoveSliding()),onChange:e[10]||(e[10]=v=>s.reset())},null,8,["modelValue"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[19]||(e[19]=[a.createTextVNode(" Length: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.lengthScale,"onUpdate:modelValue":e[11]||(e[11]=v=>n.lengthScale=v),step:.01,min:-1,max:1,"show-tooltip":!1,onInput:e[12]||(e[12]=v=>s.onLengthSliding()),onChange:e[13]||(e[13]=v=>s.reset())},null,8,["modelValue"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.newDistance,"onUpdate:modelValue":e[14]||(e[14]=v=>n.newDistance=v),controls:!1,class:"input-box number-input",onChange:s.onLengthInput},null,8,["modelValue","onChange"])]),_:1})]),_:1})],64)):a.createCommentVNode("",!0)]),_:1})]),_:1})}const Ax=Kn(gD,[["render",vD],["__scopeId","data-v-0deb177d"]]),yD={name:"PointsControls",components:{Col:Fn,Container:Jn,InputNumber:yi,Main:vi,Select:Ms,Slider:An,Row:Yn,Option:As,ElIconArrowLeft:ki,ElIconArrowRight:zi},inject:["boundingDims"],data:function(){return{attenuation:!1,size:10,choices:[{value:!0,label:"On"},{value:!1,label:"off"}],min:[0,0,0],max:[1,1,1],translation:[0,0,0],pTranslation:[0,0,0],currentIndex:-1,ElIconArrowLeft:a.shallowRef(ki),ElIconArrowRight:a.shallowRef(zi),edited:!1,zincObject:void 0}},watch:{boundingDims:{handler:function(n){const e=n.size;this.min=[-e[0]/2,-e[1]/2,-e[2]/2],this.max=[e[0]/2,e[1]/2,e[2]/2]},immediate:!0,deep:!0}},methods:{changeIndex:function(n){n?this.zincObject.drawRange>this.currentIndex+1&&(this.currentIndex++,this.reset()):(this.currentIndex--,this.reset())},onMoveSliding:function(){const n=[this.translation[0]-this.pTranslation[0],this.translation[1]-this.pTranslation[1],this.translation[2]-this.pTranslation[2]];this.edited=dD(this.zincObject,this.currentIndex,n)||this.edited;for(let e=0;e<3;e++)this.pTranslation[e]=this.translation[e]},reset:function(){this.translation=[0,0,0],this.pTranslation=[0,0,0],this.edited&&(this.$emit("primitivesUpdated",this.zincObject),this.edited=!1)},setObject:function(n){this.currentIndex=-1,n.isPointset?(this.zincObject=a.markRaw(n),this.size=this.zincObject.morph.material.size,this.attenuation=this.zincObject.morph.material.sizeAttenuation,n.isEditable&&this.zincObject.drawRange>0&&(this.currentIndex=0)):(this.zincObject=void 0,this.size=10,this.attenuation=!1)},modifyAttenuation:function(n){this.attenuation=n,this.zincObject.setSizeAttenuation(n)},modifySize:function(){this.zincObject.setSize(this.size)}}};function bD(n,e,t,i,r,s){const o=Fn,l=An,u=yi,c=Yn,f=As,h=Ms,p=ws,v=vi,m=Jn;return a.openBlock(),a.createBlock(m,{class:"pointset-container"},{default:a.withCtx(()=>[a.createVNode(v,{class:"slides-block"},{default:a.withCtx(()=>[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[15]||(e[15]=[a.createTextVNode(" Size: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.size,"onUpdate:modelValue":e[0]||(e[0]=d=>n.size=d),class:"my-slider",step:1,min:0,max:100,"show-tooltip":!1,onInput:e[1]||(e[1]=d=>s.modifySize())},null,8,["modelValue"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.size,"onUpdate:modelValue":e[2]||(e[2]=d=>n.size=d),step:1,min:0,max:100,controls:!1,class:"input-box number-input"},null,8,["modelValue"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>e[16]||(e[16]=[a.createTextVNode(" Size attenuation: ")])),_:1}),a.createVNode(o,{offset:0,span:5},{default:a.withCtx(()=>[a.createVNode(h,{teleported:!1,"model-value":n.attenuation,placeholder:"Select",class:"input-box","popper-class":"viewer_dropdown",onChange:e[3]||(e[3]=d=>s.modifyAttenuation(d,n.slide))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.choices,d=>(a.openBlock(),a.createBlock(f,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])]),_:1})]),_:1}),n.currentIndex>-1?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:4},{default:a.withCtx(()=>[a.createVNode(p,{size:"small",disabled:n.currentIndex===0,icon:n.ElIconArrowLeft,onClick:e[4]||(e[4]=d=>s.changeIndex(!1))},null,8,["disabled","icon"])]),_:1}),a.createVNode(o,{offset:4,span:9},{default:a.withCtx(()=>[a.createTextVNode(" Editing Point "+a.toDisplayString(n.currentIndex+1),1)]),_:1}),a.createVNode(o,{offset:2,span:2},{default:a.withCtx(()=>[a.createVNode(p,{size:"small",icon:n.ElIconArrowRight,onClick:e[5]||(e[5]=d=>s.changeIndex(!0))},null,8,["icon"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[17]||(e[17]=[a.createTextVNode(" x: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.translation[0],"onUpdate:modelValue":e[6]||(e[6]=d=>n.translation[0]=d),step:.01,min:n.min[0],max:n.max[0],"show-tooltip":!1,onInput:e[7]||(e[7]=d=>s.onMoveSliding()),onChange:e[8]||(e[8]=d=>s.reset())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[18]||(e[18]=[a.createTextVNode(" y: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.translation[1],"onUpdate:modelValue":e[9]||(e[9]=d=>n.translation[1]=d),step:.01,min:n.min[1],max:n.max[1],"show-tooltip":!1,onInput:e[10]||(e[10]=d=>s.onMoveSliding()),onChange:e[11]||(e[11]=d=>s.reset())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,null,{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[19]||(e[19]=[a.createTextVNode(" z: ")])),_:1}),a.createVNode(o,{offset:0,span:16},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.translation[2],"onUpdate:modelValue":e[12]||(e[12]=d=>n.translation[2]=d),step:.01,min:n.min[2],max:n.max[2],"show-tooltip":!1,onInput:e[13]||(e[13]=d=>s.onMoveSliding()),onChange:e[14]||(e[14]=d=>s.reset())},null,8,["modelValue","min","max"])]),_:1})]),_:1})],64)):a.createCommentVNode("",!0)]),_:1})]),_:1})}const Sx=Kn(yD,[["render",bD],["__scopeId","data-v-d1de9c65"]]),xD={name:"TextureSlidesControls",components:{Col:Fn,Container:Jn,Footer:Ag,Icon:ht,InputNumber:yi,Main:vi,Row:Yn,Select:Ms,Slider:An,Option:As,ElIconDelete:tl,ElIconPlus:nl},data:function(){return{settings:[],directions:[{value:"x",label:"x"},{value:"y",label:"y"},{value:"z",label:"z"}],zincObject:void 0}},methods:{setObject:function(n){n.isTextureSlides?(this.zincObject=a.markRaw(n),this.settings=this.zincObject.getTextureSettings()):(this.zincObject=void 0,this.settings=[])},addNewSlide:function(){const n={direction:"x",value:0},e=this.zincObject.createSlide(n);this.settings.push(e)},modifyDirection:function(n,e){e&&(e.direction=n,this.zincObject.modifySlideSettings(e))},modifySlide:function(n){n&&this.zincObject.modifySlideSettings(n)},removeSlide:function(n,e){this.zincObject.removeSlideWithId(e.id),this.settings.splice(n,1)}}};function wD(n,e,t,i,r,s){const o=As,l=Ms,u=Fn,c=An,f=yi,h=tl,p=ht,v=Yn,m=vi,d=nl,b=Ag,y=Jn;return a.openBlock(),a.createBlock(y,{class:"t-slides-container"},{default:a.withCtx(()=>[a.createVNode(m,{class:"slides-block"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.settings,(g,w)=>(a.openBlock(),a.createBlock(v,{key:g.id,class:"slide-row"},{default:a.withCtx(()=>[a.createVNode(u,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(l,{teleported:!1,"model-value":g.direction,placeholder:"Select",class:"input-box","popper-class":"viewer_dropdown",onChange:A=>s.modifyDirection(A,g)},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.directions,A=>(a.openBlock(),a.createBlock(o,{key:A.value,label:A.label,value:A.value},null,8,["label","value"]))),128))]),_:2},1032,["model-value","onChange"])]),_:2},1024),a.createVNode(u,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(c,{modelValue:g.value,"onUpdate:modelValue":A=>g.value=A,class:"my-slider",step:.005,min:0,max:1,"show-tooltip":!1,onInput:A=>s.modifySlide(g)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:2},1024),a.createVNode(u,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(f,{modelValue:g.value,"onUpdate:modelValue":A=>g.value=A,step:.01,min:0,max:1,controls:!1,class:"input-box number-input"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),a.createVNode(u,{offset:0,span:2},{default:a.withCtx(()=>[a.createVNode(p,{class:"delete-icon",onClick:A=>s.removeSlide(w,g)},{default:a.withCtx(()=>[a.createVNode(h)]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1}),a.createVNode(b,{height:"30px",class:"add-slides-text",onClick:s.addNewSlide},{default:a.withCtx(()=>[a.createVNode(v,null,{default:a.withCtx(()=>[a.createVNode(u,{span:2},{default:a.withCtx(()=>[a.createVNode(p,null,{default:a.withCtx(()=>[a.createVNode(d)]),_:1})]),_:1}),a.createVNode(u,{span:20},{default:a.withCtx(()=>e[0]||(e[0]=[a.createTextVNode(" Add a new slide ")])),_:1})]),_:1})]),_:1},8,["onClick"])]),_:1})}const _x=Kn(xD,[["render",wD],["__scopeId","data-v-f65f296c"]]),MD={name:"TransformationControls",components:{Col:Fn,Container:Jn,InputNumber:yi,Main:vi,Slider:An},inject:["boundingDims"],data:function(){return{x:0,y:0,z:0,scale:1,min:[0,0,0],max:[1,1,1],zincObject:void 0,enableScaling:!0}},watch:{boundingDims:{handler:function(n){this.calculateMinAndMax()},immediate:!0,deep:!0}},methods:{calculateMinAndMax:function(){var n,e;if(this.zincObject){const t=(e=(n=this.zincObject)==null?void 0:n.userData)==null?void 0:e.originalPos;t&&this.boundingDims&&(this.min=[t[0]-this.boundingDims.size[0],t[1]-this.boundingDims.size[1],t[2]-this.boundingDims.size[2]],this.max=[t[0]+this.boundingDims.size[0],t[1]+this.boundingDims.size[1],t[2]+this.boundingDims.size[2]])}},setObject:function(n){if(n.isZincObject){this.zincObject=a.markRaw(n);const e=this.zincObject.getGroup();this.zincObject.userData.originalPos,e&&e.position&&(this.x=e.position.x,this.y=e.position.y,this.z=e.position.z,this.zincObject.isGlyphset?this.scale=this.zincObject.globalScale:this.scale=e.scale.x,this.enableScaling=!this.zincObject.isTextureSlides,this.calculateMinAndMax())}else this.zincObject=void 0,this.x=0,this.y=0,this.z=0,this.scale=1},modifyPosition:function(){this.zincObject&&this.zincObject.setPosition(this.x,this.y,this.z)},modifyScale:function(){this.zincObject.setScaleAll(this.scale)}}};function AD(n,e,t,i,r,s){const o=Fn,l=An,u=yi,c=Yn,f=vi,h=Jn;return a.openBlock(),a.createBlock(h,{class:"transformation-container"},{default:a.withCtx(()=>[a.createVNode(f,{class:"slides-block"},{default:a.withCtx(()=>[a.createVNode(c,{class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[16]||(e[16]=[a.createTextVNode(" x: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.x,"onUpdate:modelValue":e[0]||(e[0]=p=>n.x=p),step:.01,min:n.min[0],max:n.max[0],"show-tooltip":!1,onInput:e[1]||(e[1]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.x,"onUpdate:modelValue":e[2]||(e[2]=p=>n.x=p),step:.01,min:n.min[0],max:n.max[0],controls:!1,class:"input-box number-input",onChange:e[3]||(e[3]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,{class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[17]||(e[17]=[a.createTextVNode(" y: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.y,"onUpdate:modelValue":e[4]||(e[4]=p=>n.y=p),step:.01,min:n.min[1],max:n.max[1],"show-tooltip":!1,onInput:e[5]||(e[5]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.y,"onUpdate:modelValue":e[6]||(e[6]=p=>n.y=p),step:.01,min:n.min[1],max:n.max[1],controls:!1,class:"input-box number-input",onChange:e[7]||(e[7]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),a.createVNode(c,{class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[18]||(e[18]=[a.createTextVNode(" z: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.z,"onUpdate:modelValue":e[8]||(e[8]=p=>n.z=p),step:.01,min:n.min[2],max:n.max[2],"show-tooltip":!1,onInput:e[9]||(e[9]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.z,"onUpdate:modelValue":e[10]||(e[10]=p=>n.z=p),step:.01,min:n.min[2],max:n.max[2],controls:!1,class:"input-box number-input",onChange:e[11]||(e[11]=p=>s.modifyPosition())},null,8,["modelValue","min","max"])]),_:1})]),_:1}),n.enableScaling?(a.openBlock(),a.createBlock(c,{key:0,class:"tool-row"},{default:a.withCtx(()=>[a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>e[19]||(e[19]=[a.createTextVNode(" Scale: ")])),_:1}),a.createVNode(o,{offset:0,span:10},{default:a.withCtx(()=>[a.createVNode(l,{modelValue:n.scale,"onUpdate:modelValue":e[12]||(e[12]=p=>n.scale=p),step:.01,min:0,max:5,"show-tooltip":!1,onInput:e[13]||(e[13]=p=>s.modifyScale())},null,8,["modelValue"])]),_:1}),a.createVNode(o,{offset:0,span:6},{default:a.withCtx(()=>[a.createVNode(u,{modelValue:n.scale,"onUpdate:modelValue":e[14]||(e[14]=p=>n.scale=p),step:.01,min:0,max:5,controls:!1,class:"input-box number-input",onChange:e[15]||(e[15]=p=>s.modifyScale())},null,8,["modelValue"])]),_:1})]),_:1})):a.createCommentVNode("",!0)]),_:1})]),_:1})}const Tx=Kn(MD,[["render",AD],["__scopeId","data-v-caf40e87"]]),SD={name:"OpacityControls",components:{Container:Jn,Header:w2,Main:vi,Slider:An},props:{material:void 0,zincObject:void 0},data:function(){return{displayString:"100%"}},watch:{"material.opacity":function(){this.material&&this.zincObject&&this.zincObject.setAlpha(this.material.opacity)}},methods:{formatTooltip(n){return this.displayString=Math.floor(100*n+.5)+"%",this.displayString}}},_D={class:"block"},TD={class:"display"};function ED(n,e,t,i,r,s){const o=An,l=Jn;return t.material?(a.openBlock(),a.createBlock(l,{key:0,class:"opacity-container"},{default:a.withCtx(()=>[a.createElementVNode("div",_D,[a.createElementVNode("span",TD,a.toDisplayString(n.displayString),1),a.createVNode(o,{modelValue:t.material.opacity,"onUpdate:modelValue":e[0]||(e[0]=u=>t.material.opacity=u),class:"my-slider",step:.01,min:0,max:1,"format-tooltip":s.formatTooltip,"show-tooltip":!1},null,8,["modelValue","format-tooltip"])])]),_:1})):a.createCommentVNode("",!0)}const Ex=Kn(SD,[["render",ED],["__scopeId","data-v-cbfc46a5"]]),CD={name:"PrimitiveControls",components:{Collapse:vg,CollapseItem:yg,LinesControls:Ax,OpacityControls:Ex,PointsControls:Sx,TextureSlidesControls:_x,TransformationControls:Tx,ElIconArrowRight:zi},props:{createData:{type:Object},viewingMode:{type:String,default:"Exploration"},usageConfig:{type:Object}},data:function(){return{activeName:"oControls",material:void 0,isTextureSlides:!1,isPointset:!1,isLines:!1,drawerOpen:!0,zincObject:void 0,isEditable:!1,displayString:"100%"}},computed:{hasValidPrimitive:function(){return this.viewingMode==="Exploration"||this.viewingMode==="Annotation"?this.material!==void 0||this.isTextureSlides===!0:!1}},methods:{formatTooltip:function(n){return this.displayString=Math.floor(100*n+.5)+"%",this.displayString},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setObject:function(n){var e,t;n?this.zincObject=a.markRaw(n):this.zincObject=void 0,this.isEditable=!!((e=this.zincObject)!=null&&e.isEditable),this.isPointset=!1,this.isTextureSlides=!1,this.isLines=!1,this.activeName="trControls",n&&(n.isTextureSlides?(this.isTextureSlides=!0,this.$refs.tSlidesControls.setObject(n),this.activeName="tsControls"):n.isPointset?(this.isPointset=!0,this.$refs.pointsetControls.setObject(n),this.activeName="pControls"):(n.isLines2||n.isTubeLines&&((t=this.usageConfig)!=null&&t.showTubeLinesControls))&&(this.isLines=!0,this.$refs.linesControls.setObject(n),this.activeName="lControls"),this.$refs.transformationControls.setObject(n)),n&&n.getMorph()?this.material=n.getMorph().material:this.material=void 0}}};function LD(n,e,t,i,r,s){const o=Ex,l=yg,u=Tx,c=_x,f=Sx,h=Ax,p=vg,v=zi,m=ht;return a.withDirectives((a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["primitive-controls",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createElementVNode("div",{class:a.normalizeClass(["my-drawer",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createVNode(p,{class:"collapse",modelValue:n.activeName,"onUpdate:modelValue":e[2]||(e[2]=d=>n.activeName=d),accordion:""},{default:a.withCtx(()=>[a.withDirectives(a.createVNode(l,{title:"Opacity",name:"oControls"},{default:a.withCtx(()=>[a.createVNode(o,{material:n.material,zincObject:n.zincObject,ref:"opacityControls"},null,8,["material","zincObject"])]),_:1},512),[[a.vShow,!n.isTextureSlides]]),a.withDirectives(a.createVNode(l,{title:"Transformation",name:"trControls"},{default:a.withCtx(()=>[a.createVNode(u,{class:"transformation-controls",ref:"transformationControls"},null,512)]),_:1},512),[[a.vShow,!n.isEditable]]),a.withDirectives(a.createVNode(l,{title:"Texture Slides",name:"tsControls"},{default:a.withCtx(()=>[a.createVNode(c,{class:"texture-controls",ref:"tSlidesControls"},null,512)]),_:1},512),[[a.vShow,n.isTextureSlides]]),a.withDirectives(a.createVNode(l,{title:"Points",name:"pControls"},{default:a.withCtx(()=>[a.createVNode(f,{class:"pointset-controls",ref:"pointsetControls",onPrimitivesUpdated:e[0]||(e[0]=d=>n.$emit("primitivesUpdated",d))},null,512)]),_:1},512),[[a.vShow,n.isPointset]]),a.withDirectives(a.createVNode(l,{title:"Lines",name:"lControls"},{default:a.withCtx(()=>[a.createVNode(h,{class:"lines-controls",ref:"linesControls",createData:t.createData,usageConfig:t.usageConfig,onPrimitivesUpdated:e[1]||(e[1]=d=>n.$emit("primitivesUpdated",d))},null,8,["createData","usageConfig"])]),_:1},512),[[a.vShow,n.isLines]])]),_:1},8,["modelValue"])],2),a.createElementVNode("div",{class:a.normalizeClass(["drawer-button",{open:n.drawerOpen,close:!n.drawerOpen}]),onClick:e[3]||(e[3]=(...d)=>s.toggleDrawer&&s.toggleDrawer(...d))},[a.createVNode(m,null,{default:a.withCtx(()=>[a.createVNode(v)]),_:1})],2)],2)),[[a.vShow,s.hasValidPrimitive]])}const Cx=Kn(CD,[["render",LD],["__scopeId","data-v-83d11562"]]),RD=(n,e)=>{const t=n.label.toUpperCase(),i=e.label.toUpperCase();return t<i?-1:t>i?1:0},FD={name:"ScaffoldTreeControls",components:{ElIconArrowLeft:ki,TreeControls:Ua.TreeControls},props:{showColourPicker:Boolean,isReady:Boolean},data:function(){return{treeData:[{label:"Root",regionPath:"",id:void 0,children:[]}],active:[],hover:[],drawerOpen:!0,nodeNumbers:0,module:void 0}},computed:{treeDataEntry:function(){return this.treeData[0].children}},watch:{treeDataEntry:{deep:!0,handler:function(n){this.isReady&&this.setColourField(n)}}},methods:{addTreeItem:function(n,e,t){n.some(i=>i.label===e.label)||(Object.assign(e,{activeColour:this.getColour(e)}),n.push(e),n.sort((i,r)=>RD(i,r)),this.nodeNumbers++,this.$nextTick(()=>{!this.$refs.treeControls.$refs.regionTree.getCheckedKeys().includes(e.id)&&t.getVisibility()&&this.$refs.treeControls.$refs.regionTree.setChecked(e.id,!0)}))},findOrCreateRegion:function(n,e,t){if(this.module&&this.module.scene&&(this.treeData[0].id=this.module.scene.getRootRegion().uuid,this.treeData[0].isRegion=!0),e.length>0){const i=[...e];let r=n.children.find(l=>l.label==i[0]);const s=t+"/"+e[0],o=this.module.scene.getRootRegion().findChildFromPath(s);return r||(r={label:i[0],id:o.uuid,children:[],regionPath:s,isRegion:!0},this.addTreeItem(n.children,r,o),s==="/_helper"&&this.$nextTick(()=>{this.$refs.treeControls.$refs.regionTree.setChecked(r.id,!1)})),i.shift(),this.findOrCreateRegion(r,i,s)}else return n},removeRegion:function(n){if(this.treeData[0].children){for(let e=0;e<this.treeData[0].children.length;e++)if(this.treeData[0].children[e].label===n){this.treeData[0].children.splice(e,1),this.nodeNumbers--;return}}},zincObjectAdded:function(n){const e=n.region;if(e){const t=e.getFullSeparatedPath(),i=this.findOrCreateRegion(this.treeData[0],t,"");if(n.groupName&&i){i.children||(i.children=[]);const r={disabled:!1,label:n.groupName,id:e.uuid+"/"+n.uuid,isPrimitives:!0,regionPath:n.region.getFullPath(),isTextureSlides:!!n.isTextureSlides};this.addTreeItem(i.children,r,n)}}},zincObjectRemoved:function(n){const e=n.groupName;if(n.region.findObjectsWithGroupName(e,!1).length===0){const i=n.region.getFullSeparatedPath(),r=this.findOrCreateRegion(this.treeData[0],i,"");if(r.children){for(let s=0;s<r.children.length;s++)if(r.children[s].label===e){r.children.splice(s,1),this.nodeNumbers--;return}}}},checkChanged:function(n,e){const t=n.isRegion,i=n.isPrimitives,r=e.checkedKeys.includes(n.id),s=this.module.scene.getRootRegion().findChildFromPath(n.regionPath);t&&(r?s.showAllPrimitives():s.hideAllPrimitives()),i&&s.findObjectsWithGroupName(n.label).forEach(l=>{const u=r&&!n.disabled;l.setVisibility(u)})},updateActiveUI:function(n){this.active.length=0,gx(n,this.active)},changeActiveByPrimitives:function(n,e){n&&n.length>0?(this.updateActiveUI(n),this.$emit("object-selected",n,e)):this.removeActive(e),this.removeHover(e)},updateHoverUI:function(n){this.hover.length=0,gx(n,this.hover)},changeHoverByPrimitives:function(n,e){n&&n.length>0?(this.updateHoverUI(n),this.$emit("object-hovered",n,e)):this.removeHover(e)},changeActiveByNames:function(n,e,t){const i=this.module.scene.getRootRegion(),r=Ao(i,n,e,!0);this.changeActiveByPrimitives(r,t)},changeHoverByNames:function(n,e,t){const i=this.module.scene.getRootRegion(),r=Ao(i,n,e,!0);this.changeHoverByPrimitives(r,t)},changeActiveByNode:function(n,e){if(n.isPrimitives||n.isRegion){const t=!!n.isRegion,i=this.getZincObjectsFromNode(n,t);this.changeActiveByPrimitives(i,e)}},changeHoverByNode:function(n,e){if(n.isPrimitives){const t=this.getZincObjectsFromNode(n,!1);this.changeHoverByPrimitives(t,e)}},removeActive:function(n){this.active=[],this.$emit("object-selected",[],n)},removeHover:function(n){this.hover=[],this.$emit("object-hovered",[],n)},clear:function(){this.active.length=0,this.hover.length=0,this.nodeNumbers=0,this.$refs.treeControls.$refs.regionTree.updateKeyChildren(this.treeData[0].id,[]),this.treeData[0].children.length=0,this.treeData[0].id=void 0,this.$emit("object-selected",[])},forEachChildInNode:function(n,e,t,i,r){if(n.isRegion){if(n.children){const s=t===""||e.includes(n.id);n.children.forEach(o=>this.forEachChildInNode(o,e,n.regionPath,i&&s,r))}}else n.isPrimitives&&r(n,t,i)},getColour:function(n){if(n){let t=this.getZincObjectsFromNode(n,!1)[0];if(t){let i=t.getColourHex();if(i)return"#"+i}}return"#FFFFFF"},getNodeDataByRegionAndGroup:function(n,e){for(const t of this.treeDataEntry)if(t.isRegion&&t.label===n){const i=t.children;for(const r of i)if(r.isPrimitives&&r.label===e)return r}},getZincObjectsFromNode:function(n,e){const t=this.module.scene.getRootRegion();if(n.isPrimitives)return Ao(t,n.label,n.regionPath,e);if(n.isRegion&&n.regionPath){let i=t.findChildFromPath(n.regionPath);if(i)return i.getAllObjects(e)}return[]},setModule:function(n){this.module=a.markRaw(n),this.nodeNumbers=0,this.module.scene.getRootRegion().getAllObjects(!0).forEach(t=>{this.zincObjectAdded(t)}),this.module.addOrganPartAddedCallback(this.zincObjectAdded),this.module.addOrganPartRemovedCallback(this.zincObjectRemoved)},setColourField:function(n,e=void 0){n.filter(t=>e&&!t.children?t.id===e.id:!0).map(t=>{if(t.children)this.setColourField(t.children,e);else{const i=this.getColour(t);t.defaultColour||(t.defaultColour=i),t.activeColour=i}})},setColour:function(n,e){n&&n.isPrimitives&&this.getZincObjectsFromNode(n,!1).forEach(i=>{let s=(e||n.defaultColour).replace("#","0x");i.setColourHex(s),this.setColourField(this.treeData[0].children,n)})},updateAllNodeColours:function(){const n=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();this.forEachChildInNode(this.treeData[0],n,"",!0,(e,t,i)=>{e.isPrimitives&&(e.activeColour=this.getColour(e))})},setOutlines:function(n){const e=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();this.forEachChildInNode(this.treeData[0],e,"",!0,(t,i,r)=>{const o=this.module.scene.getRootRegion().findChildFromPath(i).findObjectsWithGroupName(t.label);n?o.forEach(l=>{l.isLines&&(e.includes(t.id)&&r&&l.setVisibility(!0),t.disabled=!1)}):t.isPrimitives&&o.forEach(l=>{l.isLines&&(l.setVisibility(!1),t.disabled=!0)})})},visibilityToggle:function(n,e){this.module.changeOrganPartsVisibility(n,e),e==!1&&(this.activeRegion===n&&this.removeActive(!0),this.hoverRegion===n&&this.removeHover(!0))},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen,this.$emit("drawer-toggled",this.drawerOpen)},setTreeVisibilityWithFullPaths:function(n,e,t,i){let r=!1,s="";n.isRegion&&(s=`__r${n.regionPath}`),n.isPrimitives&&(s=`${n.regionPath}/${n.label}`);const o=e.indexOf(s);o>-1&&(r=!0,e.splice(o,1),t.push(n.id));const l=this.module.scene.getRootRegion().findChildFromPath(n.regionPath);s&&s!=="__r"&&n.isPrimitives&&l.findObjectsWithGroupName(n.label).forEach(c=>c.setVisibility(r)),n.children&&n.children.forEach(u=>{this.setTreeVisibilityWithFullPaths(u,e,t,!0)})},setCheckedKeys:function(n,e){this.$nextTick(()=>{e&&this.$refs.treeControls.$refs.regionTree.setCheckedKeys([]),n.forEach(t=>{this.$refs.treeControls.$refs.regionTree.setChecked(t,!0,!0)})})},checkAllKeys:function(n=[]){const e=[],t=[];vx(this.treeData[0],e);const i=e.filter(r=>!n.some(s=>r.includes(s)));this.setTreeVisibilityWithFullPaths(this.treeData[0],i,t,!0),this.$refs.treeControls.$refs.regionTree.setCheckedKeys(t)},getState:function(){let n=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();return n.length===this.nodeNumbers?{checkAll:!0,version:"2.0"}:{checkedItems:fD(this.module.scene.getRootRegion(),n),version:"2.0"}},setState:function(n){if(n){if(n.checkAll)this.checkAllKeys();else if(n.checkedItems){let e=[];n.version!=="2.0"?(e=n.checkedItems.map(i=>"/"+i),e.shift("__r/")):e.push(...n.checkedItems);const t=[];this.setTreeVisibilityWithFullPaths(this.treeData[0],e,t,!0),this.$refs.treeControls.$refs.regionTree.setCheckedKeys(t)}}}}},PD={class:"traditional-container"};function ID(n,e,t,i,r,s){const o=a.resolveComponent("TreeControls"),l=ki,u=ht;return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["tree-controls",{open:n.drawerOpen,close:!n.drawerOpen}])},[a.createElementVNode("div",PD,[a.createVNode(o,{mapType:"scaffold",title:"Regions",isReady:t.isReady,treeData:s.treeDataEntry,active:n.active,hover:n.hover,showColourPicker:t.showColourPicker,onSetColour:s.setColour,onCheckChanged:s.checkChanged,onChangeActive:s.changeActiveByNode,onChangeHover:s.changeHoverByNode,ref:"treeControls",onMouseleave:e[0]||(e[0]=c=>s.removeHover(!0))},null,8,["isReady","treeData","active","hover","showColourPicker","onSetColour","onCheckChanged","onChangeActive","onChangeHover"])]),a.createElementVNode("div",{class:a.normalizeClass(["drawer-button",{open:n.drawerOpen,close:!n.drawerOpen}]),onClick:e[1]||(e[1]=(...c)=>s.toggleDrawer&&s.toggleDrawer(...c))},[a.createVNode(u,null,{default:a.withCtx(()=>[a.createVNode(l)]),_:1})],2)],2)}const Lx=Kn(FD,[["render",ID],["__scopeId","data-v-5394b615"]]),xf=Ga.defineStore("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(n){return n.userProfile.token}},actions:{setUserToken(n){this.userProfile.token=n}}}),OD={name:"ScaffoldTooltip",components:{Col:Fn,CreateTooltipContent:Ua.CreateTooltipContent,ElIconDelete:tl,Icon:ht,Popover:Ml,Row:Yn,Tooltip:Ua.Tooltip},props:{createData:{type:Object,default:{toBeConfirmed:!1,points:[],shape:"",x:0,y:0}},label:{type:String,default:""},annotationDisplay:{type:Boolean,default:!1},annotationFeature:{type:Object,default:{}},offlineAnnotationEnabled:{type:Boolean,default:!1},region:{type:String,default:""},visible:{type:Boolean,default:!1},x:{type:Number,default:200},y:{type:Number,default:200}},inject:["scaffoldUrl"],provide(){return{userApiKey:this.userToken}},data:function(){return{display:!1,annotationEntry:[],ElIconDelete:a.shallowRef(tl)}},computed:{...Ga.mapState(xf,["userToken"]),position:function(){let n=40;return this.region&&(n=55),{left:this.x-40+"px",top:this.y-n+"px"}}},methods:{checkForDisplay:function(){if(this.visible&&this.label&&this.label!==""){if(this.display=!0,this.annotationDisplay){const n=this.region?this.region+"/":"";this.annotationEntry=[{featureId:n+this.label,resourceId:this.scaffoldUrl,resource:this.scaffoldUrl,feature:this.annotationFeature,offline:this.offlineAnnotationEnabled}]}}else this.display=!1,this.annotationEntry=[]},hideTriggered:function(){this.$emit("tooltip-hide")}},watch:{label:{handler:function(){this.checkForDisplay()},immediate:!0},visible:{handler:function(){this.checkForDisplay()},immediate:!0},annotationDisplay:{handler:function(){this.checkForDisplay()},immediate:!0}}},ND={class:"tooltip-text"},BD={key:0,class:"tooltip-text"},DD={key:1,class:"delete-container"};function VD(n,e,t,i,r,s){const o=a.resolveComponent("CreateTooltipContent"),l=a.resolveComponent("Tooltip"),u=Fn,c=ws,f=Yn,h=Ml;return a.openBlock(),a.createElementBlock("div",{style:a.normalizeStyle(s.position),class:"region-tooltip"},[a.createVNode(h,{ref:"tooltip",visible:t.visible,placement:"top","show-arrow":!1,teleported:!1,trigger:"manual","popper-class":"tooltip-popper non-selectable","virtual-triggering":"",onHide:s.hideTriggered},{default:a.withCtx(()=>[a.createElementVNode("div",ND,a.toDisplayString(t.label),1),t.region?(a.openBlock(),a.createElementBlock("div",BD,"Region: "+a.toDisplayString(t.region),1)):a.createCommentVNode("",!0),a.withDirectives(a.createVNode(o,{createData:t.createData,onConfirmCreate:e[0]||(e[0]=p=>n.$emit("confirm-create",p)),onCancelCreate:e[1]||(e[1]=p=>n.$emit("cancel-create"))},null,8,["createData"]),[[a.vShow,t.createData.toBeConfirmed]]),a.withDirectives(a.createVNode(l,{class:"p-tooltip",ref:"annotationTooltip",annotationDisplay:!0,annotationEntry:n.annotationEntry,onAnnotation:e[2]||(e[2]=p=>n.$emit("confirm-comment",p))},null,8,["annotationEntry"]),[[a.vShow,t.annotationDisplay&&!t.createData.toBeConfirmed]]),t.createData.toBeDeleted?(a.openBlock(),a.createElementBlock("div",DD,[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(u,{span:10},{default:a.withCtx(()=>e[5]||(e[5]=[a.createTextVNode("Delete this feature?")])),_:1}),a.createVNode(u,{span:7},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",icon:n.ElIconDelete,onClick:e[3]||(e[3]=p=>n.$emit("confirm-delete"))},{default:a.withCtx(()=>e[6]||(e[6]=[a.createTextVNode(" Delete ")])),_:1},8,["icon"])]),_:1}),a.createVNode(u,{span:6},{default:a.withCtx(()=>[a.createVNode(c,{class:"delete-button",onClick:e[4]||(e[4]=p=>n.$emit("cancel-create"))},{default:a.withCtx(()=>e[7]||(e[7]=[a.createTextVNode(" Dismiss ")])),_:1})]),_:1})]),_:1})])):a.createCommentVNode("",!0)]),_:1},8,["visible","onHide"])],4)}const Rx=Kn(OD,[["render",VD],["__scopeId","data-v-d3f76b72"]]),Va={ALL:0,SELECTED:1,HIGHLIGHTED:2,MOVE:3},kD=function(n,e,t){this.eventType=n,this.identifiers=e,this.zincObjects=t},zD=function(n,e,t){this.targetedID=[];const i=n,r=e;this.targetEventType=t;const s=this;t===void 0&&(this.targetEventType=Va.ALL),this.getEventType=function(){return t},this.notify=function(o,l,u,c){if(o!==i&&(s.targetEventType===Va.ALL||s.targetEventType===l)){const f=new kD(l,u,c);r(f)}}},UD=function(){const n=[];this.publish=function(e,t,i,r){for(let s=0;s<n.length;s++)n[s].notify(e,t,i,r)},this.subscribe=function(e,t,i){if(typeof t=="function"){const r=new zD(e,t,i);return n.push(r),r}},this.unsubscribe=function(e){for(let t=0;t<n.length;t++)if(e===n[t]){n.splice(t,1);return}}},Fx={isWebGLAvailable:function(){try{var n=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(n.getContext("webgl")||n.getContext("experimental-webgl")))}catch{return!1}},isWebGL2Available:function(){try{var n=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&n.getContext("webgl2"))}catch{return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(n){var e={1:"WebGL",2:"WebGL 2"},t={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},i='This module requires <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#008">$1</a> support but your $0 does not seem to support it.',r=document.createElement("div");return r.id="webglmessage",r.style.fontFamily="monospace",r.style.fontSize="20px",r.style.fontWeight="normal",r.style.textAlign="center",r.style.background="#fff",r.style.color="#000",r.style.padding="1.5em",r.style.width="400px",r.style.margin="5em auto 0",t[n]?i=i.replace("$0","graphics card"):i=i.replace("$0","browser"),i=i.replace("$1",e[n]),r.innerHTML=i,r}},wf={ALL:0,DESTROYED:1,NAME_CHANGED:2,SETTINGS_CHANGED:3},yn=function(){this.typeName="Base Module",this.instanceName="default",this.onChangedCallbacks=[],this.eventNotifiers=[]};yn.prototype.setName=function(n){if(n&&this.instanceName!==n){this.instanceName=n;const e=this.onChangedCallbacks.slice();for(let t=0;t<e.length;t++)e[t](this,wf.NAME_CHANGED)}},yn.prototype.settingsChanged=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,wf.SETTINGS_CHANGED)},yn.prototype.exportSettings=function(){const n={};return n.dialog=this.typeName,n.name=this.instanceName,n},yn.prototype.importSettings=function(n){return n.dialog==this.typeName?(this.setName(n.name),!0):!1},yn.prototype.publishChanges=function(n,e,t){for(let i=0;i<this.eventNotifiers.length;i++)this.eventNotifiers[i].publish(this,e,n,t)},yn.prototype.getName=function(){return this.instanceName},yn.prototype.destroy=function(){const n=this.onChangedCallbacks.slice();for(let e=0;e<n.length;e++)n[e](this,wf.DESTROYED);delete this},yn.prototype.addChangedCallback=function(n){this.onChangedCallbacks.includes(n)==!1&&this.onChangedCallbacks.push(n)},yn.prototype.removeChangedCallback=function(n){const e=this.onChangedCallbacks.indexOf(n);e>-1&&this.onChangedCallbacks.splice(e,1)},yn.prototype.addNotifier=function(n){this.eventNotifiers.push(n)};const jc=(n,e,t)=>{for(let i=0;i<n.length;i++)if(n[i]&&n[i].material&&n[i].material.emissive){let r=n[i].userData;r&&r.isZincObject?r.setEmissiveRGB(e):n[i].material&&n[i].material.emissive&&n[i].material.emissive.setRGB(...e),t&&n[i].material.depthFunc&&(n[i].material.depthFunc=br.THREE.LessEqualDepth),n[i].children.forEach(s=>{const o=s.userData;o&&o.isZincObject&&s.material&&s.material.emissive&&s.material.emissive.setRGB(...e)})}},GD=function(){let n=[],e=[];this.highlightColour=[1,0,0],this.selectColour=[0,1,0],this.originalColour=[0,0,0];const t=[],i=[],r=this,s=function(u,c){if(u.length==0&&c.length==0)return!1;for(let f=0;f<u.length;f++){let h=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(h=!0);if(!h)return!0}for(let f=0;f<c.length;f++){let h=!1;for(let p=0;p<u.length;p++)c[f]===u[p]&&(h=!0);if(!h)return!0}return!1},o=function(u,c){if(t.length=0,c.length==0)return u;for(let f=0;f<u.length;f++){let h=!1;for(let p=0;p<c.length;p++)u[f]===c[p]&&(h=!0);h||t.push(u[f])}return t};this.setHighlighted=function(u){const c=[...n];this.setNervesStyle(c),r.resetHighlighted();const f=o(u,e),h=l(f);return this.setNervesStyle(f,oi.HIGHLIGHTED_COLOUR),jc(h,r.highlightColour,!1),n=f,s(n,c)},this.setSelected=function(u){const c=[...e];this.setNervesStyle(c),r.resetHighlighted(),r.resetSelected();const f=l(u);return this.setNervesStyle(u,oi.SELECTED_COLOUR),jc(f,r.selectColour,!1),e=u,s(e,c)};const l=function(u){i.length=0;for(let c=0;c<u.length;c++)u[c].material&&i.push(u[c]);return i};this.setNervesStyle=function(u,c){const f=bf(u);if(f&&f.length){const h=c?oi.ZOOM_RADIUS:oi.DEFAULT_RADIUS,p=c?oi.ZOOM_RADIAL_SEGMENTS:oi.DEFAULT_RADIAL_SEGMENTS;f.forEach(v=>{var m,d,b;if(v.isTubeLines&&((m=v.userData)!=null&&m.isNerves)&&!((d=v.userData)!=null&&d.isGreyScale)){v.setTubeLines(h,p);let y=c||((b=v.userData)==null?void 0:b.defaultColour);y=y.replace("#","0x"),v.setColourHex(y)}})}},this.resetHighlighted=function(){const u=l(n);this.setNervesStyle(n),jc(u,r.originalColour,!0),n=[]},this.resetSelected=function(){const u=l(e);this.setNervesStyle(n),jc(u,r.originalColour,!0),e=[]},this.getSelected=function(){return e},this.reset=function(){r.resetSelected(),r.resetHighlighted()}},Mf=Hc.THREE,HD=function(){const n=document.createElement("div");let e;if(n.style.height="100%",Fx.isWebGLAvailable())e=new Hc.Renderer(n,window),Hc.defaultMaterialColor=16777116,e.initialiseVisualisation(),e.playAnimation=!1;else{const t=Fx.getWebGLErrorMessage();n.appendChild(t)}return{Zinc:Hc,renderer:e,container:n}},Et=function(){yn.call(this),this.scene=void 0,this.rendererContainer=void 0,this.displayArea=void 0,this.graphicsHighlight=new GD,this.selectObjectOnPick=!0,this.zincRenderer=null,this.selectedScreenCoordinates=new Mf.Vector3,this.selectedCenter=void 0,this.liveUpdatesObjects=void 0,this.ignorePreviousSelected=!1};Et.prototype=Object.create(yn.prototype),Et.prototype.getIntersectedObject=function(n){if(n){const e=n.map(i=>{if(i&&i.object&&i.object.userData){if(i.object.userData.isMarker)return 1;if(i.object.name&&i.object.userData.isZincObject)return i.object.name==="_Unnamed"?3:2}return 0});let t=e.indexOf(1);return t>-1||(t=e.indexOf(2),t=t>-1?t:e.indexOf(3)),n[t]}},Et.prototype.getAnnotationsFromObjects=function(n){const e=[];for(var t=0;t<n.length;t++){const i=n[t].userData;let r;if(i){if(i.isGlyph||i.isGlyphset){let s=i;i.isGlyph&&(s=i.getGlyphset()),r=s.userData?s.userData.annotation:void 0,r&&r.data&&(n[t].name&&n[t].name!=""?r.data.id=n[t].name:r.data.id=s.groupName)}else r=i.userData?i.userData.annotation:void 0,r&&r.data&&(r.data.id=n[t].name);r&&(r.data.anatomicalId=i.anatomicalId,r.data.isNerves=i.userData.isNerves,r.data.zincObject=i)}r&&e.push(r)}return e},Et.prototype.setHighlightedByObjects=function(n,e,t,i){const r=bf(n),s=this.graphicsHighlight.setHighlighted(n);if(i){let o=Va.MOVE;s&&(o=Va.HIGHLIGHTED);const l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,r)}return s},Et.prototype.setHighlightedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{s&&s.getMorph()&&r.push(s.getMorph())}),this.setHighlightedByObjects(r,e,t,i)},Et.prototype.setupLiveCoordinates=function(n){if(this.liveUpdatesObjects=n,n&&n.length>0){const e=this.scene.getBoundingBoxOfZincObjects(n);let t=new Mf.Vector3;e?(e.getCenter(t),this.selectedCenter==null?this.selectedCenter=t:this.selectedCenter.copy(t)):this.selectedCenter=void 0}else this.selectedCenter=void 0},Et.prototype.setSelectedByObjects=function(n,e,t,i){let r=!1;if(this.selectObjectOnPick?r=this.graphicsHighlight.setSelected(n):r=!0,r||this.ignorePreviousSelected){const s=bf(n);if(this.selectObjectOnPick&&this.setupLiveCoordinates(s),i){const o=Va.SELECTED,l=this.getAnnotationsFromObjects(n);l.length>0&&(l[0].coords=e,l[0].extraData=t),this.publishChanges(l,o,s)}}return r},Et.prototype.setSelectedByZincObjects=function(n,e,t,i){let r=[];return n&&n.forEach(s=>{if(s){const o=s.getMorph();o&&r.push(o)}}),this.setSelectedByObjects(r,e,t,i)},Et.prototype.findObjectsByGroupName=function(n){return this.scene.findObjectsWithGroupName(n)},Et.prototype.setHighlightedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setHighlightedByObjects(t,void 0,{},e)},Et.prototype.setSelectedByGroupName=function(n,e){const t=this.findObjectsByGroupName(n);return this.setSelectedByObjects(t,void 0,{},e)},Et.prototype.changeBackgroundColour=function(n){const e=new Mf.Color(n);this.zincRenderer&&this.zincRenderer.getThreeJSRenderer().setClearColor(e,1)},Et.prototype.resetView=function(){this.zincRenderer&&this.zincRenderer.resetView()},Et.prototype.viewAll=function(){this.zincRenderer&&this.zincRenderer.viewAll()},Et.prototype.playAnimation=function(n){this.zincRenderer&&(this.zincRenderer.playAnimation=n)},Et.prototype.setPlayRate=function(n){this.zincRenderer&&this.zincRenderer.setPlayRate(n)},Et.prototype.getPlayRate=function(n){return this.zincRenderer?this.zincRenderer.getPlayRate():0},Et.prototype.initialiseRenderer=function(n){if(this.zincRenderer===void 0||this.rendererContainer===void 0){let e=HD();this.Zinc=e.Zinc,this.zincRenderer=e.renderer,this.rendererContainer=e.container}n&&(this.displayArea=n,this.displayArea.appendChild(this.rendererContainer),this.zincRenderer&&this.zincRenderer.animate())},Et.prototype.destroy=function(){this.zincRenderer&&(this.zincRenderer.dispose(),this.zincRenderer.getThreeJSRenderer().dispose(),this.zincRenderer=void 0),yn.prototype.destroy.call(this)};const WD=function(){this.type="anatomical",this.data=void 0,this.isAnnotation=!0},jD=function(){this.currentName="",this.currentSystem="",this.currentPart="",this.currentSpecies="",this.metaURL="",this.viewURL="",this.timeVarying=!1,this.currentTime=0},Px=function(n){Et.call(this);const e=this;let t;this.sceneData=new jD;const i=new Array,r=new Array,s=new Array,o=new Array;let l,u;const c=n;this.NDCCameraControl=void 0,e.typeName="Organ Viewer";let f=!1;this.isIgnorePicking=function(){return f},this.setIgnorePicking=function(_){f=_},this.getSceneData=function(){return e.sceneData},this.updateTime=function(_){let E=6e3;e.scene&&(E=e.scene.getDuration());const C=_/100*E;e.sceneData.nerveMapIsActive||e.scene&&e.scene.setMorphsTime(C),e.sceneData.currentTime=_};const h=function(){let _=3e3;e.scene&&(_=e.scene.getDuration());const E=e.zincRenderer.getCurrentTime();for(let C=0;C<i.length;C++)i[C](E);!e.sceneData.nerveMapIsActive&&t&&t.setMorphsTime(E),e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setTime(E/_),e.sceneData.currentTime=E/_*100};this.getCurrentTime=function(){return e.sceneData.currentTime},this.toggleSyncControl=(_,E)=>{let C=this.scene.getZincCameraControls();_?(C.resetView(),this.NDCCameraControl=C.enableSyncControl(),C.setRotationMode(E)):(C.disableSyncControl(),this.NDCCameraControl=void 0,C.setRotationMode("free"))},this.isSyncControl=()=>this.NDCCameraControl!==void 0,this.setSyncControlZoomToBox=_=>{this.NDCCameraControl&&this.NDCCameraControl.zoomToBox(_,2)},this.setSyncControlCallback=_=>{this.NDCCameraControl&&this.NDCCameraControl.setEventCallback(_)},this.setSyncControlCenterZoom=(_,E)=>{this.NDCCameraControl&&this.NDCCameraControl.setCenterZoom(_,E)};const p=function(){if(e.zincRenderer.playAnimation&&e.liveUpdatesObjects&&e.setupLiveCoordinates(e.liveUpdatesObjects),e.selectedCenter){const _=new br.THREE.Vector3;_.copy(e.selectedCenter);const E=e.scene.vectorToScreenXY(_);e.selectedScreenCoordinates.x=E.x,e.selectedScreenCoordinates.y=E.y}},v=function(){return function(){h()}},m=function(){return function(){p()}};this.addTimeChangedCallback=function(_){i.push(_)},this.setTexturePos=function(_){e.sceneData.nerveMap&&e.sceneData.nerveMap.additionalReader&&e.sceneData.nerveMap.additionalReader.setSliderPos(_)},this.addSceneChangedCallback=function(_){r.push(_)},this.addOrganPartAddedCallback=function(_){s.push(_)},this.addOrganPartRemovedCallback=function(_){o.push(_)},this.setFinishDownloadCallback=function(_){l=_},this.unsetFinishDownloadCallback=function(){l=void 0},this.setDownloadErrorCallback=function(_){u=_},this.unsetDownloadErrorCallback=function(){u=void 0},this.getNamedObjectsToScreenCoordinates=function(_,E){const C=new br.THREE.Vector3;C.setFromMatrixPosition(obj.matrixWorld);const L=width/2,I=height/2;return C.project(E),C.x=C.x*L+L,C.y=-(C.y*I)+I,C};const d=function(_){let E,C;if(_!==void 0){let L=!1;_.object.userData&&_.object.userData.isMarker?(L=!0,C=_.object.userData.parent.getMorph()):C=_.object;try{C.userData.userData.annotation.data.lastActionOnMarker=L}finally{}if(C)if(C.name)E=C.name;else{const I=e.getAnnotationsFromObjects([C]);I&&I[0]&&(E=I[0].data.group)}}return{id:E,object:C}},b=function(){return function(_,E,C){var B;const L=e.getIntersectedObject(_),I=d(L),x={worldCoords:[L?L.point.x:0,L?L.point.y:0,L?L.point.z:0],intersected:L,intersects:_},O={x:E,y:C};if(I.id){x.threeID=(B=I.object)==null?void 0:B.id,I.object.userData.isGlyph?I.object.name?e.setSelectedByObjects([I.object],O,x,!0):e.setSelectedByZincObjects(I.object.userData.getGlyphset(),O,x,!0):e.setSelectedByObjects([I.object],O,x,!0);return}else{if(f)return;e.setSelectedByObjects([],O,x,!0)}}},y=function(){return function(_,E,C){var B;const L=e.getIntersectedObject(_),I=d(L),x={worldCoords:[L?L.point.x:0,L?L.point.y:0,L?L.point.z:0]},O={x:E,y:C};if(I.id){x.threeID=(B=I.object)==null?void 0:B.id,e.displayArea.style.cursor="pointer",e.setHighlightedByObjects([I.object],O,x,!0);return}else e.displayArea.style.cursor="auto",e.setHighlightedByObjects([],O,x,!0)}},g=function(_,E,C,L){if(L=="all"||L=="geometries"){const I=_.findGeometriesWithGroupName(E);for(let x=0;x<I.length;x++)I[x].setVisibility(C)}if(L=="all"||L=="glyphsets"){const I=_.findGlyphsetsWithGroupName(E);for(let x=0;x<I.length;x++)I[x].setVisibility(C)}if(L=="all"||L=="pointsets"){const I=_.findPointsetsWithGroupName(E);for(let x=0;x<I.length;x++)I[x].setVisibility(C)}if(L=="all"||L=="lines"){const I=_.findLinesWithGroupName(E);for(let x=0;x<I.length;x++)I[x].setVisibility(C)}};this.changeGeometriesVisibility=function(_,E){g(e.scene,_,E,"geometries")},this.changeGlyphsetsVisibility=function(_,E){g(e.scene,_,E,"glyphsets")},this.changeLinesVisibility=function(_,E){g(e.scene,_,E,"lines")},this.changePointsetsVisibility=function(_,E){g(e.scene,_,E,"pointsets")},this.changeOrganPartsVisibility=function(_,E,C){let L="all";C!==void 0&&(L=C),g(e.scene,_,E,L)},this.changeOrganPartsVisibilityCallback=function(_){return function(E){e.changeOrganPartsVisibility(_,E)}},this.changeBackgroundColour=function(_){const E=new br.THREE.Color(_);e.zincRenderer&&e.zincRenderer.getThreeJSRenderer().setClearColor(E,1)};const w=function(_,E,C,L){for(let O=0;O<s.length;O++)s[O](L,e.scene.isTimeVarying());const I=new WD,x=L.region.getFullPath();I.data={species:e.sceneData.currentSpecies,system:_,part:E,group:L.groupName,region:x,uuid:L.uuid,lastActionOnMarker:!1},L.userData.annotation=I},A=function(_,E,C,L){for(let I=0;I<o.length;I++)o[I](L)},S=function(_,E,C){return function(L){w(_,E,C,L)}},M=function(_,E,C){return function(L){A(_,E,C,L)}},F=function(){return function(){e.settingsChanged(),e.sceneData.timeVarying=e.scene.isTimeVarying(),l&&l()}},R=function(){return function(_){if((_==null?void 0:_.type)==="Error"&&u){const E={xhr:_.xhr,type:"download-error"};u(E)}}};this.updateFieldvisibility=function(_,E){for(let C=0;C<_.length;C++)if(E!=C){const L=_[C].PartName;e.changeOrganPartsVisibility(L,!1)}if(E>-1){const C=_[E].PartName;if(e.scene.findGeometriesWithGroupName(C).length>0||e.scene.findGlyphsetsWithGroupName(C).length>0)e.changeOrganPartsVisibility(C,!0);else{const L=getOrganDetails(_[E].SystemName,C);L!=null&&e.scene.loadMetadataURL(c.getOrgansDirectoryPrefix()+"/"+L.meta)}}},this.getAvailableSpecies=function(_,E,C){const L=new Array;L.push("none");const I=Object.keys(organsFileMap);for(index in I){const x=I[index];x!=_&&organsFileMap[x].hasOwnProperty(E)&&organsFileMap[x][E].hasOwnProperty(C)&&L.push(x)}return L},this.getCentreAndSize=function(){const _=new br.THREE.Vector3,E=this.scene.getBoundingBox();E.getCenter(_);const C=[_.x,_.y,_.z];E.getSize(_);const L=[_.x,_.y,_.z];return{centre:C,size:L}};const T=function(_,E,C,L){e.sceneData.nerveMapIsActive=!1,e.sceneData.nerveMap=void 0,e.sceneData.metaURL="",e.sceneData.viewURL="",e.sceneData.currentSpecies=_,e.sceneData.currentSystem=E,e.sceneData.currentPart=C,e.sceneData.currentTime=0,e.sceneData.timeVarying=!1;let I="";_&&(I=_+"/"),E&&(I=E+"/"),C&&(I=C),e.sceneData.currentName=I};this.loadOrgansFromURL=function(_,E,C,L,I,x,O){if(e.zincRenderer&&L&&e.sceneData.metaURL!==_){T(E,C,L);const B=e.sceneData.currentName;let D=e.zincRenderer.getSceneByName(B);D?x&&D.clearAll():D=e.zincRenderer.createScene(B),e.selectObjectOnPick=!0;for(let V=0;V<r.length;V++)r[V](e.sceneData);I&&I!=""?(e.sceneData.viewURL=I,D.loadViewURL(e.sceneData.viewURL)):e.sceneData.viewURL=void 0,e.sceneData.metaURL=_,D.addZincObjectAddedCallbacks(S(C,L,!1)),D.addZincObjectRemovedCallbacks(M(void 0,L,!1)),D.loadMetadataURL(_,R(),F(),O),e.scene=D,e.zincRenderer.setCurrentScene(D),e.graphicsHighlight.reset();const k=D.getZincCameraControls();k.enableRaycaster(D,b(),y()),k.setMouseButtonAction("AUXILIARY","ZOOM"),k.setMouseButtonAction("SECONDARY","PAN")}},this.loadGLTFFromURL=function(_,E,C){if(e.zincRenderer&&E&&e.sceneData.metaURL!==_){T(void 0,void 0,E);const L=e.sceneData.currentName;let I=e.zincRenderer.getSceneByName(L);I?C&&I.clearAll():I=e.zincRenderer.createScene(L);for(let O=0;O<r.length;O++)r[O](e.sceneData);e.sceneData.viewURL=void 0,e.sceneData.metaURL=_,I.addZincObjectAddedCallbacks(S(void 0,E,!1)),I.addZincObjectRemovedCallbacks(M(void 0,E,!1)),I.loadGLTF(_,void 0,F()),e.scene=I,e.zincRenderer.setCurrentScene(I),e.graphicsHighlight.reset();const x=I.getZincCameraControls();x.enableRaycaster(I,b(),y()),x.setMouseButtonAction("AUXILIARY","ZOOM"),x.setMouseButtonAction("SECONDARY","PAN")}},this.alignCameraWithSelectedObject=function(_){const E=e.graphicsHighlight.getSelected();E&&E[0]&&E[0].userData&&e.scene.alignObjectToCameraView(E[0].userData,_)},this.exportSettings=function(){const _={};return _.name=e.instanceName,e.sceneData.currentSystem&&(_.system=e.sceneData.currentSystem),e.sceneData.currentSpecies&&(_.species=e.sceneData.currentSpecies),e.sceneData.currentPart&&(_.part=e.sceneData.currentPart),_.metaURL=e.sceneData.metaURL,e.sceneData.viewURL&&(_.viewURL=e.sceneData.viewURL),_.dialog="Organ Viewer",_},this.importSettings=function(_){return _&&_.dialog==this.typeName?(e.setName(_.name),_.metaURL!==void 0&&_.metaURL!=""?e.loadOrgansFromURL(_.metaURL,_.species,_.system,_.part,_.viewURL,!0):e.loadOrgans(_.species,_.system,_.part),!0):!1},function(){e.initialiseRenderer(void 0),e.zincRenderer&&(e.zincRenderer.addPreRenderCallbackFunction(v()),e.zincRenderer.addPostRenderCallbackFunction(m()))}()};Px.prototype=Object.create(Et.prototype);var lt=function(){return lt=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},lt.apply(this,arguments)};function $D(n,e,t,i){function r(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function l(f){try{c(i.next(f))}catch(h){o(h)}}function u(f){try{c(i.throw(f))}catch(h){o(h)}}function c(f){f.done?s(f.value):r(f.value).then(l,u)}c((i=i.apply(n,[])).next())})}function ZD(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(c){return function(f){return u([c,f])}}function u(c){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(i=1,r&&(s=c[0]&2?r.return:c[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;switch(r=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,r=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(f){c=[6,f],r=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Ye(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ct(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var i=t.call(n),r,s=[],o;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s}typeof SuppressedError=="function"&&SuppressedError;var XD="ENTRIES",Ix="KEYS",Ox="VALUES",Yt="",Af=function(){function n(e,t){var i=e._tree,r=Array.from(i.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:i,keys:r}]:[]}return n.prototype.next=function(){var e=this.dive();return this.backtrack(),e},n.prototype.dive=function(){if(this._path.length===0)return{done:!0,value:void 0};var e=So(this._path),t=e.node,i=e.keys;if(So(i)===Yt)return{done:!1,value:this.result()};var r=t.get(So(i));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()},n.prototype.backtrack=function(){if(this._path.length!==0){var e=So(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}},n.prototype.key=function(){return this.set._prefix+this._path.map(function(e){var t=e.keys;return So(t)}).filter(function(e){return e!==Yt}).join("")},n.prototype.value=function(){return So(this._path).node.get(Yt)},n.prototype.result=function(){switch(this._type){case Ox:return this.value();case Ix:return this.key();default:return[this.key(),this.value()]}},n.prototype[Symbol.iterator]=function(){return this},n}(),So=function(n){return n[n.length-1]},YD=function(n,e,t){var i=new Map;if(e===void 0)return i;for(var r=e.length+1,s=r+t,o=new Uint8Array(s*r).fill(t+1),l=0;l<r;++l)o[l]=l;for(var u=1;u<s;++u)o[u*r]=u;return Nx(n,e,t,i,o,1,r,""),i},Nx=function(n,e,t,i,r,s,o,l){var u,c,f=s*o;try{e:for(var h=Ye(n.keys()),p=h.next();!p.done;p=h.next()){var v=p.value;if(v===Yt){var m=r[f-1];m<=t&&i.set(l,[n.get(v),m])}else{for(var d=s,b=0;b<v.length;++b,++d){for(var y=v[b],g=o*d,w=g-o,A=r[g],S=Math.max(0,d-t-1),M=Math.min(o-1,d+t),F=S;F<M;++F){var R=y!==e[F],T=r[w+F]+ +R,P=r[w+F+1]+1,_=r[g+F]+1,E=r[g+F+1]=Math.min(T,P,_);E<A&&(A=E)}if(A>t)continue e}Nx(n.get(v),e,t,i,r,d,o,l+v)}}}catch(C){u={error:C}}finally{try{p&&!p.done&&(c=h.return)&&c.call(h)}finally{if(u)throw u.error}}},Sf=function(){function n(e,t){e===void 0&&(e=new Map),t===void 0&&(t=""),this._size=void 0,this._tree=e,this._prefix=t}return n.prototype.atPrefix=function(e){var t,i;if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");var r=Ct($c(this._tree,e.slice(this._prefix.length)),2),s=r[0],o=r[1];if(s===void 0){var l=Ct(Ef(o),2),u=l[0],c=l[1];try{for(var f=Ye(u.keys()),h=f.next();!h.done;h=f.next()){var p=h.value;if(p!==Yt&&p.startsWith(c)){var v=new Map;return v.set(p.slice(c.length),u.get(p)),new n(v,e)}}}catch(m){t={error:m}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(t)throw t.error}}}return new n(s,e)},n.prototype.clear=function(){this._size=void 0,this._tree.clear()},n.prototype.delete=function(e){return this._size=void 0,JD(this._tree,e)},n.prototype.entries=function(){return new Af(this,XD)},n.prototype.forEach=function(e){var t,i;try{for(var r=Ye(this),s=r.next();!s.done;s=r.next()){var o=Ct(s.value,2),l=o[0],u=o[1];e(l,u,this)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.fuzzyGet=function(e,t){return YD(this._tree,e,t)},n.prototype.get=function(e){var t=_f(this._tree,e);return t!==void 0?t.get(Yt):void 0},n.prototype.has=function(e){var t=_f(this._tree,e);return t!==void 0&&t.has(Yt)},n.prototype.keys=function(){return new Af(this,Ix)},n.prototype.set=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Tf(this._tree,e);return i.set(Yt,t),this},Object.defineProperty(n.prototype,"size",{get:function(){if(this._size)return this._size;this._size=0;for(var e=this.entries();!e.next().done;)this._size+=1;return this._size},enumerable:!1,configurable:!0}),n.prototype.update=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Tf(this._tree,e);return i.set(Yt,t(i.get(Yt))),this},n.prototype.fetch=function(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;var i=Tf(this._tree,e),r=i.get(Yt);return r===void 0&&i.set(Yt,r=t()),r},n.prototype.values=function(){return new Af(this,Ox)},n.prototype[Symbol.iterator]=function(){return this.entries()},n.from=function(e){var t,i,r=new n;try{for(var s=Ye(e),o=s.next();!o.done;o=s.next()){var l=Ct(o.value,2),u=l[0],c=l[1];r.set(u,c)}}catch(f){t={error:f}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},n.fromObject=function(e){return n.from(Object.entries(e))},n}(),$c=function(n,e,t){var i,r;if(t===void 0&&(t=[]),e.length===0||n==null)return[n,t];try{for(var s=Ye(n.keys()),o=s.next();!o.done;o=s.next()){var l=o.value;if(l!==Yt&&e.startsWith(l))return t.push([n,l]),$c(n.get(l),e.slice(l.length),t)}}catch(u){i={error:u}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return t.push([n,e]),$c(void 0,"",t)},_f=function(n,e){var t,i;if(e.length===0||n==null)return n;try{for(var r=Ye(n.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;if(o!==Yt&&e.startsWith(o))return _f(n.get(o),e.slice(o.length))}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},Tf=function(n,e){var t,i,r=e.length;e:for(var s=0;n&&s<r;){try{for(var o=(t=void 0,Ye(n.keys())),l=o.next();!l.done;l=o.next()){var u=l.value;if(u!==Yt&&e[s]===u[0]){for(var c=Math.min(r-s,u.length),f=1;f<c&&e[s+f]===u[f];)++f;var h=n.get(u);if(f===u.length)n=h;else{var p=new Map;p.set(u.slice(f),h),n.set(e.slice(s,s+f),p),n.delete(u),n=p}s+=f;continue e}}}catch(m){t={error:m}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}var v=new Map;return n.set(e.slice(s),v),v}return n},JD=function(n,e){var t=Ct($c(n,e),2),i=t[0],r=t[1];if(i!==void 0){if(i.delete(Yt),i.size===0)Bx(r);else if(i.size===1){var s=Ct(i.entries().next().value,2),o=s[0],l=s[1];Dx(r,o,l)}}},Bx=function(n){if(n.length!==0){var e=Ct(Ef(n),2),t=e[0],i=e[1];if(t.delete(i),t.size===0)Bx(n.slice(0,-1));else if(t.size===1){var r=Ct(t.entries().next().value,2),s=r[0],o=r[1];s!==Yt&&Dx(n.slice(0,-1),s,o)}}},Dx=function(n,e,t){if(n.length!==0){var i=Ct(Ef(n),2),r=i[0],s=i[1];r.set(s+e,t),r.delete(s)}},Ef=function(n){return n[n.length-1]},ka,Cf="or",Vx="and",KD="and_not",qD=function(){function n(e){if((e==null?void 0:e.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');var t=e.autoVacuum==null||e.autoVacuum===!0?If:e.autoVacuum;this._options=lt(lt(lt({},Rf),e),{autoVacuum:t,searchOptions:lt(lt({},kx),e.searchOptions||{}),autoSuggestOptions:lt(lt({},i4),e.autoSuggestOptions||{})}),this._index=new Sf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=Pf,this.addFields(this._options.fields)}return n.prototype.add=function(e){var t,i,r,s,o,l,u=this._options,c=u.extractField,f=u.tokenize,h=u.processTerm,p=u.fields,v=u.idField,m=c(e,v);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(v,'"'));if(this._idToShortId.has(m))throw new Error("MiniSearch: duplicate ID ".concat(m));var d=this.addDocumentId(m);this.saveStoredFields(d,e);try{for(var b=Ye(p),y=b.next();!y.done;y=b.next()){var g=y.value,w=c(e,g);if(w!=null){var A=f(w.toString(),g),S=this._fieldIds[g],M=new Set(A).size;this.addFieldLength(d,S,this._documentCount-1,M);try{for(var F=(r=void 0,Ye(A)),R=F.next();!R.done;R=F.next()){var T=R.value,P=h(T,g);if(Array.isArray(P))try{for(var _=(o=void 0,Ye(P)),E=_.next();!E.done;E=_.next()){var C=E.value;this.addTerm(S,d,C)}}catch(L){o={error:L}}finally{try{E&&!E.done&&(l=_.return)&&l.call(_)}finally{if(o)throw o.error}}else P&&this.addTerm(S,d,P)}}catch(L){r={error:L}}finally{try{R&&!R.done&&(s=F.return)&&s.call(F)}finally{if(r)throw r.error}}}}}catch(L){t={error:L}}finally{try{y&&!y.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}},n.prototype.addAll=function(e){var t,i;try{for(var r=Ye(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.add(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},n.prototype.addAllAsync=function(e,t){var i=this;t===void 0&&(t={});var r=t.chunkSize,s=r===void 0?10:r,o={chunk:[],promise:Promise.resolve()},l=e.reduce(function(f,h,p){var v=f.chunk,m=f.promise;return v.push(h),(p+1)%s===0?{chunk:[],promise:m.then(function(){return new Promise(function(d){return setTimeout(d,0)})}).then(function(){return i.addAll(v)})}:{chunk:v,promise:m}},o),u=l.chunk,c=l.promise;return c.then(function(){return i.addAll(u)})},n.prototype.remove=function(e){var t,i,r,s,o,l,u=this._options,c=u.tokenize,f=u.processTerm,h=u.extractField,p=u.fields,v=u.idField,m=h(e,v);if(m==null)throw new Error('MiniSearch: document does not have ID field "'.concat(v,'"'));var d=this._idToShortId.get(m);if(d==null)throw new Error("MiniSearch: cannot remove document with ID ".concat(m,": it is not in the index"));try{for(var b=Ye(p),y=b.next();!y.done;y=b.next()){var g=y.value,w=h(e,g);if(w!=null){var A=c(w.toString(),g),S=this._fieldIds[g],M=new Set(A).size;this.removeFieldLength(d,S,this._documentCount,M);try{for(var F=(r=void 0,Ye(A)),R=F.next();!R.done;R=F.next()){var T=R.value,P=f(T,g);if(Array.isArray(P))try{for(var _=(o=void 0,Ye(P)),E=_.next();!E.done;E=_.next()){var C=E.value;this.removeTerm(S,d,C)}}catch(L){o={error:L}}finally{try{E&&!E.done&&(l=_.return)&&l.call(_)}finally{if(o)throw o.error}}else P&&this.removeTerm(S,d,P)}}catch(L){r={error:L}}finally{try{R&&!R.done&&(s=F.return)&&s.call(F)}finally{if(r)throw r.error}}}}}catch(L){t={error:L}}finally{try{y&&!y.done&&(i=b.return)&&i.call(b)}finally{if(t)throw t.error}}this._storedFields.delete(d),this._documentIds.delete(d),this._idToShortId.delete(m),this._fieldLength.delete(d),this._documentCount-=1},n.prototype.removeAll=function(e){var t,i;if(e)try{for(var r=Ye(e),s=r.next();!s.done;s=r.next()){var o=s.value;this.remove(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Sf,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}},n.prototype.discard=function(e){var t=this,i=this._idToShortId.get(e);if(i==null)throw new Error("MiniSearch: cannot discard document with ID ".concat(e,": it is not in the index"));this._idToShortId.delete(e),this._documentIds.delete(i),this._storedFields.delete(i),(this._fieldLength.get(i)||[]).forEach(function(r,s){t.removeFieldLength(i,s,t._documentCount,r)}),this._fieldLength.delete(i),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()},n.prototype.maybeAutoVacuum=function(){if(this._options.autoVacuum!==!1){var e=this._options.autoVacuum,t=e.minDirtFactor,i=e.minDirtCount,r=e.batchSize,s=e.batchWait;this.conditionalVacuum({batchSize:r,batchWait:s},{minDirtCount:i,minDirtFactor:t})}},n.prototype.discardAll=function(e){var t,i,r=this._options.autoVacuum;try{this._options.autoVacuum=!1;try{for(var s=Ye(e),o=s.next();!o.done;o=s.next()){var l=o.value;this.discard(l)}}catch(u){t={error:u}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}}finally{this._options.autoVacuum=r}this.maybeAutoVacuum()},n.prototype.replace=function(e){var t=this._options,i=t.idField,r=t.extractField,s=r(e,i);this.discard(s),this.add(e)},n.prototype.vacuum=function(e){return e===void 0&&(e={}),this.conditionalVacuum(e)},n.prototype.conditionalVacuum=function(e,t){var i=this;return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(function(){var r=i._enqueuedVacuumConditions;return i._enqueuedVacuumConditions=Pf,i.performVacuuming(e,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)},n.prototype.performVacuuming=function(e,t){return $D(this,void 0,void 0,function(){var i,r,s,o,l,u,c,f,h,p,v,m,d,b,y,g,w,A,S,M,F,R,T,P,_;return ZD(this,function(E){switch(E.label){case 0:if(i=this._dirtCount,!this.vacuumConditionsMet(t))return[3,10];r=e.batchSize||Ff.batchSize,s=e.batchWait||Ff.batchWait,o=1,E.label=1;case 1:E.trys.push([1,7,8,9]),l=Ye(this._index),u=l.next(),E.label=2;case 2:if(u.done)return[3,6];c=Ct(u.value,2),f=c[0],h=c[1];try{for(p=(R=void 0,Ye(h)),v=p.next();!v.done;v=p.next()){m=Ct(v.value,2),d=m[0],b=m[1];try{for(y=(P=void 0,Ye(b)),g=y.next();!g.done;g=y.next())w=Ct(g.value,1),A=w[0],!this._documentIds.has(A)&&(b.size<=1?h.delete(d):b.delete(A))}catch(C){P={error:C}}finally{try{g&&!g.done&&(_=y.return)&&_.call(y)}finally{if(P)throw P.error}}}}catch(C){R={error:C}}finally{try{v&&!v.done&&(T=p.return)&&T.call(p)}finally{if(R)throw R.error}}return this._index.get(f).size===0&&this._index.delete(f),o%r!==0?[3,4]:[4,new Promise(function(C){return setTimeout(C,s)})];case 3:E.sent(),E.label=4;case 4:o+=1,E.label=5;case 5:return u=l.next(),[3,2];case 6:return[3,9];case 7:return S=E.sent(),M={error:S},[3,9];case 8:try{u&&!u.done&&(F=l.return)&&F.call(l)}finally{if(M)throw M.error}return[7];case 9:this._dirtCount-=i,E.label=10;case 10:return[4,null];case 11:return E.sent(),this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null,[2]}})})},n.prototype.vacuumConditionsMet=function(e){if(e==null)return!0;var t=e.minDirtCount,i=e.minDirtFactor;return t=t||If.minDirtCount,i=i||If.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=i},Object.defineProperty(n.prototype,"isVacuuming",{get:function(){return this._currentVacuum!=null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtCount",{get:function(){return this._dirtCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dirtFactor",{get:function(){return this._dirtCount/(1+this._documentCount+this._dirtCount)},enumerable:!1,configurable:!0}),n.prototype.has=function(e){return this._idToShortId.has(e)},n.prototype.getStoredFields=function(e){var t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)},n.prototype.search=function(e,t){var i,r;t===void 0&&(t={});var s=this.executeQuery(e,t),o=[];try{for(var l=Ye(s),u=l.next();!u.done;u=l.next()){var c=Ct(u.value,2),f=c[0],h=c[1],p=h.score,v=h.terms,m=h.match,d=v.length||1,b={id:this._documentIds.get(f),score:p*d,terms:Object.keys(m),queryTerms:v,match:m};Object.assign(b,this._storedFields.get(f)),(t.filter==null||t.filter(b))&&o.push(b)}}catch(y){i={error:y}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}return e===n.wildcard&&t.boostDocument==null&&this._options.searchOptions.boostDocument==null||o.sort(Ux),o},n.prototype.autoSuggest=function(e,t){var i,r,s,o;t===void 0&&(t={}),t=lt(lt({},this._options.autoSuggestOptions),t);var l=new Map;try{for(var u=Ye(this.search(e,t)),c=u.next();!c.done;c=u.next()){var f=c.value,h=f.score,p=f.terms,v=p.join(" "),m=l.get(v);m!=null?(m.score+=h,m.count+=1):l.set(v,{score:h,terms:p,count:1})}}catch(S){i={error:S}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}var d=[];try{for(var b=Ye(l),y=b.next();!y.done;y=b.next()){var g=Ct(y.value,2),m=g[0],w=g[1],h=w.score,p=w.terms,A=w.count;d.push({suggestion:m,terms:p,score:h/A})}}catch(S){s={error:S}}finally{try{y&&!y.done&&(o=b.return)&&o.call(b)}finally{if(s)throw s.error}}return d.sort(Ux),d},Object.defineProperty(n.prototype,"documentCount",{get:function(){return this._documentCount},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"termCount",{get:function(){return this._index.size},enumerable:!1,configurable:!0}),n.loadJSON=function(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)},n.getDefault=function(e){if(Rf.hasOwnProperty(e))return Lf(Rf,e);throw new Error('MiniSearch: unknown option "'.concat(e,'"'))},n.loadJS=function(e,t){var i,r,s,o,l,u,c=e.index,f=e.documentCount,h=e.nextId,p=e.documentIds,v=e.fieldIds,m=e.fieldLength,d=e.averageFieldLength,b=e.storedFields,y=e.dirtCount,g=e.serializationVersion;if(g!==1&&g!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");var w=new n(t);w._documentCount=f,w._nextId=h,w._documentIds=Zc(p),w._idToShortId=new Map,w._fieldIds=v,w._fieldLength=Zc(m),w._avgFieldLength=d,w._storedFields=Zc(b),w._dirtCount=y||0,w._index=new Sf;try{for(var A=Ye(w._documentIds),S=A.next();!S.done;S=A.next()){var M=Ct(S.value,2),F=M[0],R=M[1];w._idToShortId.set(R,F)}}catch(D){i={error:D}}finally{try{S&&!S.done&&(r=A.return)&&r.call(A)}finally{if(i)throw i.error}}try{for(var T=Ye(c),P=T.next();!P.done;P=T.next()){var _=Ct(P.value,2),E=_[0],C=_[1],L=new Map;try{for(var I=(l=void 0,Ye(Object.keys(C))),x=I.next();!x.done;x=I.next()){var O=x.value,B=C[O];g===1&&(B=B.ds),L.set(parseInt(O,10),Zc(B))}}catch(D){l={error:D}}finally{try{x&&!x.done&&(u=I.return)&&u.call(I)}finally{if(l)throw l.error}}w._index.set(E,L)}}catch(D){s={error:D}}finally{try{P&&!P.done&&(o=T.return)&&o.call(T)}finally{if(s)throw s.error}}return w},n.prototype.executeQuery=function(e,t){var i=this;if(t===void 0&&(t={}),e===n.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){var r=lt(lt(lt({},t),e),{queries:void 0}),s=e.queries.map(function(b){return i.executeQuery(b,r)});return this.combineResults(s,r.combineWith)}var o=this._options,l=o.tokenize,u=o.processTerm,c=o.searchOptions,f=lt(lt({tokenize:l,processTerm:u},c),t),h=f.tokenize,p=f.processTerm,v=h(e).flatMap(function(b){return p(b)}).filter(function(b){return!!b}),m=v.map(n4(f)),d=m.map(function(b){return i.executeQuerySpec(b,f)});return this.combineResults(d,f.combineWith)},n.prototype.executeQuerySpec=function(e,t){var i,r,s,o,l=lt(lt({},this._options.searchOptions),t),u=(l.fields||this._options.fields).reduce(function(O,B){var D;return lt(lt({},O),(D={},D[B]=Lf(l.boost,B)||1,D))},{}),c=l.boostDocument,f=l.weights,h=l.maxFuzzy,p=l.bm25,v=lt(lt({},kx.weights),f),m=v.fuzzy,d=v.prefix,b=this._index.get(e.term),y=this.termResults(e.term,e.term,1,b,u,c,p),g,w;if(e.prefix&&(g=this._index.atPrefix(e.term)),e.fuzzy){var A=e.fuzzy===!0?.2:e.fuzzy,S=A<1?Math.min(h,Math.round(e.term.length*A)):A;S&&(w=this._index.fuzzyGet(e.term,S))}if(g)try{for(var M=Ye(g),F=M.next();!F.done;F=M.next()){var R=Ct(F.value,2),T=R[0],P=R[1],_=T.length-e.term.length;if(_){w==null||w.delete(T);var E=d*T.length/(T.length+.3*_);this.termResults(e.term,T,E,P,u,c,p,y)}}}catch(O){i={error:O}}finally{try{F&&!F.done&&(r=M.return)&&r.call(M)}finally{if(i)throw i.error}}if(w)try{for(var C=Ye(w.keys()),L=C.next();!L.done;L=C.next()){var T=L.value,I=Ct(w.get(T),2),x=I[0],_=I[1];if(_){var E=m*T.length/(T.length+_);this.termResults(e.term,T,E,x,u,c,p,y)}}}catch(O){s={error:O}}finally{try{L&&!L.done&&(o=C.return)&&o.call(C)}finally{if(s)throw s.error}}return y},n.prototype.executeWildcardQuery=function(e){var t,i,r=new Map,s=lt(lt({},this._options.searchOptions),e);try{for(var o=Ye(this._documentIds),l=o.next();!l.done;l=o.next()){var u=Ct(l.value,2),c=u[0],f=u[1],h=s.boostDocument?s.boostDocument(f,"",this._storedFields.get(c)):1;r.set(c,{score:h,terms:[],match:{}})}}catch(p){t={error:p}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(t)throw t.error}}return r},n.prototype.combineResults=function(e,t){if(t===void 0&&(t=Cf),e.length===0)return new Map;var i=t.toLowerCase();return e.reduce(QD[i])||new Map},n.prototype.toJSON=function(){var e,t,i,r,s=[];try{for(var o=Ye(this._index),l=o.next();!l.done;l=o.next()){var u=Ct(l.value,2),c=u[0],f=u[1],h={};try{for(var p=(i=void 0,Ye(f)),v=p.next();!v.done;v=p.next()){var m=Ct(v.value,2),d=m[0],b=m[1];h[d]=Object.fromEntries(b)}}catch(y){i={error:y}}finally{try{v&&!v.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}s.push([c,h])}}catch(y){e={error:y}}finally{try{l&&!l.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:s,serializationVersion:2}},n.prototype.termResults=function(e,t,i,r,s,o,l,u){var c,f,h,p,v;if(u===void 0&&(u=new Map),r==null)return u;try{for(var m=Ye(Object.keys(s)),d=m.next();!d.done;d=m.next()){var b=d.value,y=s[b],g=this._fieldIds[b],w=r.get(g);if(w!=null){var A=w.size,S=this._avgFieldLength[g];try{for(var M=(h=void 0,Ye(w.keys())),F=M.next();!F.done;F=M.next()){var R=F.value;if(!this._documentIds.has(R)){this.removeTerm(g,R,t),A-=1;continue}var T=o?o(this._documentIds.get(R),t,this._storedFields.get(R)):1;if(T){var P=w.get(R),_=this._fieldLength.get(R)[g],E=t4(P,A,this._documentCount,_,S,l),C=i*y*T*E,L=u.get(R);if(L){L.score+=C,r4(L.terms,e);var I=Lf(L.match,t);I?I.push(b):L.match[t]=[b]}else u.set(R,{score:C,terms:[e],match:(v={},v[t]=[b],v)})}}}catch(x){h={error:x}}finally{try{F&&!F.done&&(p=M.return)&&p.call(M)}finally{if(h)throw h.error}}}}}catch(x){c={error:x}}finally{try{d&&!d.done&&(f=m.return)&&f.call(m)}finally{if(c)throw c.error}}return u},n.prototype.addTerm=function(e,t,i){var r=this._index.fetch(i,Gx),s=r.get(e);if(s==null)s=new Map,s.set(t,1),r.set(e,s);else{var o=s.get(t);s.set(t,(o||0)+1)}},n.prototype.removeTerm=function(e,t,i){if(!this._index.has(i)){this.warnDocumentChanged(t,e,i);return}var r=this._index.fetch(i,Gx),s=r.get(e);s==null||s.get(t)==null?this.warnDocumentChanged(t,e,i):s.get(t)<=1?s.size<=1?r.delete(e):s.delete(t):s.set(t,s.get(t)-1),this._index.get(i).size===0&&this._index.delete(i)},n.prototype.warnDocumentChanged=function(e,t,i){var r,s;try{for(var o=Ye(Object.keys(this._fieldIds)),l=o.next();!l.done;l=o.next()){var u=l.value;if(this._fieldIds[u]===t){this._options.logger("warn","MiniSearch: document with ID ".concat(this._documentIds.get(e),' has changed before removal: term "').concat(i,'" was not present in field "').concat(u,'". Removing a document after it has changed can corrupt the index!'),"version_conflict");return}}}catch(c){r={error:c}}finally{try{l&&!l.done&&(s=o.return)&&s.call(o)}finally{if(r)throw r.error}}},n.prototype.addDocumentId=function(e){var t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t},n.prototype.addFields=function(e){for(var t=0;t<e.length;t++)this._fieldIds[e[t]]=t},n.prototype.addFieldLength=function(e,t,i,r){var s=this._fieldLength.get(e);s==null&&this._fieldLength.set(e,s=[]),s[t]=r;var o=this._avgFieldLength[t]||0,l=o*i+r;this._avgFieldLength[t]=l/(i+1)},n.prototype.removeFieldLength=function(e,t,i,r){if(i===1){this._avgFieldLength[t]=0;return}var s=this._avgFieldLength[t]*i-r;this._avgFieldLength[t]=s/(i-1)},n.prototype.saveStoredFields=function(e,t){var i,r,s=this._options,o=s.storeFields,l=s.extractField;if(!(o==null||o.length===0)){var u=this._storedFields.get(e);u==null&&this._storedFields.set(e,u={});try{for(var c=Ye(o),f=c.next();!f.done;f=c.next()){var h=f.value,p=l(t,h);p!==void 0&&(u[h]=p)}}catch(v){i={error:v}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(i)throw i.error}}}},n.wildcard=Symbol("*"),n}(),Lf=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0},QD=(ka={},ka[Cf]=function(n,e){var t,i;try{for(var r=Ye(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value,l=n.get(o);if(l==null)n.set(o,e.get(o));else{var u=e.get(o),c=u.score,f=u.terms,h=u.match;l.score=l.score+c,l.match=Object.assign(l.match,h),zx(l.terms,f)}}}catch(p){t={error:p}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},ka[Vx]=function(n,e){var t,i,r=new Map;try{for(var s=Ye(e.keys()),o=s.next();!o.done;o=s.next()){var l=o.value,u=n.get(l);if(u!=null){var c=e.get(l),f=c.score,h=c.terms,p=c.match;zx(u.terms,h),r.set(l,{score:u.score+f,terms:u.terms,match:Object.assign(u.match,p)})}}}catch(v){t={error:v}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(t)throw t.error}}return r},ka[KD]=function(n,e){var t,i;try{for(var r=Ye(e.keys()),s=r.next();!s.done;s=r.next()){var o=s.value;n.delete(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}return n},ka),e4={k:1.2,b:.7,d:.5},t4=function(n,e,t,i,r,s){var o=s.k,l=s.b,u=s.d,c=Math.log(1+(t-e+.5)/(e+.5));return c*(u+n*(o+1)/(n+o*(1-l+l*i/r)))},n4=function(n){return function(e,t,i){var r=typeof n.fuzzy=="function"?n.fuzzy(e,t,i):n.fuzzy||!1,s=typeof n.prefix=="function"?n.prefix(e,t,i):n.prefix===!0;return{term:e,fuzzy:r,prefix:s}}},Rf={idField:"id",extractField:function(n,e){return n[e]},tokenize:function(n){return n.split(s4)},processTerm:function(n){return n.toLowerCase()},fields:void 0,searchOptions:void 0,storeFields:[],logger:function(n,e){typeof(console==null?void 0:console[n])=="function"&&console[n](e)},autoVacuum:!0},kx={combineWith:Cf,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:e4},i4={combineWith:Vx,prefix:function(n,e,t){return e===t.length-1}},Ff={batchSize:1e3,batchWait:10},Pf={minDirtFactor:.1,minDirtCount:20},If=lt(lt({},Ff),Pf),r4=function(n,e){n.includes(e)||n.push(e)},zx=function(n,e){var t,i;try{for(var r=Ye(e),s=r.next();!s.done;s=r.next()){var o=s.value;n.includes(o)||n.push(o)}}catch(l){t={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}},Ux=function(n,e){var t=n.score,i=e.score;return i-t},Gx=function(){return new Map},Zc=function(n){var e,t,i=new Map;try{for(var r=Ye(Object.keys(n)),s=r.next();!s.done;s=r.next()){var o=s.value;i.set(parseInt(o,10),n[o])}}catch(l){e={error:l}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return i},s4=/[\n\r -#%-*,-/:;?@[-\]_{}\u00A0\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u3000-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]+/u;class o4{constructor(){this._searchEngine=new qD({fields:["path","name"],storeFields:["path"],tokenize:(e,t)=>e.split(/[\s/]+/)}),this.idMaps={}}addZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.add(o),this.idMaps[t]={path:s,zincObject:e}}removeZincObject(e,t){const i=e.getRegion().getFullPath();let r=e.groupName,s=i?`${i}/${e.groupName}`:e.groupName;r=r.replaceAll('"',""),s=s.replaceAll('"',"");const o={path:s,name:r,id:t};this._searchEngine.remove(o),delete this.idMaps[t]}addRegion(e,t){let i=e.getFullPath(),r=e.getName();i=i.replaceAll('"',""),r=r.replaceAll('"',"");const s={path:i,name:r,id:t};this._searchEngine.add(s),this.idMaps[t]={path:i,zincObject:e}}clearResults(){this._}removeAll(){this._searchEngine.removeAll(),this.idMaps={}}auto_suggest(e){let t=[];e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];t.forEach(o=>{o.id in this.idMaps&&i.push(this.idMaps[o.id].path)});const r=[...new Set(i)],s=[];return r.forEach(o=>s.push({suggestion:'"'+o+'"'})),s}processResults(e,t){const i={regionPath:void 0,label:'Search Results for "'};return Array.isArray(t)?i.label+=",".join(t):i.label+=t,i.label+='"',e.length===1&&(e[0].isRegion?i.regionPath=e[0].getFullPath():e[0].isZincObject&&(i.regionPath=e[0].getRegion().getFullPath(),i.label=e[0].groupName)),i.zincObjects=pD(e),i}search(e){let t;e.length>2&&["'",'"'].includes(e.slice(0,1))?(e=e.replaceAll(e.slice(0,1),""),t=this._searchEngine.search(e,{prefix:!0,combineWith:"AND"})):e.length>1&&(t=this._searchEngine.search(e,{prefix:!0}));const i=[];return t.forEach(r=>{r.id in this.idMaps&&i.push(this.idMaps[r.id].zincObject)}),i}searchTerms(e){let t=[];return e.forEach(i=>{const r=this.search(i);t.push(...r)}),t}searchAndProcessResult(e){let t=[];return Array.isArray(e)?t=this.searchTerms(e):t=this.search(e),this.processResults(t,e)}}const a4=[{id:0,nerve_id:"ILX:0793723",label:"Auriculotemporal nerve","FMA subclasses (in human nerves)":["FMA:53002","FMA:53001"],"subclass labels":["Left auriculotemporal nerve","Right auriculotemporal nerve"]},{id:1,nerve_id:"ILX:0792409",label:"gray communicating ramus of tenth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6895","FMA:6894"],"subclass labels":["Left T10 grey ramus communicans","Right T10 grey ramus communicans"]},{id:2,nerve_id:"UBERON:0011326",label:"superior laryngeal nerve","FMA subclasses (in human nerves)":["FMA:53530","FMA:53536"],"subclass labels":["Right superior laryngeal nerve","Left superior laryngeal nerve"]},{id:3,nerve_id:"ILX:0793220",label:"white communicating ramus of first lumbar spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:4,nerve_id:"ILX:0787082",label:"gray communicating ramus of the first thoracic nerve","FMA subclasses (in human nerves)":["FMA:6082","FMA:6084"],"subclass labels":["Right T1 grey ramus communicans","Left T1 grey ramus communicans"]},{id:5,nerve_id:"ILX:0793809",label:"Clitoral cavernous nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:6,nerve_id:"UBERON:0011096",label:"lacrimal nerve","FMA subclasses (in human nerves)":["FMA:52630","FMA:52629"],"subclass labels":["Left lacrimal nerve","Right lacrimal nerve"]},{id:7,nerve_id:"ILX:0793215",label:"white communicating ramus of ninth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:8,nerve_id:"ILX:0795005",label:"Posterior cutaneous nerve of arm","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:9,nerve_id:"UBERON:0001649",label:"glossopharyngeal nerve","FMA subclasses (in human nerves)":["FMA:50894","FMA:50892"],"subclass labels":[]},{id:10,nerve_id:"UBERON:0022302",label:"short ciliary nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:11,nerve_id:"ILX:0785932",label:"gray communicating ramus of third lumbar nerve","FMA subclasses (in human nerves)":["FMA:65920","FMA:65919"],"subclass labels":["Left L3 grey ramus communicans","Right L3 grey ramus communicans"]},{id:12,nerve_id:"ILX:0738293",label:"Ganglioglomerular nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:13,nerve_id:"ILX:0739298",label:"gray communicating ramus of twelfth thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:14,nerve_id:"UBERON:0001492",label:"radial nerve","FMA subclasses (in human nerves)":["FMA:37070","FMA:37071"],"subclass labels":["Right radial nerve","Left radial nerve"]},{id:15,nerve_id:"ILX:0793214",label:"white communicating ramus of eighth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:16,nerve_id:"UBERON:0018681",label:"lesser splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6957","FMA:6958"],"subclass labels":["Right lesser splanchnic nerve","Left lesser splanchnic nerve"]},{id:17,nerve_id:"ILX:0794476",label:"abdominal branch of vagus nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:18,nerve_id:"ILX:0791105",label:"gray communicating ramus of the second thoracic nerve","FMA subclasses (in human nerves)":["FMA:6122","FMA:6757"],"subclass labels":["Right T2 grey ramus communicans","Left T2 grey ramus communicans"]},{id:19,nerve_id:"ILX:0794853",label:"esophageal vagus trunk","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:20,nerve_id:"ILX:0793210",label:"white communicating ramus of fourth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:21,nerve_id:"UBERON:0001759",label:"vagus nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:22,nerve_id:"UBERON:0009675",label:"chorda tympani branch of facial nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:23,nerve_id:"ILX:0794949",label:"recurrent branch of the median nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:24,nerve_id:"ILX:0789339",label:"Pharyngeal branch of glossopharyngeal nerve","FMA subclasses (in human nerves)":["FMA:53495","FMA:53494"],"subclass labels":["Pharyngeal branch of left glossopharyngeal nerve","Pharyngeal branch of right glossopharyngeal nerve"]},{id:25,nerve_id:"ILX:0793712",label:"Zygomatic nerve","FMA subclasses (in human nerves)":["FMA:52968","FMA:52969"],"subclass labels":["Right zygomatic nerve","Left zygomatic nerve"]},{id:26,nerve_id:"ILX:0788536",label:"gray communicating ramus of fourth lumbar nerve","FMA subclasses (in human nerves)":["FMA:65917","FMA:65918"],"subclass labels":["Right L4 grey ramus communicans","Left L4 grey ramus communicans"]},{id:27,nerve_id:"UBERON:0018680",label:"greater splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6956","FMA:6955"],"subclass labels":["Right greater splanchnic nerve","Left greater splanchnic nerve"]},{id:28,nerve_id:"UBERON:0001322",label:"sciatic nerve","FMA subclasses (in human nerves)":["FMA:22111","FMA:22112"],"subclass labels":["Right sciatic nerve","Left sciatic nerve"]},{id:29,nerve_id:"ILX:0793209",label:"white communicating ramus of third thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:30,nerve_id:"UBERON:0011391",label:"perineal nerve","FMA subclasses (in human nerves)":["FMA:21874","FMA:21873"],"subclass labels":["Left perineal nerve","Right perineal nerve"]},{id:31,nerve_id:"ILX:0788945",label:"gray communicating ramus of the fourth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6759","FMA:6758"],"subclass labels":["Right T4 grey ramus communicans","Left T4 grey ramus communicans"]},{id:32,nerve_id:"ILX:0790497",label:"Gray communicating ramus of cervicothoracic ganglion to first thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:33,nerve_id:"UBERON:0001323",label:"tibial nerve","FMA subclasses (in human nerves)":["FMA:22109","FMA:22110"],"subclass labels":["Right tibial nerve","Left tibial nerve"]},{id:34,nerve_id:"ILX:0794969",label:"deep branch of ulnar nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:35,nerve_id:"ILX:0793227",label:"gray communicating ramus of thirteenth thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:36,nerve_id:"ILX:0793228",label:"gray communicating ramus of first sacral nerve","FMA subclasses (in human nerves)":["FMA:65992","FMA:65991"],"subclass labels":["Left S1 grey ramus communicans","Right S1 grey ramus communicans"]},{id:37,nerve_id:"UBERON:0035111",label:"medial plantar nerve","FMA subclasses (in human nerves)":["FMA:45435","FMA:45434"],"subclass labels":["Left medial plantar nerve","Right medial plantar nerve"]},{id:38,nerve_id:"UBERON:0001780",label:"spinal nerve","FMA subclasses (in human nerves)":["FMA:6117","FMA:6435","FMA:6295","FMA:6422","FMA:6417","FMA:6421","FMA:6038","FMA:6292","FMA:6439","FMA:6313","FMA:6410","FMA:6412","FMA:6088","FMA:6298","FMA:6433","FMA:6411","FMA:6438","FMA:6314","FMA:6291","FMA:6420","FMA:6116","FMA:6413","FMA:6310","FMA:6432","FMA:6305","FMA:6182","FMA:6297","FMA:6436","FMA:6418","FMA:6039","FMA:6089","FMA:6301","FMA:6294","FMA:6303","FMA:6183","FMA:6434","FMA:6429","FMA:6308","FMA:6300","FMA:6430","FMA:6428","FMA:6419","FMA:6437","FMA:6307","FMA:6311","FMA:6431"],"subclass labels":["Left T3 spinal nerve","Left S4 spinal nerve","Left T5 spinal nerve","Left L5 spinal nerve","Right L3 spinal nerve","Right L5 spinal nerve","Right T1 spinal nerve","Left T4 spinal nerve","Left coccygeal spinal nerve","Right T11 spinal nerve","Right L1 spinal nerve","Right L2 spinal nerve","Right T2 spinal nerve","Left T6 spinal nerve","Left S3 spinal nerve","Left L1 spinal nerve","Right coccygeal spinal nerve","Left T11 spinal nerve","Right T4 spinal nerve","Left L4 spinal nerve","Right T3 spinal nerve","Left L2 spinal nerve","Right T10 spinal nerve","Right S3 spinal nerve","Left T8 spinal nerve","Right T12 spinal nerve","Right T6 spinal nerve","Right S5 spinal nerve","Left L3 spinal nerve","Left T1 spinal nerve","Left T2 spinal nerve","Left T7 spinal nerve","Right T5 spinal nerve","Right T8 spinal nerve","Left T12 spinal nerve","Right S4 spinal nerve","Left S1 spinal nerve","Left T9 spinal nerve","Right T7 spinal nerve","Right S2 spinal nerve","Right S1 spinal nerve","Right L4 spinal nerve","Left S5 spinal nerve","Right T9 spinal nerve","Left T10 spinal nerve","Left S2 spinal nerve"]},{id:39,nerve_id:"UBERON:0018683",label:"lumbar splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6924","FMA:6928","FMA:6929","FMA:6931","FMA:6925","FMA:6930","FMA:6927","FMA:6926"],"subclass labels":["Right first lumbar splanchnic nerve","Right third lumbar splanchnic nerve","Left third lumbar splanchnic nerve","Left fourth lumbar splanchnic nerve","Left first lumbar splanchnic nerve","Right fourth lumbar splanchnic nerve","Left second lumbar splanchnic nerve","Right second lumbar splanchnic nerve"]},{id:40,nerve_id:"UBERON:0001643",label:"oculomotor nerve","FMA subclasses (in human nerves)":["FMA:50880","FMA:50879"],"subclass labels":["Left oculomotor nerve","Right oculomotor nerve"]},{id:41,nerve_id:"ILX:0793212",label:"white communicating ramus of sixth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:42,nerve_id:"UBERON:0003724",label:"musculocutaneous nerve","FMA subclasses (in human nerves)":["FMA:37066","FMA:37065"],"subclass labels":["Left musculocutaneous nerve","Right musculocutaneous nerve"]},{id:43,nerve_id:"ILX:0738372",label:"white communicating ramus of first thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:44,nerve_id:"ILX:0793563",label:"splenic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:45,nerve_id:"UBERON:0035526",label:"superficial fibular nerve","FMA subclasses (in human nerves)":["FMA:45363","FMA:45364"],"subclass labels":["Right superficial fibular nerve","Left superficial fibular nerve"]},{id:46,nerve_id:"ILX:0791560",label:"gray communicating ramus of eighth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6891","FMA:6890"],"subclass labels":["Left T8 grey ramus communicans","Right T8 grey ramus communicans"]},{id:47,nerve_id:"ILX:0793827",label:"posterior abdominal vagal trunk","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:48,nerve_id:"ILX:0794141",label:"right cervical vagus nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:49,nerve_id:"ILX:0793714",label:"Mesenteric nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:50,nerve_id:"UBERON:0001964",label:"least splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6960","FMA:6959"],"subclass labels":["Left least splanchnic nerve","Right least splanchnic nerve"]},{id:51,nerve_id:"UBERON:0001267",label:"femoral nerve","FMA subclasses (in human nerves)":["FMA:16499","FMA:16500"],"subclass labels":["Right femoral nerve","Left femoral nerve"]},{id:52,nerve_id:"UBERON:0034984",label:"nerve to quadratus femoris","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:53,nerve_id:"UBERON:0003721",label:"lingual nerve","FMA subclasses (in human nerves)":["FMA:53219","FMA:53220"],"subclass labels":["Right lingual nerve","Left lingual nerve"]},{id:54,nerve_id:"UBERON:0036216",label:"tympanic nerve","FMA subclasses (in human nerves)":["FMA:53481","FMA:53482"],"subclass labels":["Right tympanic nerve","Left tympanic nerve"]},{id:55,nerve_id:"ILX:0793216",label:"white communicating ramus of tenth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:56,nerve_id:"ILX:0793362",label:"White communicating ramus of fourth lumbar anterior ramus","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:57,nerve_id:"ILX:0793561",label:"Internal branch of superior laryngeal nerve","FMA subclasses (in human nerves)":["FMA:53539","FMA:53540"],"subclass labels":["Right internal laryngeal nerve","Left internal laryngeal nerve"]},{id:58,nerve_id:"ILX:0738312",label:"Aortic arch depressor nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:59,nerve_id:"ILX:0793218",label:"white communicating ramus of twelfth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:60,nerve_id:"ILX:0738308",label:"External branch of inferior laryngeal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:61,nerve_id:"ILX:0739299",label:"gray communicating ramus of sixth lumbar nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:62,nerve_id:"ILX:0793559",label:"bladder nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:63,nerve_id:"ILX:0793822",label:"Superior ovarian nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:64,nerve_id:"ILX:0793807",label:"Penile cavernous nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:65,nerve_id:"UBERON:0011390",label:"pudendal nerve","FMA subclasses (in human nerves)":["FMA:21863","FMA:21864"],"subclass labels":["Right pudendal nerve","Left pudendal nerve"]},{id:66,nerve_id:"UBERON:0008810",label:"nasopalatine nerve","FMA subclasses (in human nerves)":["FMA:52799","FMA:52798"],"subclass labels":["Left nasopalatine nerve","Right nasopalatine nerve"]},{id:67,nerve_id:"ILX:0793219",label:"white communicating ramus of thirteenth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:68,nerve_id:"ILX:0793632",label:"lumbar colonic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:69,nerve_id:"ILX:0784439",label:"gray communicating ramus of the fifth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6760","FMA:6761"],"subclass labels":["Left T5 grey ramus communicans","Right T5 grey ramus communicans"]},{id:70,nerve_id:"ILX:0794977",label:"deep branch of radial nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:71,nerve_id:"UBERON:0001884",label:"phrenic nerve","FMA subclasses (in human nerves)":["FMA:6193","FMA:6192"],"subclass labels":["Left phrenic nerve","Right phrenic nerve"]},{id:72,nerve_id:"UBERON:0035110",label:"lateral plantar nerve","FMA subclasses (in human nerves)":["FMA:45450","FMA:45451"],"subclass labels":["Right lateral plantar nerve","Left lateral plantar nerve"]},{id:73,nerve_id:"ILX:0793711",label:"Communicating branch of zygomatic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:74,nerve_id:"ILX:0793560",label:"External branch of superior laryngeal nerve","FMA subclasses (in human nerves)":["FMA:53537","FMA:53538"],"subclass labels":["Right external laryngeal nerve","Left external laryngeal nerve"]},{id:75,nerve_id:"ILX:0738309",label:"Internal branch of inferior laryngeal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:76,nerve_id:"UBERON:0001021",label:"nerve","FMA subclasses (in human nerves)":["FMA:6775","FMA:6894","FMA:6784","FMA:6728","FMA:65325","FMA:21873","FMA:45429","FMA:6844","FMA:53609","FMA:7116","FMA:44770","FMA:8916","FMA:52995","FMA:6071","FMA:45309","FMA:6122","FMA:6892","FMA:6767","FMA:16405","FMA:53560","FMA:6092","FMA:65343","FMA:37066","FMA:8894","FMA:8868","FMA:65341","FMA:53559","FMA:8897","FMA:82956","FMA:20633","FMA:6763","FMA:65339","FMA:8829","FMA:16493","FMA:8817","FMA:8821","FMA:11757","FMA:45456","FMA:45422","FMA:11261","FMA:65388","FMA:6192","FMA:65347","FMA:37068","FMA:65995","FMA:6764","FMA:39081","FMA:45338","FMA:53402","FMA:11210","FMA:52644","FMA:37067","FMA:65313","FMA:11153","FMA:6155","FMA:8797","FMA:53302","FMA:8883","FMA:53067","FMA:52939","FMA:53301","FMA:292889","FMA:45423","FMA:8791","FMA:45380","FMA:11759","FMA:7305","FMA:8830","FMA:78650","FMA:65389","FMA:45387","FMA:8827","FMA:8912","FMA:52941","FMA:6743","FMA:7126","FMA:53485","FMA:16492","FMA:53399","FMA:65337","FMA:11209","FMA:6772","FMA:52726","FMA:6121","FMA:52627","FMA:52974","FMA:53571","FMA:6729","FMA:8729","FMA:53606","FMA:80025","FMA:53481","FMA:53575","FMA:45451","FMA:11218","FMA:22109","FMA:6852","FMA:8909","FMA:11751","FMA:65991","FMA:8836","FMA:65350","FMA:53423","FMA:65569","FMA:65314","FMA:82957","FMA:65438","FMA:39146","FMA:8911","FMA:22111","FMA:65916","FMA:65739","FMA:65917","FMA:6779","FMA:8889","FMA:65924","FMA:65316","FMA:53002","FMA:16887","FMA:53366","FMA:6890","FMA:8790","FMA:6730","FMA:45358","FMA:52716","FMA:53494","FMA:7115","FMA:53561","FMA:78655","FMA:45366","FMA:11219","FMA:11555","FMA:7092","FMA:53220","FMA:45428","FMA:6193","FMA:20604","FMA:45433","FMA:21874","FMA:21875","FMA:53244","FMA:45432","FMA:6770","FMA:52640","FMA:11249","FMA:20630","FMA:53308","FMA:11216","FMA:65399","FMA:78649","FMA:11084","FMA:6897","FMA:53633","FMA:6085","FMA:6851","FMA:45457","FMA:6757","FMA:8732","FMA:8824","FMA:20632","FMA:6137","FMA:52730","FMA:7301","FMA:52699","FMA:53607","FMA:7300","FMA:53576","FMA:44904","FMA:65342","FMA:7127","FMA:6737","FMA:52669","FMA:21876","FMA:45425","FMA:65999","FMA:8728","FMA:21871","FMA:55172","FMA:6149","FMA:45453","FMA:44932","FMA:292832","FMA:6744","FMA:6781","FMA:44769","FMA:45326","FMA:6760","FMA:53634","FMA:53605","FMA:53530","FMA:6821","FMA:52968","FMA:53001","FMA:11552","FMA:45264","FMA:8835","FMA:6888","FMA:55160","FMA:44899","FMA:52979","FMA:45333","FMA:45310","FMA:6084","FMA:11781","FMA:82962","FMA:53280","FMA:52715","FMA:53311","FMA:16491","FMA:21880","FMA:44952","FMA:11687","FMA:11212","FMA:65335","FMA:52940","FMA:6774","FMA:8823","FMA:45388","FMA:6666","FMA:6072","FMA:16886","FMA:53312","FMA:65915","FMA:45357","FMA:11262","FMA:65921","FMA:0328826","FMA:81290","FMA:53279","FMA:11551","FMA:7293","FMA:6677","FMA:11756","FMA:53598","FMA:52732","FMA:44902","FMA:53545","FMA:6740","FMA:53502","FMA:53562","FMA:52700","FMA:7122","FMA:6118","FMA:65918","FMA:8814","FMA:16403","FMA:65346","FMA:6667","FMA:52630","FMA:52629","FMA:8871","FMA:16500","FMA:52725","FMA:6108","FMA:45363","FMA:65340","FMA:8872","FMA:11760","FMA:53604","FMA:11214","FMA:52777","FMA:21864","FMA:53503","FMA:6738","FMA:66000","FMA:6776","FMA:6777","FMA:6765","FMA:6111","FMA:8890","FMA:20607","FMA:52643","FMA:8908","FMA:65437","FMA:6762","FMA:11154","FMA:65344","FMA:52937","FMA:8919","FMA:45354","FMA:6766","FMA:53424","FMA:6145","FMA:65568","FMA:20634","FMA:6732","FMA:8893","FMA:11758","FMA:6889","FMA:11554","FMA:65922","FMA:7118","FMA:16884","FMA:45308","FMA:7290","FMA:6758","FMA:65743","FMA:11063","FMA:16885","FMA:8882","FMA:65286","FMA:291238","FMA:53482","FMA:52976","FMA:11308","FMA:53432","FMA:53540","FMA:45379","FMA:44871","FMA:6714","FMA:82955","FMA:65993","FMA:45452","FMA:52626","FMA:6083","FMA:53582","FMA:65919","FMA:52936","FMA:53506","FMA:8918","FMA:44901","FMA:6073","FMA:65315","FMA:53219","FMA:11194","FMA:6792","FMA:7119","FMA:52785","FMA:7296","FMA:53068","FMA:6845","FMA:52677","FMA:53504","FMA:53548","FMA:52698","FMA:53570","FMA:6771","FMA:7078","FMA:65997","FMA:65338","FMA:52969","FMA:16401","FMA:65416","FMA:6835","FMA:39082","FMA:8726","FMA:45254","FMA:8879","FMA:11250","FMA:53049","FMA:45382","FMA:8795","FMA:53495","FMA:45434","FMA:82963","FMA:0328827","FMA:52656","FMA:82961","FMA:11753","FMA:39147","FMA:45339","FMA:20605","FMA:20631","FMA:8898","FMA:6070","FMA:44892","FMA:16404","FMA:52942","FMA:6082","FMA:8861","FMA:82953","FMA:8808","FMA:8805","FMA:52994","FMA:65348","FMA:55173","FMA:7129","FMA:52674","FMA:44894","FMA:55159","FMA:65327","FMA:37320","FMA:6761","FMA:65349","FMA:11253","FMA:53507","FMA:11213","FMA:7307","FMA:6769","FMA:6759","FMA:55155","FMA:53675","FMA:53599","FMA:65282","FMA:53251","FMA:6731","FMA:11111","FMA:16497","FMA:8878","FMA:11211","FMA:65740","FMA:45367","FMA:53588","FMA:45365","UBERON:0011766","FMA:16502","FMA:6891","FMA:6091","FMA:11018","FMA:6090","FMA:292887","FMA:65401","FMA:65326","FMA:11215","FMA:44735","FMA:8735","FMA:53538","FMA:6849","FMA:53608","FMA:11217","FMA:8860","FMA:6134","FMA:6893","FMA:53534","FMA:45361","FMA:37321","FMA:82734","FMA:22112","FMA:7294","FMA:52987","FMA:65247","FMA:53535","FMA:6895","FMA:52787","FMA:53635","FMA:65920","FMA:55156","FMA:16498","FMA:53569","FMA:6739","FMA:8807","FMA:22110","FMA:81294","FMA:45450","FMA:8922","FMA:8725","FMA:20608","FMA:7308","FMA:65281","FMA:39084","FMA:78656","FMA:6133","FMA:53581","FMA:16494","FMA:53252","FMA:11789","FMA:45364","FMA:65345","FMA:44870","FMA:39083","FMA:45355","FMA:11193","FMA:16400","FMA:81287","FMA:52776","FMA:65747","FMA:8900","UBERON:0011767","FMA:45424","FMA:292830","FMA:44734","FMA:45381","FMA:82960","FMA:0328831","FMA:6689","FMA:7077","FMA:291236","FMA:8886","FMA:276381","FMA:6124","FMA:65336","FMA:65328","FMA:52670","FMA:53537","FMA:53636","FMA:6896","FMA:21879","FMA:8798","FMA:81288","FMA:53542","FMA:45368","FMA:53547","FMA:55157","FMA:65415","FMA:53309","FMA:65744","FMA:53367","FMA:53590","FMA:65923","FMA:53048","FMA:16499","FMA:53610","FMA:44951","FMA:44953","FMA:8832","FMA:45426","FMA:6114","FMA:52799","FMA:11039","FMA:53546","FMA:53589","FMA:8901","FMA:11681","FMA:52639","FMA:8905","FMA:52733","FMA:65992","FMA:52807","FMA:45435","FMA:53484","FMA:52975","FMA:7289","FMA:44905","FMA:37071","FMA:7130","FMA:65996","FMA:6132","FMA:8826","FMA:6741","FMA:11252","FMA:8917","FMA:82954","FMA:6832","FMA:37073","FMA:37074","FMA:44893","FMA:82959","FMA:20635","FMA:6093","FMA:65248","FMA:45362","FMA:52622","FMA:53508","FMA:11755","FMA:82958","FMA:52997","FMA:16501","FMA:65402","FMA:45427","FMA:52803","FMA:16402","FMA:8734","FMA:52784","FMA:45454","FMA:6736","FMA:7304","FMA:6742","FMA:52998","FMA:52804","FMA:11788","FMA:6713","FMA:52623","FMA:53536","FMA:11780","FMA:45334","FMA:52701","FMA:65998","FMA:11092","FMA:6684","FMA:52779","FMA:52778","FMA:78652","FMA:0328830","FMA:6733","FMA:44950","FMA:78653","FMA:45455","FMA:8864","FMA:8833","FMA:8876","FMA:8867","FMA:11752","FMA:53541","FMA:53611","FMA:8904","FMA:6745","FMA:21863","FMA:7297","FMA:52676","FMA:52798","FMA:8818","FMA:82735","FMA:52657","FMA:52786","FMA:6773","FMA:45253","FMA:6127","FMA:45263","FMA:8875","FMA:81295","FMA:11754","FMA:8812","FMA:45311","FMA:53568","FMA:276379","FMA:6842","FMA:8794","FMA:8820","FMA:53572","FMA:53409","FMA:37070","FMA:6119","FMA:53433","FMA:7123","FMA:8811","FMA:65444","FMA:52806","FMA:53245","FMA:65285","FMA:6768","FMA:8731","FMA:11220","FMA:6778","FMA:53509","FMA:55158","FMA:53567","FMA:65994","FMA:53539","FMA:45327","FMA:8865","FMA:44898","FMA:52673","FMA:80026","FMA:52980","FMA:53505","FMA:82952","FMA:21872","FMA:37065","FMA:52988","FMA:8815","FMA:53398","FMA:52729","FMA:81289","FMA:65398","FMA:52977","FMA:8887"],"subclass labels":["Left T9 white ramus communicans","Right T10 grey ramus communicans","Right T4 spinal nerve posterior ramus","Right fourth intercostal nerve","Right anterior interosseous nerve","Right perineal nerve","Left lateral calcaneal branch A of left sural nerve","Right C3 spinal nerve posterior ramus medial branch","Oesophageal branch of left recurrent laryngeal nerve","Anterior branch of lateral cutaneous branch of left third intercostal nerve","Left common plantar digital nerve F","Anterior cutaneous branch of right subcostal nerve","Left superior labial branch of infraorbital nerve","Left T1 spinal nerve posterior ramus","Anterior branch of left obturator nerve","Right T2 grey ramus communicans","Right T9 grey ramus communicans","Left T5 white ramus communicans","Left L3 spinal nerve posterior ramus lateral branch","Communicating branch of left vagus nerve with left glossopharyngeal nerve","Right second intercostal nerve","Right proper palmar digital nerve G","Left musculocutaneous nerve","Anterior cutaneous branch of left ninth intercostal nerve","Posterior branch of lateral cutaneous branch of left sixth intercostal nerve","Right proper palmar digital nerve H","Communicating branch of right vagus nerve with right glossopharyngeal nerve","Anterior branch of lateral cutaneous branch of right ninth intercostal nerve","Right proper plantar digital nerve C","Left genital branch of genitofemoral nerve","Left T6 grey ramus communicans","Right proper palmar digital nerve I","Right T12 spinal nerve posterior ramus","Right ilioinguinal nerve","Right T8 spinal nerve posterior ramus","Left T9 spinal nerve posterior ramus","Right T11 spinal nerve posterior ramus lateral branch","Right proper plantar digital nerve J","Right medial sural cutaneous nerve","Right T6 spinal nerve posterior ramus medial branch","Right lesser occipital nerve","Right phrenic nerve","Right proper palmar digital nerve E","Left median nerve","Right S3 grey ramus communicans","Right T4 white ramus communicans","Right medial cutaneous nerve of forearm","Right posterior femoral cutaneous nerve","Right vestibular nerve","Lateral cutaneous branch of left sixth intercostal nerve","Left supratrochlear nerve","Right median nerve","Anterior branch of right medial cutaneous nerve of forearm","Right T5 spinal nerve posterior ramus medial branch","Anterior cutaneous branch of right third intercostal nerve","Right C6 spinal nerve posterior ramus","Temporal branch of left facial nerve","Anterior cutaneous branch of left eighth intercostal nerve","Right buccal nerve","Right middle superior alveolar nerve","Temporal branch of right facial nerve","Left superficial branch of radial nerve","Left medial sural cutaneous nerve","Left C4 spinal nerve posterior ramus","Left lateral dorsal digital nerve of the third toe","Right T12 spinal nerve posterior ramus lateral branch","Anterior branch of lateral cutaneous branch of left eleventh intercostal nerve","Left T12 spinal nerve posterior ramus","Left anterior supraclavicular nerve","Left lesser occipital nerve","Right deep fibular nerve","Left T11 spinal nerve posterior ramus","Posterior branch of lateral cutaneous branch of left tenth intercostal nerve","Right anterior superior alveolar nerve","Left tenth intercostal nerve","Anterior branch of lateral cutaneous branch of right fourth intercostal nerve","Communicating branch of left glossopharyngeal nerve with auricular branch of left vagus nerve","Left iliohypogastric nerve","Cervical branch of left facial nerve","Right proper palmar digital nerve J","Lateral cutaneous branch of right sixth intercostal nerve","Right T8 white ramus communicans","Left maxillary nerve","Left intercostobrachial nerve","Left tentorial nerve","Right zygomaticotemporal nerve","Communicating branch of right internal laryngeal nerve with right recurrent laryngeal nerve","Left fourth intercostal nerve","Brachial plexus left C7 root","Vagal branch to right carotid body","Right proper plantar digital nerve G","Right tympanic nerve","Left lateral plantar nerve","Lateral cutaneous branch of left tenth intercostal nerve","Right tibial nerve","Left third occipital nerve","Anterior branch of lateral cutaneous branch of left tenth intercostal nerve","Right T8 spinal nerve posterior ramus lateral branch","Right S1 grey ramus communicans","Left L3 spinal nerve posterior ramus","Palmar cutaneous branch of left ulnar nerve","Right greater petrosal nerve","Left subcostal nerve","Anterior branch of left medial cutaneous nerve of forearm","Left proper plantar digital nerve C","Left C3 spinal nerve branch to left supraclavicular nerve","Right posterior cutaneous nerve of forearm","Posterior branch of lateral cutaneous branch of right tenth intercostal nerve","Right sciatic nerve","Left L5 grey ramus communicans","Right C4 spinal nerve posterior ramus medial branch","Right L4 grey ramus communicans","Left T11 white ramus communicans","Posterior branch of lateral cutaneous branch of right eighth intercostal nerve","Left L1 grey ramus communicans","Posterior branch of left medial cutaneous nerve of forearm","Left auriculotemporal nerve","Left L2 white ramus communicans","Marginal mandibular branch of right facial nerve","Right T8 grey ramus communicans","Right C4 spinal nerve posterior ramus","Right fifth intercostal nerve","Left common fibular nerve","Left posterior ethmoidal nerve","Pharyngeal branch of right glossopharyngeal nerve","Anterior branch of lateral cutaneous branch of right third intercostal nerve","Communicating branch of right external laryngeal nerve with right superior cardiac nerve","Right posterior supraclavicular nerve","Left medial dorsal cutaneous nerve","Lateral cutaneous branch of right eleventh intercostal nerve","Posterior branch of lateral cutaneous branch of left subcostal nerve","Anterior cutaneous branch of left second intercostal nerve","Left lingual nerve","Right lateral calcaneal branch A of right sural nerve","Left phrenic nerve","Right hypogastric nerve","Medial calcaneal branch A of left tibial nerve","Left perineal nerve","Right posterior scrotal nerve","Right inferior alveolar nerve","Medial calcaneal branch A of right tibial nerve","Right T7 white ramus communicans","Left frontal nerve","Right T1 spinal nerve posterior ramus medial branch","Right genitofemoral nerve","Zygomatic branch of right facial nerve","Lateral cutaneous branch of left ninth intercostal nerve","Left C2 spinal nerve branch to left great auricular nerve","Right anterior supraclavicular nerve","Lateral cutaneous branch of right fourth intercostal nerve","Left T11 grey ramus communicans","Lingual branch of right vagus nerve","Left T1 white ramus communicans","Left C3 spinal nerve posterior ramus medial branch","Left proper plantar digital nerve J","Left T2 grey ramus communicans","Brachial plexus left C6 root","Left T10 spinal nerve posterior ramus","Right genital branch of genitofemoral nerve","Anterior cutaneous branch of right first intercostal nerve","Left middle meningeal nerve","Anterior cutaneous branch of left eleventh intercostal nerve","Left infratrochlear nerve","Vagal branch to left carotid body","Anterior cutaneous branch of right eleventh intercostal nerve","Right proper palmar digital nerve B","Left proper palmar digital nerve H","Anterior branch of lateral cutaneous branch of left fourth intercostal nerve","Left seventh intercostal nerve","Right nasociliary nerve","Left posterior scrotal nerve","Left sural nerve","Right S5 grey ramus communicans","Brachial plexus right C7 root","Right inferior rectal nerve","Right transverse cervical nerve","Anterior cutaneous branch of left third intercostal nerve","Left proper plantar digital nerve H","Superficial branch of left ulnar nerve","Dorsal branch of left ulnar nerve","Right eleventh intercostal nerve","Right T2 white ramus communicans","Right common plantar digital nerve F","Infrapatellar branch of right saphenous nerve","Left T5 grey ramus communicans","Lingual branch of left vagus nerve","Thoracic cardiac branch of left vagus nerve","Right superior laryngeal nerve","Right C2 spinal nerve posterior ramus","Right zygomatic nerve","Right auriculotemporal nerve","Anterior branch of lateral cutaneous branch of left subcostal nerve","Left saphenous nerve","Right L3 spinal nerve posterior ramus","Right T7 grey ramus communicans","Left great auricular nerve posterior branch","Left proper palmar digital nerve A","Right infraorbital nerve","Cutaneous branch of right obturator nerve","Posterior branch of right obturator nerve","Left T1 grey ramus communicans","Right T12 white ramus communicans","Right proper plantar digital nerve F","Left posterior auricular nerve","Right posterior ethmoidal nerve","Buccal branch of right facial nerve","Right iliohypogastric nerve","Left dorsal nerve of penis","Right inferior lateral cutaneous nerve of arm","Left T7 spinal nerve posterior ramus lateral branch","Lateral cutaneous branch of left seventh intercostal nerve","Right posterior interosseous nerve","Left middle superior alveolar nerve","Right T9 white ramus communicans","Right T10 spinal nerve posterior ramus","Left deep fibular nerve","Hepatic branch of anterior vagal trunk","Left first intercostal nerve","Right L2 white ramus communicans","Buccal branch of left facial nerve","Right L5 grey ramus communicans","Right common fibular nerve","Left T6 spinal nerve posterior ramus medial branch","Right L2 grey ramus communicans","Right deep petrosal nerve","Left axillary nerve posterior branch","Right posterior auricular nerve","Anterior branch of lateral cutaneous branch of right subcostal nerve","Anterior branch of lateral cutaneous branch of right fifth intercostal nerve","Pyloric branch of greater posterior gastric nerve","Left T10 spinal nerve posterior ramus lateral branch","Superior cervical cardiac branch of right vagus nerve","Ganglionic branch of right maxillary nerve to pterygopalatine ganglion","Left proper palmar digital nerve C","Right superior cervical cardiac nerve","Right ninth intercostal nerve","Right lesser petrosal nerve","Communicating branch of left external laryngeal nerve with left superior cardiac nerve","Right long ciliary nerve B","Anterior cutaneous branch of right fourth intercostal nerve","Right third intercostal nerve","Left L4 grey ramus communicans","Right T7 spinal nerve posterior ramus","Left L2 spinal nerve posterior ramus lateral branch","Left proper palmar digital nerve F","Coeliac branch of posterior vagal trunk","Left lacrimal nerve","Right lacrimal nerve","Anterior cutaneous branch of right seventh intercostal nerve","Left femoral nerve","Right maxillary nerve","Lateral cutaneous branch of right third intercostal nerve","Right superficial fibular nerve","Left proper palmar digital nerve I","Anterior cutaneous branch of left seventh intercostal nerve","Left T12 spinal nerve posterior ramus lateral branch","Thoracic cardiac branch of right vagus nerve","Lateral cutaneous branch of left eighth intercostal nerve","Orbital branch of left maxillary nerve to left ethmoidal sinus","Left pudendal nerve","Left lesser petrosal nerve","Right eighth intercostal nerve","Left S5 grey ramus communicans","Right T10 white ramus communicans","Left T10 white ramus communicans","Left T4 white ramus communicans","Lateral cutaneous branch of left third intercostal nerve","Posterior branch of lateral cutaneous branch of left eighth intercostal nerve","Lateral cutaneous branch of right iliohypogastric nerve","Right supratrochlear nerve","Anterior branch of lateral cutaneous branch of right tenth intercostal nerve","Right C3 spinal nerve branch to right supraclavicular nerve","Right T6 grey ramus communicans","Left T5 spinal nerve posterior ramus medial branch","Left proper palmar digital nerve G","Left posterior superior alveolar nerve","Lateral cutaneous branch of left subcostal nerve","Gluteal branch A of right posterior femoral cutaneous nerve","Right T5 white ramus communicans","Left greater petrosal nerve","Left T3 spinal nerve posterior ramus","Right subcostal nerve","Right femoral branch of genitofemoral nerve","Right sixth intercostal nerve","Anterior cutaneous branch of right ninth intercostal nerve","Left T11 spinal nerve posterior ramus lateral branch","Left T7 grey ramus communicans","Posterior branch of lateral cutaneous branch of right subcostal nerve","Left L2 grey ramus communicans","Posterior branch of lateral cutaneous branch of right third intercostal nerve","Right L1 white ramus communicans","Anterior branch of right obturator nerve","Anterior cutaneous branch of left fifth intercostal nerve","Left T4 grey ramus communicans","Right C5 spinal nerve posterior ramus medial branch","Right T4 spinal nerve posterior ramus medial branch","Left L1 white ramus communicans","Anterior cutaneous branch of right eighth intercostal nerve","Left subclavian nerve","Pericardial branch of left phrenic nerve","Left tympanic nerve","Right zygomaticofacial nerve","Right intercostobrachial nerve","Right cochlear nerve","Left internal laryngeal nerve","Right lateral dorsal digital nerve of the third toe","Left proper palmar digital nerve D","Inferior cervical cardiac branch of left vagus nerve","Left proper plantar digital nerve B","Right S2 grey ramus communicans","Right proper plantar digital nerve H","Right tentorial nerve","Right T1 white ramus communicans","Inferior ramus of left internal laryngeal nerve","Right L3 grey ramus communicans","Right posterior superior alveolar nerve","Tonsillar branch of right glossopharyngeal nerve","Lateral cutaneous branch of right subcostal nerve","Right proper palmar digital nerve C","Right first intercostal nerve","Posterior branch of right medial cutaneous nerve of forearm","Right lingual nerve","Lateral cutaneous branch of right fifth intercostal nerve","Left T4 spinal nerve posterior ramus","Posterior branch of lateral cutaneous branch of left third intercostal nerve","Right posterior superior lateral nasal branch of maxillary nerve","Posterior branch of lateral cutaneous branch of right fifth intercostal nerve","Left buccal nerve","Right third occipital nerve","Left anterior ethmoidal nerve","Right lingual branch of glossopharyngeal nerve","Left laryngopharyngeal branch of superior cervical ganglion","Right infratrochlear nerve","Left external laryngeal nerve branch to pharyngeal plexus","Left T7 white ramus communicans","Left L1 spinal nerve posterior ramus","Right S4 grey ramus communicans","Left proper palmar digital nerve J","Left zygomatic nerve","Left L1 spinal nerve posterior ramus lateral branch","Left greater occipital nerve","Left medial cutaneous nerve of forearm","Brachial plexus left C8 root","Left anterior femoral cutaneous branch A","Posterior branch of lateral cutaneous branch of left seventh intercostal nerve","Left T1 spinal nerve posterior ramus medial branch","Left meningeal branch of mandibular nerve","Left medial dorsal digital nerve of the fourth toe","Left C5 spinal nerve posterior ramus","Pharyngeal branch of left glossopharyngeal nerve","Right medial plantar nerve","Left proper plantar digital nerve F","Left deep petrosal nerve","Right supraorbital nerve","Left proper plantar digital nerve E","Right T9 spinal nerve posterior ramus lateral branch","Left posterior cutaneous nerve of forearm","Left posterior femoral cutaneous nerve","Left hypogastric nerve","Left genitofemoral nerve","Anterior branch of lateral cutaneous branch of left ninth intercostal nerve","Right T1 spinal nerve posterior ramus","Right common palmar digital nerve A","Right L3 spinal nerve posterior ramus lateral branch","Left anterior superior alveolar nerve","Right T1 grey ramus communicans","Anterior cutaneous branch of left sixth intercostal nerve","Left proper plantar digital nerve A","Left T5 spinal nerve posterior ramus","Right T3 spinal nerve posterior ramus","Right superior labial branch of infraorbital nerve","Left proper palmar digital nerve E","Left transverse cervical nerve","Posterior branch of lateral cutaneous branch of right fourth intercostal nerve","Left communicating branch of nasociliary nerve with ciliary ganglion","Superficial branch of right ulnar nerve","Right great auricular nerve posterior branch","Palmar branch of right median nerve","Right ulnar nerve","Right T5 grey ramus communicans","Palmar cutaneous branch of right ulnar nerve","Left T2 spinal nerve posterior ramus medial branch","Tonsillar branch of left glossopharyngeal nerve","Lateral cutaneous branch of right eighth intercostal nerve","Posterior branch of lateral cutaneous branch of right eleventh intercostal nerve","Left T6 white ramus communicans","Right T4 grey ramus communicans","Branch of right vagus nerve to oesophageal nerve plexus","Superior cervical cardiac branch of left vagus nerve","Left long thoracic nerve","Right mental nerve","Left fifth intercostal nerve","Lateral cutaneous branch of left fourth intercostal nerve","Right lateral femoral cutaneous nerve","Posterior branch of lateral cutaneous branch of right seventh intercostal nerve","Lateral cutaneous branch of right seventh intercostal nerve","Left C4 spinal nerve posterior ramus medial branch","Right intermediate dorsal cutaneous nerve","Right medial dorsal cutaneous nerve","Left recurrent laryngeal nerve","Left obturator nerve","Left T8 grey ramus communicans","Right T2 spinal nerve posterior ramus","Right T3 spinal nerve posterior ramus medial branch","Left T2 spinal nerve posterior ramus","Right superficial branch of radial nerve","Right C3 spinal nerve branch to right great auricular nerve","Left anterior interosseous nerve","Lateral cutaneous branch of right ninth intercostal nerve","Left common plantar digital nerve E","Brachial plexus left C5 root","Left external laryngeal nerve","Left C3 spinal nerve posterior ramus","Oesophageal branch of right recurrent laryngeal nerve","Lateral cutaneous branch of right tenth intercostal nerve","Anterior cutaneous branch of right sixth intercostal nerve","Right T3 white ramus communicans","Left T9 grey ramus communicans","Auricular branch of right vagus nerve","Right lateral sural cutaneous nerve","Left ulnar nerve","Right long ciliary nerve A","Left sciatic nerve","Anterior branch of lateral cutaneous branch of left fifth intercostal nerve","Right inferior palpebral branch of infraorbital nerve","Right medial cutaneous nerve of arm","Auricular branch of left vagus nerve","Left T10 grey ramus communicans","Left medial posterior superior nasal nerve","Pharyngeal branch of right vagus nerve to pharyngeal nerve plexus","Left L3 grey ramus communicans","Left lateral femoral cutaneous nerve","Right external laryngeal nerve branch to pharyngeal plexus","Left eighth intercostal nerve","Right T5 spinal nerve posterior ramus","Left tibial nerve","Right superior lateral cutaneous nerve of arm","Right lateral plantar nerve","Anterior cutaneous branch of left first intercostal nerve","Brachial plexus right C8 root","Lateral cutaneous branch of left iliohypogastric nerve","Posterior branch of lateral cutaneous branch of left eleventh intercostal nerve","Right long thoracic nerve","Left lateral cutaneous nerve of forearm","Left posterior supraclavicular nerve","Left T3 grey ramus communicans","Left ilioinguinal nerve","Left mental nerve","Left T12 white ramus communicans","Left superficial fibular nerve","Right proper palmar digital nerve F","Right proper palmar digital nerve D","Right lateral cutaneous nerve of forearm","Gluteal branch A of left posterior femoral cutaneous nerve","Lateral cutaneous branch of left fifth intercostal nerve","Right L1 spinal nerve posterior ramus lateral branch","Right axillary nerve anterior branch","Orbital branch of right maxillary nerve to right ethmoidal sinus","Right C6 spinal nerve posterior ramus medial branch","Posterior branch of lateral cutaneous branch of right ninth intercostal nerve","Right recurrent laryngeal nerve","Right sural nerve","Dorsal branch of right ulnar nerve","Right common plantar digital nerve E","Right medial dorsal digital nerve of the fourth toe","Right proper plantar digital nerve E","Left caroticotympanic nerve","Greater posterior gastric nerve","Right L1 spinal nerve posterior ramus","Pericardial branch of right phrenic nerve","Anterior branch of lateral cutaneous branch of right eighth intercostal nerve","Left incisive branch of inferior alveolar nerve","Right T3 grey ramus communicans","Left posterior interosseous nerve","Palmar branch of left median nerve","Left nasociliary nerve","Right external laryngeal nerve","Pharyngeal branch of left vagus nerve to pharyngeal nerve plexus","Right T11 grey ramus communicans","Right dorsal nerve of penis","Left C6 spinal nerve posterior ramus","Left axillary nerve anterior branch","Meningeal branch of left vagus nerve","Left intermediate dorsal cutaneous nerve","Right laryngopharyngeal branch of superior cervical ganglion","Right great auricular nerve anterior branch","Zygomatic branch of left facial nerve","Left C5 spinal nerve posterior ramus medial branch","Marginal mandibular branch of left facial nerve","Right L1 grey ramus communicans","Right meningeal branch of mandibular nerve","Right femoral nerve","Tracheal branch of right recurrent laryngeal nerve","Left posterior cutaneous nerve of arm","Left inferior lateral cutaneous nerve of arm","Right L2 spinal nerve posterior ramus","Right lateral dorsal cutaneous nerve","Anterior cutaneous branch of right second intercostal nerve","Left nasopalatine nerve","Left T3 spinal nerve posterior ramus medial branch","Left superior cervical cardiac nerve","Posterior branch of lateral cutaneous branch of left ninth intercostal nerve","Right T7 spinal nerve posterior ramus lateral branch","Right frontal nerve","Anterior cutaneous branch of left tenth intercostal nerve","Ganglionic branch of left maxillary nerve to pterygopalatine ganglion","Left S1 grey ramus communicans","Left lesser palatine nerve","Left medial plantar nerve","Communicating branch of right glossopharyngeal nerve with auricular branch of right vagus nerve","Left zygomaticotemporal nerve","Anterior cutaneous branch of right fifth intercostal nerve","Left proper palmar digital nerve B","Left radial nerve","Posterior branch of lateral cutaneous branch of left fourth intercostal nerve","Left S3 grey ramus communicans","Left T3 white ramus communicans","Right T11 spinal nerve posterior ramus","Left ninth intercostal nerve","Right T2 spinal nerve posterior ramus medial branch","Anterior cutaneous branch of left subcostal nerve","Right proper plantar digital nerve B","Left C2 spinal nerve posterior ramus","Right axillary nerve","Left axillary nerve","Left common palmar digital nerve A","Left proper plantar digital nerve D","Left femoral branch of genitofemoral nerve","Left second intercostal nerve","Left medial cutaneous nerve of arm","Left lateral sural cutaneous nerve","Right ophthalmic nerve","Right carotid sinus nerve","Right T10 spinal nerve posterior ramus lateral branch","Right proper plantar digital nerve D","Right mandibular nerve","Right obturator nerve","Left C3 spinal nerve branch to left great auricular nerve","Left lateral dorsal cutaneous nerve","Right greater palatine nerve","Right L2 spinal nerve posterior ramus lateral branch","Brachial plexus right C5 root","Left posterior superior lateral nasal branch of maxillary nerve","Right proper plantar digital nerve I","Right seventh intercostal nerve","Anterior branch of lateral cutaneous branch of right eleventh intercostal nerve","Right tenth intercostal nerve","Left mandibular nerve","Left greater palatine nerve","Left T12 grey ramus communicans","Inferior cervical cardiac branch of right vagus nerve","Left ophthalmic nerve","Left superior laryngeal nerve","Right T12 grey ramus communicans","Cutaneous branch of left obturator nerve","Left long ciliary nerve B","Left S4 grey ramus communicans","Left T4 spinal nerve posterior ramus medial branch","Greater anterior gastric nerve","Orbital branch of left maxillary nerve to left sphenoidal sinus","Orbital branch of right maxillary nerve to right sphenoidal sinus","Right middle supraclavicular nerve","Right caroticotympanic nerve","Left sixth intercostal nerve","Right posterior cutaneous nerve of arm","Left middle supraclavicular nerve","Left proper plantar digital nerve I","Anterior branch of lateral cutaneous branch of right sixth intercostal nerve","Left L2 spinal nerve posterior ramus","Anterior branch of lateral cutaneous branch of left seventh intercostal nerve","Posterior branch of lateral cutaneous branch of right sixth intercostal nerve","Left T8 spinal nerve posterior ramus lateral branch","Meningeal branch of right vagus nerve","Tracheal branch of left recurrent laryngeal nerve","Anterior cutaneous branch of right tenth intercostal nerve","Left eleventh intercostal nerve","Right pudendal nerve","Posterior branch of lateral cutaneous branch of left fifth intercostal nerve","Right anterior ethmoidal nerve","Right nasopalatine nerve","Left T8 spinal nerve posterior ramus","Left long ciliary nerve A","Left supraorbital nerve","Right medial posterior superior nasal nerve","Left T8 white ramus communicans","Right anterior femoral cutaneous branch A","Left T2 white ramus communicans","Right saphenous nerve","Anterior branch of lateral cutaneous branch of right seventh intercostal nerve","Left superior lateral cutaneous nerve of arm","Left T9 spinal nerve posterior ramus lateral branch","Left T6 spinal nerve posterior ramus","Posterior branch of left obturator nerve","Left external laryngeal nerve branch to inferior pharyngeal constrictor","Right incisive branch of inferior alveolar nerve","Right C3 spinal nerve posterior ramus","Right C5 spinal nerve posterior ramus","Right T9 spinal nerve posterior ramus","Communicating branch of left internal laryngeal nerve with left recurrent laryngeal nerve","Left vestibular nerve","Right radial nerve","Left third intercostal nerve","Left cochlear nerve","Anterior cutaneous branch of left fourth intercostal nerve","Right T6 spinal nerve posterior ramus","Right greater occipital nerve","Right lesser palatine nerve","Left inferior alveolar nerve","Right subclavian nerve","Right T6 white ramus communicans","Brachial plexus right C6 root","Lateral cutaneous branch of left eleventh intercostal nerve","Right T11 white ramus communicans","Left carotid sinus nerve","Left great auricular nerve anterior branch","Right external laryngeal nerve branch to inferior pharyngeal constrictor","Left S2 grey ramus communicans","Right internal laryngeal nerve","Infrapatellar branch of left saphenous nerve","Anterior branch of lateral cutaneous branch of left sixth intercostal nerve","Right proper palmar digital nerve A","Right communicating branch of nasociliary nerve with ciliary ganglion","Left proper plantar digital nerve G","Left infraorbital nerve","Left lingual branch of glossopharyngeal nerve","Right proper plantar digital nerve A","Left inferior rectal nerve","Right musculocutaneous nerve","Left inferior palpebral branch of infraorbital nerve","Left T7 spinal nerve posterior ramus","Cervical branch of right facial nerve","Right middle meningeal nerve","Right axillary nerve posterior branch","Right C2 spinal nerve branch to right great auricular nerve","Left zygomaticofacial nerve","Anterior branch of lateral cutaneous branch of left eighth intercostal nerve"]},{id:77,nerve_id:"UBERON:0001647",label:"facial nerve","FMA subclasses (in human nerves)":["FMA:50888","FMA:50889"],"subclass labels":["Right facial nerve","Left facial nerve"]},{id:78,nerve_id:"UBERON:0001148",label:"median nerve","FMA subclasses (in human nerves)":["FMA:37067","FMA:37068"],"subclass labels":["Right median nerve","Left median nerve"]},{id:79,nerve_id:"UBERON:0009009",label:"carotid sinus nerve","FMA subclasses (in human nerves)":["FMA:53508","FMA:53509"],"subclass labels":["Right carotid sinus nerve","Left carotid sinus nerve"]},{id:80,nerve_id:"UBERON:0003715",label:"splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6924","FMA:6928","FMA:6929","FMA:6931","FMA:6930","FMA:6960","FMA:6958","FMA:6959","FMA:6925","FMA:6956","FMA:6927","FMA:6955","FMA:6926","FMA:6957"],"subclass labels":["Right first lumbar splanchnic nerve","Right third lumbar splanchnic nerve","Left third lumbar splanchnic nerve","Left fourth lumbar splanchnic nerve","Right fourth lumbar splanchnic nerve","Left least splanchnic nerve","Left lesser splanchnic nerve","Right least splanchnic nerve","Left first lumbar splanchnic nerve","Right greater splanchnic nerve","Left second lumbar splanchnic nerve","Left greater splanchnic nerve","Right second lumbar splanchnic nerve","Right lesser splanchnic nerve"]},{id:81,nerve_id:"ILX:0793826",label:"anterior abdominal vagal trunk","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:82,nerve_id:"UBERON:0001650",label:"hypoglossal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:83,nerve_id:"ILX:0794967",label:"posterior interosseous nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:84,nerve_id:"ILX:0793713",label:"Deep petrosal nerve","FMA subclasses (in human nerves)":["FMA:0328827","FMA:0328826"],"subclass labels":["Left deep petrosal nerve","Right deep petrosal nerve"]},{id:85,nerve_id:"ILX:0793361",label:"white communicating ramus of third lumbar spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:86,nerve_id:"ILX:0787562",label:"gray communicating ramus of the third thoracic nerve","FMA subclasses (in human nerves)":["FMA:6133","FMA:6124"],"subclass labels":["Left T3 grey ramus communicans","Right T3 grey ramus communicans"]},{id:87,nerve_id:"ILX:0793211",label:"white communicating ramus of fifth thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:88,nerve_id:"UBERON:0018679",label:"thoracic splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6958","FMA:6960","FMA:6955","FMA:6959","FMA:6957","FMA:6956"],"subclass labels":["Left lesser splanchnic nerve","Left least splanchnic nerve","Left greater splanchnic nerve","Right least splanchnic nerve","Right lesser splanchnic nerve","Right greater splanchnic nerve"]},{id:89,nerve_id:"ILX:0731969",label:"least splanchnic nerve","FMA subclasses (in human nerves)":["FMA:6960","FMA:6959"],"subclass labels":["Left least splanchnic nerve","Right least splanchnic nerve"]},{id:90,nerve_id:"ILX:0788771",label:"gray communicating ramus of seventh thoracic nerve","FMA subclasses (in human nerves)":["FMA:6888","FMA:6889"],"subclass labels":["Right T7 grey ramus communicans","Left T7 grey ramus communicans"]},{id:91,nerve_id:"UBERON:0022301",label:"long ciliary nerve","FMA subclasses (in human nerves)":["FMA:52701","FMA:52700","FMA:82734","FMA:82735"],"subclass labels":["Left long ciliary nerve B","Right long ciliary nerve B","Right long ciliary nerve A","Left long ciliary nerve A"]},{id:92,nerve_id:"ILX:0793221",label:"white communicating ramus of second lumbar spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:93,nerve_id:"ILX:0785825",label:"gray communicating ramus of first lumbar nerve","FMA subclasses (in human nerves)":["FMA:65924","FMA:65923"],"subclass labels":["Left L1 grey ramus communicans","Right L1 grey ramus communicans"]},{id:94,nerve_id:"ILX:0793208",label:"white communicating ramus of second thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:95,nerve_id:"UBERON:0018412",label:"vidian nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:96,nerve_id:"ILX:0739303",label:"gray communicating ramus of second thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:97,nerve_id:"ILX:0795006",label:"Suboccipital nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:98,nerve_id:"ILX:0785733",label:"gray communicating ramus of second lumbar nerve","FMA subclasses (in human nerves)":["FMA:65921","FMA:65922"],"subclass labels":["Right L2 grey ramus communicans","Left L2 grey ramus communicans"]},{id:99,nerve_id:"UBERON:0035207",label:"deep fibular nerve","FMA subclasses (in human nerves)":["FMA:45387","FMA:45388"],"subclass labels":["Right deep fibular nerve","Left deep fibular nerve"]},{id:100,nerve_id:"ILX:0739304",label:"gray communicating ramus of third thoracic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:101,nerve_id:"UBERON:0002019",label:"accessory XI nerve","FMA subclasses (in human nerves)":["FMA:50899","FMA:50897"],"subclass labels":["Left accessory nerve","Right accessory nerve"]},{id:102,nerve_id:"ILX:0793217",label:"white communicating ramus of eleventh thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:103,nerve_id:"ILX:0793722",label:"Lesser petrosal nerve","FMA subclasses (in human nerves)":["FMA:53503","FMA:53502"],"subclass labels":["Left lesser petrosal nerve","Right lesser petrosal nerve"]},{id:104,nerve_id:"UBERON:0018675",label:"pelvic splanchnic nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:105,nerve_id:"ILX:0793702",label:"Greater petrosal nerve","FMA subclasses (in human nerves)":["FMA:53423","FMA:53424"],"subclass labels":["Right greater petrosal nerve","Left greater petrosal nerve"]},{id:106,nerve_id:"ILX:0794916",label:"white ramus communicans","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:107,nerve_id:"UBERON:0003716",label:"Recurrent Laryngeal Nerve","FMA subclasses (in human nerves)":["UBERON:0011766","UBERON:0011767"],"subclass labels":["Left recurrent laryngeal nerve","Right recurrent laryngeal nerve"]},{id:108,nerve_id:"UBERON:0005465",label:"obturator nerve","FMA subclasses (in human nerves)":["FMA:16501","FMA:16502"],"subclass labels":["Right obturator nerve","Left obturator nerve"]},{id:109,nerve_id:"ILX:0793213",label:"white communicating ramus of seventh thoracic spinal nerve","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:110,nerve_id:"ILX:0785067",label:"gray communicating ramus of eleventh thoracic nerve","FMA subclasses (in human nerves)":["FMA:6897","FMA:6896"],"subclass labels":["Left T11 grey ramus communicans","Right T11 grey ramus communicans"]},{id:111,nerve_id:"UBERON:0001494",label:"ulnar nerve","FMA subclasses (in human nerves)":["FMA:37320","FMA:37321"],"subclass labels":["Right ulnar nerve","Left ulnar nerve"]},{id:112,nerve_id:"ILX:0794959",label:"posterior rami lower cervical nerves","FMA subclasses (in human nerves)":[],"subclass labels":[]},{id:113,nerve_id:"UBERON:0001493",label:"axillary nerve","FMA subclasses (in human nerves)":["FMA:37074","FMA:37073"],"subclass labels":["Left axillary nerve","Right axillary nerve"]},{id:114,nerve_id:"ILX:0787946",label:"gray communicating ramus of sixth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6762","FMA:6763"],"subclass labels":["Right T6 grey ramus communicans","Left T6 grey ramus communicans"]},{id:115,nerve_id:"ILX:0785542",label:"gray communicating ramus of ninth thoracic nerve","FMA subclasses (in human nerves)":["FMA:6892","FMA:6893"],"subclass labels":["Right T9 grey ramus communicans","Left T9 grey ramus communicans"]}],l4=()=>{const n={};return a4.forEach(e=>{e.nerve_id&&e.label!=="nerve"&&e["subclass labels"].forEach(t=>{t in n||(n[t.toLowerCase()]=e.nerve_id)})}),n},c4=[{label:"urinary bladder",anatomicalId:"UBERON:0001255"},{label:"brainstem",anatomicalId:"UBERON:0002298"},{label:"caecum",anatomicalId:"UBERON:0001153"},{label:"colon",anatomicalId:"UBERON:0001155"},{label:"esophagus",anatomicalId:"UBERON:0001043"},{label:"small intestine",anatomicalId:"UBERON:0002108"},{label:"stomach",anatomicalId:"UBERON:0000945"},{label:"heart",anatomicalId:"UBERON:0000948"},{label:"lung",anatomicalId:"UBERON:0002048"}],u4=()=>{const n={};return c4.forEach(e=>{const t=e.label.toLowerCase();t in n||(n[t.toLowerCase()]=e.anatomicalId)}),n},Hx=l4(),Wx=u4(),d4={name:"ScaffoldVuer",components:{Button:ws,Col:Fn,Loading:ZL,Option:As,Popover:Ml,Radio:dg,RadioGroup:hg,Row:Yn,ScaffoldOverlay:Vg,Select:Ms,Slider:An,TabPane:Ng,Tabs:Og,MapSvgIcon:Of.MapSvgIcon,MapSvgSpriteColor:Of.MapSvgSpriteColor,PrimitiveControls:Cx,ScaffoldTooltip:Rx,ElIconWarningFilled:Hp,ElIconArrowDown:gu,ElIconArrowLeft:ki,DrawToolbar:Ua.DrawToolbar,ScaffoldTreeControls:Lx},setup(n){let e=a.inject("$annotator");return e||(e=a.markRaw(new jx.AnnotationService(`${n.flatmapAPI}annotator`)),a.provide("$annotator",e)),{annotator:e}},props:{annotationSidebar:{type:Boolean,default:!1},url:{type:String,default:""},showColourPicker:{type:Boolean,default:!1},displayUI:{type:Boolean,default:!0},displayAtStartUp:{type:Boolean,default:!0},helpMode:{type:Boolean,default:!1},helpModeActiveItem:{type:Number,default:0},helpModeDialog:{type:Boolean,default:!1},helpModeLastItem:{type:Boolean,default:!1},helpModeInitialIndex:{type:Number,default:0},displayWarning:{type:Boolean,default:!0},warningMessage:{type:String,default:"Beta feature - under active development"},displayLatestChanges:{type:Boolean,default:!1},latestChangesMessage:{type:String,default:"New feature - Local search is now available"},displayMarkers:{type:Boolean,default:!1},markerCluster:{type:Boolean,default:!1},markerLabels:{type:Object,default:function(){return{}}},displayMinimap:{type:Boolean,default:!1},format:{type:String,default:"metadata"},minimapSettings:{type:Object,default:function(){return{x_offset:16,y_offset:16,width:128,height:128,align:"top-right"}}},enableOpenMapUI:{type:Boolean,default:!1},positionalRotation:{type:Boolean,default:!1},isNerves:{type:Object,default:function(){return{regions:["nerves"]}}},openMapOptions:{type:Array,default:function(){return[{display:"Open AC Map",key:"AC"},{display:"Open FC Map",key:"FC"},{display:"Open 3D Human Map",key:"3D"}]}},state:{type:Object,default:void 0},region:{type:String,default:""},viewURL:{type:String,default:""},render:{type:Boolean,default:!0},flatmapAPI:{type:String,default:"https://mapcore-demo.org/current/flatmap/v3/"},showLocalSettings:{type:Boolean,default:!0},showOpenMapButton:{type:Boolean,default:!0},usageConfig:{type:Object,default:function(){return{showTubeLinesControls:!0,tubeLines:!1}}}},provide(){return{flatmapAPI:this.flatmapAPI,scaffoldUrl:this.url,boundingDims:this.boundingDims}},data:function(){return{annotator:void 0,colourRadio:!0,createData:{drawingBox:!1,toBeConfirmed:!1,points:[],shape:"",x:0,y:0,editingIndex:-1,faceIndex:-1,toBeDeleted:!1},currentTime:0,timeVarying:!1,isPlaying:!1,isReady:!1,isTransitioning:!1,tooltipAppendToBody:!1,hoverVisibilities:[{value:!1,ref:"zoomInPopover"},{value:!1,ref:"zoomOutPopover"},{value:!1,ref:"zoomFitPopover"},{value:!1,ref:"openMapPopover"},{value:!1,ref:"settingsPopover"},{value:!1,ref:"sliderPopover"},{value:!1,ref:"regionVisibilityPopover"},{value:!1,ref:"warningPopover"},{value:!1,ref:"whatsNewPopover"},{value:!1,refs:"toolbarPopover",ref:"editPopover"},{value:!1,refs:"toolbarPopover",ref:"pointPopover"},{value:!1,refs:"toolbarPopover",ref:"lineStringPopover"},{value:!1,refs:"toolbarPopover",ref:"deletePopover"}],inHelp:!1,helpModeActiveIndex:this.helpModeInitialIndex,loading:!1,duration:3e3,drawerOpen:!0,currentBackground:"white",availableBackground:["white","lightskyblue","black"],minimisedSlider:!1,sliderPosition:"",timeMax:100,orginalDuration:"",animateDuration:"6secs",playSpeed:[{value:.1,label:"0.1x"},{value:.5,label:"0.5x"},{value:1,label:"1x"},{value:2,label:"2x"},{value:5,label:"5x"},{value:10,label:"10x"}],currentSpeed:1,timeStamps:{},defaultCheckedKeys:[],outlinesRadio:!0,tData:{label:"",region:"",visible:!1,x:200,y:200,active:!1},fileFormat:"metadata",previousMarkerLabels:a.markRaw({}),viewingMode:"Exploration",viewingModes:{Exploration:"View and explore detailed visualization of 3D scaffolds","Neuron Connection":"Discover nerve connections by selecting a nerve and viewing its associated connections",Annotation:["View feature annotations","Add, comment on and view feature annotations"]},openMapRef:void 0,backgroundIconRef:void 0,annotationFeature:{},offlineAnnotationEnabled:!1,offlineAnnotations:a.markRaw([]),authorisedUser:void 0,toolbarOptions:["Delete","Edit","Point","LineString"],existDrawnFeatures:a.markRaw([]),activeDrawTool:void 0,activeDrawMode:void 0,boundingDims:{centre:[0,0,0],size:[1,1,1]},lastSelected:a.markRaw({region:"",group:"",isSearch:!1})}},watch:{format:{handler:function(n){this.fileFormat=n},immediate:!0},url:{handler:function(n){(this.state===void 0||this.state.url===void 0)&&this.setURL(n)},immediate:!0},region:{handler:function(n){this.state||this.viewURL||this.setFocusedRegion(n)},immediate:!0},state:{handler:function(n){this.setState(n)},immediate:!0,deep:!0},viewURL:{handler:function(n){this.updateViewURL(n)},immediate:!0},helpMode:function(n,e){n!==e&&this.setHelpMode(n)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},displayMarkers:function(n){this.$module.scene.displayMarkers=n,this.$module.scene.forcePickableObjectsUpdate=!0},displayMinimap:function(n){this.$module.scene.displayMinimap=n},currentTime:{handler:function(){this.$emit("timeChanged",this.currentTime)}},duration:function(){this.$module.scene.setDuration(this.duration)},minimapSettings:{deep:!0,handler:"updateMinimapScissor"},render:function(n){this.toggleRendering(n)},markerCluster:{handler:function(n){this.$module.scene.enableMarkerCluster(n)},immediate:!0},markerLabels:function(n){for(const[e,t]of Object.entries(this.previousMarkerLabels))this.setMarkerModeForObjectsWithName(e,t,"off");for(const[e,t]of Object.entries(n))this.setMarkerModeForObjectsWithName(e,t,"on");this.previousMarkerLabels=a.markRaw({...n})}},beforeCreate:function(){this.$module=new Px,this.selectedObjects=[],this.hoveredObjects=[],this.currentBackground="white",this._currentURL=void 0,this.availableBackground=["white","black","lightskyblue"],this.$_searchIndex=new o4},mounted:function(){this.openMapRef=a.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=a.shallowRef(this.$refs.backgroundIconRef),this.$refs.scaffoldTreeControls.setModule(this.$module);let n=new UD;n.subscribe(this,this.eventNotifierCallback),this.$module.addNotifier(n),this.$module.addOrganPartAddedCallback(this.zincObjectAdded),this.$module.addOrganPartRemovedCallback(this.zincObjectRemoved),this.$module.initialiseRenderer(this.$refs.display),this.toggleRendering(this.render),this.ro=new ResizeObserver(this.adjustLayout).observe(this.$refs.scaffoldContainer.$el),this.helpTextWait=[],this.helpTextWait.length=this.hoverVisibilities.length,this.defaultRate=this.$module.getPlayRate(),this.$module.zincRenderer.addPreRenderCallbackFunction(()=>{this.currentTime=this.$module.getCurrentTime()}),this.$module.zincRenderer.addContextRestoredCallbackFunction(()=>{this.backgroundChangeCallback(this.currentBackground)})},beforeUnmount:function(){this.ro&&this.ro.disconnect(),this.$module.destroy(),this.$module=void 0},computed:{...Ga.mapStores(xf),...Ga.mapState(xf,["userToken"]),annotationDisplay:function(){return this.viewingMode==="Annotation"&&this.tData.active===!0&&this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"},enableColourPicker:function(){return this.showColourPicker&&this.colourRadio},modeDescription:function(){let n=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.authorisedUser?n[1]:n[0]:n}},methods:{zoomToNerves:function(n,e=!1){if(this.$module.scene){this.$module.setIgnorePicking(e);const t=[];this.$module.scene.getRootRegion().getChildRegions().forEach(r=>{r.getName()==="Nerves"&&e&&n.forEach(o=>{const l=this.findObjectsWithGroupName(o);t.push(...l)})}),this.$module.setSelectedByZincObjects(t,void 0,{},!0),this.$module.scene.viewAll()}},enableAxisDisplay:function(n,e){this.$module.scene&&this.$module.scene.enableAxisDisplay(n,e)},createAxisDisplay:function(n){this.$module.scene&&this.$module.scene.createAxisDisplay(n)},addZincObject:function(n){this.$module.scene&&this.$module.scene.addZincObject(n)},zincObjectAdded:function(n){var r;this.loading=!1,this.$_searchIndex.addZincObject(n,n.uuid),this.timeVarying===!1&&n.isTimeVarying()&&(this.timeVarying=!0);const e=n.groupName.toLowerCase();e in Wx&&n.setAnatomicalId(Wx[e]);const t=n.getGroup();t&&t.position?n.userData.originalPos=[t.position.x,t.position.y,t.position.z]:n.userData.originalPos=[0,0,0];const i=(r=this.isNerves)==null?void 0:r.regions;if(i){const s=n.getRegion().getFullPath().toLowerCase();for(let o=0;o<i.length;o++)s.includes(i[o].toLowerCase())?(n.userData.isNerves=!0,n.userData.defaultColour=`#${n.getColourHex()}`,n.userData.isGreyScale=!1,e in Hx&&n.setAnatomicalId(Hx[e])):n.userData.isNerves=!1}this.calculateBoundingBox(),this.$emit("zinc-object-added",n)},removeFromOfflineAnnotation:function(n,e){for(let t=0;t<this.offlineAnnotations.length;t++){const i=this.offlineAnnotations[t];if(i.region===n&&i.group===e){this.offlineAnnotations.splice(t,1);return}}},zincObjectRemoved:function(n){if(this.$module.scene){const e=n.groupName;n.region.findObjectsWithGroupName(e,!1).length===0&&this.$_searchIndex.removeZincObject(n,n.uuid)}},addRegionsToSearchIndex:function(){this.$module.scene.getRootRegion().getChildRegions(!0).forEach(t=>{this.$_searchIndex.addRegion(t,t.uuid)})},backgroundChangeCallback:function(n){this.currentBackground=n,this.$module.zincRenderer.getThreeJSRenderer().setClearColor(this.currentBackground,1)},captureScreenshotCallback:function(){this.$module.zincRenderer.removePostRenderCallbackFunction(this.captureID);let n=this.$module.zincRenderer.getThreeJSRenderer().domElement.toDataURL("image/png"),e=document.createElement("a");document.body.append(e),this.captureFilename?e.download=this.captureFilename:e.download="screenshot.png",e.href=n,e.click(),e.remove()},captureScreenshot:function(n){this.captureFilename=n,this.captureID=this.$module.zincRenderer.addPostRenderCallbackFunction(this.captureScreenshotCallback)},clearScene:function(){this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.$_searchIndex&&this.$_searchIndex.removeAll(),this.$module.scene&&this.$module.scene.clearAll()},addAndEditAnnotations:function(n,e,t,i){const r=xx(this.annotator,this.userToken,t,n,e,this.url,i);if(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(s=>s.id!==r.item.id)),this.existDrawnFeatures.push(r.feature),this.offlineAnnotationEnabled){r.group=e;let s=n;s.slice(-1)==="/"&&(s=s.slice(0,-1)),r.region=s,this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[];const o=this.offlineAnnotations.find(l=>l.group===r.group&&l.region===r.region&&l.resource===r.resource&&l.feature.geometry.type===r.feature.geometry.type);o?Object.assign(o,r):this.offlineAnnotations.push(r),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))}this.$emit("userPrimitivesUpdated",{region:n,group:e,zincObject:t})},primitivesUpdated:function(n){if(n.isZincObject&&n.isEditable){const e=n.groupName,t=n.region.getFullPath();this.addAndEditAnnotations(t,e,n,"Position Updated")}},confirmCreate:function(n){if(n){let e;if(n.shape==="Point")e=this.$module.scene.createPoints(n.region,n.group,this.createData.points,n.group,8942);else if(n.shape==="LineString")e=this.$module.scene.createLines(n.region,n.group,[this.createData.points[0],this.createData.points[1]],60962);else if(n.editingIndex>-1&&this._editingZincObject){let t;n.editingIndex>-1&&(this.createData.faceIndex>-1?t=this.createData.points[1]:t=this.createData.points[0]),this._editingZincObject.editVertices([t],n.editingIndex);const i=this._editingZincObject.region.getFullPath()+"/",r=this._editingZincObject.groupName;this.addAndEditAnnotations(i,r,this._editingZincObject,"Position Updated")}e&&(this.addAndEditAnnotations(n.region,n.group,e.zincObject,"Create"),e.zincObject.isEditable=!0,this.tData.region=n.region,this.tData.label=n.group,this.changeActiveByName([n.group],n.region,!1))}this.cancelCreate()},cancelCreate:function(){this.changeActiveByName(void 0),this.createData.points.length=0,this.createData.toBeConfirmed=!1,this._editingZincObject=void 0,this.createData.editingIndex=-1,this.createData.faceIndex=-1,this.tData.visible=!1,this.createData.toBeDeleted=!1,this._tempLine&&(this.$module.scene.removeTemporaryPrimitive(this._tempLine),this._tempLine=void 0),this._tempPoint&&(this.$module.scene.removeTemporaryPrimitive(this._tempPoint),this._tempPoint=void 0),this.annotationSidebar&&this.$emit("annotation-close")},confirmComment:function(n){if(this._editingZincObject){let e=n;this._editingZincObject.isEditable&&(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(t=>t.id!==e.item.id)),this.existDrawnFeatures.push(n.feature)),this.offlineAnnotationEnabled&&(e.group=this._editingZincObject.groupName,e.region=this._editingZincObject.region.getFullPath(),this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations.push(e),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations)))}},confirmDelete:function(){var n;if((n=this._editingZincObject)!=null&&n.isEditable){const e=this._editingZincObject.region.getFullPath()+"/",t=this._editingZincObject.groupName,i=xx(this.annotator,this.userToken,this._editingZincObject,e,t,this.url,"Deleted");i&&(this.existDrawnFeatures=a.markRaw(this.existDrawnFeatures.filter(s=>s.id!==i.item.id)),this.$module.scene.getRootRegion().findChildFromPath(e).removeZincObject(this._editingZincObject),this.offlineAnnotationEnabled&&(this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],this.offlineAnnotations=this.offlineAnnotations.filter(s=>s.item.id!==i.item.id),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))))}this.cancelCreate()},onTooltipHide:function(){this.createData.toBeConfirmed&&!this.annotationSidebar&&this.cancelCreate()},formatTooltip(n){if(this.timeMax>=1e3&&n){let e=(n%6e4/1e3).toFixed(2)+"s";return(n>6e4?(n/6e4).toFixed(0)+"m ":"")+e}return n?n.toFixed(2)+" ms":"0 ms"},fitWindow:function(){if(this.$module.scene){let n=!1;this._boundingBoxGeo&&(n=this._boundingBoxGeo.getVisibility(),this._boundingBoxGeo.setVisibility(!1)),this.$module.scene.viewAll(),this._boundingBoxGeo&&(hD(this._boundingBoxGeo,this.$module.scene),this._boundingBoxGeo.setVisibility(n))}},zoomIn:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(-1)},zoomOut:function(){this.$module.scene&&this.$module.scene.changeZoomByScrollRateUnit(1)},speedChanged:function(n){this.currentSpeed=n,this.$module.setPlayRate(this.defaultRate*this.currentSpeed)},stopFreeSpin:function(){this.$module.scene.getZincCameraControls().stopAutoTumble(),this.isTransitioning=!1},findObjectsWithGroupName:function(n){let e=[];return n&&n!=""&&this.$module.scene&&(e=this.$module.scene.findObjectsWithGroupName(n)),e},toggleDrawing:function(n,e){this.createData.toBeDeleted=!1,n==="mode"?(this.cancelCreate(),this.activeDrawMode=e,this.createData.shape="",this.$module.selectObjectOnPick=!0):n==="tool"&&(this.activeDrawTool=e,this.createData.shape=this.activeDrawTool?this.activeDrawTool:"",this.$module.selectObjectOnPick=!1)},toggleDrawingBox:function(){this.createData.drawingBox=!this.createData.drawingBox},viewRegion:function(n){const e=this.$module.scene.getRootRegion(),t=Array.isArray(n)?n:[n],i=Ao(e,t,"",!0);let r=this.$module.scene.getBoundingBoxOfZincObjects(i);if(r){if(this.$module.isSyncControl())this.$module.setSyncControlZoomToBox(r);else{const s=this.$module.scene.camera.far-this.$module.scene.camera.near;this.$module.scene.viewAllWithBoundingBox(r),this.$module.scene.camera.far=this.$module.scene.camera.near+s,this.$module.scene.camera.updateProjectionMatrix()}return!0}return!1},setFocusedRegion:function(n){n&&(this.isReady?this.viewRegion(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({region:n})))},setRotationMode:function(n){this.$module.scene&&this.$module.scene.getZincCameraControls().setRotationMode(n)},updateViewURL:function(n){if(n)if(this.isReady){const e=new URL(n,this.url);this.$module.scene.loadViewURL(e)}else this.$module.setFinishDownloadCallback(this.setURLFinishCallback({viewURL:n}))},createEditTemporaryPoint:function(n){const e=n[0].extraData.worldCoords;if(e&&(this.createData.shape==="Point"||this.createData.editingIndex>-1)&&this.createData.points.length===0)if(this.showRegionTooltipWithAnnotations(n,!0,!1),this.tData.x=50,this.tData.y=200,this._tempPoint){const t=this._tempPoint.geometry.getAttribute("position");t.setXYZ(0,e[0],e[1],e[2]),t.needsUpdate=!0}else this._tempPoint=this.$module.scene.addTemporaryPoints([e],65535)},createEditTemporaryLines:function(n){const e=n[0].extraData.worldCoords;if(e&&(this.createData.shape==="LineString"||this.createData.editingIndex>-1&&this.createData.faceIndex>-1)&&this.createData.points.length===1)if(this.showRegionTooltipWithAnnotations(n,!0,!1),this.tData.x=50,this.tData.y=200,this._tempLine){const t=this._tempLine.geometry.getAttribute("position");t.setXYZ(1,e[0],e[1],e[2]),t.needsUpdate=!0}else this._tempLine=this.$module.scene.addTemporaryLines([this.createData.points[0],e],65535)},createEditTemporaryPrimitive:function(n){this.createData.shape==="LineString"||this.createData.editingIndex>-1&&this.createData.faceIndex>-1?this.createEditTemporaryLines(n):(this.createData.shape==="Point"||this.createData.editingIndex>-1)&&this.createEditTemporaryPoint(n)},draw:function(n){n&&n.length>0&&n[0].data.group&&n[0].extraData.worldCoords&&(this.createData.shape==="LineString"||this.createData.editingIndex>-1&&this.createData.faceIndex>-1?this.drawLine(n[0].extraData.worldCoords,n):(this.createData.shape==="Point"||this.createData.editingIndex>-1&&this.createData.faceIndex===-1)&&this.drawPoint(n[0].extraData.worldCoords,n))},drawPoint:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length=0,this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200,this._tempPoint||(this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960)))},drawLine:function(n,e){this.createData.toBeConfirmed===!1&&(this.createData.points.length===1?(this.createData.points.push(n),this.createData.toBeConfirmed=!0,this.showRegionTooltipWithAnnotations(e,!0,!1),this.tData.x=50,this.tData.y=200):(this._tempPoint=this.$module.scene.addTemporaryPoints([n],16776960),this.createData.points.push(n)))},getRendererInfo:function(){if(this.$module.zincRenderer)return this.$module.zincRenderer.getThreeJSRenderer().info},freeSpin:function(){if(this.$module.scene){let n=this.$module.scene.getZincCameraControls();this.isTransitioning=!0,n.enableAutoTumble(),n.autoTumble([1,0],Math.PI,!0),setTimeout(this.stopFreeSpin,4e3)}},activateEditingMode:function(n){let e=aD(n);e?this.activatePointEditingMode(e.zincObject,e.index,e.point):(e=lD(n),e&&this.activateLineEditingMode(e.zincObject,e.faceIndex,e.vertexIndex,e.point))},activateAnnotationMode:function(n,e){if(this.authorisedUser||this.offlineAnnotationEnabled)if(this.createData.toBeDeleted=!1,this.createData.shape!==""||this.createData.editingIndex>-1)n.length>0&&e.identifiers[0].coords&&(this.createData.x=e.identifiers[0].coords.x,this.createData.y=e.identifiers[0].coords.y,this.draw(e.identifiers));else{if(this.activeDrawMode==="Edit")this.activateEditingMode(e.identifiers);else if(this.activeDrawMode==="Delete"){const t=uD(e);t&&(this.createData.toBeDeleted=!0,this._editingZincObject=t)}this.activeDrawMode!=="Point"&&this.activeDrawMode!=="LineString"?this.showRegionTooltipWithAnnotations(e.identifiers,!0,!1):this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)}else this.showRegionTooltipWithAnnotations(e.identifiers,!0,!0)},activatePointEditingMode:function(n,e,t){this._editingZincObject=n,this.createData.faceIndex=-1,this.createData.editingIndex=e},activateLineEditingMode:function(n,e,t,i){this._editingZincObject=n,this.createData.faceIndex=e,this.createData.editingIndex=t,this.drawLine(i,void 0)},eventNotifierCallback:function(n){if(!(this.createData.toBeConfirmed||this.createData.toBeDeleted)){const e=[];let t=[];(n.eventType==1||n.eventType==2)&&(n.identifiers.forEach(s=>{if(s){let o=s.data.id?s.data.id:s.data.group;e.push(o)}}),t=n.zincObjects);let i,r;if(n.identifiers.length>0&&n.identifiers[0]&&(i=n.identifiers[0].data.id?n.identifiers[0].data.id:n.identifiers[0].data.group,n.identifiers[0].data.region&&(r=n.identifiers[0].data.region)),n.eventType==1)if(this.viewingMode==="Annotation"){this.tData.label=i,this.tData.region=r;const s=cD(n);if(this.createData.editingIndex===-1&&(this._editingZincObject=s),s){const o=this._editingZincObject.region.getFullPath()+"/",l=this._editingZincObject.groupName;this.annotationFeature=bx(this._editingZincObject,o,l,this.url,"").feature}this.activateAnnotationMode(e,n)}else this.$refs.scaffoldTreeControls&&(e.length>0?(this.$refs.scaffoldTreeControls.updateActiveUI(t),this.updatePrimitiveControls(t)):(this.hideRegionTooltip(),this.$refs.scaffoldTreeControls.removeActive(!1))),n.identifiers.length===1?this.lastSelected={isSearch:!1,region:r,group:n.identifiers[0].data.group}:n.identifiers.length===0&&(this.lastSelected={isSearch:!1,region:"",group:""}),this.$emit("scaffold-selected",n.identifiers);else if(n.eventType==2)this.hideRegionTooltip(),this.$refs.scaffoldTreeControls&&(e.length>0?this.$refs.scaffoldTreeControls.updateHoverUI(t):this.$refs.scaffoldTreeControls.removeHover(!0)),n.identifiers.length>0&&n.identifiers[0]&&n.identifiers[0].coords&&(this.tData.active=!1,(this.viewingMode!=="Annotation"||!this.annotationSidebar)&&(this.tData.visible=!0),this.tData.label=i,this.tData.region=r,this.tData.x=n.identifiers[0].coords.x,this.tData.y=n.identifiers[0].coords.y,this.createEditTemporaryPrimitive(n.identifiers)),this.$emit("scaffold-highlighted",n.identifiers);else if(n.eventType==3&&n.identifiers.length>0&&n.identifiers[0]){if(n.identifiers[0].coords){const s=this.$refs.scaffoldContainer.$el.getBoundingClientRect();this.tData.x=n.identifiers[0].coords.x-s.left,this.tData.y=n.identifiers[0].coords.y-s.top}this.createEditTemporaryPrimitive(n.identifiers)}}},getCoordinatesOfSelected:function(){if(this.selectedObjects&&this.selectedObjects.length>0)return this.$module.scene.getObjectsScreenXY(this.selectedObjects)},getDynamicSelectedCoordinates:function(){return this.$module.selectedScreenCoordinates},timeChange:function(n){let e=n/this.timeMax*100;e!=this.currentTime&&this.$module.updateTime(e)},updatePrimitiveControls:function(n){(this.viewingMode==="Exploration"||this.viewingMode==="Annotation")&&(this.selectedObjects=n,this.selectedObjects&&this.selectedObjects.length>0?this.$refs.primitiveControls.setObject(this.selectedObjects[0]):this.$refs.primitiveControls.setObject(void 0))},objectSelected:function(n,e){this.$module.isIgnorePicking()||(this.updatePrimitiveControls(n),this.$module.setSelectedByZincObjects(n,void 0,{},e))},objectHovered:function(n,e){this.hoveredObjects=n,this.$module.setHighlightedByZincObjects(n,void 0,{},e)},changeActiveByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeActive(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeActiveByNames(r,e,t)}},changeHighlightedByName:function(n,e,t){const i=Array.isArray(n);if(n===void 0||i&&n.length===0)this.$refs.scaffoldTreeControls.removeHover(t);else{let r=n;i||(r=[r]),this.$refs.scaffoldTreeControls.changeHoverByNames(r,e,t)}},play:function(n){this.$module.playAnimation(n),this.isPlaying=n},setHelpMode:function(n){const e=this.hoverVisibilities.length,t=e-1,i=this.hoverVisibilities[this.helpModeActiveIndex];if(i){const r=i==null?void 0:i.refs,s=i==null?void 0:i.ref;this.$refs[r||s]||(this.helpModeActiveIndex+=1)}n||(this.helpModeActiveIndex=this.helpModeInitialIndex),n&&this.helpModeActiveIndex>=t&&this.$emit("help-mode-last-item",!0),n&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(r=>{r.value=!0})):n&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1&&setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}),this.showHelpText(this.helpModeActiveIndex,200)},300):(this.inHelp=!1,this.hoverVisibilities.forEach(r=>{r.value=!1}))},displayTooltipOfObjectsCallback:function(n,e,t,i,r){const s=this;return function(){s.$module.zincRenderer.removePostRenderCallbackFunction(s.$_regionTooltipCallback),s.$_regionTooltipCallback=void 0,s.displayTooltipOfObjects(n,e,t,i,r)}},liveUpdateTooltipPosition:function(){this.$module.selectedCenter&&(this.tData.x=this.$module.selectedScreenCoordinates.x,this.tData.y=this.$module.selectedScreenCoordinates.y)},displayTooltipOfObjects:function(n,e,t,i,r){if(e.length>0){let s=e[0].getClosestVertexDOMElementCoords(this.$module.scene);if(s)return s.inView?(n.includes("Search Results for")?this.tData.active=!1:this.tData.active=!0,this.tData.visible=!0,this.tData.label=n,this.tData.x=s.position.x,this.tData.y=s.position.y,this.tData.region=t,this.$_liveCoordinatesUpdated&&(this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),this.$_liveCoordinatesUpdated=void 0),r&&(this.$module.setupLiveCoordinates(e),this.$_liveCoordinatesUpdated=this.$module.zincRenderer.addPostRenderCallbackFunction(this.liveUpdateTooltipPosition))):(this.hideRegionTooltip(),i&&(this.$module.scene.viewAll(),this.$_regionTooltipCallback&&(this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_regionTooltipCallback),this.$module.$_regionTooltipCallback=void 0),this.$_regionTooltipCallback=this.$module.zincRenderer.addPostRenderCallbackFunction(this.displayTooltipOfObjectsCallback(n,e,t,i,r)))),!0}return this.hideRegionTooltip(),!1},showRegionTooltipWithObjects:function(n,e,t,i,r){return n&&e&&e.length>0&&this.$module.scene?this.displayTooltipOfObjects(n,e,t,i,r):(this.hideRegionTooltip(),!1)},showRegionTooltip:function(n,e,t){if(n&&this.$module.scene){const i=this.$module.scene.getRootRegion(),s=Ao(i,[n],"",!0);let o;return s&&s.length>0&&(o=s[0].getRegion().getFullPath()),this.showRegionTooltipWithObjects(n,s,o,e,t)}return this.hideRegionTooltip(),!1},showRegionTooltipWithAnnotations:function(n,e,t){if(this.$module.scene){const i=yx(this.$module.scene,n);if(this._editingZincObject&&(i.regionPath=this._editingZincObject.region.getFullPath()+"/",i.label=this._editingZincObject.groupName),i&&i.objects.length>0)if(this.annotationSidebar){const s=[{featureId:(this.tData.region?this.tData.region+"/":"")+this.tData.label,resourceId:this.url,resource:this.url,feature:this.annotationFeature,offline:this.offlineAnnotationEnabled}];this.$emit("annotation-open",{annotationEntry:s,createData:this.createData,confirmCreate:this.confirmCreate,cancelCreate:this.cancelCreate,confirmDelete:this.confirmDelete,confirmComment:this.confirmComment});return}else return this.showRegionTooltipWithObjects(i.label,i.objects,i.regionPath,e,t)}return this.hideRegionTooltip(),!1},clearAnnotationFeature:function(){const n=this.getOfflineAnnotations();this.existDrawnFeatures.map(t=>decodeURIComponent(t.id).split("/").pop()).forEach(t=>{const i=this.$module.scene.findObjectsWithGroupName(t,!1);if(i&&i.length){const r=i[0].region.getFullPath()+"/";this.$module.scene.getRootRegion().findChildFromPath(r).removeZincObject(i[0])}}),this.$refs.scaffoldTreeControls.removeRegion("__annotation"),this.offlineAnnotations=n},addAnnotationFeature:async function(){let n;if(this.offlineAnnotationEnabled)this.offlineAnnotations=JSON.parse(sessionStorage.getItem("anonymous-annotation"))||[],n=this.offlineAnnotations.filter(e=>e.resource===this.url&&e.feature.properties.drawn).map(e=>e.feature);else{n=[];const e=await wx(this.annotator,this.userToken,this.url);e&&e.features&&(n=[...e.features]);const t=await wx(this.annotator,this.userToken,encodeURIComponent(this.url));t&&t.features&&(n=[...n,...t.features])}this.existDrawnFeatures=a.markRaw(n),Mx(this.$module.scene,n)},changeViewingMode:function(n){let e=!0;this.$module&&(n&&(this.viewingMode=n),this.clearAnnotationFeature(),this.viewingMode==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(t=>{t.name&&t.email&&t.canUpdate?(this.authorisedUser=t,this.offlineAnnotationEnabled=!1):(this.authorisedUser=void 0,this.offlineAnnotationEnabled=!0),this.emitOfflineAnnotationUpdate(),this.addAnnotationFeature(),this.loading=!1})):this.viewingMode==="Exploration"?(this.activeDrawTool=void 0,this.activeDrawMode=void 0,this.createData.shape=""):this.viewingMode==="Neuron Connection"&&(e=!1),this.viewingMode==="Exploration"||this.viewingMode==="Neuron Connection"||this.viewingMode==="Annotation"&&this.createData.shape===""?this.$module.selectObjectOnPick=!0:this.$module.selectObjectOnPick=!1,this.cancelCreate(),n&&this.setObjectIsPickable(e))},emitOfflineAnnotationUpdate:function(){this.$emit("update-offline-annotation-enabled",this.offlineAnnotationEnabled)},forceContextRestore:function(){this.$module.zincRenderer.forceContextRestore()},forceContextLoss:function(){this.$module.zincRenderer.forceContextLoss()},hideRegionTooltip:function(){this.$_liveCoordinatesUpdated&&(this.$module.zincRenderer.removePostRenderCallbackFunction(this.$_liveCoordinatesUpdated),this.$module.setupLiveCoordinates(void 0),this.$_liveCoordinatesUpdated=void 0),this.tData.active=!1,this.tData.visible=!1,this.tData.region=void 0},setObjectIsPickable:function(n){this.$module.scene.getRootRegion().getAllObjects(!0).forEach(t=>{var i;!((i=t.userData)!=null&&i.isNerves)&&!t.anatomicalId&&t.setIsPickable(n)})},setGreyScale:function(n,e=[]){this.$module.scene.getRootRegion().getAllObjects(!0).forEach(i=>{var l;const r=i.groupName.toLowerCase(),s=(l=i.userData)==null?void 0:l.isNerves;(e.length>0&&s&&!e.includes(r)||e.length===0&&!s)&&(i.setGreyScale(n),i.userData.isGreyScale=n)}),this.$refs.scaffoldTreeControls.updateAllNodeColours()},setColour:function(n,e=!1){this.isReady&&this.$module.scene&&typeof n=="boolean"&&(e||n!==this.colourRadio)&&(this.loading=!0,setTimeout(()=>{this.setGreyScale(!n),this.loading=!1,this.colourRadio=n},100))},setOutlines:function(n,e=!1){this.isReady&&this.$module.scene&&typeof n=="boolean"&&(e||n!==this.outlinesRadio)&&(this.outlinesRadio=n,this.$nextTick(()=>this.$refs.scaffoldTreeControls.setOutlines(n)))},setMarkerModeForObjectsWithName:function(n,e,t){if(n&&this.$module.scene){let i=e;typeof e=="number"&&(i={number:e,imgURL:void 0});const r=this.$module.scene.getRootRegion();Ao(r,[n],"",!0).forEach(l=>l.setMarkerMode(t,i))}},setMarkerModeWithAnnotations:function(n,e){if(this.$module.scene){const t=yx(this.$module.scene,n);t&&t.objects.length>0&&t.objects.forEach(i=>i.setMarkerMode(e))}},showHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!0,this.$emit("shown-tooltip")},e))},hideHelpText:function(n,e=500){this.inHelp||(clearTimeout(this.helpTextWait[n]),this.helpTextWait[n]=setTimeout(()=>{this.hoverVisibilities[n].value=!1},e))},search:function(n,e){if(this.$_searchIndex){if(n===void 0||n===""||Array.isArray(n)&&n.length===0)return this.lastSelected={region:"",group:"",isSearch:!0},this.objectSelected([],!0),!1;{this.lastSelected={region:"",group:n,isSearch:!0};const t=this.$_searchIndex.searchAndProcessResult(n),i=t.zincObjects;if(i.length>0){if(this.objectSelected(i,!0),e)for(let r=0;r<i.length;r++)i[r]&&i[r].groupName&&this.showRegionTooltipWithObjects(t.label,i,t.regionPath,!0,!0);return!0}else this.objectSelected([],!0)}}return!1},fetchSuggestions:function(n){return this.$_searchIndex===void 0?[]:this.$_searchIndex.auto_suggest(n)},updateMinimapScissor:function(){Object.keys(this.minimapSettings).forEach(n=>{this.$module.scene.minimapScissor[n]=this.minimapSettings[n]}),this.$module.scene.minimapScissor.updateRequired=!0},updateSettingsfromScene:function(){this.currentSpeed=1,this.$module.setPlayRate(this.defaultRate),this.orginalDuration=this.$module.scene.getMetadataTag("OriginalDuration"),this.animateDuration=this.$module.scene.getMetadataTag("Duration");let n=this.$module.scene.getMetadataTag("TimeStamps");this.timeStamps={};for(const e in n)this.timeStamps[n[e]]=e;this.timeMax=this.$module.scene.getDuration()},restoreSettings:function(n){if(n){if(n.viewport)this.$module.scene.getZincCameraControls().setCurrentCameraSettings(n.viewport);else if(n.viewURL&&n.viewURL!==""){const t=new URL(n.viewURL,this.url);this.$module.scene.loadViewURL(t)}else n.region&&n.region!==""&&this.viewRegion(n.region);n.visibility&&this.$nextTick(()=>{this.$refs.scaffoldTreeControls.setState(n.visibility)}),n.background&&this.backgroundChangeCallback(n.background),"colour"in n&&this.setColour(n.colour),n.offlineAnnotations&&sessionStorage.setItem("anonymous-annotation",n.offlineAnnotations),"outlines"in n&&this.setOutlines(n.outlines),n.viewingMode&&this.changeViewingMode(n.viewingMode);const e=n.search;e&&e.group&&(e.isSearch?this.search(e.group,!0):this.changeActiveByName(e.group,e.region,!0))}},calculateBoundingBox:function(){if(this.isReady){const{centre:n,size:e}=this.$module.getCentreAndSize();this.boundingDims.centre=n,this.boundingDims.size=e}},downloadErrorCallback:function(){return n=>{this.$emit("on-error",n)}},setURLFinishCallback:function(n){return()=>{this.offlineAnnotations.length=0,this.updateSettingsfromScene(),this.$module.updateTime(.01),this.$module.updateTime(0),this.$module.unsetFinishDownloadCallback(),this.addRegionsToSearchIndex(),this.setMarkers(),this._boundingBoxGeo=this.$module.scene.addBoundingBoxPrimitive("_helper","boundingBox",4251856,.15),this._slides=this.$module.scene.addSlicesPrimitive("_helper",["x-plane","y-plane","z-plane"],[16733525,5635925,5592575],.5),this.calculateBoundingBox(),this.isReady=!0,this.$nextTick(()=>{this.restoreSettings(n),this.$emit("on-ready")})}},getState:function(){let n={format:this.fileFormat,url:this._currentURL,viewport:void 0,visibility:void 0,background:this.currentBackground,colour:this.colourRadio,outlines:this.outlinesRadio,viewingMode:this.viewingMode,usageConfig:this.usageConfig};if(this.$refs.scaffoldTreeControls&&(n.visibility=this.$refs.scaffoldTreeControls.getState()),this.$module.scene){let e=this.$module.scene.getZincCameraControls();n.viewport=e.getCurrentViewport()}return this.lastSelected&&this.lastSelected.group&&(n.search={...this.lastSelected}),this.offlineAnnotationEnabled&&(n.offlineAnnotations=sessionStorage.getItem("anonymous-annotation")),n},setState:function(n){n&&(n.url&&n.url!==this._currentURL?this.setURLAndState(n.url,{fileFormat:n.fileFormat,viewport:n.viewport,visibility:n.visibility,background:n.background,colour:n.colour,outlines:n.outlines,viewingMode:n.viewingMode,search:n.search,offlineAnnotations:n.offlineAnnotations}):(n.background||n.colour||n.search||n.outlines||n.viewport||n.viewingMode||n.visibility)&&(this.isReady&&this.$module.scene?this.restoreSettings(n):this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:n.background,colour:n.colour,search:n.search,offlineAnnotations:n.offlineAnnotations,outlines:n.outlines,viewingMode:n.viewingMode,viewport:n.viewport,visibility:n.visibility}))))},exportGLTF:function(n){return this.$module.scene.exportGLTF(n)},getOfflineAnnotations:function(){return[...this.offlineAnnotations]},importOfflineAnnotations:function(n){if(this.offlineAnnotationEnabled){n.forEach(t=>{const i=t.group,r=t.region;let s=r.slice(-1)==="/"?r:r+"/";const o=s.slice(0,-1);t.region=o,s=s+i;const l=s;t.item.id=l,t.feature.id=l});const e=n.map(t=>t.feature);Mx(this.$module.scene,e),n.forEach(t=>{this.offlineAnnotations.push({...t})}),sessionStorage.setItem("anonymous-annotation",JSON.stringify(this.offlineAnnotations))}},setURLAndState:function(n,e){var t,i;if(n!=this._currentURL){const r={};e!=null&&e.format&&(this.fileFormat=e.format),this._currentURL=n,this.$refs.scaffoldTreeControls&&this.$refs.scaffoldTreeControls.clear(),this.loading=!0,this.timeVarying=!1,this.isReady=!1,this.$_searchIndex.removeAll(),this.hideRegionTooltip(),this.$module.setDownloadErrorCallback(this.downloadErrorCallback()),this.$module.setFinishDownloadCallback(this.setURLFinishCallback({background:e==null?void 0:e.background,colour:e==null?void 0:e.colour,outlines:e==null?void 0:e.outlines,region:this.region,search:e==null?void 0:e.search,viewingMode:e==null?void 0:e.viewingMode,viewURL:this.viewURL,viewport:e==null?void 0:e.viewport,visibility:e==null?void 0:e.visibility,offlineAnnotations:e==null?void 0:e.offlineAnnotations})),this.fileFormat==="gltf"?this.$module.loadGLTFFromURL(n,"scene",!0):(((t=this==null?void 0:this.usageConfig)!=null&&t.tubeLines||(i=e==null?void 0:e.usageConfig)!=null&&i.tubeLines)&&(r.tubeLines=!0),this.$module.loadOrgansFromURL(n,void 0,void 0,"scene",void 0,!0,r)),this.$module&&this.$module.scene&&(this.$module.scene.displayMarkers=this.displayMarkers,this.$module.scene.forcePickableObjectsUpdate=!0,this.$module.scene.displayMinimap=this.displayMinimap,this.updateMinimapScissor())}},setURL:function(n){this.setURLAndState(n,void 0)},drawerToggled:function(n){this.drawerOpen=n,this.adjustLayout()},adjustLayout:function(){var n;if((n=this.$refs.scaffoldContainer)!=null&&n.$el){let e=this.$refs.scaffoldContainer.$el.clientWidth;this.minimisedSlider=e<812,this.minimisedSlider?this.sliderPosition=this.drawerOpen?"right":"left":this.sliderPosition=""}},toggleRendering:function(n){this.$module.zincRenderer&&(n?(this.forceContextRestore(),this.$module.zincRenderer.animate()):(this.$module.zincRenderer.stopAnimate(),this.forceContextLoss()))},forceResize:function(){this.$module.zincRenderer&&this.$module.zincRenderer.onWindowResize()},syncControlCallback:function(){const n=this.$module.NDCCameraControl.getPanZoom();this.tData.visible&&this.showRegionTooltip(this.tData.label,!0,!0),this.$emit("scaffold-navigated",n)},toggleSyncControl:function(n,e){this.$module.toggleSyncControl(n,e),this.$module.setSyncControlCallback(this.syncControlCallback)},setMarkers:function(){for(const[n,e]of Object.entries(this.markerLabels))this.setMarkerModeForObjectsWithName(n,e,"on")}}},h4={class:"primitive-controls-box"},f4={class:"animation-data"},p4={class:"purple"},m4={class:"animation-data"},g4={class:"purple"},v4={class:"animation-data"},y4={class:"bottom-right-control control-layer"},b4={class:"control-layer"},x4={style:{"margin-bottom":"2px"}},w4={key:0,class:"viewing-mode-title"},M4=["onClick"],A4=["onClick"];function S4(n,e,t,i,r,s){const o=a.resolveComponent("map-svg-sprite-color"),l=Rx,u=a.resolveComponent("DrawToolbar"),c=Hp,f=ht,h=Ml,p=Lx,v=Cx,m=a.resolveComponent("map-svg-icon"),d=An,b=Yn,y=Ng,g=As,w=Ms,A=Og,S=ws,M=dg,F=hg,R=Vg,T=ed;return a.withDirectives((a.openBlock(),a.createBlock(R,{ref:"scaffoldContainer",class:"scaffold-container","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)",positionalRotation:t.positionalRotation,onOnRotationModeChange:s.setRotationMode},{default:a.withCtx(()=>[a.createVNode(o),a.createVNode(l,{createData:n.createData,label:n.tData.label,region:n.tData.region,visible:n.tData.visible,x:n.tData.x,y:n.tData.y,annotationDisplay:s.annotationDisplay,annotationFeature:n.annotationFeature,offlineAnnotationEnabled:n.offlineAnnotationEnabled,onConfirmCreate:e[0]||(e[0]=P=>s.confirmCreate(P)),onCancelCreate:e[1]||(e[1]=P=>s.cancelCreate()),onConfirmComment:e[2]||(e[2]=P=>s.confirmComment(P)),onConfirmDelete:e[3]||(e[3]=P=>s.confirmDelete()),onTooltipHide:e[4]||(e[4]=P=>s.onTooltipHide())},null,8,["createData","label","region","visible","x","y","annotationDisplay","annotationFeature","offlineAnnotationEnabled"]),a.createElementVNode("div",{id:"organsDisplayArea",ref:"display",tabindex:"-1",style:{height:"100%",width:"100%"},onKeydown:e[5]||(e[5]=a.withKeys((...P)=>s.backgroundChangeCallback&&s.backgroundChangeCallback(...P),["66"]))},null,544),a.withDirectives(a.createElementVNode("div",null,[n.viewingMode==="Annotation"&&(n.authorisedUser||n.offlineAnnotationEnabled)?(a.openBlock(),a.createBlock(u,{key:0,class:"control-layer",toolbarOptions:n.toolbarOptions,activeDrawTool:n.activeDrawTool,activeDrawMode:n.activeDrawMode,hoverVisibilities:n.hoverVisibilities,onClickToolbar:s.toggleDrawing,onShowTooltip:s.showHelpText,onHideTooltip:s.hideHelpText,ref:"toolbarPopover"},null,8,["toolbarOptions","activeDrawTool","activeDrawMode","hoverVisibilities","onClickToolbar","onShowTooltip","onHideTooltip"])):a.createCommentVNode("",!0),t.displayWarning?(a.openBlock(),a.createBlock(h,{key:1,ref:"warningPopover",visible:n.hoverVisibilities[7].value,content:t.warningMessage,placement:"right",width:"max-content",teleported:!1,"popper-class":"scaffold-popper message-popper right-popper non-selectable"},{reference:a.withCtx(()=>[t.displayWarning?(a.openBlock(),a.createElementBlock("div",{key:0,class:"message-icon warning-icon control-layer",onMouseover:e[6]||(e[6]=P=>s.showHelpText(7)),onMouseout:e[7]||(e[7]=P=>s.hideHelpText(7))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),e[31]||(e[31]=a.createElementVNode("span",{class:"message-text"},"Beta",-1))],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),t.displayLatestChanges?(a.openBlock(),a.createBlock(h,{key:2,visible:n.hoverVisibilities[8].value,content:t.latestChangesMessage,placement:"right",teleported:!1,trigger:"manual","popper-class":"scaffold-popper message-popper right-popper non-selectable",ref:"whatsNewPopover"},{reference:a.withCtx(()=>[t.displayLatestChanges&&t.latestChangesMessage?(a.openBlock(),a.createElementBlock("div",{key:0,class:"el-icon-warning message-icon latest-changesicon control-layer",onMouseover:e[8]||(e[8]=P=>s.showHelpText(8)),onMouseout:e[9]||(e[9]=P=>s.hideHelpText(8))},[a.createVNode(f,null,{default:a.withCtx(()=>[a.createVNode(c)]),_:1}),e[32]||(e[32]=a.createElementVNode("span",{class:"message-text"},"What's new?",-1))],32)):a.createCommentVNode("",!0)]),_:1},8,["visible","content"])):a.createCommentVNode("",!0),a.createVNode(h,{visible:n.hoverVisibilities[6].value,content:"Change region visibility",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"regionVisibilityPopover"},{reference:a.withCtx(()=>[a.createVNode(p,{class:"control-layer",ref:"scaffoldTreeControls",isReady:n.isReady,"show-colour-picker":s.enableColourPicker,onObjectSelected:s.objectSelected,onObjectHovered:s.objectHovered,onDrawerToggled:s.drawerToggled},null,8,["isReady","show-colour-picker","onObjectSelected","onObjectHovered","onDrawerToggled"])]),_:1},8,["visible"]),a.createElementVNode("div",h4,[a.createVNode(v,{class:"control-layer",ref:"primitiveControls",createData:n.createData,viewingMode:n.viewingMode,usageConfig:t.usageConfig,onPrimitivesUpdated:s.primitivesUpdated},null,8,["createData","viewingMode","usageConfig","onPrimitivesUpdated"])]),n.timeVarying?(a.openBlock(),a.createBlock(h,{key:3,ref:"sliderPopover",width:"max-content",visible:n.hoverVisibilities[5].value,content:"Move the slider to animate the region",placement:"top",teleported:!1,trigger:"manual","popper-class":"scaffold-popper top-popper non-selectable"},{reference:a.withCtx(()=>[n.timeVarying?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["time-slider-container control-layer",[n.minimisedSlider?"minimised":"",n.sliderPosition]])},[a.createVNode(A,{type:"card"},{default:a.withCtx(()=>[a.createVNode(y,{label:"Animate scaffold"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[n.isPlaying?(a.openBlock(),a.createBlock(m,{key:0,icon:"pause",class:"icon-button video-button",onClick:e[10]||(e[10]=P=>s.play(!1))})):(a.openBlock(),a.createBlock(m,{key:1,icon:"play",class:"video-button icon-button",onClick:e[11]||(e[11]=P=>s.play(!0))})),a.createVNode(d,{min:0,max:n.timeMax,"model-value":n.currentTime/100*n.timeMax,step:.1,"tooltip-class":"time-slider-tooltip",class:"slider","format-tooltip":s.formatTooltip,marks:n.timeStamps,onInput:e[12]||(e[12]=P=>s.timeChange(P))},null,8,["max","model-value","format-tooltip","marks"])]),_:1})]),_:1}),a.createVNode(y,{label:"Animation data"},{default:a.withCtx(()=>[a.createVNode(b,{class:"tab-content"},{default:a.withCtx(()=>[a.createElementVNode("div",f4,[e[33]||(e[33]=a.createTextVNode(" Original duration: ")),a.createElementVNode("div",p4,a.toDisplayString(n.orginalDuration),1)]),a.createElementVNode("div",m4,[e[34]||(e[34]=a.createTextVNode(" Animation duration: ")),a.createElementVNode("div",g4,a.toDisplayString(n.animateDuration),1)]),a.createElementVNode("div",v4,[e[35]||(e[35]=a.createTextVNode(" Playback speed ")),a.createVNode(w,{teleported:!0,"model-value":n.currentSpeed,placeholder:"Select",class:"scaffold-select-box speed","popper-class":"scaffold_viewer_dropdown",onChange:e[13]||(e[13]=P=>s.speedChanged(P))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.playSpeed,P=>(a.openBlock(),a.createBlock(g,{key:P.value,label:P.label,value:P.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})],2)):a.createCommentVNode("",!0)]),_:1},8,["visible"])):a.createCommentVNode("",!0),a.createElementVNode("div",y4,[a.createVNode(h,{visible:n.hoverVisibilities[0].value,content:"Zoom in",width:"max-content",placement:"left",teleported:!1,trigger:"manual","popper-class":"scaffold-popper left-popper non-selectable",ref:"zoomInPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomIn",class:"icon-button zoomIn",onClick:e[14]||(e[14]=P=>s.zoomIn()),onMouseover:e[15]||(e[15]=P=>s.showHelpText(0)),onMouseout:e[16]||(e[16]=P=>s.hideHelpText(0))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[1].value,content:"Zoom out",placement:"top-end",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper popper-zoomout non-selectable",ref:"zoomOutPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"zoomOut",class:"icon-button zoomOut",onClick:e[17]||(e[17]=P=>s.zoomOut()),onMouseover:e[18]||(e[18]=P=>s.showHelpText(1)),onMouseout:e[19]||(e[19]=P=>s.hideHelpText(1))})]),_:1},8,["visible"]),a.createVNode(h,{visible:n.hoverVisibilities[2].value,placement:"top",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper non-selectable",ref:"zoomFitPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{icon:"fitWindow",class:"icon-button fitWindow",onClick:e[20]||(e[20]=P=>s.fitWindow()),onMouseover:e[21]||(e[21]=P=>s.showHelpText(2)),onMouseout:e[22]||(e[22]=P=>s.hideHelpText(2))})]),default:a.withCtx(()=>[e[36]||(e[36]=a.createElementVNode("div",null,[a.createTextVNode(" Fit to "),a.createElementVNode("br"),a.createTextVNode(" window ")],-1))]),_:1},8,["visible"])]),n.openMapRef?(a.openBlock(),a.createBlock(h,{key:4,ref:"open-map-popover","virtual-ref":n.openMapRef,placement:"top-start",width:"128",teleported:!1,trigger:"click","popper-class":"open-map-popper","virtual-triggering":""},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.openMapOptions,P=>(a.openBlock(),a.createBlock(b,{key:P.key},{default:a.withCtx(()=>[a.createVNode(S,{type:"primary",plain:"",onClick:_=>n.$emit("open-map",P.key)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(P.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):a.createCommentVNode("",!0),a.createVNode(h,{ref:"backgroundPopover","virtual-ref":n.backgroundIconRef,placement:"top-start",width:"320",teleported:!1,trigger:"click","popper-class":"background-popper non-selectable h-auto","virtual-triggering":""},{default:a.withCtx(()=>[a.createElementVNode("div",b4,[a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[37]||(e[37]=[a.createTextVNode("Viewing Mode")])),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createElementVNode("div",x4,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.viewingModes,(P,_,E)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:_},[_===n.viewingMode?(a.openBlock(),a.createElementBlock("span",w4,[a.createElementVNode("b",null,a.toDisplayString(_),1)])):(a.openBlock(),a.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:C=>s.changeViewingMode(_)},a.toDisplayString(_),9,M4))],64))),128))]),a.createVNode(b,{class:"viewing-mode-description"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(s.modeDescription),1)]),_:1}),n.viewingMode==="Annotation"&&n.offlineAnnotationEnabled?(a.openBlock(),a.createBlock(b,{key:0,class:"viewing-mode-description"},{default:a.withCtx(()=>e[38]||(e[38]=[a.createTextVNode(" (Anonymous annotate) ")])),_:1})):a.createCommentVNode("",!0)]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[39]||(e[39]=[a.createTextVNode("Organs display")])),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createVNode(F,{modelValue:n.colourRadio,"onUpdate:modelValue":e[23]||(e[23]=P=>n.colourRadio=P),class:"scaffold-radio",onChange:e[24]||(e[24]=P=>s.setColour(n.colourRadio,!0))},{default:a.withCtx(()=>[a.createVNode(M,{value:!0},{default:a.withCtx(()=>e[40]||(e[40]=[a.createTextVNode("Colour")])),_:1}),a.createVNode(M,{value:!1},{default:a.withCtx(()=>e[41]||(e[41]=[a.createTextVNode("Greyscale")])),_:1})]),_:1},8,["modelValue"])]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[42]||(e[42]=[a.createTextVNode("Outlines display")])),_:1}),a.createVNode(b,{class:"backgroundControl"},{default:a.withCtx(()=>[a.createVNode(F,{modelValue:n.outlinesRadio,"onUpdate:modelValue":e[25]||(e[25]=P=>n.outlinesRadio=P),class:"scaffold-radio",onChange:e[26]||(e[26]=P=>s.setOutlines(n.outlinesRadio,!0))},{default:a.withCtx(()=>[a.createVNode(M,{value:!0},{default:a.withCtx(()=>e[43]||(e[43]=[a.createTextVNode("Show")])),_:1}),a.createVNode(M,{value:!1},{default:a.withCtx(()=>e[44]||(e[44]=[a.createTextVNode("Hide")])),_:1})]),_:1},8,["modelValue"])]),_:1}),a.createVNode(b,{class:"backgroundSpacer"}),a.createVNode(b,{class:"backgroundText"},{default:a.withCtx(()=>e[45]||(e[45]=[a.createTextVNode(" Change background ")])),_:1}),a.createVNode(b,{class:"backgroundChooser"},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.availableBackground,P=>(a.openBlock(),a.createElementBlock("div",{key:P,class:a.normalizeClass(["backgroundChoice",P,P==n.currentBackground?"active":""]),onClick:_=>s.backgroundChangeCallback(P)},null,10,A4))),128))]),_:1})])]),_:1},8,["virtual-ref"]),a.createElementVNode("div",{class:a.normalizeClass(["settings-group control-layer",{open:n.drawerOpen,close:!n.drawerOpen}])},[t.showOpenMapButton?(a.openBlock(),a.createBlock(b,{key:0},{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[3].value,content:"Open new map",placement:"right",teleported:!1,trigger:"manual",width:"max-content","popper-class":"scaffold-popper right-popper non-selectable",ref:"openMapPopover"},{reference:a.withCtx(()=>[t.enableOpenMapUI&&t.openMapOptions.length>0?(a.openBlock(),a.createBlock(m,{key:0,ref:"openMapRef",icon:"openMap",class:"icon-button open-map-button",onMouseover:e[27]||(e[27]=P=>s.showHelpText(3)),onMouseout:e[28]||(e[28]=P=>s.hideHelpText(3))},null,512)):a.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1})):a.createCommentVNode("",!0),t.showLocalSettings?(a.openBlock(),a.createBlock(b,{key:1},{default:a.withCtx(()=>[a.createVNode(h,{visible:n.hoverVisibilities[4].value,content:"Change background color",placement:"right",width:"max-content",teleported:!1,trigger:"manual","popper-class":"scaffold-popper right-popper non-selectable",ref:"settingsPopover"},{reference:a.withCtx(()=>[a.createVNode(m,{ref:"backgroundIconRef",icon:"changeBckgd",class:"icon-button",onMouseover:e[29]||(e[29]=P=>s.showHelpText(4)),onMouseout:e[30]||(e[30]=P=>s.hideHelpText(4))},null,512)]),_:1},8,["visible"])]),_:1})):a.createCommentVNode("",!0)],2)],512),[[a.vShow,t.displayUI&&!n.isTransitioning]])]),_:1},8,["positionalRotation","onOnRotationModeChange"])),[[T,n.loading]])}const _4=Kn(d4,[["render",S4],["__scopeId","data-v-2a126135"]]);Ot.ScaffoldVuer=_4,Object.defineProperty(Ot,Symbol.toStringTag,{value:"Module"})});
|