@snabcentr/vue-ui-lib 3.55.2 → 3.55.3

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.
@@ -1,4 +1,4 @@
1
- (function(H,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","ts-case-convert","vue-tel-input"],M):(H=typeof globalThis<"u"?globalThis:H||self,M(H.SC_VueUiLib={},H["lodash-es"],H.Vue,H["naive-ui"],H["@snabcentr/common-lib"],H["date-fns"],H["libphonenumber-js"],H["ts-case-convert"],H["vue-tel-input"]))})(this,(function(H,M,i,L,Z,Hn,sr,Os,Uh){"use strict";var jC=Object.defineProperty;var jh=H=>{throw TypeError(H)};var qC=(H,M,i)=>M in H?jC(H,M,{enumerable:!0,configurable:!0,writable:!0,value:i}):H[M]=i;var C=(H,M,i)=>qC(H,typeof M!="symbol"?M+"":M,i),qh=(H,M,i)=>M.has(H)||jh("Cannot "+i);var $t=(H,M,i)=>(qh(H,M,"read from private field"),i?i.call(H):M.get(H)),Wa=(H,M,i)=>M.has(H)?jh("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(H):M.set(H,i),Xh=(H,M,i,L)=>(qh(H,M,"write to private field"),L?L.call(H,i):M.set(H,i),i);var Bi,dt,As;var Qe=(t=>(t.AttachedUser="attached_user",t.ClientInfo="client_info",t.CreatedAt="created_at",t.DeliveryInfo="delivery_info",t.Id="id",t.SalesDirections="sales_directions",t.Status="status",t))(Qe||{}),Ge=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Ge||{});class ai{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&M.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&ai.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!ai.isVnodeEmpty(e()):!1}}const st=(t,e=!1)=>{const{key:n}=t;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(n)&&!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(n.toLowerCase()))){if(e&&n==="-"){const r=t.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(n)||t.preventDefault()}},qa=(t,e=".",n=!1)=>{const{key:r}=t,s=t.target;["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(r)||(t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(r.toLowerCase())||n&&r==="-"&&!s.value.includes("-")&&((s.selectionStart??0)===0||s.value.length===0)||(r===e||r===(e==="."?",":"."))&&!s.value.includes(e)&&!s.value.includes(e==="."?",":".")||/^\d$/.test(r)||t.preventDefault()},Pt=t=>t?Number.parseFloat(t.replace(",",".")):null,Oe=(t,e)=>{t[e]={}},ze=t=>{const e=t.target;setTimeout(()=>{e.select()},100)};class Mt{static convertReferencesToOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){let l=e.map(c=>({label:o?o(c):c.name,value:c.id,item:c,disabled:a?a(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...s?[{label:"",value:-1,disabled:!0}]:[],...l]:[...s?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(M.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=M.isString(r.key)?M.get(d,r.key):r.key(c),h=M.isString(r.label)?M.get(d,r.label):r.label(c);return{type:"group",label:M.isEmpty(h)?"- Не определено -":h,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Mt.convertReferencesToOptionsList(e,n,r,s,o,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Mt.convertReferencesToOptionsList(e,n,r,s,o,a)}}const Kh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Gh(t,e){return i.openBlock(),i.createElementBlock("svg",Kh,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)])])}const Xa=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Gh}),Zh={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Qh(t,e){return i.openBlock(),i.createElementBlock("svg",Zh,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const Ya=i.markRaw({name:"tabler-edit",render:Qh}),Jh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ef(t,e){return i.openBlock(),i.createElementBlock("svg",Jh,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M258.9 48C141.92 46.42 46.42 141.92 48 258.9c1.56 112.19 92.91 203.54 205.1 205.1c117 1.6 212.48-93.9 210.88-210.88C462.44 140.91 371.09 49.56 258.9 48m-16.79 192.47l51.55-59a16 16 0 0 1 24.1 21.06l-51.55 59a16 16 0 1 1-24.1-21.06m-38.86 90.85a16 16 0 0 1-22.62 0l-47.95-48a16 16 0 1 1 22.64-22.62l48 48a16 16 0 0 1-.07 22.62m176.8-128.79l-111.88 128a16 16 0 0 1-11.51 5.47h-.54a16 16 0 0 1-11.32-4.69l-47.94-48a16 16 0 1 1 22.64-22.62l29.8 29.83a8 8 0 0 0 11.68-.39l95-108.66a16 16 0 0 1 24.1 21.06Z"},null,-1)])])}const Ua=i.markRaw({name:"ion-checkmark-done-circle",render:ef}),tf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function nf(t,e){return i.openBlock(),i.createElementBlock("svg",tf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 192L256.13 320l-47.95-48m-16.23 48L144 272m161.71-80l-51.55 59"},null,-1)])])}const Ka=i.markRaw({name:"ion-checkmark-done-circle-outline",render:nf}),rf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function sf(t,e){return i.openBlock(),i.createElementBlock("svg",rf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M22.15 3.237c-1.93-1.93-5.185-1.403-6.406 1.04l-3.175 6.35a1.5 1.5 0 0 1-.868.752L6.72 13.04a2 2 0 0 0-.782 3.312l4.149 4.149L4 26.586v1.415h1.414l6.086-6.086l4.149 4.149a2 2 0 0 0 3.311-.782l1.661-4.983a1.5 1.5 0 0 1 .752-.867l6.351-3.175c2.442-1.222 2.97-4.476 1.04-6.407zM17.533 5.17a2 2 0 0 1 3.203-.52l6.614 6.614a2 2 0 0 1-.52 3.203l-6.351 3.175a3.5 3.5 0 0 0-1.755 2.024l-1.661 4.982l-9.712-9.711l4.983-1.661a3.5 3.5 0 0 0 2.024-1.755z"},null,-1)])])}const of=i.markRaw({name:"fluent-pin32-regular",render:sf}),af={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lf(t,e){return i.openBlock(),i.createElementBlock("svg",af,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const cf=i.markRaw({name:"ion-eye-outline",render:lf}),df={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function uf(t,e){return i.openBlock(),i.createElementBlock("svg",df,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M15.744 4.276c1.221-2.442 4.476-2.97 6.406-1.04l6.614 6.614c1.93 1.93 1.402 5.186-1.04 6.406l-6.35 3.176a1.5 1.5 0 0 0-.753.867l-1.66 4.983a2 2 0 0 1-3.312.782l-4.149-4.15l-6.086 6.087H4v-1.415l6.086-6.085l-4.149-4.15a2 2 0 0 1 .782-3.31l4.982-1.662a1.5 1.5 0 0 0 .868-.752z"},null,-1)])])}const hf=i.markRaw({name:"fluent-pin32-filled",render:uf}),ff={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function mf(t,e){return i.openBlock(),i.createElementBlock("svg",ff,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48"},null,-1)])])}const gf=i.markRaw({name:"ion-bookmark-outline",render:mf}),pf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function yf(t,e){return i.openBlock(),i.createElementBlock("svg",pf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m63.998 86.005l21.998-21.998L447.999 426.01l-21.998 21.998zM259.34 192.09l60.57 60.57a64.07 64.07 0 0 0-60.57-60.57m-6.68 127.82l-60.57-60.57a64.07 64.07 0 0 0 60.57 60.57"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M256 352a96 96 0 0 1-92.6-121.34l-69.07-69.08C66.12 187.42 39.24 221.14 16 256c26.42 44 62.56 89.24 100.2 115.18C159.38 400.92 206.33 416 255.76 416A233.5 233.5 0 0 0 335 402.2l-53.61-53.6A95.8 95.8 0 0 1 256 352m0-192a96 96 0 0 1 92.6 121.34L419.26 352c29.15-26.25 56.07-61.56 76.74-96c-26.38-43.43-62.9-88.56-101.18-114.82C351.1 111.2 304.31 96 255.76 96a222.9 222.9 0 0 0-78.21 14.29l53.11 53.11A95.8 95.8 0 0 1 256 160"},null,-1)])])}const bf=i.markRaw({name:"ion-eye-off-sharp",render:yf}),_f={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function wf(t,e){return i.openBlock(),i.createElementBlock("svg",_f,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const xf=i.markRaw({name:"ion-chevron-forward-outline",render:wf}),kf=["data-name"],vf={class:"sc-collapse-item-header flex flex-row gap-2.5"},Cf={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},Sf={key:0},Bf={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},Tf={class:"flex flex-1 flex-col"},Rf={key:0,class:"sc-collapse-item-sub-title flex-1"},$f={key:1,class:"sc-collapse-item-title-extra flex-none"},Pf={key:0,class:"sc-collapse-item-content"},Nf={},Ef=i.defineComponent({...Nf,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.inject("itemHeaderClickHandler",M.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=M.some(a,p=>p===r.name),d=i.computed(()=>M.some(l,p=>p===r.name)),u=i.ref(c),h=()=>{r.disabled||(u.value=d.value||!u.value,s("header:click",r.name,u.value),o(r.name,u.value))};return e({expand:()=>{!r.disabled&&!u.value&&(u.value=!0,s("header:click",r.name,u.value),o(r.name,u.value))},toggle:()=>{r.disabled||h()},collapse:()=>{!r.disabled&&u.value&&!d.value&&(u.value=!1,s("header:click",r.name,u.value),o(r.name,u.value))},expanded:i.readonly(u)}),(p,b)=>{const y=xf;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass([{"cursor-not-allowed text-gray-400":t.disabled},"sc-collapse-item flex flex-col p-2"])},[i.createElementVNode("div",vf,[i.createElementVNode("div",Cf,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":u.value}),onClick:h},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(y)],!0)],2)]),i.unref(ai).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",Sf,[i.createElementVNode("div",Bf,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",Tf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(ai).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",Rf,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(ai).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",$f,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||u.value?(i.openBlock(),i.createElementBlock("div",Pf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,kf)}}}),Wn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},Ga=Wn(Ef,[["__scopeId","data-v-f1311d1c"]]),Ff={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Af(t,e){return i.openBlock(),i.createElementBlock("svg",Ff,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M160 288h249.44a8 8 0 0 0 7.85-6.43l28.8-144a8 8 0 0 0-7.85-9.57H128"},null,-1)])])}const Za=i.markRaw({name:"ion-cart-outline",render:Af}),Mr=Symbol(),Mf={Button:{border:"1px solid grey"},Card:{paddingMedium:"1rem"},Checkbox:{border:"1px solid rgb(12, 88, 32)"},Common:{borderRadius:"0.5rem",borderRadiusSmall:"0.25rem",fontWeight:"500",fontWeightStrong:"600",fontSize:"0.75rem",fontSizeMedium:"0.75rem",fontSizeLarge:"0.8125rem",lineHeight:"1.25rem",heightSmall:"24px",heightMedium:"30px",heightTiny:"20px",heightLarge:"36px",heightHuge:"42px",primaryColor:"#FFCC40FF",primaryColorHover:"#FFE49BFF",primaryColorPressed:"#FFBB00FF",primaryColorSuppl:"#FCC42AFF",successColor:"#4AC99BFF",successColorHover:"#4AC99BBF",successColorPressed:"#21AA78FF",errorColor:"#F45725FF",errorColorHover:"#F4572599",textColorBase:"#191C30E5",textColorDisabled:"#191C30E5"},DataTable:{borderColor:"rgb(207, 207, 207)",lineHeight:1.4,tdColorHover:"rgb(250,250,250)",thColor:"rgb(231, 231, 231)",thFontWeight:400,thPaddingMedium:"8px",tdPaddingMedium:"8px",thTextColor:"rgb(22, 0, 108)"},Drawer:{closeIconColor:"rgba(31, 34, 37, 1)",closeIconColorHover:"rgba(10, 157, 5, 1)"},Form:{marginBottom:0,lineHeight:1,labelFontSizeTopMedium:"0.75rem",labelHeightMedium:"20px",labelFontWeight:500,labelTextColor:"rgba(27, 31, 59, 0.65)",labelPaddingVertical:"0",labelPaddingHorizontal:"0"},Input:{paddingMedium:"0.5rem",fontSizeMedium:"0.9125rem",lineHeight:"1.25rem",lineHeightTextarea:"1.25rem",border:"1px solid #E0E0E0",borderRadius:"0.5rem",iconSize:"1,125rem"},Tabs:{tabFontSizeMedium:"0.9375rem",tabColorSegment:"#FFCC40FF",tabBorderColor:"#CCCCCCFF"}},Vf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},If={},Qa=i.defineComponent({...If,__name:"product-actions",props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(t){const e=t,n=i.inject(Mr,"medium"),r=i.computed(()=>M.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=i.computed(()=>M.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),o=i.computed(()=>M.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>M.isNil(e.productContextButtonsConfig)?[]:M.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),l=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},c=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},d=()=>{e.eventEmitter.emit("product:required",{product:e.product})},u=h=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:h})};return(h,m)=>{var T;const g=Ka,f=Ua,p=L.NButton,b=L.NTooltip,y=Ya,_=Za,S=Xa,v=L.NDropdown;return i.openBlock(),i.createElementBlock("div",Vf,[o.value?(i.openBlock(),i.createBlock(b,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:o.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:d},{default:i.withCtx(()=>[t.product.isRequired?(i.openBlock(),i.createBlock(f,{key:1})):(i.openBlock(),i.createBlock(g,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[m[0]||(m[0]=i.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createBlock(b,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary",disabled:s.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(y)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[1]||(m[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(b,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:r.value==="disabled",type:"primary",onClick:l},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[2]||(m[2]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),((T=a.value)==null?void 0:T.length)>0?(i.openBlock(),i.createBlock(v,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:u},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(S)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Of={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zf(t,e){return i.openBlock(),i.createElementBlock("svg",Of,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const Lf=i.markRaw({name:"tabler-history",render:zf}),Df={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Hf(t,e){return i.openBlock(),i.createElementBlock("svg",Df,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m18.5 3.5l2 2l-15 15l-2-2zM7 4c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3m10 10c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3M7 6c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1m10 10c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1"},null,-1)])])}const Wf=i.markRaw({name:"mdi-percent-outline",render:Hf}),jf={class:"flex flex-row gap-1"},qf={key:0,class:"flex gap-1"},Xf={key:0,class:"flex text-nowrap text-sm line-through"},Yf={key:1,class:"flex flex-row text-nowrap text-sm"},Uf={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Kf={},jn=i.defineComponent({...Kf,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){var b;const e=t,n=i.computed(()=>"product"in e.product),r=i.computed(()=>"product"in e.product?e.product.product:e.product),s=i.computed(()=>M.find(r.value.priceCoefficients,["coefficient.slug",e.costFieldName])),o=i.computed(()=>{const y=M.find(r.value.priceCoefficients,["coefficient.slug","k0"]);return s.value||!y||M.isNil(l.value)||M.isNil(y.cost)?!1:l.value<y.cost}),a=((b=Z.useBaseConfigStateStore().getConfig())==null?void 0:b.defaultCurrency)??"RUB",l=i.computed(()=>s.value?s.value.cost:M.get(e.product,e.costFieldName)),c=i.computed(()=>e.additionalThroughFieldName?M.get(e.product,e.additionalThroughFieldName):void 0),d=i.computed(()=>r.value.costDate?Hn.format(r.value.costDate,Z.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),u=i.computed(()=>e.currencyRates||r.value.currency.signature===a?e.currencyRates:{[r.value.currency.signature]:r.value.costRub/r.value.cost}),h=i.computed(()=>(M.isFunction(e.allowPriceClick)?e.allowPriceClick(r.value):e.allowPriceClick)&&!M.isNil(l.value)),m=i.computed(()=>M.isNil(l.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value))),g=i.computed(()=>{if(r.value.currency.signature===a||!u.value||!u.value[r.value.currency.signature])return null;const y=u.value[r.value.currency.signature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value)*y)}),f=i.computed(()=>M.isNil(c.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(c.value)),p=i.computed(()=>{if(!c.value||!l.value||c.value===l.value||l.value===0)return null;const y=(l.value-c.value)/c.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(y)});return(y,_)=>{var w;const S=L.NTag,v=L.NTooltip,T=Wf,R=Lf;return i.openBlock(),i.createElementBlock("div",jf,[t.showTag?(i.openBlock(),i.createBlock(v,{key:0},{trigger:i.withCtx(()=>[i.createVNode(S,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!s.value}])},{default:i.withCtx(()=>{var B;return[i.createTextVNode(i.toDisplayString(((B=s.value)==null?void 0:B.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var B;return[i.createTextVNode(" "+i.toDisplayString(((B=s.value)==null?void 0:B.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass({"!text-red-600":o.value})},[c.value&&c.value!==l.value||p.value?(i.openBlock(),i.createElementBlock("div",qf,[c.value&&c.value!==l.value?(i.openBlock(),i.createElementBlock("span",Xf,i.toDisplayString(f.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":o.value}])}," ("+i.toDisplayString(p.value)+"%) ",3)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base flex items-center gap-1",{"text-gray-600":(w=s.value)==null?void 0:w.readOnly,"font-bold":!s.value&&!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":h.value&&t.eventEmitter}),onClick:_[0]||(_[0]=()=>{var B;h.value&&((B=t.eventEmitter)==null||B.emit("cost:click",{product:r.value,cost:l.value}))})},i.toDisplayString(m.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:"")+" ",1),l.value&&!s.value&&"discount"in t.product&&t.product.discount?(i.openBlock(),i.createBlock(v,{key:0},{trigger:i.withCtx(()=>[i.createVNode(T,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:i.withCtx(()=>[i.createElementVNode("span",null,' На продукт действует скидка "'+i.toDisplayString(t.product.discount.name)+'"; ',1)]),_:1})):i.createCommentVNode("",!0)],2),g.value?(i.openBlock(),i.createElementBlock("span",Yf," ~ "+i.toDisplayString(g.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(M.isNil)(d.value)?(i.openBlock(),i.createElementBlock("span",Uf,[i.createTextVNode(i.toDisplayString(d.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(v,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(R,{class:"cursor-pointer",onClick:_[1]||(_[1]=B=>{var x;return(x=t.eventEmitter)==null?void 0:x.emit("cost:show-price-history",{product:r.value})})})]),default:i.withCtx(()=>[_[2]||(_[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2)])}}}),Gf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Zf(t,e){return i.openBlock(),i.createElementBlock("svg",Gf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)])])}const zs=i.markRaw({name:"ion-information-circle-outline",render:Zf}),Qf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jf(t,e){return i.openBlock(),i.createElementBlock("svg",Qf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)])])}const Ja=i.markRaw({name:"ion-images",render:Jf}),em={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tm(t,e){return i.openBlock(),i.createElementBlock("svg",em,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16"},null,-1)])])}const nm=i.markRaw({name:"ion-bookmark",render:tm});/*!
1
+ (function(H,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","ts-case-convert","vue-tel-input"],M):(H=typeof globalThis<"u"?globalThis:H||self,M(H.SC_VueUiLib={},H["lodash-es"],H.Vue,H["naive-ui"],H["@snabcentr/common-lib"],H["date-fns"],H["libphonenumber-js"],H["ts-case-convert"],H["vue-tel-input"]))})(this,(function(H,M,i,L,Z,Hn,sr,Os,Uh){"use strict";var jC=Object.defineProperty;var jh=H=>{throw TypeError(H)};var qC=(H,M,i)=>M in H?jC(H,M,{enumerable:!0,configurable:!0,writable:!0,value:i}):H[M]=i;var C=(H,M,i)=>qC(H,typeof M!="symbol"?M+"":M,i),qh=(H,M,i)=>M.has(H)||jh("Cannot "+i);var Pt=(H,M,i)=>(qh(H,M,"read from private field"),i?i.call(H):M.get(H)),ja=(H,M,i)=>M.has(H)?jh("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(H):M.set(H,i),Xh=(H,M,i,L)=>(qh(H,M,"write to private field"),L?L.call(H,i):M.set(H,i),i);var Bi,dt,As;var Qe=(t=>(t.AttachedUser="attached_user",t.ClientInfo="client_info",t.CreatedAt="created_at",t.DeliveryInfo="delivery_info",t.Id="id",t.SalesDirections="sales_directions",t.Status="status",t))(Qe||{}),Ge=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Ge||{});class ai{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&M.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&ai.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!ai.isVnodeEmpty(e()):!1}}const lt=(t,e=!1)=>{const{key:n}=t;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(n)&&!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(n.toLowerCase()))){if(e&&n==="-"){const r=t.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(n)||t.preventDefault()}},zs=(t,e=".",n=!1)=>{const{key:r}=t,s=t.target;["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(r)||(t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(r.toLowerCase())||n&&r==="-"&&!s.value.includes("-")&&((s.selectionStart??0)===0||s.value.length===0)||(r===e||r===(e==="."?",":"."))&&!s.value.includes(e)&&!s.value.includes(e==="."?",":".")||/^\d$/.test(r)||t.preventDefault()},xt=t=>t?Number.parseFloat(t.replace(",",".")):null,Oe=(t,e)=>{t[e]={}},ze=t=>{const e=t.target;setTimeout(()=>{e.select()},100)};class Mt{static convertReferencesToOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){let l=e.map(c=>({label:o?o(c):c.name,value:c.id,item:c,disabled:a?a(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...s?[{label:"",value:-1,disabled:!0}]:[],...l]:[...s?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(M.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=M.isString(r.key)?M.get(d,r.key):r.key(c),h=M.isString(r.label)?M.get(d,r.label):r.label(c);return{type:"group",label:M.isEmpty(h)?"- Не определено -":h,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Mt.convertReferencesToOptionsList(e,n,r,s,o,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Mt.convertReferencesToOptionsList(e,n,r,s,o,a)}}const Kh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Gh(t,e){return i.openBlock(),i.createElementBlock("svg",Kh,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)])])}const Xa=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Gh}),Zh={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Qh(t,e){return i.openBlock(),i.createElementBlock("svg",Zh,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const Ya=i.markRaw({name:"tabler-edit",render:Qh}),Jh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ef(t,e){return i.openBlock(),i.createElementBlock("svg",Jh,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M258.9 48C141.92 46.42 46.42 141.92 48 258.9c1.56 112.19 92.91 203.54 205.1 205.1c117 1.6 212.48-93.9 210.88-210.88C462.44 140.91 371.09 49.56 258.9 48m-16.79 192.47l51.55-59a16 16 0 0 1 24.1 21.06l-51.55 59a16 16 0 1 1-24.1-21.06m-38.86 90.85a16 16 0 0 1-22.62 0l-47.95-48a16 16 0 1 1 22.64-22.62l48 48a16 16 0 0 1-.07 22.62m176.8-128.79l-111.88 128a16 16 0 0 1-11.51 5.47h-.54a16 16 0 0 1-11.32-4.69l-47.94-48a16 16 0 1 1 22.64-22.62l29.8 29.83a8 8 0 0 0 11.68-.39l95-108.66a16 16 0 0 1 24.1 21.06Z"},null,-1)])])}const Ua=i.markRaw({name:"ion-checkmark-done-circle",render:ef}),tf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function nf(t,e){return i.openBlock(),i.createElementBlock("svg",tf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 192L256.13 320l-47.95-48m-16.23 48L144 272m161.71-80l-51.55 59"},null,-1)])])}const Ka=i.markRaw({name:"ion-checkmark-done-circle-outline",render:nf}),rf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function sf(t,e){return i.openBlock(),i.createElementBlock("svg",rf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M22.15 3.237c-1.93-1.93-5.185-1.403-6.406 1.04l-3.175 6.35a1.5 1.5 0 0 1-.868.752L6.72 13.04a2 2 0 0 0-.782 3.312l4.149 4.149L4 26.586v1.415h1.414l6.086-6.086l4.149 4.149a2 2 0 0 0 3.311-.782l1.661-4.983a1.5 1.5 0 0 1 .752-.867l6.351-3.175c2.442-1.222 2.97-4.476 1.04-6.407zM17.533 5.17a2 2 0 0 1 3.203-.52l6.614 6.614a2 2 0 0 1-.52 3.203l-6.351 3.175a3.5 3.5 0 0 0-1.755 2.024l-1.661 4.982l-9.712-9.711l4.983-1.661a3.5 3.5 0 0 0 2.024-1.755z"},null,-1)])])}const of=i.markRaw({name:"fluent-pin32-regular",render:sf}),af={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lf(t,e){return i.openBlock(),i.createElementBlock("svg",af,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const cf=i.markRaw({name:"ion-eye-outline",render:lf}),df={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function uf(t,e){return i.openBlock(),i.createElementBlock("svg",df,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M15.744 4.276c1.221-2.442 4.476-2.97 6.406-1.04l6.614 6.614c1.93 1.93 1.402 5.186-1.04 6.406l-6.35 3.176a1.5 1.5 0 0 0-.753.867l-1.66 4.983a2 2 0 0 1-3.312.782l-4.149-4.15l-6.086 6.087H4v-1.415l6.086-6.085l-4.149-4.15a2 2 0 0 1 .782-3.31l4.982-1.662a1.5 1.5 0 0 0 .868-.752z"},null,-1)])])}const hf=i.markRaw({name:"fluent-pin32-filled",render:uf}),ff={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function mf(t,e){return i.openBlock(),i.createElementBlock("svg",ff,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48"},null,-1)])])}const gf=i.markRaw({name:"ion-bookmark-outline",render:mf}),pf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function yf(t,e){return i.openBlock(),i.createElementBlock("svg",pf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m63.998 86.005l21.998-21.998L447.999 426.01l-21.998 21.998zM259.34 192.09l60.57 60.57a64.07 64.07 0 0 0-60.57-60.57m-6.68 127.82l-60.57-60.57a64.07 64.07 0 0 0 60.57 60.57"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M256 352a96 96 0 0 1-92.6-121.34l-69.07-69.08C66.12 187.42 39.24 221.14 16 256c26.42 44 62.56 89.24 100.2 115.18C159.38 400.92 206.33 416 255.76 416A233.5 233.5 0 0 0 335 402.2l-53.61-53.6A95.8 95.8 0 0 1 256 352m0-192a96 96 0 0 1 92.6 121.34L419.26 352c29.15-26.25 56.07-61.56 76.74-96c-26.38-43.43-62.9-88.56-101.18-114.82C351.1 111.2 304.31 96 255.76 96a222.9 222.9 0 0 0-78.21 14.29l53.11 53.11A95.8 95.8 0 0 1 256 160"},null,-1)])])}const bf=i.markRaw({name:"ion-eye-off-sharp",render:yf}),_f={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function wf(t,e){return i.openBlock(),i.createElementBlock("svg",_f,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const xf=i.markRaw({name:"ion-chevron-forward-outline",render:wf}),kf=["data-name"],vf={class:"sc-collapse-item-header flex flex-row gap-2.5"},Cf={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},Sf={key:0},Bf={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},Tf={class:"flex flex-1 flex-col"},Rf={key:0,class:"sc-collapse-item-sub-title flex-1"},$f={key:1,class:"sc-collapse-item-title-extra flex-none"},Pf={key:0,class:"sc-collapse-item-content"},Nf={},Ef=i.defineComponent({...Nf,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.inject("itemHeaderClickHandler",M.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=M.some(a,p=>p===r.name),d=i.computed(()=>M.some(l,p=>p===r.name)),u=i.ref(c),h=()=>{r.disabled||(u.value=d.value||!u.value,s("header:click",r.name,u.value),o(r.name,u.value))};return e({expand:()=>{!r.disabled&&!u.value&&(u.value=!0,s("header:click",r.name,u.value),o(r.name,u.value))},toggle:()=>{r.disabled||h()},collapse:()=>{!r.disabled&&u.value&&!d.value&&(u.value=!1,s("header:click",r.name,u.value),o(r.name,u.value))},expanded:i.readonly(u)}),(p,b)=>{const y=xf;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass([{"cursor-not-allowed text-gray-400":t.disabled},"sc-collapse-item flex flex-col p-2"])},[i.createElementVNode("div",vf,[i.createElementVNode("div",Cf,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":u.value}),onClick:h},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(y)],!0)],2)]),i.unref(ai).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",Sf,[i.createElementVNode("div",Bf,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",Tf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(ai).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",Rf,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(ai).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",$f,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||u.value?(i.openBlock(),i.createElementBlock("div",Pf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,kf)}}}),Wn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},Ga=Wn(Ef,[["__scopeId","data-v-f1311d1c"]]),Ff={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Af(t,e){return i.openBlock(),i.createElementBlock("svg",Ff,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M160 288h249.44a8 8 0 0 0 7.85-6.43l28.8-144a8 8 0 0 0-7.85-9.57H128"},null,-1)])])}const Za=i.markRaw({name:"ion-cart-outline",render:Af}),Mr=Symbol(),Mf={Button:{border:"1px solid grey"},Card:{paddingMedium:"1rem"},Checkbox:{border:"1px solid rgb(12, 88, 32)"},Common:{borderRadius:"0.5rem",borderRadiusSmall:"0.25rem",fontWeight:"500",fontWeightStrong:"600",fontSize:"0.75rem",fontSizeMedium:"0.75rem",fontSizeLarge:"0.8125rem",lineHeight:"1.25rem",heightSmall:"24px",heightMedium:"30px",heightTiny:"20px",heightLarge:"36px",heightHuge:"42px",primaryColor:"#FFCC40FF",primaryColorHover:"#FFE49BFF",primaryColorPressed:"#FFBB00FF",primaryColorSuppl:"#FCC42AFF",successColor:"#4AC99BFF",successColorHover:"#4AC99BBF",successColorPressed:"#21AA78FF",errorColor:"#F45725FF",errorColorHover:"#F4572599",textColorBase:"#191C30E5",textColorDisabled:"#191C30E5"},DataTable:{borderColor:"rgb(207, 207, 207)",lineHeight:1.4,tdColorHover:"rgb(250,250,250)",thColor:"rgb(231, 231, 231)",thFontWeight:400,thPaddingMedium:"8px",tdPaddingMedium:"8px",thTextColor:"rgb(22, 0, 108)"},Drawer:{closeIconColor:"rgba(31, 34, 37, 1)",closeIconColorHover:"rgba(10, 157, 5, 1)"},Form:{marginBottom:0,lineHeight:1,labelFontSizeTopMedium:"0.75rem",labelHeightMedium:"20px",labelFontWeight:500,labelTextColor:"rgba(27, 31, 59, 0.65)",labelPaddingVertical:"0",labelPaddingHorizontal:"0"},Input:{paddingMedium:"0.5rem",fontSizeMedium:"0.9125rem",lineHeight:"1.25rem",lineHeightTextarea:"1.25rem",border:"1px solid #E0E0E0",borderRadius:"0.5rem",iconSize:"1,125rem"},Tabs:{tabFontSizeMedium:"0.9375rem",tabColorSegment:"#FFCC40FF",tabBorderColor:"#CCCCCCFF"}},Vf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},If={},Qa=i.defineComponent({...If,__name:"product-actions",props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(t){const e=t,n=i.inject(Mr,"medium"),r=i.computed(()=>M.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=i.computed(()=>M.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),o=i.computed(()=>M.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>M.isNil(e.productContextButtonsConfig)?[]:M.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),l=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},c=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},d=()=>{e.eventEmitter.emit("product:required",{product:e.product})},u=h=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:h})};return(h,m)=>{var T;const g=Ka,f=Ua,p=L.NButton,b=L.NTooltip,y=Ya,_=Za,S=Xa,v=L.NDropdown;return i.openBlock(),i.createElementBlock("div",Vf,[o.value?(i.openBlock(),i.createBlock(b,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:o.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:d},{default:i.withCtx(()=>[t.product.isRequired?(i.openBlock(),i.createBlock(f,{key:1})):(i.openBlock(),i.createBlock(g,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[m[0]||(m[0]=i.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createBlock(b,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary",disabled:s.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(y)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[1]||(m[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(b,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:r.value==="disabled",type:"primary",onClick:l},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[2]||(m[2]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),((T=a.value)==null?void 0:T.length)>0?(i.openBlock(),i.createBlock(v,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:u},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(S)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Of={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zf(t,e){return i.openBlock(),i.createElementBlock("svg",Of,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const Lf=i.markRaw({name:"tabler-history",render:zf}),Df={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Hf(t,e){return i.openBlock(),i.createElementBlock("svg",Df,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m18.5 3.5l2 2l-15 15l-2-2zM7 4c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3m10 10c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3M7 6c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1m10 10c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1"},null,-1)])])}const Wf=i.markRaw({name:"mdi-percent-outline",render:Hf}),jf={class:"flex flex-row gap-1"},qf={key:0,class:"flex gap-1"},Xf={key:0,class:"flex text-nowrap text-sm line-through"},Yf={key:1,class:"flex flex-row text-nowrap text-sm"},Uf={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Kf={},jn=i.defineComponent({...Kf,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){var b;const e=t,n=i.computed(()=>"product"in e.product),r=i.computed(()=>"product"in e.product?e.product.product:e.product),s=i.computed(()=>M.find(r.value.priceCoefficients,["coefficient.slug",e.costFieldName])),o=i.computed(()=>{const y=M.find(r.value.priceCoefficients,["coefficient.slug","k0"]);return s.value||!y||M.isNil(l.value)||M.isNil(y.cost)?!1:l.value<y.cost}),a=((b=Z.useBaseConfigStateStore().getConfig())==null?void 0:b.defaultCurrency)??"RUB",l=i.computed(()=>s.value?s.value.cost:M.get(e.product,e.costFieldName)),c=i.computed(()=>e.additionalThroughFieldName?M.get(e.product,e.additionalThroughFieldName):void 0),d=i.computed(()=>r.value.costDate?Hn.format(r.value.costDate,Z.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),u=i.computed(()=>e.currencyRates||r.value.currency.signature===a?e.currencyRates:{[r.value.currency.signature]:r.value.costRub/r.value.cost}),h=i.computed(()=>(M.isFunction(e.allowPriceClick)?e.allowPriceClick(r.value):e.allowPriceClick)&&!M.isNil(l.value)),m=i.computed(()=>M.isNil(l.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value))),g=i.computed(()=>{if(r.value.currency.signature===a||!u.value||!u.value[r.value.currency.signature])return null;const y=u.value[r.value.currency.signature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value)*y)}),f=i.computed(()=>M.isNil(c.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(c.value)),p=i.computed(()=>{if(!c.value||!l.value||c.value===l.value||l.value===0)return null;const y=(l.value-c.value)/c.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(y)});return(y,_)=>{var w;const S=L.NTag,v=L.NTooltip,T=Wf,R=Lf;return i.openBlock(),i.createElementBlock("div",jf,[t.showTag?(i.openBlock(),i.createBlock(v,{key:0},{trigger:i.withCtx(()=>[i.createVNode(S,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!s.value}])},{default:i.withCtx(()=>{var B;return[i.createTextVNode(i.toDisplayString(((B=s.value)==null?void 0:B.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var B;return[i.createTextVNode(" "+i.toDisplayString(((B=s.value)==null?void 0:B.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass({"!text-red-600":o.value})},[c.value&&c.value!==l.value||p.value?(i.openBlock(),i.createElementBlock("div",qf,[c.value&&c.value!==l.value?(i.openBlock(),i.createElementBlock("span",Xf,i.toDisplayString(f.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":o.value}])}," ("+i.toDisplayString(p.value)+"%) ",3)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base flex items-center gap-1",{"text-gray-600":(w=s.value)==null?void 0:w.readOnly,"font-bold":!s.value&&!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":h.value&&t.eventEmitter}),onClick:_[0]||(_[0]=()=>{var B;h.value&&((B=t.eventEmitter)==null||B.emit("cost:click",{product:r.value,cost:l.value}))})},i.toDisplayString(m.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:"")+" ",1),l.value&&!s.value&&"discount"in t.product&&t.product.discount?(i.openBlock(),i.createBlock(v,{key:0},{trigger:i.withCtx(()=>[i.createVNode(T,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:i.withCtx(()=>[i.createElementVNode("span",null,' На продукт действует скидка "'+i.toDisplayString(t.product.discount.name)+'"; ',1)]),_:1})):i.createCommentVNode("",!0)],2),g.value?(i.openBlock(),i.createElementBlock("span",Yf," ~ "+i.toDisplayString(g.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(M.isNil)(d.value)?(i.openBlock(),i.createElementBlock("span",Uf,[i.createTextVNode(i.toDisplayString(d.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(v,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(R,{class:"cursor-pointer",onClick:_[1]||(_[1]=B=>{var x;return(x=t.eventEmitter)==null?void 0:x.emit("cost:show-price-history",{product:r.value})})})]),default:i.withCtx(()=>[_[2]||(_[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2)])}}}),Gf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Zf(t,e){return i.openBlock(),i.createElementBlock("svg",Gf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)])])}const Ls=i.markRaw({name:"ion-information-circle-outline",render:Zf}),Qf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jf(t,e){return i.openBlock(),i.createElementBlock("svg",Qf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)])])}const Ja=i.markRaw({name:"ion-images",render:Jf}),em={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tm(t,e){return i.openBlock(),i.createElementBlock("svg",em,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16"},null,-1)])])}const nm=i.markRaw({name:"ion-bookmark",render:tm});/*!
2
2
  * lightgallery | 2.9.0 | October 1st 2025
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
@@ -37,7 +37,7 @@
37
37
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
38
38
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39
39
  PERFORMANCE OF THIS SOFTWARE.
40
- ***************************************************************************** */var Ir=function(){return Ir=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ir.apply(this,arguments)},sm={scale:1,zoom:!0,infiniteZoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:"lg-zoom-in",zoomOut:"lg-zoom-out"},enableZoomAfter:300,zoomPluginStrings:{zoomIn:"Zoom in",zoomOut:"Zoom out",viewActualSize:"View actual size"}},Tn={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ls=500,om=(function(){function t(e,n){return this.core=e,this.$LG=n,this.settings=Ir(Ir({},sm),this.core.settings),this}return t.prototype.buildTemplates=function(){var e=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(e+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(e)},t.prototype.enableZoom=function(e){var n=this,r=this.settings.enableZoomAfter+e.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&e.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(e.detail.index).addClass("lg-zoomable"),e.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},t.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(Tn.slideItemLoad+".zoom",this.enableZoom.bind(this))},t.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},t.prototype.getSwipeCords=function(e){var n=e.touches[0].pageX,r=e.touches[0].pageY;return{x:n,y:r}},t.prototype.getDragAllowedAxises=function(e,n){if(!this.containerRect)return{allowX:!1,allowY:!1};var r=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),s=0,o=0,a=r.getBoundingClientRect();e?(s=r.offsetHeight*e,o=r.offsetWidth*e):n?(s=a.height+n*a.height,o=a.width+n*a.width):(s=a.height,o=a.width);var l=s>this.containerRect.height,c=o>this.containerRect.width;return{allowX:c,allowY:l}},t.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},t.prototype.zoomImage=function(e,n,r,s){if(!(!this.containerRect||Math.abs(n)<=0)){var o=this.containerRect.width/2+this.containerRect.left,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,l,c;e===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),u=d.allowY,h=d.allowX;this.positionChanged&&(l=this.left/(this.scale-n),c=this.top/(this.scale-n),this.pageX=o-l,this.pageY=a-c,this.positionChanged=!1);var m=this.getPossibleSwipeDragCords(n),g,f,p=o-this.pageX,b=a-this.pageY;if(e-n>1){var y=(e-n)/Math.abs(n);p=(n<0?-p:p)+this.left*(y+(n<0?-1:1)),b=(n<0?-b:b)+this.top*(y+(n<0?-1:1)),g=p/y,f=b/y}else{var y=(e-n)*n;g=p*y,f=b*y}r&&(h?this.isBeyondPossibleLeft(g,m.minX)?g=m.minX:this.isBeyondPossibleRight(g,m.maxX)&&(g=m.maxX):e>1&&(g<m.minX?g=m.minX:g>m.maxX&&(g=m.maxX)),u?this.isBeyondPossibleTop(f,m.minY)?f=m.minY:this.isBeyondPossibleBottom(f,m.maxY)&&(f=m.maxY):e>1&&(f<m.minY?f=m.minY:f>m.maxY&&(f=m.maxY))),this.setZoomStyles({x:g,y:f,scale:e}),this.left=g,this.top=f,s&&this.setZoomImageSize()}},t.prototype.resetImageTranslate=function(e){if(this.isImageSlide(e)){var n=this.core.getSlideItem(e).find(".lg-image").first();this.imageReset=!1,n.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),n.css("width","auto").css("height","auto"),setTimeout(function(){n.removeClass("no-transition")},10)}},t.prototype.setZoomImageSize=function(){var e=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=e.getCurrentImageActualSizeScale();e.scale>=r&&(n.addClass("no-transition"),e.imageReset=!0)},Ls),setTimeout(function(){var r=e.getCurrentImageActualSizeScale();if(e.scale>=r){var s=e.getDragAllowedAxises(e.scale);n.css("width",n.get().naturalWidth+"px").css("height",n.get().naturalHeight+"px"),e.core.outer.addClass("lg-actual-size"),s.allowX&&s.allowY?n.addClass("reset-transition"):s.allowX&&!s.allowY?n.addClass("reset-transition-x"):!s.allowX&&s.allowY&&n.addClass("reset-transition-y")}},Ls+50)},t.prototype.setZoomStyles=function(e){var n=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),r=this.core.getSlideItem(this.core.index).find(".lg-image").first(),s=this.core.outer.find(".lg-current .lg-dummy-img").first();this.scale=e.scale,r.css("transform","scale3d("+e.scale+", "+e.scale+", 1)"),s.css("transform","scale3d("+e.scale+", "+e.scale+", 1)");var o="translate3d("+e.x+"px, "+e.y+"px, 0)";n.css("transform",o)},t.prototype.setActualSize=function(e,n){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var s=this.core.galleryItems[this.core.index];this.resetImageTranslate(e),setTimeout(function(){if(!(!s.src||r.core.outer.hasClass("lg-first-slide-loading"))){var o=r.getCurrentImageActualSizeScale(),a=r.scale;r.core.outer.hasClass("lg-zoomed")?r.scale=1:r.scale=r.getScale(o),r.setPageCords(n),r.beginZoom(r.scale),r.zoomImage(r.scale,r.scale-a,!0,!0)}},50),setTimeout(function(){r.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},60),setTimeout(function(){r.zoomInProgress=!1},Ls+110)}},t.prototype.getNaturalWidth=function(e){var n=this.core.getSlideItem(e).find(".lg-image").first(),r=this.core.galleryItems[e].width;return r?parseFloat(r):n.get().naturalWidth},t.prototype.getActualSizeScale=function(e,n){var r,s;return e>=n?(r=e/n,s=r||2):s=1,s},t.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=e.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},t.prototype.getPageCords=function(e){var n={};if(e)n.x=e.pageX||e.touches[0].pageX,n.y=e.pageY||e.touches[0].pageY;else{var r=this.core.$content.get().getBoundingClientRect();n.x=r.width/2+r.left,n.y=r.height/2+this.scrollTop+r.top}return n},t.prototype.setPageCords=function(e){var n=this.getPageCords(e);this.pageX=n.x,this.pageY=n.y},t.prototype.manageActualPixelClassNames=function(){var e=this.core.getElementById("lg-actual-size");e.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},t.prototype.beginZoom=function(e){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),e>1},t.prototype.getScale=function(e){var n=this.getCurrentImageActualSizeScale();return e<1?e=1:e>n&&(e=n),e},t.prototype.init=function(){var e=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){e.$LG(r.target).hasClass("lg-image")&&e.setActualSize(e.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var s=e.$LG(r.target);r.touches.length===1&&s.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),e.setActualSize(e.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on(Tn.containerResize+".zoom "+Tn.rotateRight+".zoom "+Tn.rotateLeft+".zoom "+Tn.flipHorizontal+".zoom "+Tn.flipVertical+".zoom",function(){if(!(!e.core.lgOpened||!e.isImageSlide(e.core.index)||e.core.touchAction)){var r=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();e.top=0,e.left=0,e.setZoomEssentials(),e.setZoomSwipeStyles(r,{x:0,y:0}),e.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){e.core.lgOpened&&(e.scrollTop=e.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(e.isImageSlide(e.core.index)){var r=0;e.imageReset&&(e.resetImageTranslate(e.core.index),r=50),setTimeout(function(){var s=e.scale-e.settings.scale;s<1&&(s=1),e.beginZoom(s),e.zoomImage(s,-e.settings.scale,!0,!e.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){e.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){e.setActualSize(e.core.index)}),this.core.LGel.on(Tn.beforeOpen+".zoom",function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(Tn.afterOpen+".zoom",function(){e.scrollTop=e.$LG(window).scrollTop(),e.pageX=e.core.outer.width()/2,e.pageY=e.core.outer.height()/2+e.scrollTop,e.scale=1}),this.core.LGel.on(Tn.afterSlide+".zoom",function(r){var s=r.detail.prevIndex;e.scale=1,e.positionChanged=!1,e.zoomInProgress=!1,e.resetZoom(s),e.resetImageTranslate(s),e.isImageSlide(e.core.index)&&e.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},t.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var e=this.scale+this.settings.scale;this.settings.infiniteZoom||(e=this.getScale(e)),this.beginZoom(e),this.zoomImage(e,Math.min(this.settings.scale,e-this.scale),!0,!this.settings.infiniteZoom)}},t.prototype.resetZoom=function(e){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(e!==void 0?e:this.core.index);n.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),r.find(".lg-img-wrap").first().removeAttr("style"),r.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},t.prototype.getTouchDistance=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)*(e.touches[0].pageX-e.touches[1].pageX)+(e.touches[0].pageY-e.touches[1].pageY)*(e.touches[0].pageY-e.touches[1].pageY))},t.prototype.pinchZoom=function(){var e=this,n=0,r=!1,s=1,o=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(l){if(a=e.core.getSlideItem(e.core.index),!!e.isImageSlide(e.core.index)&&l.touches.length===2){if(l.preventDefault(),e.core.outer.hasClass("lg-first-slide-loading"))return;s=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.setPageCords(l),e.resetImageTranslate(e.core.index),e.core.touchAction="pinch",n=e.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=e.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){o=e.scale;var u=Math.max(1,s+-d*.02);e.scale=Math.round((u+Number.EPSILON)*100)/100;var h=e.scale-o;e.zoomImage(e.scale,Math.round((h+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,e.scale<=1)e.resetZoom();else{var c=e.getCurrentImageActualSizeScale();if(e.scale>=c){var d=c-e.scale;d===0&&(d=.01),e.zoomImage(c,d,!1,!0)}e.manageActualPixelClassNames(),e.core.outer.addClass("lg-zoomed")}e.core.touchAction=void 0}})},t.prototype.touchendZoom=function(e,n,r,s,o){var a=n.x-e.x,l=n.y-e.y,c=Math.abs(a)/o+1,d=Math.abs(l)/o+1;c>2&&(c+=1),d>2&&(d+=1),a=a*c,l=l*d;var u=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),h={};h.x=this.left+a,h.y=this.top+l;var m=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(h.y,m.minY)?h.y=m.minY:this.isBeyondPossibleBottom(h.y,m.maxY)&&(h.y=m.maxY)),r&&(this.isBeyondPossibleLeft(h.x,m.minX)?h.x=m.minX:this.isBeyondPossibleRight(h.x,m.maxX)&&(h.x=m.maxX)),s?this.top=h.y:h.y=this.top,r?this.left=h.x:h.x=this.left,this.setZoomSwipeStyles(u,h),this.positionChanged=!0)},t.prototype.getZoomSwipeCords=function(e,n,r,s,o){var a={};if(s){if(a.y=this.top+(n.y-e.y),this.isBeyondPossibleTop(a.y,o.minY)){var l=o.minY-a.y;a.y=o.minY-l/6}else if(this.isBeyondPossibleBottom(a.y,o.maxY)){var c=a.y-o.maxY;a.y=o.maxY+c/6}}else a.y=this.top;if(r){if(a.x=this.left+(n.x-e.x),this.isBeyondPossibleLeft(a.x,o.minX)){var d=o.minX-a.x;a.x=o.minX-d/6}else if(this.isBeyondPossibleRight(a.x,o.maxX)){var u=a.x-o.maxX;a.x=o.maxX+u/6}}else a.x=this.left;return a},t.prototype.isBeyondPossibleLeft=function(e,n){return e>=n},t.prototype.isBeyondPossibleRight=function(e,n){return e<=n},t.prototype.isBeyondPossibleTop=function(e,n){return e>=n},t.prototype.isBeyondPossibleBottom=function(e,n){return e<=n},t.prototype.isImageSlide=function(e){var n=this.core.galleryItems[e];return this.core.getSlideType(n)==="image"},t.prototype.getPossibleSwipeDragCords=function(e){var n=this.core.getSlideItem(this.core.index).find(".lg-image").first(),r=this.core.mediaContainerPosition.bottom,s=n.get().getBoundingClientRect(),o=s.height,a=s.width;e&&(o=o+e*o,a=a+e*a);var l=(o-this.containerRect.height)/2,c=(this.containerRect.height-o)/2+r,d=(a-this.containerRect.width)/2,u=(this.containerRect.width-a)/2,h={minY:l,maxY:c,minX:d,maxX:u};return h},t.prototype.setZoomSwipeStyles=function(e,n){e.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},t.prototype.zoomSwipe=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=new Date,c=new Date,d,u,h=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(m){if(e.isImageSlide(e.core.index)&&(h=e.core.getSlideItem(e.core.index),(e.$LG(m.target).hasClass("lg-item")||h.get().contains(m.target))&&m.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){m.preventDefault(),l=new Date,e.core.touchAction="zoomSwipe",u=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var g=e.getDragAllowedAxises(0);a=g.allowY,o=g.allowX,(o||a)&&(n=e.getSwipeCords(m)),d=e.getPossibleSwipeDragCords(),e.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(m){if(m.touches.length===1&&e.core.touchAction==="zoomSwipe"&&(e.$LG(m.target).hasClass("lg-item")||h.get().contains(m.target))){m.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(m);var g=e.getZoomSwipeCords(n,r,o,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(s=!0,e.setZoomSwipeStyles(u,g))}}),this.core.$inner.on("touchend.lg",function(m){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(m.target).hasClass("lg-item")||h.get().contains(m.target))){if(m.preventDefault(),e.core.touchAction=void 0,e.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var g=c.valueOf()-l.valueOf();e.touchendZoom(n,r,o,a,g)}})},t.prototype.zoomDrag=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,u,h;this.core.outer.on("mousedown.lg.zoom",function(m){if(e.isImageSlide(e.core.index)){var g=e.core.getSlideItem(e.core.index);if(e.$LG(m.target).hasClass("lg-item")||g.get().contains(m.target)){c=new Date,h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var f=e.getDragAllowedAxises(0);l=f.allowY,a=f.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(m.target).hasClass("lg-object")&&(a||l)&&(m.preventDefault(),n=e.getDragCords(m),u=e.getPossibleSwipeDragCords(),s=!0,e.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(m){if(s){o=!0,r=e.getDragCords(m);var g=e.getZoomSwipeCords(n,r,a,l,u);e.setZoomSwipeStyles(h,g)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(m){if(s){if(d=new Date,s=!1,e.core.outer.removeClass("lg-zoom-dragging"),o&&(n.x!==r.x||n.y!==r.y)){r=e.getDragCords(m);var g=d.valueOf()-c.valueOf();e.touchendZoom(n,r,a,l,g)}o=!1}e.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},t.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},t.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},t})();const am={ref:"gallery-container",class:"lightgallery-wrapper"},lm={},el=i.defineComponent({...lm,__name:"lightgallery",props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(t){const e=t,n={lgAfterAppendSlide:e.onAfterAppendSlide,lgInit:e.onInit,lgHasVideo:e.onHasVideo,lgContainerResize:e.onContainerResize,lgAfterAppendSubHtml:e.onAfterAppendSubHtml,lgBeforeOpen:e.onBeforeOpen,lgAfterOpen:e.onAfterOpen,lgSlideItemLoad:e.onSlideItemLoad,lgBeforeSlide:e.onBeforeSlide,lgAfterSlide:e.onAfterSlide,lgPosterClick:e.onPosterClick,lgDragStart:e.onDragStart,lgDragMove:e.onDragMove,lgDragEnd:e.onDragEnd,lgBeforeNextSlide:e.onBeforeNextSlide,lgBeforePrevSlide:e.onBeforePrevSlide,lgBeforeClose:e.onBeforeClose,lgAfterClose:e.onAfterClose,lgRotateLeft:e.onRotateLeft,lgRotateRight:e.onRotateRight,lgFlipHorizontal:e.onFlipHorizontal,lgFlipVertical:e.onFlipVertical},r=i.useTemplateRef("gallery-container"),s=i.ref(null);return i.onMounted(async()=>{if(!r.value)return;const o=await import("lightgallery");s.value=o.default(r.value,{...e.settings}),M.forOwn(n,(a,l)=>{var c;a&&((c=r.value)==null||c.addEventListener(l,a))})}),i.onBeforeUnmount(()=>{var o;s.value&&((o=s.value)==null||o.destroy(),s.value=null)}),(o,a)=>(i.openBlock(),i.createElementBlock("div",am,[i.renderSlot(o.$slots,"default")],512))}}),lt=class lt{static init(){lt.isInitialized||(lt.isInitialized=!0,lt.windowResizeHandler(),window.addEventListener("resize",lt.windowResizeHandler))}static destroy(){window.removeEventListener("resize",lt.windowResizeHandler),lt.isInitialized=!1}static getDeviceTypeByResolution(){const e=Z.useBaseConfigStateStore().config.deviceTypeByResolution;return window.innerWidth<e.tablet?Ge.phone:window.innerWidth<e.laptop?Ge.tablet:Ge.laptop}static initRefDependingOnDeviceResolution(e,n,r){const s=i.ref(r);return lt.setRefValueDependingOnDeviceResolution(s,e,n,r),lt.refsDependingOnDeviceResolution.push({r:s,phoneValue:e,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return lt.getDeviceTypeByResolution()===Ge.phone}static isTabletDevice(){return lt.getDeviceTypeByResolution()===Ge.tablet}static isLaptopDevice(){return lt.getDeviceTypeByResolution()===Ge.laptop}static setRefValueDependingOnDeviceResolution(e,n,r,s){switch(lt.getDeviceTypeByResolution()){case Ge.phone:e.value=n;break;case Ge.tablet:e.value=r;break;default:e.value=s;break}}static windowResizeHandler(){M.forEach(lt.refsDependingOnDeviceResolution,e=>{lt.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};C(lt,"isInitialized",!1),C(lt,"refsDependingOnDeviceResolution",[]);let xt=lt;const cm=["href"],dm=["src","alt"],um={},tl=i.defineComponent({...um,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[rm,om],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(xt.getDeviceTypeByResolution()===Ge.phone?.7:.8),a=i.ref(o()),l=()=>{a.value=o()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),e({show:c}),window.addEventListener("resize",l),(d,u)=>{const h=Ja,m=L.NPopover;return i.openBlock(),i.createBlock(m,{trigger:"manual",show:n.value,class:"sc-image",placement:"top-start",onClickoutside:u[3]||(u[3]=()=>{r.value||(n.value=!1)})},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:"inline-flex",onClick:u[0]||(u[0]=g=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(h)])])]),default:i.withCtx(()=>[i.createVNode(el,{settings:s.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:u[1]||(u[1]=()=>{r.value=!0}),onAfterClose:u[2]||(u[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.images,(g,f)=>(i.openBlock(),i.createElementBlock("a",{key:f,href:g.image},[i.createElementVNode("img",{src:g.preview,alt:`Изображение #${f+1}`},null,8,dm)],8,cm))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),hm={class:"flex flex-col text-sm"},fm={},mm=i.defineComponent({...fm,__name:"product-stock-count",props:{product:{}},setup(t){return(e,n)=>{const r=zs,s=L.NPopover;return i.openBlock(),i.createBlock(s,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(e.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",hm,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.product.stockCount,(o,a)=>(i.openBlock(),i.createElementBlock("span",{key:a},i.toDisplayString(o.warehouse.name)+": "+i.toDisplayString(o.count)+" "+i.toDisplayString(t.product.unit.name),1))),128))])]),_:3})}}}),gm={class:"flex flex-row justify-between"},pm={class:"inline-flex flex-row gap-0.5 mr-2 align-sub"},ym={key:0},bm={class:"ml-2 align-sub"},_m={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},wm={class:"@container"},xm={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},km={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},vm={class:"text-sc-dark-grey"},Cm={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},Sm={class:"text-gray-600"},Bm={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},Tm={key:3,class:"underline decoration-dashed"},Rm={key:4,class:"sc-product-pack whitespace-nowrap"},$m={class:"text-gray-600"},Pm={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},Nm={class:"text-gray-600"},Em={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},Fm={key:0},Am={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Mm={},ar=i.defineComponent({...Mm,__name:"product-name",props:{product:{},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},showProductCosts:{type:[Boolean,Function],default:!1},showPlanningDates:{type:Boolean,default:!0},showPriceHistory:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(t,{expose:e}){const n=t,r=i.computed(()=>M.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>M.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,m;return(m=(h=n.product)==null?void 0:h.properties)==null?void 0:m.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>M.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=i.computed(()=>{var h;return n.showProductAddToCartButton||n.showProductEditButton||n.showProductRequiredButton||(((h=n.productContextButtonsConfig)==null?void 0:h.length)??0)>0}),u=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return e({showProductImagesPreview:l}),(h,m)=>{var T,R,w,B;const g=nm,f=L.NTooltip,p=Za,b=Ja,y=L.NText,_=Qa,S=zs,v=L.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",gm,[i.createVNode(y,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>{var x,$;return[i.createElementVNode("div",pm,[((x=t.product)==null?void 0:x.isFavorite)??!1?(i.openBlock(),i.createBlock(f,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"!text-yellow-300"})]),default:i.withCtx(()=>[m[0]||(m[0]=i.createTextVNode(" Избранный товар ",-1))]),_:1})):i.createCommentVNode("",!0),(($=t.product)==null?void 0:$.isPreviouslyOrdered)??!1?(i.openBlock(),i.createBlock(f,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{class:"!text-green-700"})]),default:i.withCtx(()=>[m[1]||(m[1]=i.createTextVNode(" Ранее заказанный товар ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&t.eventEmitter}),onClick:u},i.toDisplayString(t.product.name),3),t.product.onOrder?(i.openBlock(),i.createElementBlock("span",ym," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",bm,[t.product.images&&t.product.images.length>0?(i.openBlock(),i.createBlock(tl,{key:0,ref:"image-gallery",images:t.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",_m,[i.createVNode(b)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]}),_:1}),d.value?(i.openBlock(),i.createBlock(_,{key:0,product:t.product,"event-emitter":t.eventEmitter,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-edit-button":t.showProductEditButton,"show-product-required-button":t.showProductRequiredButton,"product-context-buttons-config":t.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","show-product-required-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",wm,[i.createElementVNode("div",xm,[t.product.supplierSku?(i.openBlock(),i.createElementBlock("div",km,[m[2]||(m[2]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",vm,i.toDisplayString(t.product.supplierSku),1)])):i.createCommentVNode("",!0),t.showCode?(i.openBlock(),i.createElementBlock("span",Cm,[m[3]||(m[3]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",Sm,i.toDisplayString(t.product.code),1)])):i.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(i.openBlock(),i.createBlock(mm,{key:2,product:t.product},{default:i.withCtx(()=>[i.createElementVNode("span",Bm,[m[4]||(m[4]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(S,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",Tm," Нет в наличии ")),t.product.pack??((R=(T=t.product)==null?void 0:T.properties)==null?void 0:R.pack)?(i.openBlock(),i.createElementBlock("span",Rm,[m[5]||(m[5]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",$m,i.toDisplayString(t.product.pack??((B=(w=t.product)==null?void 0:w.properties)==null?void 0:B.pack)),1)])):i.createCommentVNode("",!0),t.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",Pm,[m[6]||(m[6]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",Nm,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(v,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",Em,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,x=>(i.openBlock(),i.createBlock(jn,{key:x.coefficient.slug,product:t.product,"cost-field-name":x.coefficient.slug??"","event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","currency-rates"]))),128)),i.createVNode(jn,{product:t.product,"event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":t.showCostDate,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates,"cost-field-name":"cost","additional-through-field-name":"retailCost",style:{"background-color":"var(--n-merged-td-color)"},class:"sticky right-0 border-0 border-l-2 border-solid border-gray-300 pl-2"},null,8,["product","event-emitter","allow-price-click","show-cost-date","show-price-history","currency-rates"])])):i.createCommentVNode("",!0)]),_:1}),t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",Fm,[i.createElementVNode("ul",Am,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.product.id,slug:t.product.slug},(x,$)=>(i.openBlock(),i.createElementBlock("li",{key:$}," ("+i.toDisplayString($)+"): "+i.toDisplayString(x),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.product.properties,(x,$)=>(i.openBlock(),i.createElementBlock("li",{key:$}," ("+i.toDisplayString($)+"): "+i.toDisplayString(x),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),Vm=(t,e,n)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>i.h(jn,{product:r,costFieldName:t,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),Im=(t,e)=>{if(t.length===0)return[];const n=[],r={};switch(M.isNil(e.isProductItemSelected)||n.push({key:"checkbox",title:"",className:"align-top",width:"32",render:s=>{var o,a;return i.h(L.NCheckbox,{checked:!!((o=e.isProductItemSelected)!=null&&o.call(e,s)),disabled:((a=e.isProductItemSelected)==null?void 0:a.call(e,s))==="disabled",onUpdateChecked:l=>{e.eventEmitter.emit("product:checked",{product:s,checked:l})}})}}),xt.getDeviceTypeByResolution()){case Ge.phone:case Ge.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(ar,{product:s,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(ar,{product:s,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})}),e.showProductCosts&&(M.forEach(t,s=>{M.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),M.forEach(M.sortBy(r,["slug"]),s=>{n.push(Vm(s.slug??"",s.name,e))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(jn,{product:s,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:e.eventEmitter,allowPriceClick:e.allowPriceClick,showQuantityUnit:!0,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})})),(e.showProductEditButton||e.showProductRequiredButton||e.showProductAddToCartButton||!M.isNil(e.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(Qa,{product:s,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return n},Om={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function zm(t,e){return i.openBlock(),i.createElementBlock("svg",Om,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z"},null,-1)])])}const Ds=i.markRaw({name:"ion-trash",render:zm}),Lm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Dm(t,e){return i.openBlock(),i.createElementBlock("svg",Lm,[...e[0]||(e[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const nl=i.markRaw({name:"ion-plus",render:Dm}),Hm={key:0,class:"flex w-fit items-center gap-2"},Wm={key:1,class:"flex flex-wrap gap-1"},jm={key:0},qm={key:2},Xm={},lr=i.defineComponent({...Xm,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0},validation:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{var r,s;return(s=(r=e.product)==null?void 0:r.properties)==null?void 0:s.planingProductionDate});return(r,s)=>{const o=L.NSpin,a=L.NText;return t.isProductSearching?(i.openBlock(),i.createElementBlock("div",Hm,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):t.product&&!t.product.isNewRec()?(i.openBlock(),i.createElementBlock("div",Wm,[i.createElementVNode("div",null,i.toDisplayString(t.product.code)+" - "+i.toDisplayString(t.product.name)+" - "+i.toDisplayString(t.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(t.product.unit.name),1),n.value?(i.openBlock(),i.createElementBlock("div",jm,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)])):t.validation?(i.openBlock(),i.createElementBlock("div",qm,[i.createVNode(a,{type:t.validation.validationStatus},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.validation.feedback),1)]),_:1},8,["type"])])):i.createCommentVNode("",!0)}}}),ae={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(t){return{type:"number",min:t,trigger:["blur","input"],message:`Минимальное значение: ${t}`}},max(t){return{type:"number",max:t,trigger:["blur","input"],message:`Максимальное значение: ${t}`}},step(t){return{type:"number",trigger:["blur","input"],validator:(e,n)=>n===null||Math.abs(n/t-Math.round(n/t))<1e-10?!0:new Error(`Значение должно быть кратно ${t}`)}}},De={serverValidation(t){return{validator:(e,n)=>n===null?!0:t?new Error(t):!0}}},Ym={class:"flex flex-col gap-4"},Um={class:"flex flex-col gap-2"},Km={class:"mt-8 font-bold"},Gm={class:"grid grow grid-cols-2 items-start gap-2"},Zm={key:2,class:"text-red-500 text-sm"},Qm={key:3,class:"text-red-500 text-sm mb-2"},Jm={class:"flex flex-col gap-4"},eg={key:1},tg={class:"text-lg font-semibold"},ng={class:"flex gap-3"},ig={},rg=i.defineComponent({...ig,__name:"kozyrek-configurator-params-form",props:{value:{},settings:{},previewParams:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},selectTemplateIndex:{}},emits:["update:value","update:params","submit","click:add-line","click:remove-line","click:save-template"],setup(t,{expose:e,emit:n}){var b;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.ref(!1),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>{var _,S,v;const y={"configuratorParams.length":[ae.required,ae.min(r.settings.stripMinLength),ae.max(r.settings.stripMaxLength||Number.MAX_VALUE),ae.step(r.settings.lengthStep),De.serverValidation((_=r.validation.length)==null?void 0:_.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),De.serverValidation((S=r.validation.quantity)==null?void 0:S.feedback)],marker:[De.serverValidation((v=r.validation.marker)==null?void 0:v.feedback)]};return M.forEach(l.value.configuratorParams.linesWidths,(T,R)=>{var x;const B=l.value.configuratorParams.linesWidths.length>1?r.settings.minLineWidth:r.settings.stripMinWidth;y[`configuratorParams.linesWidths.${R}`]=[ae.required,ae.min(B),ae.max(r.settings.maxLineWidth),ae.step(r.settings.lineWidthStep),De.serverValidation((x=r.validation[`lines_widths[${R+1}]`])==null?void 0:x.feedback)]}),M.forEach(l.value.configuratorParams.linesAngles,(T,R)=>{var w;y[`configuratorParams.linesAngles.${R}`]=[ae.required,ae.min(r.settings.minLineAngle),ae.max(r.settings.maxLineAngle),ae.step(r.settings.lineAngleStep),De.serverValidation((w=r.validation[`lines_angles[${R+1}]`])==null?void 0:w.feedback)]}),y}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>{var T;const{length:y}=l.value.configuratorParams,{quantity:_}=l.value,S=((T=l.value.product)==null?void 0:T.costRub)||0;if(!y||!_||S===0)return null;const v=y/1e3;return(S*_*v).toLocaleString("ru-ru",{maximumFractionDigits:2,minimumFractionDigits:2})}),h=i.computed(()=>M.reduce(l.value.configuratorParams.linesWidths,(y,_)=>y+(_||0),0)),m=i.computed(()=>{const y=h.value;return y>=r.settings.stripMinWidth&&y<=r.settings.stripMaxWidth}),g=i.computed(()=>{const{configuratorParams:y}=l.value,_=M.every(y.linesWidths,R=>!!(R&&R>0)),S=M.every(y.linesAngles,R=>!M.isNil(R)),v=!!(l.value.quantity&&l.value.quantity>0),T=y.length>0&&y.length>0;return _&&S&&v&&T&&m.value}),f=()=>{i.nextTick(()=>{var y;(y=o.value)==null||y.validate(_=>{_||(s("update:params",l.value.configuratorParams),p("configuratorParams",l.value.configuratorParams))}).catch(M.noop)})},p=(y,_)=>{const S=new Z.OrderItemBase(l.value);S[y]=_,y==="configuratorParams"&&(S.product=new Z.ClientProduct),s("update:value",S)};return i.watch(()=>r.previewParams,y=>{l.value.configuratorParams.linesWidths=y.linesWidths,l.value.configuratorParams.linesAngles=y.linesAngles},{deep:!0}),i.watch(()=>r.value,y=>{l.value=M.cloneDeep(y)},{deep:!0}),e({validate:(b=o.value)==null?void 0:b.validate,formReference:o}),(y,_)=>{const S=nl,v=Ds,T=L.NCheckbox;return i.openBlock(),i.createBlock(i.unref(L.NForm),{ref:"form-reference",model:l.value,rules:c.value,class:"flex flex-col gap-4 sc-hide-empty-feedback-message",onKeydown:_[20]||(_[20]=i.withKeys(i.withModifiers(R=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var R;return[i.createElementVNode("div",Ym,[_[22]||(_[22]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),t.settings.startTailConfigs&&t.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(L.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NSelect),{value:l.value.configuratorParams.startTailType,"onUpdate:value":[_[0]||(_[0]=w=>l.value.configuratorParams.startTailType=w),f],options:t.settings.startTailConfigs.map(({label:w},B)=>({label:w,value:B})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Um,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value.configuratorParams.linesAngles,(w,B)=>(i.openBlock(),i.createElementBlock("div",{key:B,class:"flex items-start gap-2"},[i.createElementVNode("div",Km,i.toDisplayString(B+1),1),i.createElementVNode("div",Gm,[i.createVNode(i.unref(L.NFormItem),{path:`configuratorParams.linesWidths.${B}`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:l.value.configuratorParams.linesWidths[B],"onUpdate:value":[x=>l.value.configuratorParams.linesWidths[B]=x,_[2]||(_[2]=x=>f())],parse:i.unref(Pt),"show-button":!1,class:"w-full",onKeydown:_[1]||(_[1]=x=>i.unref(st)(x)),onInput:x=>i.unref(Oe)(t.validation,`lines_widths[${B+1}]`),onFocus:i.unref(ze)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(L.NFormItem),{path:`configuratorParams.linesAngles.${B}`,label:"Угол сгиба, °"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:l.value.configuratorParams.linesAngles[B],"onUpdate:value":[x=>l.value.configuratorParams.linesAngles[B]=x,_[4]||(_[4]=x=>f())],parse:i.unref(Pt),"show-button":!1,class:"w-full",onKeydown:_[3]||(_[3]=x=>i.unref(st)(x,!0)),onInput:x=>i.unref(Oe)(t.validation,`lines_angles[${B+1}]`),onFocus:i.unref(ze)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"])]),i.createVNode(i.unref(L.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(L.NButton),{key:0,size:"medium",onClick:x=>s("click:add-line",B)},{default:i.withCtx(()=>[i.createVNode(S)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(L.NButton),{key:1,disabled:l.value.configuratorParams.linesWidths.length===1,size:"medium",class:"ml-2",onClick:x=>s("click:remove-line",B)},{default:i.withCtx(()=>[i.createVNode(v)]),_:1},8,["disabled","onClick"]))]),_:2},1024)]))),128))]),t.settings.endTailConfigs&&t.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(L.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NSelect),{value:l.value.configuratorParams.endTailType,"onUpdate:value":[_[5]||(_[5]=w=>l.value.configuratorParams.endTailType=w),f],options:t.settings.endTailConfigs.map(({label:w},B)=>({label:w,value:B})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(lr,{"is-product-searching":t.isProductSearching,product:l.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),m.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Zm," Суммарная ширина участков гиба должна быть от "+i.toDisplayString(t.settings.stripMinWidth)+" до "+i.toDisplayString(t.settings.stripMaxWidth)+" мм., текущая ширина: "+i.toDisplayString(h.value)+" мм. ",1)),g.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Qm," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((R=t.settings.allTemplates)==null?void 0:R.length)-1?(i.openBlock(),i.createBlock(i.unref(L.NButton),{key:4,type:"tertiary",class:"self-start",loading:a.value,onClick:_[6]||(_[6]=w=>s("click:save-template"))},{default:i.withCtx(()=>[..._[21]||(_[21]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Jm,[i.createVNode(i.unref(L.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NSelect),{value:l.value.configuratorParams.colorSide,"onUpdate:value":[_[7]||(_[7]=w=>l.value.configuratorParams.colorSide=w),f],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(L.NFormItem),{path:"configuratorParams.length",label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[_[8]||(_[8]=w=>l.value.configuratorParams.length=w),_[11]||(_[11]=w=>f())],parse:i.unref(Pt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:_[9]||(_[9]=w=>i.unref(st)(w)),onInput:_[10]||(_[10]=w=>i.unref(Oe)(t.validation,"length")),onFocus:i.unref(ze)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(L.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:l.value.quantity,"onUpdate:value":[_[12]||(_[12]=w=>l.value.quantity=w),_[15]||(_[15]=w=>p("quantity",w??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:_[13]||(_[13]=w=>i.unref(st)(w,!1)),onInput:_[14]||(_[14]=w=>i.unref(Oe)(t.validation,"quantity")),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(L.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInput),{value:l.value.marker??null,placeholder:"Введите маркировку",onInput:_[16]||(_[16]=w=>i.unref(Oe)(t.validation,"marker")),"onUpdate:value":_[17]||(_[17]=w=>{l.value.marker=w??null,p("marker",w??null)}),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(T,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":_[18]||(_[18]=w=>{l.value.isAdditionalSale=w??!1,p("isAdditionalSale",w??!1)})},{default:i.withCtx(()=>[..._[23]||(_[23]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createElementBlock("div",eg,[_[24]||(_[24]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",tg,i.toDisplayString(u.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",ng,[i.createVNode(i.unref(L.NButton),{loading:t.isSubmitProcessing,disabled:!g.value||l.value.product.isNewRec(),type:"primary",class:"self-start",onClick:_[19]||(_[19]=w=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1},8,["model","rules"])}}}),il=Wn(rg,[["__scopeId","data-v-47ba4507"]]);var rl=Object.defineProperty,sg=Object.defineProperties,og=Object.getOwnPropertyDescriptors,sl=Object.getOwnPropertySymbols,ag=Object.prototype.hasOwnProperty,lg=Object.prototype.propertyIsEnumerable,ol=t=>{throw TypeError(t)},Hs=(t,e,n)=>e in t?rl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ws=(t,e)=>{for(var n in e||(e={}))ag.call(e,n)&&Hs(t,n,e[n]);if(sl)for(var n of sl(e))lg.call(e,n)&&Hs(t,n,e[n]);return t},js=(t,e)=>sg(t,og(e)),al=(t,e)=>{for(var n in e)rl(t,n,{get:e[n],enumerable:!0})},k=(t,e,n)=>Hs(t,typeof e!="symbol"?e+"":e,n),ll=(t,e,n)=>e.has(t)||ol("Cannot "+n),Nt=(t,e,n)=>(ll(t,e,"read from private field"),n?n.call(t):e.get(t)),cl=(t,e,n)=>e.has(t)?ol("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),cg=(t,e,n,r)=>(ll(t,e,"write to private field"),e.set(t,n),n),kt={Image:null,isHeadless:!1,shim:function(t,e){return t.tagName=t.nodeName=e||"canvas",t.nodeType=1,t.getAttribute=function(n){return this[n]},t.setAttribute=function(n,r){return this[n]=r,this},t},polyfill:function(t,e){return kt.shim(t),typeof e<"u"&&(kt.Image=e),kt.isHeadless=!0,t}},dl={};al(dl,{Curve:()=>Oi,getAnchorsFromArcData:()=>hg,getComponentOnCubicBezier:()=>cr,getControlPoints:()=>xl,getCurveBoundingBox:()=>bl,getCurveFromPoints:()=>wl,getCurveLength:()=>yl,getReflection:()=>Us,integrate:()=>_l,subdivide:()=>Ys});var ul={};al(ul,{HALF_PI:()=>et,NumArray:()=>un,TWO_PI:()=>ut,decomposeMatrix:()=>li,getComputedMatrix:()=>qs,getEffectiveStrokeWidth:()=>hn,getPoT:()=>ml,lerp:()=>Vt,mod:()=>It,setMatrix:()=>fl,toFixed:()=>Ae});var je;typeof window<"u"?je=window:typeof global<"u"?je=global:typeof self<"u"&&(je=self);var hl,ut=Math.PI*2,et=Math.PI*.5;function li(t,e,n,r,s,o){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,s=t.e,o=t.f):a=t,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function fl(t){hl=t}function qs(t,e){e=e&&e.identity()||new hl;let n=t;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function Vt(t,e,n){return n*(e-t)+t}var Xs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function ml(t){let e=0;for(;Xs[e]&&Xs[e]<t;)e++;return Xs[e]}function It(t,e){for(;t<0;)t+=e;return t%e}var un=je.Float32Array||Array,dg=Math.floor;function Ae(t){return dg(t*1e6)/1e6}function hn(t,e){const n=t._linewidth;if(t.strokeAttenuation)return n;e||(e=t.worldMatrix||qs(t));const r=li(e.elements[0],e.elements[3],e.elements[1],e.elements[4],e.elements[2],e.elements[5]),s=Math.max(Math.abs(r.scaleX),Math.abs(r.scaleY));return s>0?n/s:n}var ne={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},U=class{constructor(){k(this,"_events",{}),k(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){e=r[s];let a=this._events[e];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let u=a[c];u=u.handler?u.handler:u,n!==u&&l.push(u)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,n,r){const s=this;e&&(o.obj=e,o.name=n,o.handler=r,e.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(e,n,r){return e.off(n,r),this}};k(U,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),k(U,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var gl={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(U.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(U.Types.change))}}},Qt=class ir extends U{constructor(e=0,n=0){super(),k(this,"_x",0),k(this,"_y",0);for(let r in gl)Object.defineProperty(this,r,gl[r]);this.x=e,this.y=n}static add(e,n){return new ir(e.x+n.x,e.y+n.y)}static sub(e,n){return new ir(e.x-n.x,e.y-n.y)}static subtract(e,n){return ir.sub(e,n)}static ratioBetween(e,n){return(e.x*n.x+e.y*n.y)/(e.length()*n.length())}static angleBetween(e,n){if(arguments.length>=4){const o=arguments[0]-arguments[2],a=arguments[1]-arguments[3];return Math.atan2(a,o)}const r=e.x-n.x,s=e.y-n.y;return Math.atan2(s,r)}static distanceBetween(e,n){return Math.sqrt(ir.distanceBetweenSquared(e,n))}static distanceBetweenSquared(e,n){const r=e.x-n.x,s=e.y-n.y;return r*r+s*s}set(e,n){return this.x=e,this.y=n,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new ir(this.x,this.y)}add(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x+=e,this.y+=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=n),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x-=e,this.y-=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=n),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x*=e,this.y*=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=n),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x/=e,this.y/=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=n),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,n){return n=typeof n>"u"?1e-4:n,this.distanceTo(e)<n}lerp(e,n){const r=(e.x-this.x)*n+this.x,s=(e.y-this.y)*n+this.y;return this.set(r,s)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:Ae(this.x),y:Ae(this.y)}}rotate(e){const n=this.x,r=this.y,s=Math.cos(e),o=Math.sin(e);return this.x=n*s-r*o,this.y=n*o+r*s,this}};k(Qt,"zero",new Qt),k(Qt,"left",new Qt(-1,0)),k(Qt,"right",new Qt(1,0)),k(Qt,"up",new Qt(0,-1)),k(Qt,"down",new Qt(0,1));var te=Qt,ve=class Is extends te{constructor(e=0,n=0,r=0,s=0,o=0,a=0,l=ne.move){super(e,n),k(this,"controls",{left:new te,right:new te}),k(this,"_command",ne.move),k(this,"_relative",!0),k(this,"_rx",0),k(this,"_ry",0),k(this,"_xAxisRotation",0),k(this,"_largeArcFlag",0),k(this,"_sweepFlag",1);for(let d in pl)Object.defineProperty(this,d,pl[d]);this.command=l,this.relative=!0;const c=Is.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(U.Types.change,c),this.controls.right.set(o,a).addEventListener(U.Types.change,c)}static makeBroadcast(e){return n;function n(){e._bound&&e.dispatchEvent(U.Types.change)}}static fromObject(e){return new Is().copy(e)}copy(e){return this.x=e.x,this.y=e.y,typeof e.command=="string"&&(this.command=e.command),e.controls&&(e.controls.left&&this.controls.left.copy(e.controls.left),e.controls.right&&this.controls.right.copy(e.controls.right)),typeof e.relative=="boolean"&&(this.relative=e.relative),typeof e.rx=="number"&&(this.rx=e.rx),typeof e.ry=="number"&&(this.ry=e.ry),typeof e.xAxisRotation=="number"&&(this.xAxisRotation=e.xAxisRotation),typeof e.largeArcFlag=="number"&&(this.largeArcFlag=e.largeArcFlag),typeof e.sweepFlag=="number"&&(this.sweepFlag=e.sweepFlag),this}clone(){return new Is().copy(this)}toObject(){return{x:Ae(this.x),y:Ae(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Ae(this.rx),ry:Ae(this.ry),xAxisRotation:Ae(this.xAxisRotation),largeArcFlag:Ae(this.largeArcFlag),sweepFlag:Ae(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},pl={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(U.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(U.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(U.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(U.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(U.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(U.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(U.Types.change))}}},ug=0,vt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.21",PublishDate:"2025-10-01T00:18:49.277Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return ug++}},Oi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function cr(t,e,n,r,s){const o=1-t;return o*o*o*e+3*o*o*t*n+3*o*t*t*r+t*t*t*s}function Ys(t,e,n,r,s,o,a,l,c){c=c||Oi.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new ve(a,l)];const u=[];for(let h=0;h<d;h++){const m=h/d,g=cr(m,t,n,s,a),f=cr(m,e,r,o,l);u.push(new ve(g,f))}return u}function yl(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-s)+3*(a-t),u=6*(t+s)-12*n,h=3*(n-t),m=9*(r-o)+3*(l-e),g=6*(e+o)-12*r,f=3*(r-e);function p(b){const y=(d*b+u)*b+h,_=(m*b+g)*b+f;return Math.sqrt(y*y+_*_)}return _l(p,0,1,c||Oi.RecursionLimit)}function bl(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let u,h,m,g,f,p,b,y;for(let T=0;T<2;++T){if(T===0?(h=6*t-12*n+6*s,u=-3*t+9*n-9*s+3*a,m=3*n-3*t):(h=6*e-12*r+6*o,u=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;g=-m/h,0<g&&g<1&&c.push(g);continue}b=h*h-4*m*u,y=Math.sqrt(b),!(b<0)&&(f=(-h+y)/(2*u),0<f&&f<1&&c.push(f),p=(-h-y)/(2*u),0<p&&p<1&&c.push(p))}let _=c.length,S=_,v;for(;_--;)g=c[_],v=1-g,d[0][_]=v*v*v*t+3*v*v*g*n+3*v*g*g*s+g*g*g*a,d[1][_]=v*v*v*e+3*v*v*g*r+3*v*g*g*o+g*g*g*l;return d[0][S]=t,d[1][S]=e,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function _l(t,e,n,r){let s=Oi.abscissas[r-2],o=Oi.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,u=r&1?o[c++]*t(l):0;for(;c<d;){const h=a*s[c];u+=o[c++]*(t(l+h)+t(l-h))}return a*u}function wl(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?It(s-1,n):Math.max(s-1,0),l=e?It(s+1,n):Math.min(s+1,r),c=t[a],d=o,u=t[l];xl(c,d,u),d.command=s===0?ne.move:ne.curve}}function xl(t,e,n){const r=te.angleBetween(t,e),s=te.angleBetween(n,e);let o=te.distanceBetween(t,e),a=te.distanceBetween(n,e),l=(r+s)/2;return o<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(o*=.33,a*=.33,s<r?l+=et:l-=et,e.controls.left.x=Math.cos(l)*o,e.controls.left.y=Math.sin(l)*o,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}function Us(t,e,n){return new te(2*t.x-(e.x+t.x)-(n?t.x:0),2*t.y-(e.y+t.y)-(n?t.y:0))}function hg(t,e,n,r,s,o,a){const l=vt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const u=d*o+s,h=n*Math.cos(u),m=r*Math.sin(u),g=new ve(h,m);g.command=ne.line}}var kl=Array.prototype.slice;function fg(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var J={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=kl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]=r[s]}return t},defaults:function(t){const e=kl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]===void 0&&(t[s]=r[s])}return t},each:function(t,e,n){const r=n||this,s=!fg(t)&&Object.keys(t),o=(s||t).length;for(let a=0;a<o;a++){const l=s?s[a]:a;e.call(r,t[l],l,t)}return t},performance:je.performance&&je.performance.now?je.performance:Date},Ot={hasEventListeners:typeof je.addEventListener=="function",bind:function(t,e,n,r){return this.hasEventListeners?t.addEventListener(e,n,!!r):t.attachEvent("on"+e,n),Ot},unbind:function(t,e,n,r){return Ot.hasEventListeners?t.removeEventListeners(e,n,!!r):t.detachEvent("on"+e,n),Ot},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,n=je.requestAnimationFrame;if(!n){for(let s=0;s<t.length;s++)n=je[t[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=je.setTimeout(d,l);e=a+l;function d(){s(a+l)}return c}return n}},zi=je.document?je.document.createElement("div"):{};zi.id="help-two-load",Object.defineProperty(Ot,"temp",{enumerable:!0,get:function(){return J.isElement(zi)&&!je.document.head.contains(zi)&&(zi.style.display="none",je.document.head.appendChild(zi)),zi}});var Et=class extends Error{constructor(e){super(),k(this,"name","Two.js"),k(this,"message"),this.message=e}},mg=je.devicePixelRatio||1;function gg(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function Ks(t){return mg/gg(t)}var Or=class{constructor(){k(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}},ht,qn=class extends Array{constructor(){super(),cl(this,ht,new U),arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return Nt(this,ht)}set _events(e){cg(this,ht,e)}get _bound(){return Nt(this,ht)._bound}set _bound(e){Nt(this,ht)._bound=e}addEventListener(){return Nt(this,ht).addEventListener.apply(this,arguments)}on(){return Nt(this,ht).on.apply(this,arguments)}bind(){return Nt(this,ht).bind.apply(this,arguments)}removeEventListener(){return Nt(this,ht).removeEventListener.apply(this,arguments)}off(){return Nt(this,ht).off.apply(this,arguments)}unbind(){return Nt(this,ht).unbind.apply(this,arguments)}dispatchEvent(){return Nt(this,ht).dispatchEvent.apply(this,arguments)}trigger(){return Nt(this,ht).trigger.apply(this,arguments)}listen(){return Nt(this,ht).listen.apply(this,arguments)}ignore(){return Nt(this,ht).ignore.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(U.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(U.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(U.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(U.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(U.Types.remove,e),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(U.Types.insert,n),this.trigger(U.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(U.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(U.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(e,n){const r=[];for(let s=0;s<this.length;s++){const o=this[s];let a;n?a=e.call(n,o,s):a=e(o,s),r.push(a)}return r}};ht=new WeakMap;var vl=class Yh extends U{constructor(){super(),k(this,"_flagId",!1),k(this,"_flagClassName",!1),k(this,"_renderer",{}),k(this,"_id",vt.Identifier+vt.uniqueId()),k(this,"_className",""),k(this,"classList",[]);for(let e in Cl)Object.defineProperty(this,e,Cl[e])}static fromObject(e){const n=new Yh().copy(e);return"id"in e&&(n.id=e.id),n}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return e.renderer&&typeof e.renderer.type=="string"&&(this.renderer.type=e.renderer.type),typeof e.className=="string"&&(this.className=e.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const e=this._renderer.type;return this._renderer={type:e},typeof this.unbind=="function"&&this.unbind(),this}};k(vl,"Properties",["renderer","id","className"]);var Li=vl,Cl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}},zr,Sl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};je.document&&(zr=document.createElement("a"));var Jt=class Ht extends Li{constructor(e,n){super(),k(this,"_flagSrc",!1),k(this,"_flagImage",!1),k(this,"_flagVideo",!1),k(this,"_flagLoaded",!1),k(this,"_flagRepeat",!1),k(this,"_flagOffset",!1),k(this,"_flagScale",!1),k(this,"_src",""),k(this,"_image",null),k(this,"_loaded",!1),k(this,"_repeat","no-repeat"),k(this,"_scale",1),k(this,"_offset",null);for(let r in Bl)Object.defineProperty(this,r,Bl[r]);if(this._renderer.type="texture",this._renderer.flagOffset=pg.bind(this),this._renderer.flagScale=yg.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new te,typeof n=="function"){const r=(function(){this.unbind(U.Types.load,r),typeof n=="function"&&n()}).bind(this);this.bind(U.Types.load,r)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const r=Object.prototype.toString.call(e);(r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]"||r==="[object HTMLVideoElement]"||r==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const n=new Ht().copy(e);return"id"in e&&(n.id=e.id),n}static getAbsoluteURL(e){return zr?(zr.href=e,zr.href):e}static loadHeadlessBuffer(e,n){e.image.onload=n,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const n=Ht.getAbsoluteURL(e);if(Ht.ImageRegistry.contains(n))return Ht.ImageRegistry.get(n);let r;return kt.Image?(r=new kt.Image,kt.shim(r,"img")):je.document?Sl.video.test(n)?r=document.createElement("video"):r=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),r.crossOrigin="anonymous",r.referrerPolicy="no-referrer",r}static load(e,n){let r=e.image,s=Ht.getTag(r);e._flagImage&&(/canvas/i.test(s)?Ht.Register.canvas(e,n):(e._src=!kt.isHeadless&&r.getAttribute("two-src")||r.src,Ht.Register[s](e,n))),e._flagSrc&&(r||(r=Ht.getImage(e.src),e.image=r),s=Ht.getTag(r),Ht.Register[s](e,n))}clone(){const e=new Ht(this.src);return e.repeat=this.repeat,e.offset.copy(this.offset),e.scale=this.scale,e}copy(e){return this.src=e.src,this.repeat=e.repeat,this.offset=typeof e.offset=="number"||e.offset instanceof te?e.offset:new te().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof te?e.scale:new te().copy(e.scale),this}toObject(){const e=super.toObject.call(this);return e.renderer.type="texture",e.src=this.src,e.repeat=this.repeat,e.offset=this.offset.toObject(),e.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),e}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(U.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Ht.load(this,(function(){this.loaded=!0,this.trigger(U.Types.change).trigger(U.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};k(Jt,"Properties",["src","loaded","repeat","scale","offset","image"]),k(Jt,"RegularExpressions",Sl),k(Jt,"ImageRegistry",new Or),k(Jt,"Register",{canvas:function(t,e){t._src="#"+t.id,Jt.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const n=t.image,r=function(o){!kt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),typeof e=="function"&&e()},s=function(o){throw!kt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new Et("unable to load "+t.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!kt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),t._src=Jt.getAbsoluteURL(t._src),!(!kt.isHeadless&&n&&n.getAttribute("two-src"))&&(kt.isHeadless||n.setAttribute("two-src",t.src),Jt.ImageRegistry.add(t.src,n),kt.isHeadless?Jt.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(kt.isHeadless)throw new Et("video textures are not implemented in headless environments.");const n=function(s){t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),t.image.width=t.image.videoWidth,t.image.height=t.image.videoHeight,typeof e=="function"&&e()},r=function(s){throw t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),new Et("unable to load "+t.src)};t._src=Jt.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),Jt.ImageRegistry.add(t.src,t.image)),t.image.readyState>=4?n():(t.image.addEventListener("canplaythrough",n,!1),t.image.addEventListener("error",r,!1),t.image.src=t.src,t.image.load())}});var Me=Jt,Bl={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=Me.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Me.ImageRegistry.contains(n)?this._image=Me.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(U.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(U.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof te&&this._scale.unbind(U.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof te&&this._scale.bind(U.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function pg(){this._flagOffset=!0}function yg(){this._flagScale=!0}var Gs=class dn extends Li{constructor(e,n,r){super(),k(this,"_flagOffset",!0),k(this,"_flagOpacity",!0),k(this,"_flagColor",!0),k(this,"_offset",0),k(this,"_opacity",1),k(this,"_color","#fff");for(let s in Tl)Object.defineProperty(this,s,Tl[s]);this._renderer.type="stop",this.offset=typeof e=="number"?e:dn.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof n=="string"?n:dn.Index<=0?"#fff":"#000",dn.Index=(dn.Index+1)%2}static fromObject(e){const n=new dn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<dn.Properties.length;n++){const r=dn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new dn;return J.each(dn.Properties,function(r){n[r]=this[r]},this),e&&e.stops&&e.stops.push(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",J.each(dn.Properties,n=>{e[n]=this[n]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};k(Gs,"Index",0),k(Gs,"Properties",["offset","opacity","color"]);var Xn=Gs,Tl={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},Zs=class Pi extends Li{constructor(e){super(),k(this,"_flagStops",!1),k(this,"_flagSpread",!1),k(this,"_flagUnits",!1),k(this,"_spread",""),k(this,"_units","");for(let n in Rl)Object.defineProperty(this,n,Rl[n]);this._renderer.type="gradient",this._renderer.flagStops=bg.bind(this),this._renderer.bindStops=_g.bind(this),this._renderer.unbindStops=wg.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let n=e.stops;n&&n.length>0&&(n=n.map(s=>s instanceof Xn?s:new Xn().copy(s)));const r=new Pi(n).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const n=this.stops.map(s=>s.clone()),r=new Pi(n);return J.each(Pi.Properties,s=>{r[s]=this[s]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let n=0;n<Pi.Properties.length;n++){const r=Pi.Properties[n];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(n=>n.toObject())};return J.each(Pi.Properties,n=>{e[n]=this[n]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};k(Zs,"Stop",Xn),k(Zs,"Properties",["spread","stops","units"]);var tt=Zs,Rl={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(U.Types.insert,e).unbind(U.Types.remove,n),this._stops=new qn((t||[]).slice(0)),this._stops.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._stops)}}};function bg(){this._flagStops=!0}function _g(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function wg(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var Qs=class Nr extends tt{constructor(e,n,r,s,o){super(o),k(this,"_flagEndPoints",!1),k(this,"_left",null),k(this,"_right",null);for(let a in $l)Object.defineProperty(this,a,$l[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=xg.bind(this),this.left=new te,this.right=new te,typeof e=="number"&&(this.left.x=e),typeof n=="number"&&(this.left.y=n),typeof r=="number"&&(this.right.x=r),typeof s=="number"&&(this.right.y=s)}static fromObject(e){const n=new Nr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Nr.Properties.length;n++){const r=Nr.Properties[n];r in e&&(this[r]=e[r]instanceof te?e[r]:new te().copy(e[r]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new Nr(this.left._x,this.left._y,this.right._x,this.right._y,n);return J.each(tt.Properties,function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};k(Qs,"Stop",Xn),k(Qs,"Properties",["left","right"]);var qe=Qs,$l={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof te&&this._left.unbind(U.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(U.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof te&&this._right.unbind(U.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(U.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function xg(){this._flagEndPoints=!0}var Js=class Ni extends tt{constructor(e,n,r,s,o,a){super(s),k(this,"_flagRadius",!1),k(this,"_flagCenter",!1),k(this,"_flagFocal",!1),k(this,"_radius",0),k(this,"_center",null),k(this,"_focal",null);for(let l in Pl)Object.defineProperty(this,l,Pl[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=kg.bind(this),this._renderer.flagFocal=vg.bind(this),this.center=new te,this.radius=typeof r=="number"?r:1,this.focal=new te,typeof e=="number"&&(this.center.x=e),typeof n=="number"&&(this.center.y=n),this.focal.copy(this.center),typeof o=="number"&&(this.focal.x=o),typeof a=="number"&&(this.focal.y=a)}static fromObject(e){const n=new Ni().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ni.Properties.length;n++){const r=Ni.Properties[n];r in e&&(/(center|focal)i/.test(r)?this[r]=e[r]instanceof te?e[r]:new te().copy(e[r]):typeof e[r]=="number"&&(this[r]=e[MediaKeySystemAccess]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new Ni(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return J.each(tt.Properties.concat(Ni.Properties),function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return J.each(Ni.Properties,function(n){e[n]=this[n]},this),e.center=this.center.toObject(),e.focal=this.focal.toObject(),e}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};k(Js,"Stop",Xn),k(Js,"Properties",["center","radius","focal"]);var Xe=Js,Pl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(U.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(U.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(U.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(U.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function kg(){this._flagCenter=!0}function vg(){this._flagFocal=!0}function Nl(t,e){if(e===0||e===1)return!0;const r=t._length*e;let s=0;for(let o=0;o<t._lengths.length;o++){const a=t._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Lr(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,s=0;r<t._lengths.length;r++){if(s+t._lengths[r]>=e)return e-=s,Math.max(r-1,0)+e/t._lengths[r];s+=t._lengths[r]}return-1}function El(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(m||t).x,d=(m||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),yl(r,l,s,c,o,d,a,u,n)}function Fl(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(m||t).x,d=(m||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),Ys(r,l,s,c,o,d,a,u,n)}function ci(t){switch(t.renderer.type){case"texture":return Me.fromObject(t);case"gradient":return tt.fromObject(t);case"linear-gradient":return qe.fromObject(t);case"radial-gradient":return Xe.fromObject(t)}return t}var Cg=Math.cos,Sg=Math.sin,Al=Math.tan,eo=[],Ml=class Wt extends U{constructor(e,n,r,s,o,a){super(),k(this,"elements",new un(9)),k(this,"manual",!1);let l=e;Array.isArray(l)||(l=Array.prototype.slice.call(arguments)),this.identity(),l.length>0&&this.set(l)}static Multiply(e,n,r){if(n.length<=3){const R=e;let w,B,x;const $=n[0]||0,P=n[1]||0,A=n[2]||0;return w=R[0]*$+R[1]*P+R[2]*A,B=R[3]*$+R[4]*P+R[5]*A,x=R[6]*$+R[7]*P+R[8]*A,[w,B,x]}const s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],u=e[6],h=e[7],m=e[8],g=n[0],f=n[1],p=n[2],b=n[3],y=n[4],_=n[5],S=n[6],v=n[7],T=n[8];return r=r||new un(9),r[0]=s*g+o*b+a*S,r[1]=s*f+o*y+a*v,r[2]=s*p+o*_+a*T,r[3]=l*g+c*b+d*S,r[4]=l*f+c*y+d*v,r[5]=l*p+c*_+d*T,r[6]=u*g+h*b+m*S,r[7]=u*f+h*y+m*v,r[8]=u*p+h*_+m*T,r}static fromObject(e){return new Wt().copy(e)}set(e,n,r,s,o,a,l,c,d){if(typeof n>"u"){const u=e;e=u[0],n=u[1],r=u[2],s=u[3],o=u[4],a=u[5],l=u[6],c=u[7],d=u[8]}return this.elements[0]=e,this.elements[1]=n,this.elements[2]=r,this.elements[3]=s,this.elements[4]=o,this.elements[5]=a,this.elements[6]=l,this.elements[7]=c,this.elements[8]=d,this.trigger(U.Types.change)}copy(e){return this.elements[0]=e.elements[0],this.elements[1]=e.elements[1],this.elements[2]=e.elements[2],this.elements[3]=e.elements[3],this.elements[4]=e.elements[4],this.elements[5]=e.elements[5],this.elements[6]=e.elements[6],this.elements[7]=e.elements[7],this.elements[8]=e.elements[8],this.manual=e.manual,this.trigger(U.Types.change)}identity(){return this.elements[0]=Wt.Identity[0],this.elements[1]=Wt.Identity[1],this.elements[2]=Wt.Identity[2],this.elements[3]=Wt.Identity[3],this.elements[4]=Wt.Identity[4],this.elements[5]=Wt.Identity[5],this.elements[6]=Wt.Identity[6],this.elements[7]=Wt.Identity[7],this.elements[8]=Wt.Identity[8],this.trigger(U.Types.change)}multiply(e,n,r,s,o,a,l,c,d){if(typeof n>"u")return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(U.Types.change);if(typeof r>"u"&&(r=1),typeof s>"u"){e=e||0,n=n||0,r=r||0,o=this.elements;const F=o[0]*e+o[1]*n+o[2]*r,N=o[3]*e+o[4]*n+o[5]*r,Y=o[6]*e+o[7]*n+o[8]*r;return[F,N,Y]}const u=this.elements,h=[e,n,r,s,o,a,l,c,d],m=u[0],g=u[1],f=u[2],p=u[3],b=u[4],y=u[5],_=u[6],S=u[7],v=u[8],T=h[0],R=h[1],w=h[2],B=h[3],x=h[4],$=h[5],P=h[6],A=h[7],V=h[8];return this.elements[0]=m*T+g*B+f*P,this.elements[1]=m*R+g*x+f*A,this.elements[2]=m*w+g*$+f*V,this.elements[3]=p*T+b*B+y*P,this.elements[4]=p*R+b*x+y*A,this.elements[5]=p*w+b*$+y*V,this.elements[6]=_*T+S*B+v*P,this.elements[7]=_*R+S*x+v*A,this.elements[8]=_*w+S*$+v*V,this.trigger(U.Types.change)}inverse(e){const n=this.elements;e=e||new Wt;const r=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],d=n[6],u=n[7],h=n[8],m=h*l-c*u,g=-h*a+c*d,f=u*a-l*d;let p=r*m+s*g+o*f;return p?(p=1/p,e.elements[0]=m*p,e.elements[1]=(-h*s+o*u)*p,e.elements[2]=(c*s-o*l)*p,e.elements[3]=g*p,e.elements[4]=(h*r-o*d)*p,e.elements[5]=(-c*r+o*a)*p,e.elements[6]=f*p,e.elements[7]=(-u*r+s*d)*p,e.elements[8]=(l*r-s*a)*p,e):null}scale(e,n){return arguments.length<=1&&(n=e),this.multiply(e,0,0,0,n,0,0,0,1)}rotate(e){const n=Cg(e),r=Sg(e);return this.multiply(n,-r,0,r,n,0,0,0,1)}translate(e,n){return this.multiply(1,0,e,0,1,n,0,0,1)}skewX(e){const n=Al(e);return this.multiply(1,n,0,0,1,0,0,0,1)}skewY(e){const n=Al(e);return this.multiply(1,0,0,n,1,0,0,0,1)}toString(e){return eo.length=0,this.toTransformArray(e,eo),eo.map(Ae).join(" ")}toTransformArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],u=r[5];if(e){const h=r[6],m=r[7],g=r[8];if(s){n[0]=o,n[1]=c,n[2]=h,n[3]=a,n[4]=d,n[5]=m,n[6]=l,n[7]=u,n[8]=g;return}return[o,c,h,a,d,m,l,u,g]}if(s){n[0]=o,n[1]=c,n[2]=a,n[3]=d,n[4]=l,n[5]=u;return}return[o,c,a,d,l,u]}toArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],u=r[5];if(e){const h=r[6],m=r[7],g=r[8];if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=u,n[6]=h,n[7]=m,n[8]=g;return}return[o,a,l,c,d,u,h,m,g]}if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=u;return}return[o,a,l,c,d,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Wt().copy(this)}};k(Ml,"Identity",[1,0,0,0,1,0,0,0,1]);var Di=Ml;fl(Di);var Vl=class ja extends Li{constructor(){super(),k(this,"_flagMatrix",!0),k(this,"_flagScale",!1),k(this,"_matrix",null),k(this,"_worldMatrix",null),k(this,"_position",null),k(this,"_rotation",0),k(this,"_scale",1),k(this,"_skewX",0),k(this,"_skewY",0);for(let e in Dr)Object.defineProperty(this,e,Dr[e]);this._renderer.flagMatrix=Il.bind(this),this.isShape=!0,this.matrix=new Di,this.worldMatrix=new Di,this.position=new te,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const n=new ja().copy(e);return"id"in e&&(n.id=e.id),n}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return Dr.position.get.apply(this,arguments)}set translation(e){Dr.position.set.apply(this,arguments)}addTo(e){return e.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(e){return super.copy.call(this,e),"position"in e&&(e.position instanceof te?this.position=e.position:this.position.copy(e.position)),"rotation"in e&&(this.rotation=e.rotation),"scale"in e&&(this.scale=typeof e.scale=="number"||e.scale instanceof te?e.scale:new te(e.scale.x,e.scale.y)),"skewX"in e&&(this.skewX=e.skewX),"skewY"in e&&(this.skewY=e.skewY),"matrix"in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(e){const n=new ja;return n.position.copy(this.position),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer={type:"shape"},e.isShape=!0,e.translation=this.translation.toObject(),e.rotation=this.translation.rotation,e.scale=this.scale instanceof te?this.scale.toObject():this.scale,e.skewX=this.skewX,e.skewY=this.skewY,e.matrix=this.matrix.toObject(),e}_update(e){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof te?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),e&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};k(Vl,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Yn=Vl,Dr={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(U.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(U.Types.change,this._renderer.flagMatrix),Il.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof te&&this._scale.unbind(U.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof te&&this._scale.bind(U.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return qs(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Il(){this._flagMatrix=!0}var Hi=Math.min,Wi=Math.max,Bg=Math.ceil,Tg=Math.floor,Rg=new te,to=class ri extends Yn{constructor(e,n,r,s){super(),k(this,"_flagVertices",!0),k(this,"_flagLength",!0),k(this,"_flagFill",!0),k(this,"_flagStroke",!0),k(this,"_flagLinewidth",!0),k(this,"_flagOpacity",!0),k(this,"_flagVisible",!0),k(this,"_flagCap",!0),k(this,"_flagJoin",!0),k(this,"_flagMiter",!0),k(this,"_flagStrokeAttenuation",!0),k(this,"_flagMask",!1),k(this,"_flagClip",!1),k(this,"_length",0),k(this,"_fill","#fff"),k(this,"_stroke","#000"),k(this,"_linewidth",1),k(this,"_opacity",1),k(this,"_visible",!0),k(this,"_cap","round"),k(this,"_join","round"),k(this,"_miter",4),k(this,"_closed",!0),k(this,"_curved",!1),k(this,"_automatic",!0),k(this,"_beginning",0),k(this,"_ending",1),k(this,"_mask",null),k(this,"_clip",!1),k(this,"_dashes",null),k(this,"_strokeAttenuation",!0);for(let o in Ol)Object.defineProperty(this,o,Ol[o]);this._renderer.type="path",this._renderer.flagVertices=zl.bind(this),this._renderer.bindVertices=Ll.bind(this),this._renderer.unbindVertices=Dl.bind(this),this._renderer.flagFill=Hl.bind(this),this._renderer.flagStroke=Wl.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!n,this.curved=!!r,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!s,this.dashes=[],this.dashes.offset=0}static fromObject(e){const n=typeof e.fill=="string"?e.fill:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),s=new ri().copy(js(Ws({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){if(super.copy.call(this,e),e.vertices){this.vertices=[];for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof ve?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new ve().copy(r))}}for(let n=0;n<ri.Properties.length;n++){const r=ri.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new ri;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<ri.Properties.length;r++){const s=ri.Properties[r];n[s]=this[s]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(n=>n.toObject()),J.each(ri.Properties,n=>{typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind(),n.controls&&(n.controls.left&&typeof n.controls.left.unbind=="function"&&n.controls.left.unbind(),n.controls.right&&typeof n.controls.right.unbind=="function"&&n.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),n=e.width/2,r=e.height/2,s=e.left+e.width/2,o=e.top+e.height/2;for(let a=0;a<this.vertices.length;a++){const l=this.vertices[a];l.x-=s,l.y-=o,l.x+=n,l.y+=r}return this.mask&&(this.mask.translation.x-=s,this.mask.translation.x+=n,this.mask.translation.y-=o,this.mask.translation.y+=r),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s];o.x-=n,o.y-=r}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getBoundingClientRect(e){let n,r,s,o,a,l,c=1/0,d=-1/0,u=1/0,h=-1/0;if(this._update(!0),n=e?this.matrix:this.worldMatrix,r=(this.linewidth||0)/2,s=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:m,scaleY:g}=li(n.elements[0],n.elements[3],n.elements[1],n.elements[4],n.elements[2],n.elements[5]);typeof m=="number"&&typeof g=="number"&&(r=Math.max(m,g)*(this.linewidth||0)/2)}else r*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(s<=0)return{width:0,height:0};for(o=0;o<s;o++){l=this._renderer.vertices[o],a=this._renderer.vertices[(o+s-1)%s];const[m,g]=n.multiply(a.x,a.y),[f,p]=n.multiply(l.x,l.y);if(a.controls&&l.controls){let b=a.controls.right.x,y=a.controls.right.y;a.relative&&(b+=a.x,y+=a.y);let[_,S]=n.multiply(b,y),v=l.controls.left.x,T=l.controls.left.y;l.relative&&(v+=l.x,T+=l.y);let[R,w]=n.multiply(v,T);const B=bl(m,g,_,S,R,w,f,p);u=Hi(B.min.y-r,u),c=Hi(B.min.x-r,c),d=Wi(B.max.x+r,d),h=Wi(B.max.y+r,h)}else o<=1&&(u=Hi(g-r,u),c=Hi(m-r,c),d=Wi(m+r,d),h=Wi(g+r,h)),u=Hi(p-r,u),c=Hi(f-r,c),d=Wi(f+r,d),h=Wi(p+r,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-u}}getPointAt(e,n){let r,s,o,a,l,c,d,u,h,m,g,f,p,b,y,_=this.length*Math.min(Math.max(e,0),1);const S=this.vertices.length,v=S-1;let T=null,R=null;for(let ee=0,I=this._lengths.length,z=0;ee<I;ee++){if(z+this._lengths[ee]>=_){this._closed?(r=It(ee,S),s=It(ee-1,S),ee===0&&(r=s,s=ee)):(r=ee,s=Math.min(Math.max(ee-1,0),v)),T=this.vertices[r],R=this.vertices[s],_-=z,this._lengths[ee]!==0?e=_/this._lengths[ee]:e=0;break}z+=this._lengths[ee]}if(T===null||R===null)return null;if(T){if(!R)return T}else return R;y=R.controls&&R.controls.right,b=T.controls&&T.controls.left,l=R.x,m=R.y,c=(y||R).x,g=(y||R).y,d=(b||T).x,f=(b||T).y,u=T.x,p=T.y,y&&R.relative&&(c+=R.x,g+=R.y),b&&T.relative&&(d+=T.x,f+=T.y),a=cr(e,l,c,d,u),h=cr(e,m,g,f,p);const w=Vt(l,c,e),B=Vt(m,g,e),x=Vt(c,d,e),$=Vt(g,f,e),P=Vt(d,u,e),A=Vt(f,p,e),V=Vt(w,x,e),F=Vt(B,$,e),N=Vt(x,P,e),Y=Vt($,A,e);return J.isObject(n)?(n.x=a,n.y=h,n instanceof ve&&(n.controls.left.x=V,n.controls.left.y=F,n.controls.right.x=N,n.controls.right.y=Y,(typeof n.relative!="boolean"||n.relative)&&(n.controls.left.x-=a,n.controls.left.y-=h,n.controls.right.x-=a,n.controls.right.y-=h)),n.t=e,n):(o=new ve(a,h,V-a,F-h,N-a,Y-h,this._curved?ne.curve:ne.line),o.t=e,o)}plot(){if(this.curved)return wl(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?ne.move:ne.line;return this}subdivide(e){this._update();const n=this.vertices.length-1,r=this._closed||this.vertices[n]._command===ne.close;let s=this.vertices[n],o=[],a;return J.each(this.vertices,function(l,c){if(c<=0&&!r){s=l;return}if(l.command===ne.move){o.push(new ve(s.x,s.y)),c>0&&(o[o.length-1].command=ne.line),s=l;return}a=Fl(l,s,e),o=o.concat(a),J.each(a,function(d,u){u<=0&&s.command===ne.move?d.command=ne.move:d.command=ne.line}),c>=n&&(this._closed&&this._automatic&&(s=l,a=Fl(l,s,e),o=o.concat(a),J.each(a,function(d,u){u<=0&&s.command===ne.move?d.command=ne.move:d.command=ne.line})),o.push(new ve(l.x,l.y)),o[o.length-1].command=r?ne.close:ne.line),s=l},this),this._automatic=!1,this._curved=!1,this.vertices=o,this}_updateLength(e,n){n||this._update();const s=this.vertices.length-1;let o=this.vertices[s],a=0;return typeof this._lengths>"u"&&(this._lengths=[]),J.each(this.vertices,function(l,c){if(c<=0||l.command===ne.move){o=l,this._lengths[c]=0;return}this._lengths[c]=El(l,o,e),a+=this._lengths[c],o=l},this),this._length=a,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,n=this._closed,r=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),o=Lr(this,r*this._length),a=Lr(this,s*this._length),l=Bg(o),c=Tg(a);let d,u,h,m,g,f;for(this._renderer.vertices.length=0,f=0;f<e;f++)this._renderer.collection.length<=f&&this._renderer.collection.push(new ve),f>c&&!u?(g=this._renderer.collection[f].copy(this._collection[f]),this.getPointAt(s,g),g.command=this._renderer.collection[f].command,this._renderer.vertices.push(g),u=g,h=this._collection[f-1],h&&h.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),h.relative?this._renderer.collection[f-1].controls.right.copy(h.controls.right).lerp(te.zero,1-g.t):this._renderer.collection[f-1].controls.right.copy(h.controls.right).lerp(h,1-g.t))):f>=l&&f<=c&&(g=this._renderer.collection[f].copy(this._collection[f]),this._renderer.vertices.push(g),f===c&&Nl(this,s)?(u=g,!n&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):f===l&&Nl(this,r)&&(d=g,d.command=ne.move,!n&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(f=l-1,g=this._renderer.collection[f].copy(this._collection[f]),this.getPointAt(r,g),g.command=ne.move,this._renderer.vertices.unshift(g),m=this._collection[f+1],m&&m.controls&&(g.controls.left.clear(),m.relative?this._renderer.collection[f+1].controls.left.copy(m.controls.left).lerp(te.zero,g.t):(Rg.copy(m),this._renderer.collection[f+1].controls.left.copy(m.controls.left).lerp(m,g.t))))}return Yn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,Yn.prototype.flagReset.call(this),this}};k(to,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),k(to,"Utils",{getCurveLength:El});var Ce=to,Ol={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof qe||this._fill instanceof Xe||this._fill instanceof Me)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof qe||this._fill instanceof Xe||this._fill instanceof Me)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof qe||this._stroke instanceof Xe||this._stroke instanceof Me)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof qe||this._stroke instanceof Xe||this._stroke instanceof Me)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";J.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(U.Types.insert,e).unbind(U.Types.remove,n),t instanceof qn?this._collection=t:this._collection=new qn(t||[]),this._collection.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,J.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function zl(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Ll(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Dl(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Hl(){this._flagFill=!0}function Wl(){this._flagStroke=!0}var jl=class Er extends Ce{constructor(e,n,r,s){const o=[new ve,new ve,new ve,new ve];super(o,!0,!1,!0),k(this,"_flagWidth",!1),k(this,"_flagHeight",!1),k(this,"_width",0),k(this,"_height",0),k(this,"_origin",null),this._renderer.type="rectangle";for(let a in ql)Object.defineProperty(this,a,ql[a]);this.width=typeof r=="number"?r:1,this.height=typeof s=="number"?s:1,this.origin=new te,typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n),this._update()}static fromObject(e){const n=new Er().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Er.Properties.length;n++){const r=Er.Properties[n];r in e&&(typeof e[r]=="number"?this[r]=e[r]:this[r]instanceof te&&this[r].copy(e[r]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,n=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new ve),this.vertices[0].set(-e,-n).sub(this._origin).command=ne.move,this.vertices[1].set(e,-n).sub(this._origin).command=ne.line,this.vertices[2].set(e,n).sub(this._origin).command=ne.line,this.vertices[3].set(-e,n).sub(this._origin).command=ne.line,this.vertices[4]&&(this.vertices[4].set(-e,-n).sub(this._origin).command=ne.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=new Er(0,0,this.width,this.height);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Ce.Properties.length;r++){const s=Ce.Properties[r];n[s]instanceof te?n[s].copy(this[s]):n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="rectangle",e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}};k(jl,"Properties",["width","height","origin"]);var Un=jl,ql={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(U.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(U.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Xl=class Fr extends Un{constructor(e,n,r,s,o,a){super(n,r,0,0),k(this,"_flagTexture",!1),k(this,"_flagColumns",!1),k(this,"_flagRows",!1),k(this,"_flagFrameRate",!1),k(this,"_flagIndex",!1),k(this,"_amount",1),k(this,"_duration",0),k(this,"_startTime",0),k(this,"_playing",!1),k(this,"_firstFrame",0),k(this,"_lastFrame",0),k(this,"_loop",!0),k(this,"_texture",null),k(this,"_columns",1),k(this,"_rows",1),k(this,"_frameRate",0),k(this,"_index",0),k(this,"_origin",null),this._renderer.type="sprite";for(let l in Yl)Object.defineProperty(this,l,Yl[l]);this.noStroke(),this.noFill(),e instanceof Me?this.texture=e:typeof e=="string"&&(this.texture=new Me(e)),this.origin=new te,this._update(),typeof s=="number"&&(this.columns=s),typeof o=="number"&&(this.rows=o),typeof a=="number"&&(this.frameRate=a),this.index=0}static fromObject(e){const n=new Fr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Fr.Properties.length;n++){const r=Fr.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=J.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(e){const n=new Fr(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&n.play(this._firstFrame,this._lastFrame),n.loop=this.loop,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="sprite",e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture,n=this._columns,r=this._rows;let s,o,a,l,c,d,u,h,m;if(e&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=e),e.loaded)){u=e.image.width,h=e.image.height,s=u/n,o=h/r,l=this._amount,this.width!==s&&(this.width=s),this.height!==o&&(this.height=o),this._playing&&this._frameRate>0&&(J.isNaN(this._lastFrame)&&(this._lastFrame=l-1),a=J.performance.now()-this._startTime,m=this._lastFrame+1,c=1e3*(m-this._firstFrame)/this._frameRate,this._loop?a=a%c:a=Math.min(a,c),d=Vt(this._firstFrame,m,a/c),d=Math.floor(d),d!==this._index&&(this._index=d,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const g=this._index%n,f=Math.floor(this._index/n),p=-s*g+(u-s)/2,b=-o*f+(h-o)/2;p!==e.offset.x&&(e.offset.x=p),b!==e.offset.y&&(e.offset.y=b)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};k(Xl,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var Hr=Xl,Yl={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},no,Ul=class extends qn{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),cl(this,no,{}),this.attach(e),this.on(U.Types.insert,this.attach),this.on(U.Types.remove,this.detach)}get ids(){return Nt(this,no)}attach(e){for(let n=0;n<e.length;n++){const r=e[n];r&&r.id&&(this.ids[r.id]=r)}return this}detach(e){for(let n=0;n<e.length;n++)delete this.ids[e[n].id];return this}};no=new WeakMap;var Kl=class Ei extends Ce{constructor(e,n,r,s,o,a,l){const c=l||vt.Resolution*3,d=[];for(let u=0;u<c;u++)d.push(new ve);super(d,!0,!1,!0),k(this,"_flagStartAngle",!1),k(this,"_flagEndAngle",!1),k(this,"_flagInnerRadius",!1),k(this,"_flagOuterRadius",!1),k(this,"_startAngle",0),k(this,"_endAngle",ut),k(this,"_innerRadius",0),k(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let u in Gl)Object.defineProperty(this,u,Gl[u]);typeof r=="number"&&(this.innerRadius=r),typeof s=="number"&&(this.outerRadius=s),typeof o=="number"&&(this.startAngle=o),typeof a=="number"&&(this.endAngle=a),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ei().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ei.Properties.length;n++){const r=Ei.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,n=this._endAngle,r=this._innerRadius,s=this._outerRadius,o=It(e,ut)===It(n,ut),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,u=0,h,m,g,f,p,b,y,_,S;for(o?c--:a||(c-=2),h=0,m=c-1;h<c;h++){switch(g=h/m,f=l[u],p=g*(n-e)+e,b=(n-e)/c,y=s*Math.cos(p),_=s*Math.sin(p),h){case 0:d=ne.move;break;default:d=ne.curve}f.command=d,f.x=y,f.y=_,f.controls.left.clear(),f.controls.right.clear(),f.command===ne.curve&&(S=s*b/Math.PI,f.controls.left.x=S*Math.cos(p-et),f.controls.left.y=S*Math.sin(p-et),f.controls.right.x=S*Math.cos(p+et),f.controls.right.y=S*Math.sin(p+et),h===1&&f.controls.left.multiplyScalar(2),h===m&&f.controls.right.multiplyScalar(2)),u++}if(a){for(o?(l[u].command=ne.close,u++):(c--,m=c-1),h=0;h<c;h++)g=h/m,f=l[u],p=(1-g)*(n-e)+e,b=(n-e)/c,y=r*Math.cos(p),_=r*Math.sin(p),d=ne.curve,h<=0&&(d=o?ne.move:ne.line),f.command=d,f.x=y,f.y=_,f.controls.left.clear(),f.controls.right.clear(),f.command===ne.curve&&(S=r*b/Math.PI,f.controls.left.x=S*Math.cos(p+et),f.controls.left.y=S*Math.sin(p+et),f.controls.right.x=S*Math.cos(p-et),f.controls.right.y=S*Math.sin(p-et),h===1&&f.controls.left.multiplyScalar(2),h===m&&f.controls.right.multiplyScalar(2)),u++;l[u].copy(l[0]),l[u].command=ne.line}else o||(l[u].command=ne.line,l[u].x=0,l[u].y=0,u++,l[u].copy(l[0]),l[u].command=ne.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(e){const n=this.innerRadius,r=this.outerRadius,s=this.startAngle,o=this.endAngle,a=this.vertices.length,l=new Ei(0,0,n,r,s,o,a);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let c=0;c<Ce.Properties.length;c++){const d=Ce.Properties[c];l[d]=this[d]}return e&&e.add(l),l}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let n=0;n<Ei.Properties.length;n++){const r=Ei.Properties[n];e[r]=this[r]}return e}};k(Kl,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var io=Kl,Gl={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},ro=Math.cos,so=Math.sin,Zl=class Fi extends Ce{constructor(e,n,r,s){const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new ve(0,0,0,0,0,0));super(a,!0,!0,!0),k(this,"_flagRadius",!1),k(this,"_radius",0),this._renderer.type="circle";for(let l in Ql)Object.defineProperty(this,l,Ql[l]);typeof r=="number"&&(this.radius=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Fi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Fi.Properties.length;n++){const r=Fi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(e*2)),r=this._radius,s=r*n;for(let o=0;o<this.vertices.length;o++){const l=o/e*ut,c=r*ro(l),d=r*so(l),u=s*ro(l-et),h=s*so(l-et),m=s*ro(l+et),g=s*so(l+et),f=this.vertices[o];f.command=o===0?ne.move:ne.curve,f.set(c,d),f.controls.left.set(u,h),f.controls.right.set(m,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=new Fi(0,0,this.radius,this.vertices.length);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Ce.Properties.length;r++){const s=Ce.Properties[r];n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let n=0;n<Fi.Properties.length;n++){const r=Fi.Properties[n];e[r]=this[r]}return e}};k(Zl,"Properties",["radius"]);var Wr=Zl,Ql={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},oo=Math.cos,ao=Math.sin,Jl=class Ai extends Ce{constructor(e,n,r,s,o){typeof s!="number"&&typeof r=="number"&&(s=r);const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new ve);super(l,!0,!0,!0),k(this,"_flagWidth",!1),k(this,"_flagHeight",!1),k(this,"_width",0),k(this,"_height",0),this._renderer.type="ellipse";for(let c in ec)Object.defineProperty(this,c,ec[c]);typeof r=="number"&&(this.width=r*2),typeof s=="number"&&(this.height=s*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ai().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(this.vertices.length*2)),r=this._width/2,s=this._height/2;for(let o=0;o<this.vertices.length;o++){const l=o/e*ut,c=r*oo(l),d=s*ao(l),u=r*n*oo(l-et),h=s*n*ao(l-et),m=r*n*oo(l+et),g=s*n*ao(l+et),f=this.vertices[o];f.command=o===0?ne.move:ne.curve,f.set(c,d),f.controls.left.set(u,h),f.controls.right.set(m,g)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=this.width/2,r=this.height/2,s=this.vertices.length,o=new Ai(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Ce.Properties.length;a++){const l=Ce.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];e[r]=this[r]}return e}};k(Jl,"Properties",["width","height"]);var jr=Jl,ec={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},$g=Math.ceil,Pg=Math.floor,tc=class si extends Yn{constructor(e){super(),k(this,"_flagVertices",!0),k(this,"_flagLength",!0),k(this,"_flagFill",!0),k(this,"_flagStroke",!0),k(this,"_flagLinewidth",!0),k(this,"_flagOpacity",!0),k(this,"_flagVisible",!0),k(this,"_flagSize",!0),k(this,"_flagSizeAttenuation",!0),k(this,"_flagStrokeAttenuation",!0),k(this,"_length",0),k(this,"_fill","#fff"),k(this,"_stroke","#000"),k(this,"_linewidth",1),k(this,"_opacity",1),k(this,"_visible",!0),k(this,"_size",1),k(this,"_sizeAttenuation",!1),k(this,"_beginning",0),k(this,"_ending",1),k(this,"_dashes",null),k(this,"_strokeAttenuation",!0),k(this,"noFill",Ce.prototype.noFill),k(this,"noStroke",Ce.prototype.noStroke),k(this,"corner",Ce.prototype.corner),k(this,"center",Ce.prototype.center),k(this,"getBoundingClientRect",Ce.prototype.getBoundingClientRect),k(this,"_updateLength",Ce.prototype._updateLength);for(let n in nc)Object.defineProperty(this,n,nc[n]);this._renderer.type="points",this._renderer.flagVertices=zl.bind(this),this._renderer.bindVertices=Ll.bind(this),this._renderer.unbindVertices=Dl.bind(this),this._renderer.flagFill=Hl.bind(this),this._renderer.flagStroke=Wl.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=e,this.dashes=[],this.dashes.offset=0}static fromObject(e){const n=typeof e.fill=="string"?e.fill:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),s=new si().copy(js(Ws({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){super.copy.call(this,e);for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof ve?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new ve().copy(r))}for(let n=0;n<si.Properties.length;n++){const r=si.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new si;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<si.Properties.length;r++){const s=si.Properties[r];n[s]=this[s]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(n=>n.toObject()),J.each(si.Properties,function(n){typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(e){this._update();let n=[];for(let r=0;r<this.vertices.length;r++){const s=this.vertices[r],o=this.vertices[r-1];if(!o)continue;const a=s.x,l=s.y,c=o.x,d=o.y,u=Ys(a,l,a,l,c,d,c,d,e);n=n.concat(u)}return this.vertices=n,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),n=Math.max(this._beginning,this._ending),r=Lr(this,e*this._length),s=Lr(this,n*this._length),o=$g(r),a=Pg(s);let l=0,c;this._renderer.vertices=[],this._renderer.collection=[];for(let d=0;d<this._collection.length;d++)d>=o&&d<=a&&(c=this._collection[d],this._renderer.collection.push(c),this._renderer.vertices[l*2+0]=c.x,this._renderer.vertices[l*2+1]=c.y,l++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};k(tc,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var lo=tc,nc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof qe||this._fill instanceof Xe||this._fill instanceof Me)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof qe||this._fill instanceof Xe||this._fill instanceof Me)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof qe||this._stroke instanceof Xe||this._stroke instanceof Me)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof qe||this._stroke instanceof Xe||this._stroke instanceof Me)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(U.Types.insert,e).unbind(U.Types.remove,n),t instanceof qn?this._collection=t:this._collection=new qn(t||[]),this._collection.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}},Ng=Math.cos,Eg=Math.sin,ic=class Mi extends Ce{constructor(e,n,r,s){s=Math.max(s||0,3),super(),k(this,"_flagWidth",!1),k(this,"_flagHeight",!1),k(this,"_flagSides",!1),k(this,"_radius",0),k(this,"_width",0),k(this,"_height",0),k(this,"_sides",0),this._renderer.type="polygon";for(let o in rc)Object.defineProperty(this,o,rc[o]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.radius=r),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Mi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Mi.Properties.length;n++){const r=Mi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let s=0;s<n;s++){const o=(s+.5)/e,a=ut*o+Math.PI/2,l=this._width*Ng(a)/2,c=this._height*Eg(a)/2;s>=r?this.vertices.push(new ve(l,c)):this.vertices[s].set(l,c),this.vertices[s].command=s===0?ne.move:ne.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=new Mi(0,0,0,this.sides);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.width=this.width,n.height=this.height,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Ce.Properties.length;r++){const s=Ce.Properties[r];n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let n=0;n<Mi.Properties.length;n++){const r=Mi.Properties[n];e[r]=this[r]}return e}};k(ic,"Properties",["width","height","sides"]);var co=ic,rc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},sc=class Vi extends Ce{constructor(e,n,r,s,o){typeof o>"u"&&typeof r=="number"&&typeof s=="number"&&(o=Math.floor(Math.min(r,s)/12));const a=[];for(let l=0;l<10;l++)a.push(new ve(0,0,0,0,0,0,l===0?ne.move:ne.curve));super(a),k(this,"_flagWidth",!1),k(this,"_flagHeight",!1),k(this,"_flagRadius",!1),k(this,"_width",0),k(this,"_height",0),k(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let l in oc)Object.defineProperty(this,l,oc[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Fg.bind(this),typeof r=="number"&&(this.width=r),typeof s=="number"&&(this.height=s),(typeof o=="number"||o instanceof te)&&(this.radius=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Vi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Vi.Properties.length;n++){const r=Vi.Properties[n];if(r in e){const s=e[r];/radius/i.test(r)?this[r]=typeof s=="number"||s instanceof te?s:new te().copy(s):typeof s=="number"&&(this[r]=s)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,n=this._height;let r,s;this._radius instanceof te?(r=this._radius.x,s=this._radius.y):(r=this._radius,s=this._radius);let o,a=e/2,l=n/2;o=this.vertices[0],o.x=-(a-r),o.y=-l,o=this.vertices[1],o.x=a-r,o.y=-l,o.controls.left.clear(),o.controls.right.x=r,o.controls.right.y=0,o=this.vertices[2],o.x=a,o.y=-(l-s),o.controls.right.clear(),o.controls.left.clear(),o=this.vertices[3],o.x=a,o.y=l-s,o.controls.left.clear(),o.controls.right.x=0,o.controls.right.y=s,o=this.vertices[4],o.x=a-r,o.y=l,o.controls.right.clear(),o.controls.left.clear(),o=this.vertices[5],o.x=-(a-r),o.y=l,o.controls.left.clear(),o.controls.right.x=-r,o.controls.right.y=0,o=this.vertices[6],o.x=-a,o.y=l-s,o.controls.left.clear(),o.controls.right.clear(),o=this.vertices[7],o.x=-a,o.y=-(l-s),o.controls.left.clear(),o.controls.right.x=0,o.controls.right.y=-s,o=this.vertices[8],o.x=-(a-r),o.y=-l,o.controls.left.clear(),o.controls.right.clear(),o=this.vertices[9],o.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=this.width,r=this.height,s=this.radius,o=new Vi(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Ce.Properties.length;a++){const l=Ce.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let n=0;n<Vi.Properties.length;n++){const r=Vi.Properties[n];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};k(sc,"Properties",["width","height","radius"]);var qr=sc,oc={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof te&&this._radius.unbind(U.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof te&&this._radius.bind(U.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Fg(){this._flagRadius=!0}var Ag=Math.cos,Mg=Math.sin,ac=class Ii extends Ce{constructor(e,n,r,s,o){arguments.length<=3&&(s=r,r=s/2),(typeof o!="number"||o<=0)&&(o=5),super(),k(this,"_flagInnerRadius",!1),k(this,"_flagOuterRadius",!1),k(this,"_flagSides",!1),k(this,"_innerRadius",0),k(this,"_outerRadius",0),k(this,"_sides",0),this._renderer.type="star";for(let a in lc)Object.defineProperty(this,a,lc[a]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.innerRadius=r),typeof s=="number"&&(this.outerRadius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ii().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ii.Properties.length;n++){const r=Ii.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let s=0;s<n;s++){const o=(s+.5)/e,a=ut*o,l=(s%2?this._outerRadius:this._innerRadius)/2,c=l*Ag(a),d=l*Mg(a);s>=r?this.vertices.push(new ve(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?ne.move:ne.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=this.innerRadius,r=this.outerRadius,s=this.sides,o=new Ii(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Ce.Properties.length;a++){const l=Ce.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let n=0;n<Ii.Properties.length;n++){const r=Ii.Properties[n];e[r]=this[r]}return e}};k(ac,"Properties",["innerRadius","outerRadius","sides"]);var uo=ac,lc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},ho,cc=Math.min,dc=Math.max;je.document&&(ho=document.createElement("canvas"));var fo=class jt extends Yn{constructor(e,n,r,s){super(),k(this,"_flagValue",!0),k(this,"_flagFamily",!0),k(this,"_flagSize",!0),k(this,"_flagLeading",!0),k(this,"_flagAlignment",!0),k(this,"_flagBaseline",!0),k(this,"_flagStyle",!0),k(this,"_flagWeight",!0),k(this,"_flagDecoration",!0),k(this,"_flagFill",!0),k(this,"_flagStroke",!0),k(this,"_flagLinewidth",!0),k(this,"_flagOpacity",!0),k(this,"_flagVisible",!0),k(this,"_flagMask",!1),k(this,"_flagClip",!1),k(this,"_flagDirection",!0),k(this,"_flagStrokeAttenuation",!0),k(this,"_value",""),k(this,"_family","sans-serif"),k(this,"_size",13),k(this,"_leading",17),k(this,"_alignment","center"),k(this,"_baseline","middle"),k(this,"_style","normal"),k(this,"_weight",500),k(this,"_decoration","none"),k(this,"_direction","ltr"),k(this,"_fill","#000"),k(this,"_stroke","none"),k(this,"_linewidth",1),k(this,"_opacity",1),k(this,"_visible",!0),k(this,"_mask",null),k(this,"_clip",!1),k(this,"_dashes",null),k(this,"_strokeAttenuation",!0);for(let o in uc)Object.defineProperty(this,o,uc[o]);if(this._renderer.type="text",this._renderer.flagFill=Vg.bind(this),this._renderer.flagStroke=Ig.bind(this),this.value=e,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this.dashes=[],this.dashes.offset=0,!J.isObject(s))return this;for(let o=0;o<jt.Properties.length;o++){const a=jt.Properties[o];a in s&&(this[a]=s[a])}}static Measure(e){if(ho){const n=ho.getContext("2d");n.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const r=n.measureText(e.value,0,0),s=r.actualBoundingBoxDescent+r.actualBoundingBoxAscent;return{width:r.width,height:s}}else{const n=this.value.length*this.size*jt.Ratio,r=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:n,height:r}}}static fromObject(e){const n=typeof e.fill=="string"?e.fill:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),s=new jt().copy(js(Ws({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){super.copy.call(this,e);for(let n=0;n<jt.Properties.length;n++){const r=jt.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new jt(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let r=0;r<jt.Properties.length;r++){const s=jt.Properties[r];n[s]=this[s]}return this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let n=0;n<jt.Properties.length;n++){const r=jt.Properties[n];e[r]=this[r]}return e}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let n,r,s,o,a;this._update(!0),n=e?this.matrix:this.worldMatrix;const{width:l,height:c}=jt.Measure(this),d=(this._linewidth||0)/2;switch(this.alignment){case"left":r=-d,s=l+d;break;case"right":r=-(l+d),s=d;break;default:r=-(l/2+d),s=l/2+d}switch(this.baseline){case"middle":o=-(c/2+d),a=c/2+d;break;default:o=-(c+d),a=d}const[u,h]=n.multiply(r,o),[m,g]=n.multiply(r,a),[f,p]=n.multiply(s,o),[b,y]=n.multiply(s,a);return o=cc(h,g,p,y),r=cc(u,m,f,b),s=dc(u,m,f,b),a=dc(h,g,p,y),{top:o,left:r,right:s,bottom:a,width:s-r,height:a-o}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};k(fo,"Ratio",.6),k(fo,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var fn=fo,uc={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof qe||this._fill instanceof Xe||this._fill instanceof Me)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof qe||this._fill instanceof Xe||this._fill instanceof Me)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof qe||this._stroke instanceof Xe||this._stroke instanceof Me)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof qe||this._stroke instanceof Xe||this._stroke instanceof Me)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,J.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Vg(){this._flagFill=!0}function Ig(){this._flagStroke=!0}var mo=class rr extends Un{constructor(e,n,r,s){super(n,r,0,0),k(this,"_flagTextures",!1),k(this,"_flagFrameRate",!1),k(this,"_flagIndex",!1),k(this,"_amount",1),k(this,"_duration",0),k(this,"_index",0),k(this,"_startTime",0),k(this,"_playing",!1),k(this,"_firstFrame",0),k(this,"_lastFrame",0),k(this,"_loop",!0),k(this,"_textures",null),k(this,"_frameRate",0),k(this,"_origin",null),this._renderer.type="image-sequence";for(let o in hc)Object.defineProperty(this,o,hc[o]);this._renderer.flagTextures=Og.bind(this),this._renderer.bindTextures=zg.bind(this),this._renderer.unbindTextures=Lg.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(fc.bind(this)):typeof e=="string"&&(this.textures=[fc(e)]),this.origin=new te,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=rr.DefaultFrameRate,this.index=0}static fromObject(e){const n=new rr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<rr.Properties.length;n++){const r=rr.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=J.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(e){const n=new rr(this.textures,this.translation.x,this.translation.y,this.frameRate);return n._loop=this._loop,this._playing&&n.play(),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image-sequence",e.textures=this.textures.map(function(n){return n.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let e=0;e<this.textures.length;e++){const n=this.textures[e];typeof n.dispose=="function"?n.dispose():typeof n.unbind=="function"&&n.unbind()}return this}_update(){const e=this._textures;let n,r,s,o,a,l,c,d;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(o=this._amount,J.isNaN(this._lastFrame)&&(this._lastFrame=o-1),s=J.performance.now()-this._startTime,d=this._lastFrame+1,a=1e3*(d-this._firstFrame)/this._frameRate,this._loop?s=s%a:s=Math.min(s,a),c=Vt(this._firstFrame,d,s/a),c=Math.floor(c),c!==this._index&&(this._index=c,l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r),this.fill=l,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Me))&&(l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r)),this.fill=l)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};k(mo,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),k(mo,"DefaultFrameRate",30);var go=mo,hc={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(U.Types.insert,e).unbind(U.Types.remove,n),this._textures=new qn((t||[]).slice(0)),this._textures.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function Og(){this._flagTextures=!0}function zg(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Lg(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function fc(t){if(t instanceof Me)return t;if(typeof t=="string")return new Me(t)}var Xr=Math.min,Yr=Math.max,po=class oi extends Yn{constructor(e){super(),k(this,"_flagAdditions",!1),k(this,"_flagSubtractions",!1),k(this,"_flagOrder",!1),k(this,"_flagOpacity",!0),k(this,"_flagBeginning",!1),k(this,"_flagEnding",!1),k(this,"_flagLength",!1),k(this,"_flagMask",!1),k(this,"_fill","#fff"),k(this,"_stroke","#000"),k(this,"_linewidth",1),k(this,"_opacity",1),k(this,"_visible",!0),k(this,"_cap","round"),k(this,"_join","round"),k(this,"_miter",4),k(this,"_closed",!0),k(this,"_curved",!1),k(this,"_automatic",!0),k(this,"_beginning",0),k(this,"_ending",1),k(this,"_length",0),k(this,"_mask",null),k(this,"_strokeAttenuation",!0);for(let n in mc)Object.defineProperty(this,n,mc[n]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let n=0;n<e.length;n++)gc.call(this,e[n],this)}static RemoveChildren(e){for(let n=0;n<e.length;n++)gc.call(this,e[n])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const n=new oi;for(let s=0;s<oi.Properties.length;s++){const o=oi.Properties[s];o in e&&(/(fill|stroke)/i.test(o)?n[o]=typeof e[o]=="string"?e[o]:ci(e[o]):n[o]=e[o])}return"mask"in e&&(n.mask=r(e.mask)),"id"in e&&(n.id=e.id),n.children=e.children.map(r),n;function r(s){if(s&&s.renderer)switch(s.renderer.type){case"arc-segment":return io.fromObject(s);case"circle":return Wr.fromObject(s);case"element":return Li.fromObject(s);case"ellipse":return jr.fromObject(s);case"group":return oi.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return go.fromObject(s);case"path":return Ce.fromObject(s);case"points":return lo.fromObject(s);case"polygon":return co.fromObject(s);case"rectangle":return Un.fromObject(s);case"rounded-rectangle":return qr.fromObject(s);case"shape":return Yn.fromObject(s);case"sprite":return Hr.fromObject(s);case"star":return uo.fromObject(s);case"text":return fn.fromObject(s)}return s}}copy(e){super.copy.call(this,e),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let n=0;n<oi.Properties.length;n++){const r=oi.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new oi,r=this.children.map(function(s){return s.clone()});return n.add(r),n.opacity=this.opacity,this.mask&&(n.mask=this.mask),n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.className=this.className,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="group",e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,J.each(this.children,(n,r)=>{e.children[r]=n.toObject()},this),e}dispose(){if(super.dispose(),this.children)for(let e=0;e<this.children.length;e++){const n=this.children[e];typeof n.dispose=="function"&&n.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const e=this.getBoundingClientRect(!0);for(let n=0;n<this.children.length;n++){const r=this.children[n];r.translation.x-=e.left,r.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let s=0;s<this.children.length;s++){const o=this.children[s];o.isShape&&(o.translation.x-=n,o.translation.y-=r)}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getById(e){let n=null;function r(s){if(s.id===e)return s;if(s.children){if(s.children.ids[e])return s.children.ids[e];for(let o=0;o<s.children.length;o++)if(n=r(s.children[o]),n)return n}return null}return r(this)}getByClassName(e){const n=[];function r(s){if(Array.prototype.indexOf.call(s.classList,e)>=0&&n.push(s),s.children)for(let o=0;o<s.children.length;o++){const a=s.children[o];r(a)}return n}return r(this)}getByType(e){const n=[];function r(s){if(s instanceof e&&n.push(s),s.children)for(let o=0;o<s.children.length;o++){const a=s.children[o];r(a)}return n}return r(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let n=0;n<e.length;n++){const r=e[n];if(!(r&&r.id))continue;const s=Array.prototype.indexOf.call(this.children,r);s>=0&&this.children.splice(s,1),this.children.push(r)}return this}remove(e){const n=arguments.length,r=this.parent;if(n<=0&&r)return r.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let s=0;s<e.length;s++){const o=e[s];if(!o||!this.children.ids[o.id])continue;const a=this.children.indexOf(o);a>=0&&this.children.splice(a,1)}return this}getBoundingClientRect(e){let n,r,s,o,a,l;this._update(!0);let c=1/0,d=-1/0,u=1/0,h=-1/0;const m=/texture|gradient/i;r=e?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const f=this.children[g];if(!(!f.visible||m.test(f._renderer.type))&&(n=f.getBoundingClientRect(e),s=typeof n.top!="number"||J.isNaN(n.top)||!isFinite(n.top),o=typeof n.left!="number"||J.isNaN(n.left)||!isFinite(n.left),a=typeof n.right!="number"||J.isNaN(n.right)||!isFinite(n.right),l=typeof n.bottom!="number"||J.isNaN(n.bottom)||!isFinite(n.bottom),!(s||o||a||l)))if(e){const[p,b]=r.multiply(n.left,n.top),[y,_]=r.multiply(n.right,n.top),[S,v]=r.multiply(n.left,n.bottom),[T,R]=r.multiply(n.right,n.bottom);u=Xr(b,_,v,R,u),c=Xr(p,y,S,T,c),d=Yr(p,y,S,T,d),h=Yr(b,_,v,R,h)}else u=Xr(n.top,u),c=Xr(n.left,c),d=Yr(n.right,d),h=Yr(n.bottom,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-u}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){const e=arguments;return this.children.forEach(function(n){n.subdivide.apply(n,e)}),this}_update(){let e,n,r;if(this._flagBeginning||this._flagEnding){const s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=this.length;let l=0;const c=s*a,d=o*a;for(e=0;e<this.children.length;e++)r=this.children[e],n=r.length,c>l+n?(r.beginning=1,r.ending=1):d<l?(r.beginning=0,r.ending=0):c>l&&c<l+n?(r.beginning=(c-l)/n,r.ending=1):d>l&&d<l+n?(r.beginning=0,r.ending=(d-l)/n):(r.beginning=0,r.ending=1),l+=n}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};k(po,"Children",Ul),k(po,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var ot=po,mc={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=ot.InsertChildren.bind(this),n=ot.RemoveChildren.bind(this),r=ot.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Ul(t),this._children.bind(U.Types.insert,e),this._children.bind(U.Types.remove,n),this._children.bind(U.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,J.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function gc(t,e){const n=t.parent;let r;if(n===e){s();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),o()),e){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function s(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}var Ur=class extends Ce{constructor(e,n,r,s){const o=[new ve(e,n),new ve(r,s)];super(o);for(let a in pc)Object.defineProperty(this,a,pc[a]);this.vertices[0].command=ne.move,this.vertices[1].command=ne.line,this.automatic=!1}};k(Ur,"Properties",["left","right"]);var pc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(J.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=ne.move;else{const e=new Et("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(J.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=ne.line;else{const e=new Et("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},mn={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},Dg={start:"left",middle:"center",end:"right"},yc=["id","class","transform","xmlns","viewBox"],Hg=["x","y","width","height","href","xlink:href"];function Wg(t){return Dg[t]}function jg(t){const e=t.getAttribute("dominant-baseline"),n=t.getAttribute("alignment-baseline");return e||n}function dr(t){return t.replace(/svg:/gi,"").toLowerCase()}function bc(t,e){if(e.x+=t.translateX,e.y+=t.translateY,e.x*=t.scaleX,e.y*=t.scaleY,t.rotation!==0){const n=e.length();e.x=n*Math.cos(t.rotation),e.y=n*Math.sin(t.rotation)}}function qg(t,e){e||(e={});const n=t.split(";");for(let r=0;r<n.length;r++){const s=n[r].split(":"),o=s[0],a=s[1];if(typeof o>"u"||typeof a>"u")continue;const l=o.replace(/\s/g,""),c=a.replace(/\s/g,"");e[l]=c}return e}function Xg(t){const e={},n=Yg(t),r=Math.max(n.length,t.style.length);for(let s=0;s<r;s++){const o=t.style[s],a=n[s];o&&(e[o]=t.style[o]),a&&(e[a]=t.getAttribute(a))}return e}function Yg(t){const e=t.getAttributeNames();for(let n=0;n<yc.length;n++){const r=yc[n],s=Array.prototype.indexOf.call(e,r);s>=0&&e.splice(s,1)}return e}function Ug(t,e){const n=e.split(/[\s,]/),r=-parseFloat(n[0]),s=-parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&s)for(let h=0;h<t.children.length;h++){const m=t.children[h];"translation"in m?m.translation.add(r,s):"x"in m?m.x=r:"y"in m&&(m.y=s)}const l=typeof t.x=="number",c=typeof t.y=="number",d=typeof t.width=="number",u=typeof t.height=="number";return l&&(t.translation.x+=t.x),c&&(t.translation.y+=t.y),(d||u)&&(t.scale=new te(1,1)),d&&(t.scale.x=t.width/o),u&&(t.scale.y=t.height/a),t.mask=new Un(0,0,o,a),t.mask.origin.set(-o/2,-a/2),t}function qt(t,e,n){const r={},s={},o={};let a,l,c,d,u,h,m,g,f,p,b,y,_,S,v,T,R;if(t===null)return r;if(je.getComputedStyle){const w=je.getComputedStyle(t);for(a=w.length;a--;)c=w[a],d=w[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<t.attributes.length;a++)h=t.attributes[a],/style/i.test(h.nodeName)?qg(h.value,o):s[h.nodeName]=h.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&J.defaults(r,n),J.extend(r,o,s),r.visible=!(typeof r.display>"u"&&/none/i.test(r.display))||typeof r.visibility>"u"&&/hidden/i.test(r.visibility);for(c in r)switch(d=r[c],c){case"gradientTransform":if(/none/i.test(d)||(l=t.gradientTransform&&t.gradientTransform.baseVal&&t.gradientTransform.baseVal.length>0?t.gradientTransform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;switch(m=li(l),e._renderer.type){case"linear-gradient":bc(m,e.left),bc(m,e.right);break;case"radial-gradient":e.center.x+=m.translateX,e.center.y+=m.translateY,e.focal.x+=m.translateX,e.focal.y+=m.translateY,e.radius*=Math.max(m.scaleX,m.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=t.transform&&t.transform.baseVal&&t.transform.baseVal.length>0?t.transform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;m=li(l),e.translation.set(m.translateX,m.translateY),e.rotation=Math.PI*(m.rotation/180),e.scale=new te(m.scaleX,m.scaleY),g=parseFloat((r.x+"").replace("px")),f=parseFloat((r.y+"").replace("px")),g&&(e.translation.x=g),f&&(e.translation.y=f);break;case"visible":if(e instanceof ot){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof ot){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof ot){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof ot){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof ot){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof ot){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(mn.cssBackgroundImage.test(d)&&(p=d.replace(mn.cssBackgroundImage,"$1"),He.defs.current&&He.defs.current.contains(p)&&(y=He.defs.current.get(p),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],_=dr(y.nodeName),e.mask=He[_].call(this,y,{}),e._renderer.type){case"text":case"path":e.position.add(e.mask.position),e.mask.position.clear();break}break;case"fill":case"stroke":u=(e instanceof ot?"_":"")+c,mn.cssBackgroundImage.test(d)?(p=d.replace(mn.cssBackgroundImage,"$1"),He.defs.current&&He.defs.current.contains(p)?(y=He.defs.current.get(p),y.object||(_=dr(y.nodeName),y.object=He[_].call(this,y,{})),y=y.object):(b=Gg(this),y=b.getById(p)),e[u]=y):e[u]=d;break;case"id":e.id=d;break;case"class":case"className":e.classList=d.split(" "),e._flagClassName=!0;break;case"x":case"y":if(S=e instanceof tt,v=e instanceof qe,T=e instanceof Xe,S||v||T)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(R=new Et("only pixel values are supported with the "+c+" attribute."),console.warn(R.name,R.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof fn&&(e.family=d);break;case"font-size":e instanceof fn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(R=new Et("only pixel values are supported with the "+c+" attribute."),console.warn(R.name,R.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof fn&&(e.weight=d);break;case"font-style":e instanceof fn&&(e.style=d);break;case"text-decoration":e instanceof fn&&(e.decoration=d);break;case"line-height":e instanceof fn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function Kg(t,e){for(let n=0,r=t.childNodes.length;n<r;n++){const s=t.childNodes[n];!s.id||dr(t.nodeName)==="#text"||e.add(s.id,s)}}function Gg(t){for(;t.parent;)t=t.parent;return t.scene}var He={svg:function(t){const e=He.defs.current=new Or,n=t.getElementsByTagName("defs");for(let f=0;f<n.length;f++)Kg(n[f],e);const r=He.g.call(this,t),s=t.getAttribute("viewBox"),o=t.getAttribute("x"),a=t.getAttribute("y"),l=t.getAttribute("width"),c=t.getAttribute("height");r.defs=e;const d=s!==null,u=o!==null,h=a!==null,m=l!==null,g=c!==null;return u&&(r.x=parseFloat(o.replace(mn.unitSuffix,""))),h&&(r.y=parseFloat(a.replace(mn.unitSuffix,""))),m&&(r.width=parseFloat(l.replace(mn.unitSuffix,""))),g&&(r.height=parseFloat(c.replace(mn.unitSuffix,""))),d&&Ug(r,s),delete He.defs.current,r},defs:function(t){return null},use:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new Et("encountered <use /> with no href."),console.warn(n.name,n.message),null;const s=r.slice(1);if(!He.defs.current.contains(s))return n=new Et("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=He.defs.current.get(s).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],u=Hg.includes(d.nodeName),h=!a.hasAttribute(d.nodeName);(u||h)&&a.setAttribute(d.nodeName,d.value)}const l=dr(a.nodeName);return He[l].call(this,a,e)},g:function(t,e){const n=new ot;qt.call(this,t,n,e),this.add(n);const r=Xg.call(this,t);for(let s=0,o=t.childNodes.length;s<o;s++){const a=t.childNodes[s],l=a.nodeName;if(!l)return;const c=dr(l);if(c in He){const d=He[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(t,e){let n;typeof t=="string"?n=t:n=t.getAttribute("points");const r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(o,a,l){r.push(new ve(parseFloat(a),parseFloat(l)))});const s=new Ce(r,!0);return s.stroke="none",s.fill="black",qt.call(this,t,s,e),s},polyline:function(t,e){const n=He.polygon.call(this,t,e);return n.closed=!1,n},path:function(t,e){let n;typeof t=="string"?(n=t,t=null):n=t.getAttribute("d");let r=[],s=!1,o=!1;if(n){let l=new ve,c,d,u=n.match(/[a-df-z][^a-df-z]*/gi);const h=u.length-1;J.each(u.slice(0),function(m,g){const f=m.slice(1).trim().match(mn.path),p=m[0],b=p.toLowerCase();let y,_,S,v,T;const R=[];switch(g===0&&(u=[]),b){case"h":case"v":f.length>1&&(y=1);break;case"m":case"l":case"t":f.length>2&&(y=2);break;case"s":case"q":f.length>4&&(y=4);break;case"c":f.length>6&&(y=6);break;case"a":f.length>7&&(y=7);break}if(y){for(_=0,S=f.length,T=0;_<S;_+=y){if(v=p,T>0)switch(p){case"m":v="l";break;case"M":v="L";break}R.push(v+f.slice(_,_+y).join(" ")),T++}u=Array.prototype.concat.apply(u,R)}else u.push(m)}),J.each(u,function(m,g){let f,p,b;const y=m[0],_=y.toLowerCase();d=m.slice(1).trim().match(mn.path),o=y===_;let S,v,T,R,w,B,x,$,P,A,V,F,N,Y,ee,I,z;switch(_){case"z":if(g>=h)s=!0;else{p=l.x,b=l.y,f=new ve(p,b,void 0,void 0,void 0,void 0,ne.close);for(let q=r.length-1;q>=0;q--){const W=r[q];if(/m/i.test(W.command)){l=W;break}}}break;case"m":case"l":c=void 0,p=parseFloat(d[0]),b=parseFloat(d[1]),f=new ve(p,b,void 0,void 0,void 0,void 0,/m/i.test(_)?ne.move:ne.line),o&&f.addSelf(l),l=f;break;case"h":case"v":A=/h/i.test(_)?"x":"y",V=/x/i.test(A)?"y":"x",f=new ve(void 0,void 0,void 0,void 0,void 0,void 0,ne.line),f[A]=parseFloat(d[0]),f[V]=l[V],o&&(f[A]+=l[A]),l=f;break;case"c":case"s":S=l.x,v=l.y,c||(c=new te),/c/i.test(_)?(T=parseFloat(d[0]),R=parseFloat(d[1]),w=parseFloat(d[2]),B=parseFloat(d[3]),x=parseFloat(d[4]),$=parseFloat(d[5])):(P=Us(l,c,o),T=P.x,R=P.y,w=parseFloat(d[0]),B=parseFloat(d[1]),x=parseFloat(d[2]),$=parseFloat(d[3])),o&&(T+=S,R+=v,w+=S,B+=v,x+=S,$+=v),l.controls.right.set(T-l.x,R-l.y),f=new ve(x,$,w-x,B-$,void 0,void 0,ne.curve),l=f,c=f.controls.left;break;case"t":case"q":S=l.x,v=l.y,c||(c=new te),/q/i.test(_)?(T=parseFloat(d[0]),R=parseFloat(d[1]),w=parseFloat(d[0]),B=parseFloat(d[1]),x=parseFloat(d[2]),$=parseFloat(d[3])):(P=Us(l,c,o),T=P.x,R=P.y,w=P.x,B=P.y,x=parseFloat(d[0]),$=parseFloat(d[1])),o&&(T+=S,R+=v,w+=S,B+=v,x+=S,$+=v),l.controls.right.set((T-l.x)*.33,(R-l.y)*.33),f=new ve(x,$,w-x,B-$,void 0,void 0,ne.curve),l=f,c=f.controls.left;break;case"a":S=l.x,v=l.y,N=parseFloat(d[0]),Y=parseFloat(d[1]),ee=parseFloat(d[2]),I=parseFloat(d[3]),z=parseFloat(d[4]),x=parseFloat(d[5]),$=parseFloat(d[6]),o&&(x+=S,$+=v),F=new ve(x,$),F.command=ne.arc,F.rx=N,F.ry=Y,F.xAxisRotation=ee,F.largeArcFlag=I,F.sweepFlag=z,f=F,l=F,c=void 0;break}f&&(Array.isArray(f)?r=r.concat(f):r.push(f))})}n=new Ce(r,s,void 0,!0),n.stroke="none",n.fill="black";const a=n.getBoundingClientRect(!0);return a.centroid={x:a.left+a.width/2,y:a.top+a.height/2},J.each(n.vertices,function(l){l.subSelf(a.centroid)}),qt.call(this,t,n,e),n.translation.addSelf(a.centroid),n},circle:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),s=parseFloat(t.getAttribute("r")),o=new Wr(0,0,s);return o.stroke="none",o.fill="black",qt.call(this,t,o,e),o.translation.x=n,o.translation.y=r,o},ellipse:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),s=parseFloat(t.getAttribute("rx")),o=parseFloat(t.getAttribute("ry")),a=new jr(0,0,s,o);return a.stroke="none",a.fill="black",qt.call(this,t,a,e),a.translation.x=n,a.translation.y=r,a},rect:function(t,e){const n=parseFloat(t.getAttribute("rx")),r=parseFloat(t.getAttribute("ry"));if(!J.isNaN(n)||!J.isNaN(r))return He["rounded-rect"](t);const s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new Un(0,0,s,o);return c.stroke="none",c.fill="black",qt.call(this,t,c,e),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(t,e){const n=parseFloat(t.getAttribute("rx"))||0,r=parseFloat(t.getAttribute("ry"))||0,s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new te(n,r),d=new qr(0,0,s,o,c);return d.stroke="none",d.fill="black",qt.call(this,t,d,e),d.translation.x+=a,d.translation.y+=l,d},line:function(t,e){const n=parseFloat(t.getAttribute("x1")),r=parseFloat(t.getAttribute("y1")),s=parseFloat(t.getAttribute("x2")),o=parseFloat(t.getAttribute("y2")),a=new Ur(n,r,s,o).noFill();return qt.call(this,t,a,e),a},lineargradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(t.getAttribute("x1")||0),o=parseFloat(t.getAttribute("y1")||0),a=parseFloat(t.getAttribute("x2")||0),l=parseFloat(t.getAttribute("y2")||0);const c=(a+s)/2,d=(l+o)/2;/userSpaceOnUse/i.test(n)&&(s-=c,o-=d,a-=c,l-=d);const u=[];for(let m=0;m<t.children.length;m++){const g=t.children[m];let f=g.getAttribute("offset");/%/gi.test(f)&&(f=parseFloat(f.replace(/%/gi,""))/100),f=parseFloat(f);let p=g.getAttribute("stop-color"),b=g.getAttribute("stop-opacity"),y=g.getAttribute("style"),_;p===null&&(_=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,p=_&&_.length>1?_[1]:void 0),b===null?(_=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=_&&_.length>1?parseFloat(_[1]):1):b=parseFloat(b),u.push(new Xn(f,p,b))}const h=new qe(s,o,a,l,u);return h.spread=r,h.units=n,qt.call(this,t,h,e),h},radialgradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(t.getAttribute("cx"))||0,o=parseFloat(t.getAttribute("cy"))||0,a=parseFloat(t.getAttribute("r")),l=parseFloat(t.getAttribute("fx")),c=parseFloat(t.getAttribute("fy"));J.isNaN(l)&&(l=s),J.isNaN(c)&&(c=o);const d=Math.abs(s+l)/2,u=Math.abs(o+c)/2;/userSpaceOnUse/i.test(n)&&(s-=d,o-=u,l-=d,c-=u);const h=[];for(let g=0;g<t.children.length;g++){const f=t.children[g];let p=f.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let b=f.getAttribute("stop-color"),y=f.getAttribute("stop-opacity"),_=f.getAttribute("style"),S;b===null&&(S=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,b=S&&S.length>1?S[1]:void 0),y===null?(S=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=S&&S.length>1?parseFloat(S[1]):1):y=parseFloat(y),h.push(new Xn(p,b,y))}const m=new Xe(s,o,a,h,l,c);return m.spread=r,m.units=n,qt.call(this,t,m,e),m},text:function(t,e){const n=Wg(t.getAttribute("text-anchor"))||"left",r=jg(t)||"baseline";let s="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?s=t.childNodes[0].textContent:s=t.textContent;const o=new fn(s);return qt.call(this,t,o,e),o.alignment=n,o.baseline=r,o},clippath:function(t,e){return He.defs.current&&!He.defs.current.contains(t.id)&&He.defs.current.add(t.id,t),null},image:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new Et("encountered <image /> with no href."),console.warn(n.name,n.message),null;const s=parseFloat(t.getAttribute("x"))||0,o=parseFloat(t.getAttribute("y"))||0,a=parseFloat(t.getAttribute("width")),l=parseFloat(t.getAttribute("height")),c=new Hr(r,s,o);return J.isNaN(a)||(c.width=a),J.isNaN(l)||(c.height=l),qt.call(this,t,c,e),c}};function _c(t,e){const n=new XMLHttpRequest;return n.open("GET",t),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&e(n.responseText)},n.send(),n}var yo=class Bn extends Un{constructor(e,n,r,s,o,a){super(n,r,s||1,o||1),k(this,"_flagTexture",!1),k(this,"_flagMode",!1),k(this,"_texture",null),k(this,"_mode","fill"),this._renderer.type="image";for(let l in xc)Object.defineProperty(this,l,xc[l]);this.noStroke(),this.noFill(),e instanceof Me?this.texture=e:typeof e=="string"&&(this.texture=new Me(e)),typeof a=="string"&&(this.mode=a),this._update()}static fromObject(e){const n=new Bn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Bn.Properties.length;n++){const r=Bn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Bn(this.texture,this.translation.x,this.translation.y,this.width,this.height);return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image",e.texture=this.texture.toObject(),e.mode=this.mode,e}dispose(){return super.dispose(),this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture;if(e&&(this._flagTexture&&(this.fill=e),e.loaded)){const n=e.image.width,r=e.image.height,s=this.width,o=this.height,a=s/n,l=o/r;switch(this._mode){case Bn.Modes.fill:{const c=Math.max(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="repeat";break}case Bn.Modes.fit:{const c=Math.min(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="no-repeat";break}case Bn.Modes.crop:break;case Bn.Modes.tile:{e.offset.x=(n-s)/2,e.offset.y=(r-o)/2,e.repeat="repeat";break}case Bn.Modes.stretch:default:e.scale=new te(a,l),e.offset.x=0,e.offset.y=0,e.repeat="repeat"}}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagTexture=this._flagMode=!1,this}};k(yo,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),k(yo,"Properties",["texture","mode"]);var wc=yo,xc={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},mode:{enumerable:!0,get:function(){return this._mode},set:function(t){this._mode=t,this._flagMode=!0}}},bo=[],_o=Math.max,Zg=Math.min,kc=Math.abs,Kr=Math.sin,Gr=Math.cos,Qg=Math.acos,Zr=Math.sqrt,Be={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(t){return t in Be?t:"path"},group:{renderChild:function(t){const e=Be.getRendererType(t._renderer.type);Be[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);const r=this._mask,s=Qr(e),o=!s||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=t,o&&(t.save(),s||t.transform(e[0],e[3],e[1],e[4],e[2],e[5])),r){const a=Be.getRendererType(r._renderer.type);Be[a].render.call(r,t,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Be.getRendererType(l._renderer.type);Be[c].render.call(l,t)}return o&&t.restore(),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t,e,n){let r,s,o,a,l,c,d,u,h,m,g,f,p,b,y,_,S,v,T,R,w,B,x,$,P,A,V,F,N,Y,ee,I,z,q;if(q=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,N=this._mask,Y=this._clip,l=this._opacity*(q||1),c=this._visible,!e&&(!c||Y||l===0))return this;if(J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,d=this._cap,u=this._join,h=this._miter,m=this._closed,g=this._renderer.vertices,f=g.length,p=f-1,ee=Qr(r),z=this.dashes,ee||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),N){const re=Be.getRendererType(N._renderer.type);Be[re].render.call(N,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const re=Be.getRendererType(a._renderer.type);Be[re].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const re=Be.getRendererType(s._renderer.type);Be[re].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=hn(this)),h&&(t.miterLimit=h),u&&(t.lineJoin=u),!m&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),z&&z.length>0&&(t.lineDashOffset=z.offset||0,t.setLineDash(z)),t.beginPath();let W,O,D,j,G,ue,oe;for(let re=0;re<f;re++)switch(_=g[re],V=_.x,F=_.y,_.command){case ne.close:t.closePath();break;case ne.arc:W=_.rx,O=_.ry,D=_.xAxisRotation,j=_.largeArcFlag,G=_.sweepFlag,b=m?It(re-1,f):_o(re-1,0),y=g[b],ue=y.x,oe=y.y,Be.renderSvgArcCommand(t,ue,oe,W,O,j,G,D,V,F);break;case ne.curve:b=m?It(re-1,f):Math.max(re-1,0),y=g[b],x=y.controls&&y.controls.right||te.zero,$=_.controls&&_.controls.left||te.zero,y._relative?(w=x.x+y.x,B=x.y+y.y):(w=x.x,B=x.y),_._relative?(T=$.x+_.x,R=$.y+_.y):(T=$.x,R=$.y),t.bezierCurveTo(w,B,T,R,V,F),re>=p&&m&&(S=v,P=_.controls&&_.controls.right||te.zero,A=S.controls&&S.controls.left||te.zero,_._relative?(w=P.x+_.x,B=P.y+_.y):(w=P.x,B=P.y),S._relative?(T=A.x+S.x,R=A.y+S.y):(T=A.x,R=A.y),V=S.x,F=S.y,t.bezierCurveTo(w,B,T,R,V,F));break;case ne.line:t.lineTo(V,F);break;case ne.move:v=_,t.moveTo(V,F);break}return m&&t.closePath(),!Y&&!n&&(Be.isHidden.test(a)||(I=a._renderer&&a._renderer.offset,I&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),I&&t.restore()),Be.isHidden.test(s)||(I=s._renderer&&s._renderer.offset,I&&(t.save(),t.translate(-s._renderer.offset.x,-s._renderer.offset.y),t.scale(s._renderer.scale.x,s._renderer.scale.y),t.lineWidth=o/s._renderer.scale.x),t.stroke(),I&&t.restore())),ee||t.restore(),Y&&!n&&t.clip(),z&&z.length>0&&t.setLineDash(bo),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,n){let r,s,o,a,l,c,d,u,h,m,g,f,p,b,y,_;if(_=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(_||1),c=this._visible,!e&&(!c||l===0))return this;if(J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,u=this._renderer.collection,h=u.length,p=Qr(r),y=this.dashes,d=this._size,p||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")t.fillStyle=a;else{const T=Be.getRendererType(a._renderer.type);Be[T].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const T=Be.getRendererType(s._renderer.type);Be[T].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=hn(this))}typeof l=="number"&&(t.globalAlpha=l),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),t.beginPath();let S=d*.5,v;this._sizeAttenuation||(v=this.worldMatrix.elements,v=li(v[0],v[3],v[1],v[4],v[2],v[5]),S/=Math.max(v.scaleX,v.scaleY));for(let T=0;T<h;T++)m=u[T],g=m.x,f=m.y,t.moveTo(g+S,f),t.arc(g,f,S,0,ut);return n||(Be.isHidden.test(a)||(b=a._renderer&&a._renderer.offset,b&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),b&&t.restore()),Be.isHidden.test(s)||(b=s._renderer&&s._renderer.offset,b&&(t.save(),t.translate(-s._renderer.offset.x,-s._renderer.offset.y),t.scale(s._renderer.scale.x,s._renderer.scale.y),t.lineWidth=o/s._renderer.scale.x),t.stroke(),b&&t.restore())),p||t.restore(),y&&y.length>0&&t.setLineDash(bo),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t,e,n){const r=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,s=this._opacity*r,o=this._visible,a=this._mask,l=this._clip;if(!e&&(!o||l||s===0))return this;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,u=this._linewidth,h=this._fill,m=this._decoration,g=this._direction,f=Qr(c),p=h._renderer&&h._renderer.offset&&d._renderer&&d._renderer.offset,b=this.dashes,y=Be.alignments[this._alignment]||this._alignment,_=Be.baselines[this._baseline]||this._baseline;let S,v,T,R,w,B,x,$,P,A,V;if(f||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const F=Be.getRendererType(a._renderer.type);Be[F].render.call(a,t,!0)}if(p||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=y,t.textBaseline=_,t.direction=g,h)if(typeof h=="string")t.fillStyle=h;else{const F=Be.getRendererType(h._renderer.type);Be[F].render.call(h,t,this),t.fillStyle=h._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const F=Be.getRendererType(d._renderer.type);Be[F].render.call(d,t,this),t.strokeStyle=d._renderer.effect}u&&(t.lineWidth=hn(this))}if(typeof s=="number"&&(t.globalAlpha=s),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),!l&&!n&&(Be.isHidden.test(h)||(h._renderer&&h._renderer.offset?(B=h._renderer.scale.x,x=h._renderer.scale.y,t.save(),t.translate(-h._renderer.offset.x,-h._renderer.offset.y),t.scale(B,x),S=this._size/h._renderer.scale.y,v=this._leading/h._renderer.scale.y,t.font=[this._style,this._weight,S+"px/",v+"px",this._family].join(" "),T=h._renderer.offset.x/h._renderer.scale.x,R=h._renderer.offset.y/h._renderer.scale.y,t.fillText(this.value,T,R),t.restore()):t.fillText(this.value,0,0)),Be.isHidden.test(d)||(d._renderer&&d._renderer.offset?(B=d._renderer.scale.x,x=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(B,x),S=this._size/d._renderer.scale.y,v=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,S+"px/",v+"px",this._family].join(" "),T=d._renderer.offset.x/d._renderer.scale.x,R=d._renderer.offset.y/d._renderer.scale.y,w=u/d._renderer.scale.x,t.lineWidth=w,t.strokeText(this.value,T,R),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(m)){const F=t.measureText(this.value);let N=1;switch(m){case"underline":P=F.actualBoundingBoxDescent,V=F.actualBoundingBoxDescent;break;case"strikethrough":P=0,V=0,N=.5;break}switch(_){case"top":P+=this._size*N,V+=this._size*N;break;case"baseline":case"bottom":P-=this._size*N,V-=this._size*N;break}switch(y){case"left":case"start":$=0,A=F.width;break;case"right":case"end":$=-F.width,A=0;break;default:$=-F.width/2,A=F.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo($,P),t.lineTo(A,V),t.stroke()}return f||t.restore(),l&&!n&&t.clip(),b&&b.length>0&&t.setLineDash(bo),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=t.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=t.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=t.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof te||(this._renderer.offset=new te),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,e&&(this._renderer.offset.x+=e.width/2,this._renderer.offset.y+=e.height/2,this._scale instanceof te?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),(this._flagScale||this._flagLoaded)&&(this._renderer.scale instanceof te||(this._renderer.scale=new te),this._scale instanceof te?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},renderSvgArcCommand:function(t,e,n,r,s,o,a,l,c,d){l=l*Math.PI/180,r=kc(r),s=kc(s);const u=(e-c)/2,h=(n-d)/2,m=Gr(l)*u+Kr(l)*h,g=-Kr(l)*u+Gr(l)*h,f=m*m,p=g*g;let b=r*r,y=s*s;const _=f/b+p/y;if(_>1){const F=Zr(_);r=F*r,s=F*s,b=r*r,y=s*s}const S=b*p+y*f,v=(b*y-S)/S;let T=Zr(_o(0,v));o===a&&(T=-T);const R=T*r*g/s,w=-T*s*m/r,B=Gr(l)*R-Kr(l)*w+(e+c)/2,x=Kr(l)*R+Gr(l)*w+(n+d)/2,$=vc(1,0,(m-R)/r,(g-w)/s),P=vc((m-R)/r,(g-w)/s,(-m-R)/r,(-g-w)/s)%ut,A=$+P;Jg(t,B,x,r,s,$,A,a===0,l)}},ft=class extends U{constructor(t){super();const e=t.smoothing!==!1;this.domElement=t.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=t.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=e),this.scene=new ot,this.scene.parent=this}setSize(t,e,n){return this.width=t,this.height=e,this.ratio=typeof n>"u"?Ks(this.ctx):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&J.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(U.Types.resize,t,e,n)}render(){const t=this.ratio===1;return t||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Be.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};k(ft,"Utils",Be);function Jg(t,e,n,r,s,o,a,l,c){const d=a-o,u=Oi.Tolerance.epsilon,h=Math.abs(d)<u;let m=It(d,ut);m<u&&(h?m=0:m=ut),l===!0&&!h&&(m===ut?m=-ut:m=m-ut);for(let g=0;g<vt.Resolution;g++){const f=g/(vt.Resolution-1),p=o+f*m;let b=e+r*Math.cos(p),y=n+s*Math.sin(p);if(c!==0){const _=Math.cos(c),S=Math.sin(c),v=b-e,T=y-n;b=v*_-T*S+e,y=v*S+T*_+n}t.lineTo(b,y)}}function vc(t,e,n,r){const s=t*n+e*r,o=Zr(t*t+e*e)*Zr(n*n+r*r);let a=Qg(_o(-1,Zg(1,s/o)));return t*r-e*n<0&&(a=-a),a}function Qr(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var le={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},baselines:{top:"hanging",middle:"middle",bottom:"ideographic",baseline:"alphabetic"},createElement:function(t,e){const n=t,r=document.createElementNS(le.ns,n);return n==="svg"&&(e=J.defaults(e||{},{version:le.version})),e&&Object.keys(e).length>0&&le.setAttributes(r,e),r},setAttributes:function(t,e){const n=Object.keys(e);for(let r=0;r<n.length;r++)/href/.test(n[r])?t.setAttributeNS(le.xlink,n[r],e[n[r]]):t.setAttribute(n[r],e[n[r]]);return this},removeAttributes:function(t,e){for(let n in e)t.removeAttribute(n);return this},toString:function(t,e){let n=t.length,r=n-1,s,o="";for(let a=0;a<n;a++){const l=t[a],c=e?It(a-1,n):Math.max(a-1,0),d=t[c];let u,h,m,g,f,p,b,y,_,S,v,T,R,w,B,x=Ae(l.x),$=Ae(l.y);switch(l.command){case ne.close:u=ne.close;break;case ne.arc:v=l.rx,T=l.ry,R=l.xAxisRotation,w=l.largeArcFlag,B=l.sweepFlag,u=ne.arc+" "+v+" "+T+" "+R+" "+w+" "+B+" "+x+" "+$;break;case ne.curve:b=d.controls&&d.controls.right||te.zero,y=l.controls&&l.controls.left||te.zero,d.relative?(m=Ae(b.x+d.x),g=Ae(b.y+d.y)):(m=Ae(b.x),g=Ae(b.y)),l.relative?(f=Ae(y.x+l.x),p=Ae(y.y+l.y)):(f=Ae(y.x),p=Ae(y.y)),u=(a===0?ne.move:ne.curve)+" "+m+" "+g+" "+f+" "+p+" "+x+" "+$;break;case ne.move:s=l,u=ne.move+" "+x+" "+$;break;default:u=l.command+" "+x+" "+$}a>=r&&e&&(l.command===ne.curve&&(h=s,_=l.controls&&l.controls.right||l,S=h.controls&&h.controls.left||h,l.relative?(m=Ae(_.x+l.x),g=Ae(_.y+l.y)):(m=Ae(_.x),g=Ae(_.y)),h.relative?(f=Ae(S.x+h.x),p=Ae(S.y+h.y)):(f=Ae(S.x),p=Ae(S.y)),x=Ae(h.x),$=Ae(h.y),u+=" C "+m+" "+g+" "+f+" "+p+" "+x+" "+$),l.command!==ne.close&&(u+=" Z")),o+=u+" "}return o},pointsToString:function(t,e){let n="";const r=e*.5;for(let s=0;s<t.length;s++){const o=t[s].x,a=t[s].y-r;n+=ne.move+" "+o+" "+a+" ",n+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return n},getClip:function(t,e){let n=t._renderer.clip;return n||(n=t._renderer.clip=le.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&e.defs.appendChild(n),n},getRendererType:function(t){return t in le?t:"path"},defs:{update:function(t){const{defs:e}=t;if(e._flagUpdate){const n=Array.prototype.slice.call(e.children,0);for(let r=0;r<n.length;r++){const s=n[r],o=s.id,a=`[fill="url(#${o})"],[stroke="url(#${o})"],[clip-path="url(#${o})"]`;t.querySelector(a)||e.removeChild(s)}e._flagUpdate=!1}}},group:{appendChild:function(t){const e=t._renderer.elem;if(!e)return;const n=e.nodeName;!n||/(radial|linear)gradient/i.test(n)||t._clip||this.elem.appendChild(e)},removeChild:function(t){const e=t._renderer.elem;!e||e.parentNode!=this.elem||!e.nodeName||t._clip||this.elem.removeChild(e)},orderChild:function(t){this.elem.appendChild(t._renderer.elem)},renderChild:function(t){const e=le.getRendererType(t._renderer.type);le[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=le.createElement("g",{id:this.id}),t.appendChild(this._renderer.elem));const e=this._matrix.manual||this._flagMatrix,n={domElement:t,elem:this._renderer.elem};e&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const s=this.children[r],o=le.getRendererType(s._renderer.type);le[o].render.call(s,t)}if(this._flagId&&this._renderer.elem.setAttribute("id",this._id),this._flagOpacity&&this._renderer.elem.setAttribute("opacity",this._opacity),this._flagVisible&&this._renderer.elem.setAttribute("display",this._visible?"inline":"none"),this._flagClassName&&this._renderer.elem.setAttribute("class",this.classList.join(" ")),this._flagAdditions&&this.additions.forEach(le.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(le.group.removeChild,n),this._flagOrder&&this.children.forEach(le.group.orderChild,n),this._flagMask)if(this._mask){const r=le.getRendererType(this._mask._renderer.type);le[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.dataset&&Object.assign(this._renderer.elem.dataset,this.dataset),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices){const r=le.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=le.getRendererType(this._fill._renderer.type);le[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=le.getRendererType(this._stroke._renderer.type);le[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=hn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this._flagCap&&(e["stroke-linecap"]=this._cap),this._flagJoin&&(e["stroke-linejoin"]=this._join),this._flagMiter&&(e["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?le.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=le.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=le.getClip(this,t),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=le.getRendererType(this._mask._renderer.type);le[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const o=this.worldMatrix.elements,a=li(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=le.pointsToString(this._renderer.collection,r);e.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=le.getRendererType(this._fill._renderer.type);le[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=le.getRendererType(this._stroke._renderer.type);le[r].render.call(this._stroke,t,!0)}return this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=hn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?le.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=le.createElement("path",e),t.appendChild(this._renderer.elem)),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t){this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagFamily&&(e["font-family"]=this._family),this._flagSize&&(e["font-size"]=this._size),this._flagLeading&&(e["line-height"]=this._leading),this._flagAlignment&&(e["text-anchor"]=le.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=le.baselines[this._baseline]||this._baseline),this._flagStyle&&(e["font-style"]=this._style),this._flagWeight&&(e["font-weight"]=this._weight),this._flagDecoration&&(e["text-decoration"]=this._decoration),this._flagDirection&&(e.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=le.getRendererType(this._fill._renderer.type);le[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=le.getRendererType(this._stroke._renderer.type);le[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=hn(this)),this._flagOpacity&&(e.opacity=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?le.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=le.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=le.getClip(this,t),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=le.getRendererType(this._mask._renderer.type);le[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(t,e){J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagEndPoints&&(n.x1=this.left._x,n.y1=this.left._y,n.x2=this.right._x,n.y2=this.right._y),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?le.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=le.createElement("linearGradient",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?le.setAttributes(o._renderer.elem,a):o._renderer.elem=le.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagCenter&&(n.cx=this.center._x,n.cy=this.center._y),this._flagFocal&&(n.fx=this.focal._x,n.fy=this.focal._y),this._flagRadius&&(n.r=this._radius),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?le.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=le.createElement("radialGradient",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?le.setAttributes(o._renderer.elem,a):o._renderer.elem=le.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={},r={x:0,y:0},s=this.image;if(this._flagId&&(n.id=this._id),this._flagLoaded&&this.loaded)switch(s.nodeName.toLowerCase()){case"canvas":r.href=r["xlink:href"]=s.toDataURL("image/png");break;case"img":case"image":r.href=r["xlink:href"]=this.src;break}if((this._flagOffset||this._flagLoaded||this._flagScale)&&(n.x=this._offset.x,n.y=this._offset.y,s&&(n.x-=s.width/2,n.y-=s.height/2,this._scale instanceof te?(n.x*=this._scale.x,n.y*=this._scale.y):(n.x*=this._scale,n.y*=this._scale)),n.x>0&&(n.x*=-1),n.y>0&&(n.y*=-1)),(this._flagScale||this._flagLoaded||this._flagRepeat)&&(n.width=0,n.height=0,s)){switch(n.width=s.width,n.height=s.height,this._repeat){case"no-repeat":n.width+=1,n.height+=1;break}this._scale instanceof te?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),/no-repeat/i.test(this._repeat)?r.preserveAspectRatio="xMidYMid":r.preserveAspectRatio="none",r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?le.setAttributes(this._renderer.image,r):this._renderer.image=le.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&le.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=le.createElement("pattern",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},Cc=class extends U{constructor(t){super(),this.domElement=t.domElement||le.createElement("svg"),this.scene=new ot,this.scene.parent=this,this.defs=le.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(t,e){return this.width=t,this.height=e,le.setAttributes(this.domElement,{width:t,height:e}),this.trigger(U.Types.resize,t,e)}render(){return le.group.render.call(this.scene,this.domElement),le.defs.update(this.domElement),this}};k(Cc,"Utils",le);var Xt={create:function(t,e,n){const r=t.createShader(t[n]);if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const o=t.getShaderInfoLog(r);throw t.deleteShader(r),new Et("unable to compile shader "+r+": "+o)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
40
+ ***************************************************************************** */var Ir=function(){return Ir=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ir.apply(this,arguments)},sm={scale:1,zoom:!0,infiniteZoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:"lg-zoom-in",zoomOut:"lg-zoom-out"},enableZoomAfter:300,zoomPluginStrings:{zoomIn:"Zoom in",zoomOut:"Zoom out",viewActualSize:"View actual size"}},Tn={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ds=500,om=(function(){function t(e,n){return this.core=e,this.$LG=n,this.settings=Ir(Ir({},sm),this.core.settings),this}return t.prototype.buildTemplates=function(){var e=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(e+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(e)},t.prototype.enableZoom=function(e){var n=this,r=this.settings.enableZoomAfter+e.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&e.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(e.detail.index).addClass("lg-zoomable"),e.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},t.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(Tn.slideItemLoad+".zoom",this.enableZoom.bind(this))},t.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},t.prototype.getSwipeCords=function(e){var n=e.touches[0].pageX,r=e.touches[0].pageY;return{x:n,y:r}},t.prototype.getDragAllowedAxises=function(e,n){if(!this.containerRect)return{allowX:!1,allowY:!1};var r=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),s=0,o=0,a=r.getBoundingClientRect();e?(s=r.offsetHeight*e,o=r.offsetWidth*e):n?(s=a.height+n*a.height,o=a.width+n*a.width):(s=a.height,o=a.width);var l=s>this.containerRect.height,c=o>this.containerRect.width;return{allowX:c,allowY:l}},t.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},t.prototype.zoomImage=function(e,n,r,s){if(!(!this.containerRect||Math.abs(n)<=0)){var o=this.containerRect.width/2+this.containerRect.left,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,l,c;e===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),u=d.allowY,h=d.allowX;this.positionChanged&&(l=this.left/(this.scale-n),c=this.top/(this.scale-n),this.pageX=o-l,this.pageY=a-c,this.positionChanged=!1);var m=this.getPossibleSwipeDragCords(n),g,f,p=o-this.pageX,b=a-this.pageY;if(e-n>1){var y=(e-n)/Math.abs(n);p=(n<0?-p:p)+this.left*(y+(n<0?-1:1)),b=(n<0?-b:b)+this.top*(y+(n<0?-1:1)),g=p/y,f=b/y}else{var y=(e-n)*n;g=p*y,f=b*y}r&&(h?this.isBeyondPossibleLeft(g,m.minX)?g=m.minX:this.isBeyondPossibleRight(g,m.maxX)&&(g=m.maxX):e>1&&(g<m.minX?g=m.minX:g>m.maxX&&(g=m.maxX)),u?this.isBeyondPossibleTop(f,m.minY)?f=m.minY:this.isBeyondPossibleBottom(f,m.maxY)&&(f=m.maxY):e>1&&(f<m.minY?f=m.minY:f>m.maxY&&(f=m.maxY))),this.setZoomStyles({x:g,y:f,scale:e}),this.left=g,this.top=f,s&&this.setZoomImageSize()}},t.prototype.resetImageTranslate=function(e){if(this.isImageSlide(e)){var n=this.core.getSlideItem(e).find(".lg-image").first();this.imageReset=!1,n.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),n.css("width","auto").css("height","auto"),setTimeout(function(){n.removeClass("no-transition")},10)}},t.prototype.setZoomImageSize=function(){var e=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=e.getCurrentImageActualSizeScale();e.scale>=r&&(n.addClass("no-transition"),e.imageReset=!0)},Ds),setTimeout(function(){var r=e.getCurrentImageActualSizeScale();if(e.scale>=r){var s=e.getDragAllowedAxises(e.scale);n.css("width",n.get().naturalWidth+"px").css("height",n.get().naturalHeight+"px"),e.core.outer.addClass("lg-actual-size"),s.allowX&&s.allowY?n.addClass("reset-transition"):s.allowX&&!s.allowY?n.addClass("reset-transition-x"):!s.allowX&&s.allowY&&n.addClass("reset-transition-y")}},Ds+50)},t.prototype.setZoomStyles=function(e){var n=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),r=this.core.getSlideItem(this.core.index).find(".lg-image").first(),s=this.core.outer.find(".lg-current .lg-dummy-img").first();this.scale=e.scale,r.css("transform","scale3d("+e.scale+", "+e.scale+", 1)"),s.css("transform","scale3d("+e.scale+", "+e.scale+", 1)");var o="translate3d("+e.x+"px, "+e.y+"px, 0)";n.css("transform",o)},t.prototype.setActualSize=function(e,n){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var s=this.core.galleryItems[this.core.index];this.resetImageTranslate(e),setTimeout(function(){if(!(!s.src||r.core.outer.hasClass("lg-first-slide-loading"))){var o=r.getCurrentImageActualSizeScale(),a=r.scale;r.core.outer.hasClass("lg-zoomed")?r.scale=1:r.scale=r.getScale(o),r.setPageCords(n),r.beginZoom(r.scale),r.zoomImage(r.scale,r.scale-a,!0,!0)}},50),setTimeout(function(){r.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},60),setTimeout(function(){r.zoomInProgress=!1},Ds+110)}},t.prototype.getNaturalWidth=function(e){var n=this.core.getSlideItem(e).find(".lg-image").first(),r=this.core.galleryItems[e].width;return r?parseFloat(r):n.get().naturalWidth},t.prototype.getActualSizeScale=function(e,n){var r,s;return e>=n?(r=e/n,s=r||2):s=1,s},t.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=e.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},t.prototype.getPageCords=function(e){var n={};if(e)n.x=e.pageX||e.touches[0].pageX,n.y=e.pageY||e.touches[0].pageY;else{var r=this.core.$content.get().getBoundingClientRect();n.x=r.width/2+r.left,n.y=r.height/2+this.scrollTop+r.top}return n},t.prototype.setPageCords=function(e){var n=this.getPageCords(e);this.pageX=n.x,this.pageY=n.y},t.prototype.manageActualPixelClassNames=function(){var e=this.core.getElementById("lg-actual-size");e.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},t.prototype.beginZoom=function(e){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),e>1},t.prototype.getScale=function(e){var n=this.getCurrentImageActualSizeScale();return e<1?e=1:e>n&&(e=n),e},t.prototype.init=function(){var e=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){e.$LG(r.target).hasClass("lg-image")&&e.setActualSize(e.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var s=e.$LG(r.target);r.touches.length===1&&s.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),e.setActualSize(e.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on(Tn.containerResize+".zoom "+Tn.rotateRight+".zoom "+Tn.rotateLeft+".zoom "+Tn.flipHorizontal+".zoom "+Tn.flipVertical+".zoom",function(){if(!(!e.core.lgOpened||!e.isImageSlide(e.core.index)||e.core.touchAction)){var r=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();e.top=0,e.left=0,e.setZoomEssentials(),e.setZoomSwipeStyles(r,{x:0,y:0}),e.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){e.core.lgOpened&&(e.scrollTop=e.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(e.isImageSlide(e.core.index)){var r=0;e.imageReset&&(e.resetImageTranslate(e.core.index),r=50),setTimeout(function(){var s=e.scale-e.settings.scale;s<1&&(s=1),e.beginZoom(s),e.zoomImage(s,-e.settings.scale,!0,!e.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){e.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){e.setActualSize(e.core.index)}),this.core.LGel.on(Tn.beforeOpen+".zoom",function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(Tn.afterOpen+".zoom",function(){e.scrollTop=e.$LG(window).scrollTop(),e.pageX=e.core.outer.width()/2,e.pageY=e.core.outer.height()/2+e.scrollTop,e.scale=1}),this.core.LGel.on(Tn.afterSlide+".zoom",function(r){var s=r.detail.prevIndex;e.scale=1,e.positionChanged=!1,e.zoomInProgress=!1,e.resetZoom(s),e.resetImageTranslate(s),e.isImageSlide(e.core.index)&&e.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},t.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var e=this.scale+this.settings.scale;this.settings.infiniteZoom||(e=this.getScale(e)),this.beginZoom(e),this.zoomImage(e,Math.min(this.settings.scale,e-this.scale),!0,!this.settings.infiniteZoom)}},t.prototype.resetZoom=function(e){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(e!==void 0?e:this.core.index);n.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),r.find(".lg-img-wrap").first().removeAttr("style"),r.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},t.prototype.getTouchDistance=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)*(e.touches[0].pageX-e.touches[1].pageX)+(e.touches[0].pageY-e.touches[1].pageY)*(e.touches[0].pageY-e.touches[1].pageY))},t.prototype.pinchZoom=function(){var e=this,n=0,r=!1,s=1,o=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(l){if(a=e.core.getSlideItem(e.core.index),!!e.isImageSlide(e.core.index)&&l.touches.length===2){if(l.preventDefault(),e.core.outer.hasClass("lg-first-slide-loading"))return;s=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.setPageCords(l),e.resetImageTranslate(e.core.index),e.core.touchAction="pinch",n=e.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=e.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){o=e.scale;var u=Math.max(1,s+-d*.02);e.scale=Math.round((u+Number.EPSILON)*100)/100;var h=e.scale-o;e.zoomImage(e.scale,Math.round((h+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,e.scale<=1)e.resetZoom();else{var c=e.getCurrentImageActualSizeScale();if(e.scale>=c){var d=c-e.scale;d===0&&(d=.01),e.zoomImage(c,d,!1,!0)}e.manageActualPixelClassNames(),e.core.outer.addClass("lg-zoomed")}e.core.touchAction=void 0}})},t.prototype.touchendZoom=function(e,n,r,s,o){var a=n.x-e.x,l=n.y-e.y,c=Math.abs(a)/o+1,d=Math.abs(l)/o+1;c>2&&(c+=1),d>2&&(d+=1),a=a*c,l=l*d;var u=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),h={};h.x=this.left+a,h.y=this.top+l;var m=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(h.y,m.minY)?h.y=m.minY:this.isBeyondPossibleBottom(h.y,m.maxY)&&(h.y=m.maxY)),r&&(this.isBeyondPossibleLeft(h.x,m.minX)?h.x=m.minX:this.isBeyondPossibleRight(h.x,m.maxX)&&(h.x=m.maxX)),s?this.top=h.y:h.y=this.top,r?this.left=h.x:h.x=this.left,this.setZoomSwipeStyles(u,h),this.positionChanged=!0)},t.prototype.getZoomSwipeCords=function(e,n,r,s,o){var a={};if(s){if(a.y=this.top+(n.y-e.y),this.isBeyondPossibleTop(a.y,o.minY)){var l=o.minY-a.y;a.y=o.minY-l/6}else if(this.isBeyondPossibleBottom(a.y,o.maxY)){var c=a.y-o.maxY;a.y=o.maxY+c/6}}else a.y=this.top;if(r){if(a.x=this.left+(n.x-e.x),this.isBeyondPossibleLeft(a.x,o.minX)){var d=o.minX-a.x;a.x=o.minX-d/6}else if(this.isBeyondPossibleRight(a.x,o.maxX)){var u=a.x-o.maxX;a.x=o.maxX+u/6}}else a.x=this.left;return a},t.prototype.isBeyondPossibleLeft=function(e,n){return e>=n},t.prototype.isBeyondPossibleRight=function(e,n){return e<=n},t.prototype.isBeyondPossibleTop=function(e,n){return e>=n},t.prototype.isBeyondPossibleBottom=function(e,n){return e<=n},t.prototype.isImageSlide=function(e){var n=this.core.galleryItems[e];return this.core.getSlideType(n)==="image"},t.prototype.getPossibleSwipeDragCords=function(e){var n=this.core.getSlideItem(this.core.index).find(".lg-image").first(),r=this.core.mediaContainerPosition.bottom,s=n.get().getBoundingClientRect(),o=s.height,a=s.width;e&&(o=o+e*o,a=a+e*a);var l=(o-this.containerRect.height)/2,c=(this.containerRect.height-o)/2+r,d=(a-this.containerRect.width)/2,u=(this.containerRect.width-a)/2,h={minY:l,maxY:c,minX:d,maxX:u};return h},t.prototype.setZoomSwipeStyles=function(e,n){e.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},t.prototype.zoomSwipe=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=new Date,c=new Date,d,u,h=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(m){if(e.isImageSlide(e.core.index)&&(h=e.core.getSlideItem(e.core.index),(e.$LG(m.target).hasClass("lg-item")||h.get().contains(m.target))&&m.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){m.preventDefault(),l=new Date,e.core.touchAction="zoomSwipe",u=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var g=e.getDragAllowedAxises(0);a=g.allowY,o=g.allowX,(o||a)&&(n=e.getSwipeCords(m)),d=e.getPossibleSwipeDragCords(),e.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(m){if(m.touches.length===1&&e.core.touchAction==="zoomSwipe"&&(e.$LG(m.target).hasClass("lg-item")||h.get().contains(m.target))){m.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(m);var g=e.getZoomSwipeCords(n,r,o,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(s=!0,e.setZoomSwipeStyles(u,g))}}),this.core.$inner.on("touchend.lg",function(m){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(m.target).hasClass("lg-item")||h.get().contains(m.target))){if(m.preventDefault(),e.core.touchAction=void 0,e.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var g=c.valueOf()-l.valueOf();e.touchendZoom(n,r,o,a,g)}})},t.prototype.zoomDrag=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,u,h;this.core.outer.on("mousedown.lg.zoom",function(m){if(e.isImageSlide(e.core.index)){var g=e.core.getSlideItem(e.core.index);if(e.$LG(m.target).hasClass("lg-item")||g.get().contains(m.target)){c=new Date,h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var f=e.getDragAllowedAxises(0);l=f.allowY,a=f.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(m.target).hasClass("lg-object")&&(a||l)&&(m.preventDefault(),n=e.getDragCords(m),u=e.getPossibleSwipeDragCords(),s=!0,e.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(m){if(s){o=!0,r=e.getDragCords(m);var g=e.getZoomSwipeCords(n,r,a,l,u);e.setZoomSwipeStyles(h,g)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(m){if(s){if(d=new Date,s=!1,e.core.outer.removeClass("lg-zoom-dragging"),o&&(n.x!==r.x||n.y!==r.y)){r=e.getDragCords(m);var g=d.valueOf()-c.valueOf();e.touchendZoom(n,r,a,l,g)}o=!1}e.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},t.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},t.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},t})();const am={ref:"gallery-container",class:"lightgallery-wrapper"},lm={},el=i.defineComponent({...lm,__name:"lightgallery",props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(t){const e=t,n={lgAfterAppendSlide:e.onAfterAppendSlide,lgInit:e.onInit,lgHasVideo:e.onHasVideo,lgContainerResize:e.onContainerResize,lgAfterAppendSubHtml:e.onAfterAppendSubHtml,lgBeforeOpen:e.onBeforeOpen,lgAfterOpen:e.onAfterOpen,lgSlideItemLoad:e.onSlideItemLoad,lgBeforeSlide:e.onBeforeSlide,lgAfterSlide:e.onAfterSlide,lgPosterClick:e.onPosterClick,lgDragStart:e.onDragStart,lgDragMove:e.onDragMove,lgDragEnd:e.onDragEnd,lgBeforeNextSlide:e.onBeforeNextSlide,lgBeforePrevSlide:e.onBeforePrevSlide,lgBeforeClose:e.onBeforeClose,lgAfterClose:e.onAfterClose,lgRotateLeft:e.onRotateLeft,lgRotateRight:e.onRotateRight,lgFlipHorizontal:e.onFlipHorizontal,lgFlipVertical:e.onFlipVertical},r=i.useTemplateRef("gallery-container"),s=i.ref(null);return i.onMounted(async()=>{if(!r.value)return;const o=await import("lightgallery");s.value=o.default(r.value,{...e.settings}),M.forOwn(n,(a,l)=>{var c;a&&((c=r.value)==null||c.addEventListener(l,a))})}),i.onBeforeUnmount(()=>{var o;s.value&&((o=s.value)==null||o.destroy(),s.value=null)}),(o,a)=>(i.openBlock(),i.createElementBlock("div",am,[i.renderSlot(o.$slots,"default")],512))}}),at=class at{static init(){at.isInitialized||(at.isInitialized=!0,at.windowResizeHandler(),window.addEventListener("resize",at.windowResizeHandler))}static destroy(){window.removeEventListener("resize",at.windowResizeHandler),at.isInitialized=!1}static getDeviceTypeByResolution(){const e=Z.useBaseConfigStateStore().config.deviceTypeByResolution;return window.innerWidth<e.tablet?Ge.phone:window.innerWidth<e.laptop?Ge.tablet:Ge.laptop}static initRefDependingOnDeviceResolution(e,n,r){const s=i.ref(r);return at.setRefValueDependingOnDeviceResolution(s,e,n,r),at.refsDependingOnDeviceResolution.push({r:s,phoneValue:e,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return at.getDeviceTypeByResolution()===Ge.phone}static isTabletDevice(){return at.getDeviceTypeByResolution()===Ge.tablet}static isLaptopDevice(){return at.getDeviceTypeByResolution()===Ge.laptop}static setRefValueDependingOnDeviceResolution(e,n,r,s){switch(at.getDeviceTypeByResolution()){case Ge.phone:e.value=n;break;case Ge.tablet:e.value=r;break;default:e.value=s;break}}static windowResizeHandler(){M.forEach(at.refsDependingOnDeviceResolution,e=>{at.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};C(at,"isInitialized",!1),C(at,"refsDependingOnDeviceResolution",[]);let kt=at;const cm=["href"],dm=["src","alt"],um={},tl=i.defineComponent({...um,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[rm,om],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(kt.getDeviceTypeByResolution()===Ge.phone?.7:.8),a=i.ref(o()),l=()=>{a.value=o()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),e({show:c}),window.addEventListener("resize",l),(d,u)=>{const h=Ja,m=L.NPopover;return i.openBlock(),i.createBlock(m,{trigger:"manual",show:n.value,class:"sc-image",placement:"top-start",onClickoutside:u[3]||(u[3]=()=>{r.value||(n.value=!1)})},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:"inline-flex",onClick:u[0]||(u[0]=g=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(h)])])]),default:i.withCtx(()=>[i.createVNode(el,{settings:s.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:u[1]||(u[1]=()=>{r.value=!0}),onAfterClose:u[2]||(u[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.images,(g,f)=>(i.openBlock(),i.createElementBlock("a",{key:f,href:g.image},[i.createElementVNode("img",{src:g.preview,alt:`Изображение #${f+1}`},null,8,dm)],8,cm))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),hm={class:"flex flex-col text-sm"},fm={},mm=i.defineComponent({...fm,__name:"product-stock-count",props:{product:{}},setup(t){return(e,n)=>{const r=Ls,s=L.NPopover;return i.openBlock(),i.createBlock(s,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(e.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",hm,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.product.stockCount,(o,a)=>(i.openBlock(),i.createElementBlock("span",{key:a},i.toDisplayString(o.warehouse.name)+": "+i.toDisplayString(o.count)+" "+i.toDisplayString(t.product.unit.name),1))),128))])]),_:3})}}}),gm={class:"flex flex-row justify-between"},pm={class:"inline-flex flex-row gap-0.5 mr-2 align-sub"},ym={key:0},bm={class:"ml-2 align-sub"},_m={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},wm={class:"@container"},xm={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},km={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},vm={class:"text-sc-dark-grey"},Cm={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},Sm={class:"text-gray-600"},Bm={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},Tm={key:3,class:"underline decoration-dashed"},Rm={key:4,class:"sc-product-pack whitespace-nowrap"},$m={class:"text-gray-600"},Pm={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},Nm={class:"text-gray-600"},Em={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},Fm={key:0},Am={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Mm={},ar=i.defineComponent({...Mm,__name:"product-name",props:{product:{},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},showProductCosts:{type:[Boolean,Function],default:!1},showPlanningDates:{type:Boolean,default:!0},showPriceHistory:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(t,{expose:e}){const n=t,r=i.computed(()=>M.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>M.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,m;return(m=(h=n.product)==null?void 0:h.properties)==null?void 0:m.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>M.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=i.computed(()=>{var h;return n.showProductAddToCartButton||n.showProductEditButton||n.showProductRequiredButton||(((h=n.productContextButtonsConfig)==null?void 0:h.length)??0)>0}),u=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return e({showProductImagesPreview:l}),(h,m)=>{var T,R,w,B;const g=nm,f=L.NTooltip,p=Za,b=Ja,y=L.NText,_=Qa,S=Ls,v=L.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",gm,[i.createVNode(y,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>{var x,$;return[i.createElementVNode("div",pm,[((x=t.product)==null?void 0:x.isFavorite)??!1?(i.openBlock(),i.createBlock(f,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"!text-yellow-300"})]),default:i.withCtx(()=>[m[0]||(m[0]=i.createTextVNode(" Избранный товар ",-1))]),_:1})):i.createCommentVNode("",!0),(($=t.product)==null?void 0:$.isPreviouslyOrdered)??!1?(i.openBlock(),i.createBlock(f,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{class:"!text-green-700"})]),default:i.withCtx(()=>[m[1]||(m[1]=i.createTextVNode(" Ранее заказанный товар ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&t.eventEmitter}),onClick:u},i.toDisplayString(t.product.name),3),t.product.onOrder?(i.openBlock(),i.createElementBlock("span",ym," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",bm,[t.product.images&&t.product.images.length>0?(i.openBlock(),i.createBlock(tl,{key:0,ref:"image-gallery",images:t.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",_m,[i.createVNode(b)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]}),_:1}),d.value?(i.openBlock(),i.createBlock(_,{key:0,product:t.product,"event-emitter":t.eventEmitter,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-edit-button":t.showProductEditButton,"show-product-required-button":t.showProductRequiredButton,"product-context-buttons-config":t.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","show-product-required-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",wm,[i.createElementVNode("div",xm,[t.product.supplierSku?(i.openBlock(),i.createElementBlock("div",km,[m[2]||(m[2]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",vm,i.toDisplayString(t.product.supplierSku),1)])):i.createCommentVNode("",!0),t.showCode?(i.openBlock(),i.createElementBlock("span",Cm,[m[3]||(m[3]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",Sm,i.toDisplayString(t.product.code),1)])):i.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(i.openBlock(),i.createBlock(mm,{key:2,product:t.product},{default:i.withCtx(()=>[i.createElementVNode("span",Bm,[m[4]||(m[4]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(S,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",Tm," Нет в наличии ")),t.product.pack??((R=(T=t.product)==null?void 0:T.properties)==null?void 0:R.pack)?(i.openBlock(),i.createElementBlock("span",Rm,[m[5]||(m[5]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",$m,i.toDisplayString(t.product.pack??((B=(w=t.product)==null?void 0:w.properties)==null?void 0:B.pack)),1)])):i.createCommentVNode("",!0),t.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",Pm,[m[6]||(m[6]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",Nm,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(v,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",Em,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,x=>(i.openBlock(),i.createBlock(jn,{key:x.coefficient.slug,product:t.product,"cost-field-name":x.coefficient.slug??"","event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","currency-rates"]))),128)),i.createVNode(jn,{product:t.product,"event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":t.showCostDate,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates,"cost-field-name":"cost","additional-through-field-name":"retailCost",style:{"background-color":"var(--n-merged-td-color)"},class:"sticky right-0 border-0 border-l-2 border-solid border-gray-300 pl-2"},null,8,["product","event-emitter","allow-price-click","show-cost-date","show-price-history","currency-rates"])])):i.createCommentVNode("",!0)]),_:1}),t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",Fm,[i.createElementVNode("ul",Am,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.product.id,slug:t.product.slug},(x,$)=>(i.openBlock(),i.createElementBlock("li",{key:$}," ("+i.toDisplayString($)+"): "+i.toDisplayString(x),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.product.properties,(x,$)=>(i.openBlock(),i.createElementBlock("li",{key:$}," ("+i.toDisplayString($)+"): "+i.toDisplayString(x),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),Vm=(t,e,n)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>i.h(jn,{product:r,costFieldName:t,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),Im=(t,e)=>{if(t.length===0)return[];const n=[],r={};switch(M.isNil(e.isProductItemSelected)||n.push({key:"checkbox",title:"",className:"align-top",width:"32",render:s=>{var o,a;return i.h(L.NCheckbox,{checked:!!((o=e.isProductItemSelected)!=null&&o.call(e,s)),disabled:((a=e.isProductItemSelected)==null?void 0:a.call(e,s))==="disabled",onUpdateChecked:l=>{e.eventEmitter.emit("product:checked",{product:s,checked:l})}})}}),kt.getDeviceTypeByResolution()){case Ge.phone:case Ge.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(ar,{product:s,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(ar,{product:s,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})}),e.showProductCosts&&(M.forEach(t,s=>{M.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),M.forEach(M.sortBy(r,["slug"]),s=>{n.push(Vm(s.slug??"",s.name,e))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(jn,{product:s,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:e.eventEmitter,allowPriceClick:e.allowPriceClick,showQuantityUnit:!0,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})})),(e.showProductEditButton||e.showProductRequiredButton||e.showProductAddToCartButton||!M.isNil(e.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(Qa,{product:s,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return n},Om={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function zm(t,e){return i.openBlock(),i.createElementBlock("svg",Om,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z"},null,-1)])])}const Hs=i.markRaw({name:"ion-trash",render:zm}),Lm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Dm(t,e){return i.openBlock(),i.createElementBlock("svg",Lm,[...e[0]||(e[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const nl=i.markRaw({name:"ion-plus",render:Dm}),Hm={key:0,class:"flex w-fit items-center gap-2"},Wm={key:1,class:"flex flex-wrap gap-1"},jm={key:0},qm={key:2},Xm={},lr=i.defineComponent({...Xm,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0},validation:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{var r,s;return(s=(r=e.product)==null?void 0:r.properties)==null?void 0:s.planingProductionDate});return(r,s)=>{const o=L.NSpin,a=L.NText;return t.isProductSearching?(i.openBlock(),i.createElementBlock("div",Hm,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):t.product&&!t.product.isNewRec()?(i.openBlock(),i.createElementBlock("div",Wm,[i.createElementVNode("div",null,i.toDisplayString(t.product.code)+" - "+i.toDisplayString(t.product.name)+" - "+i.toDisplayString(t.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(t.product.unit.name),1),n.value?(i.openBlock(),i.createElementBlock("div",jm,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)])):t.validation?(i.openBlock(),i.createElementBlock("div",qm,[i.createVNode(a,{type:t.validation.validationStatus},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.validation.feedback),1)]),_:1},8,["type"])])):i.createCommentVNode("",!0)}}}),ae={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(t){return{type:"number",min:t,trigger:["blur","input"],message:`Минимальное значение: ${t}`}},max(t){return{type:"number",max:t,trigger:["blur","input"],message:`Максимальное значение: ${t}`}},step(t){return{type:"number",trigger:["blur","input"],validator:(e,n)=>n===null||Math.abs(n/t-Math.round(n/t))<1e-10?!0:new Error(`Значение должно быть кратно ${t}`)}}},De={serverValidation(t){return{validator:(e,n)=>n===null?!0:t?new Error(t):!0}}},Ym={class:"flex flex-col gap-4"},Um={class:"flex flex-col gap-2"},Km={class:"mt-8 font-bold"},Gm={class:"grid grow grid-cols-2 items-start gap-2"},Zm={key:2,class:"text-red-500 text-sm"},Qm={key:3,class:"text-red-500 text-sm mb-2"},Jm={class:"flex flex-col gap-4"},eg={key:1},tg={class:"text-lg font-semibold"},ng={class:"flex gap-3"},ig={},rg=i.defineComponent({...ig,__name:"kozyrek-configurator-params-form",props:{value:{},settings:{},previewParams:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},selectTemplateIndex:{}},emits:["update:value","update:params","submit","click:add-line","click:remove-line","click:save-template"],setup(t,{expose:e,emit:n}){var b;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.ref(!1),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>{var _,S,v;const y={"configuratorParams.length":[ae.required,ae.min(r.settings.stripMinLength),ae.max(r.settings.stripMaxLength||Number.MAX_VALUE),ae.step(r.settings.lengthStep),De.serverValidation((_=r.validation.length)==null?void 0:_.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),De.serverValidation((S=r.validation.quantity)==null?void 0:S.feedback)],marker:[De.serverValidation((v=r.validation.marker)==null?void 0:v.feedback)]};return M.forEach(l.value.configuratorParams.linesWidths,(T,R)=>{var x;const B=l.value.configuratorParams.linesWidths.length>1?r.settings.minLineWidth:r.settings.stripMinWidth;y[`configuratorParams.linesWidths.${R}`]=[ae.required,ae.min(B),ae.max(r.settings.maxLineWidth),ae.step(r.settings.lineWidthStep),De.serverValidation((x=r.validation[`lines_widths[${R+1}]`])==null?void 0:x.feedback)]}),M.forEach(l.value.configuratorParams.linesAngles,(T,R)=>{var w;y[`configuratorParams.linesAngles.${R}`]=[ae.required,ae.min(r.settings.minLineAngle),ae.max(r.settings.maxLineAngle),ae.step(r.settings.lineAngleStep),De.serverValidation((w=r.validation[`lines_angles[${R+1}]`])==null?void 0:w.feedback)]}),y}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>{var T;const{length:y}=l.value.configuratorParams,{quantity:_}=l.value,S=((T=l.value.product)==null?void 0:T.costRub)||0;if(!y||!_||S===0)return null;const v=y/1e3;return(S*_*v).toLocaleString("ru-ru",{maximumFractionDigits:2,minimumFractionDigits:2})}),h=i.computed(()=>M.reduce(l.value.configuratorParams.linesWidths,(y,_)=>y+(_||0),0)),m=i.computed(()=>{const y=h.value;return y>=r.settings.stripMinWidth&&y<=r.settings.stripMaxWidth}),g=i.computed(()=>{const{configuratorParams:y}=l.value,_=M.every(y.linesWidths,R=>!!(R&&R>0)),S=M.every(y.linesAngles,R=>!M.isNil(R)),v=!!(l.value.quantity&&l.value.quantity>0),T=y.length>0&&y.length>0;return _&&S&&v&&T&&m.value}),f=()=>{i.nextTick(()=>{var y;(y=o.value)==null||y.validate(_=>{_||(s("update:params",l.value.configuratorParams),p("configuratorParams",l.value.configuratorParams))}).catch(M.noop)})},p=(y,_)=>{const S=new Z.OrderItemBase(l.value);S[y]=_,y==="configuratorParams"&&(S.product=new Z.ClientProduct),s("update:value",S)};return i.watch(()=>r.previewParams,y=>{l.value.configuratorParams.linesWidths=y.linesWidths,l.value.configuratorParams.linesAngles=y.linesAngles},{deep:!0}),i.watch(()=>r.value,y=>{l.value=M.cloneDeep(y)},{deep:!0}),e({validate:(b=o.value)==null?void 0:b.validate,formReference:o}),(y,_)=>{const S=nl,v=Hs,T=L.NCheckbox;return i.openBlock(),i.createBlock(i.unref(L.NForm),{ref:"form-reference",model:l.value,rules:c.value,class:"flex flex-col gap-4 sc-hide-empty-feedback-message",onKeydown:_[20]||(_[20]=i.withKeys(i.withModifiers(R=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var R;return[i.createElementVNode("div",Ym,[_[22]||(_[22]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),t.settings.startTailConfigs&&t.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(L.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NSelect),{value:l.value.configuratorParams.startTailType,"onUpdate:value":[_[0]||(_[0]=w=>l.value.configuratorParams.startTailType=w),f],options:t.settings.startTailConfigs.map(({label:w},B)=>({label:w,value:B})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Um,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value.configuratorParams.linesAngles,(w,B)=>(i.openBlock(),i.createElementBlock("div",{key:B,class:"flex items-start gap-2"},[i.createElementVNode("div",Km,i.toDisplayString(B+1),1),i.createElementVNode("div",Gm,[i.createVNode(i.unref(L.NFormItem),{path:`configuratorParams.linesWidths.${B}`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:l.value.configuratorParams.linesWidths[B],"onUpdate:value":[x=>l.value.configuratorParams.linesWidths[B]=x,_[2]||(_[2]=x=>f())],parse:i.unref(xt),"show-button":!1,class:"w-full",onKeydown:_[1]||(_[1]=x=>i.unref(lt)(x)),onInput:x=>i.unref(Oe)(t.validation,`lines_widths[${B+1}]`),onFocus:i.unref(ze)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(L.NFormItem),{path:`configuratorParams.linesAngles.${B}`,label:"Угол сгиба, °"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:l.value.configuratorParams.linesAngles[B],"onUpdate:value":[x=>l.value.configuratorParams.linesAngles[B]=x,_[4]||(_[4]=x=>f())],parse:i.unref(xt),"show-button":!1,class:"w-full",onKeydown:_[3]||(_[3]=x=>i.unref(lt)(x,!0)),onInput:x=>i.unref(Oe)(t.validation,`lines_angles[${B+1}]`),onFocus:i.unref(ze)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"])]),i.createVNode(i.unref(L.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(L.NButton),{key:0,size:"medium",onClick:x=>s("click:add-line",B)},{default:i.withCtx(()=>[i.createVNode(S)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(L.NButton),{key:1,disabled:l.value.configuratorParams.linesWidths.length===1,size:"medium",class:"ml-2",onClick:x=>s("click:remove-line",B)},{default:i.withCtx(()=>[i.createVNode(v)]),_:1},8,["disabled","onClick"]))]),_:2},1024)]))),128))]),t.settings.endTailConfigs&&t.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(L.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NSelect),{value:l.value.configuratorParams.endTailType,"onUpdate:value":[_[5]||(_[5]=w=>l.value.configuratorParams.endTailType=w),f],options:t.settings.endTailConfigs.map(({label:w},B)=>({label:w,value:B})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(lr,{"is-product-searching":t.isProductSearching,product:l.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),m.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Zm," Суммарная ширина участков гиба должна быть от "+i.toDisplayString(t.settings.stripMinWidth)+" до "+i.toDisplayString(t.settings.stripMaxWidth)+" мм., текущая ширина: "+i.toDisplayString(h.value)+" мм. ",1)),g.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Qm," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((R=t.settings.allTemplates)==null?void 0:R.length)-1?(i.openBlock(),i.createBlock(i.unref(L.NButton),{key:4,type:"tertiary",class:"self-start",loading:a.value,onClick:_[6]||(_[6]=w=>s("click:save-template"))},{default:i.withCtx(()=>[..._[21]||(_[21]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Jm,[i.createVNode(i.unref(L.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NSelect),{value:l.value.configuratorParams.colorSide,"onUpdate:value":[_[7]||(_[7]=w=>l.value.configuratorParams.colorSide=w),f],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(L.NFormItem),{path:"configuratorParams.length",label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[_[8]||(_[8]=w=>l.value.configuratorParams.length=w),_[11]||(_[11]=w=>f())],parse:i.unref(xt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:_[9]||(_[9]=w=>i.unref(lt)(w)),onInput:_[10]||(_[10]=w=>i.unref(Oe)(t.validation,"length")),onFocus:i.unref(ze)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(L.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:l.value.quantity,"onUpdate:value":[_[12]||(_[12]=w=>l.value.quantity=w),_[15]||(_[15]=w=>p("quantity",w??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:_[13]||(_[13]=w=>i.unref(lt)(w,!1)),onInput:_[14]||(_[14]=w=>i.unref(Oe)(t.validation,"quantity")),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(L.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInput),{value:l.value.marker??null,placeholder:"Введите маркировку",onInput:_[16]||(_[16]=w=>i.unref(Oe)(t.validation,"marker")),"onUpdate:value":_[17]||(_[17]=w=>{l.value.marker=w??null,p("marker",w??null)}),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(T,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":_[18]||(_[18]=w=>{l.value.isAdditionalSale=w??!1,p("isAdditionalSale",w??!1)})},{default:i.withCtx(()=>[..._[23]||(_[23]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createElementBlock("div",eg,[_[24]||(_[24]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",tg,i.toDisplayString(u.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",ng,[i.createVNode(i.unref(L.NButton),{loading:t.isSubmitProcessing,disabled:!g.value||l.value.product.isNewRec(),type:"primary",class:"self-start",onClick:_[19]||(_[19]=w=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1},8,["model","rules"])}}}),il=Wn(rg,[["__scopeId","data-v-47ba4507"]]);var rl=Object.defineProperty,sg=Object.defineProperties,og=Object.getOwnPropertyDescriptors,sl=Object.getOwnPropertySymbols,ag=Object.prototype.hasOwnProperty,lg=Object.prototype.propertyIsEnumerable,ol=t=>{throw TypeError(t)},Ws=(t,e,n)=>e in t?rl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,js=(t,e)=>{for(var n in e||(e={}))ag.call(e,n)&&Ws(t,n,e[n]);if(sl)for(var n of sl(e))lg.call(e,n)&&Ws(t,n,e[n]);return t},qs=(t,e)=>sg(t,og(e)),al=(t,e)=>{for(var n in e)rl(t,n,{get:e[n],enumerable:!0})},k=(t,e,n)=>Ws(t,typeof e!="symbol"?e+"":e,n),ll=(t,e,n)=>e.has(t)||ol("Cannot "+n),Nt=(t,e,n)=>(ll(t,e,"read from private field"),n?n.call(t):e.get(t)),cl=(t,e,n)=>e.has(t)?ol("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),cg=(t,e,n,r)=>(ll(t,e,"write to private field"),e.set(t,n),n),vt={Image:null,isHeadless:!1,shim:function(t,e){return t.tagName=t.nodeName=e||"canvas",t.nodeType=1,t.getAttribute=function(n){return this[n]},t.setAttribute=function(n,r){return this[n]=r,this},t},polyfill:function(t,e){return vt.shim(t),typeof e<"u"&&(vt.Image=e),vt.isHeadless=!0,t}},dl={};al(dl,{Curve:()=>Oi,getAnchorsFromArcData:()=>hg,getComponentOnCubicBezier:()=>cr,getControlPoints:()=>xl,getCurveBoundingBox:()=>bl,getCurveFromPoints:()=>wl,getCurveLength:()=>yl,getReflection:()=>Ks,integrate:()=>_l,subdivide:()=>Us});var ul={};al(ul,{HALF_PI:()=>et,NumArray:()=>un,TWO_PI:()=>ut,decomposeMatrix:()=>li,getComputedMatrix:()=>Xs,getEffectiveStrokeWidth:()=>hn,getPoT:()=>ml,lerp:()=>Vt,mod:()=>It,setMatrix:()=>fl,toFixed:()=>Ae});var je;typeof window<"u"?je=window:typeof global<"u"?je=global:typeof self<"u"&&(je=self);var hl,ut=Math.PI*2,et=Math.PI*.5;function li(t,e,n,r,s,o){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,s=t.e,o=t.f):a=t,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function fl(t){hl=t}function Xs(t,e){e=e&&e.identity()||new hl;let n=t;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function Vt(t,e,n){return n*(e-t)+t}var Ys=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function ml(t){let e=0;for(;Ys[e]&&Ys[e]<t;)e++;return Ys[e]}function It(t,e){for(;t<0;)t+=e;return t%e}var un=je.Float32Array||Array,dg=Math.floor;function Ae(t){return dg(t*1e6)/1e6}function hn(t,e){const n=t._linewidth;if(t.strokeAttenuation)return n;e||(e=t.worldMatrix||Xs(t));const r=li(e.elements[0],e.elements[3],e.elements[1],e.elements[4],e.elements[2],e.elements[5]),s=Math.max(Math.abs(r.scaleX),Math.abs(r.scaleY));return s>0?n/s:n}var ne={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},U=class{constructor(){k(this,"_events",{}),k(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){e=r[s];let a=this._events[e];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let u=a[c];u=u.handler?u.handler:u,n!==u&&l.push(u)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,n,r){const s=this;e&&(o.obj=e,o.name=n,o.handler=r,e.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(e,n,r){return e.off(n,r),this}};k(U,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),k(U,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var gl={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(U.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(U.Types.change))}}},Qt=class ir extends U{constructor(e=0,n=0){super(),k(this,"_x",0),k(this,"_y",0);for(let r in gl)Object.defineProperty(this,r,gl[r]);this.x=e,this.y=n}static add(e,n){return new ir(e.x+n.x,e.y+n.y)}static sub(e,n){return new ir(e.x-n.x,e.y-n.y)}static subtract(e,n){return ir.sub(e,n)}static ratioBetween(e,n){return(e.x*n.x+e.y*n.y)/(e.length()*n.length())}static angleBetween(e,n){if(arguments.length>=4){const o=arguments[0]-arguments[2],a=arguments[1]-arguments[3];return Math.atan2(a,o)}const r=e.x-n.x,s=e.y-n.y;return Math.atan2(s,r)}static distanceBetween(e,n){return Math.sqrt(ir.distanceBetweenSquared(e,n))}static distanceBetweenSquared(e,n){const r=e.x-n.x,s=e.y-n.y;return r*r+s*s}set(e,n){return this.x=e,this.y=n,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new ir(this.x,this.y)}add(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x+=e,this.y+=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=n),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x-=e,this.y-=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=n),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x*=e,this.y*=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=n),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x/=e,this.y/=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=n),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,n){return n=typeof n>"u"?1e-4:n,this.distanceTo(e)<n}lerp(e,n){const r=(e.x-this.x)*n+this.x,s=(e.y-this.y)*n+this.y;return this.set(r,s)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:Ae(this.x),y:Ae(this.y)}}rotate(e){const n=this.x,r=this.y,s=Math.cos(e),o=Math.sin(e);return this.x=n*s-r*o,this.y=n*o+r*s,this}};k(Qt,"zero",new Qt),k(Qt,"left",new Qt(-1,0)),k(Qt,"right",new Qt(1,0)),k(Qt,"up",new Qt(0,-1)),k(Qt,"down",new Qt(0,1));var te=Qt,ve=class Is extends te{constructor(e=0,n=0,r=0,s=0,o=0,a=0,l=ne.move){super(e,n),k(this,"controls",{left:new te,right:new te}),k(this,"_command",ne.move),k(this,"_relative",!0),k(this,"_rx",0),k(this,"_ry",0),k(this,"_xAxisRotation",0),k(this,"_largeArcFlag",0),k(this,"_sweepFlag",1);for(let d in pl)Object.defineProperty(this,d,pl[d]);this.command=l,this.relative=!0;const c=Is.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(U.Types.change,c),this.controls.right.set(o,a).addEventListener(U.Types.change,c)}static makeBroadcast(e){return n;function n(){e._bound&&e.dispatchEvent(U.Types.change)}}static fromObject(e){return new Is().copy(e)}copy(e){return this.x=e.x,this.y=e.y,typeof e.command=="string"&&(this.command=e.command),e.controls&&(e.controls.left&&this.controls.left.copy(e.controls.left),e.controls.right&&this.controls.right.copy(e.controls.right)),typeof e.relative=="boolean"&&(this.relative=e.relative),typeof e.rx=="number"&&(this.rx=e.rx),typeof e.ry=="number"&&(this.ry=e.ry),typeof e.xAxisRotation=="number"&&(this.xAxisRotation=e.xAxisRotation),typeof e.largeArcFlag=="number"&&(this.largeArcFlag=e.largeArcFlag),typeof e.sweepFlag=="number"&&(this.sweepFlag=e.sweepFlag),this}clone(){return new Is().copy(this)}toObject(){return{x:Ae(this.x),y:Ae(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Ae(this.rx),ry:Ae(this.ry),xAxisRotation:Ae(this.xAxisRotation),largeArcFlag:Ae(this.largeArcFlag),sweepFlag:Ae(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},pl={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(U.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(U.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(U.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(U.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(U.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(U.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(U.Types.change))}}},ug=0,Ct={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.21",PublishDate:"2025-10-01T00:18:49.277Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return ug++}},Oi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function cr(t,e,n,r,s){const o=1-t;return o*o*o*e+3*o*o*t*n+3*o*t*t*r+t*t*t*s}function Us(t,e,n,r,s,o,a,l,c){c=c||Oi.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new ve(a,l)];const u=[];for(let h=0;h<d;h++){const m=h/d,g=cr(m,t,n,s,a),f=cr(m,e,r,o,l);u.push(new ve(g,f))}return u}function yl(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-s)+3*(a-t),u=6*(t+s)-12*n,h=3*(n-t),m=9*(r-o)+3*(l-e),g=6*(e+o)-12*r,f=3*(r-e);function p(b){const y=(d*b+u)*b+h,_=(m*b+g)*b+f;return Math.sqrt(y*y+_*_)}return _l(p,0,1,c||Oi.RecursionLimit)}function bl(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let u,h,m,g,f,p,b,y;for(let T=0;T<2;++T){if(T===0?(h=6*t-12*n+6*s,u=-3*t+9*n-9*s+3*a,m=3*n-3*t):(h=6*e-12*r+6*o,u=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;g=-m/h,0<g&&g<1&&c.push(g);continue}b=h*h-4*m*u,y=Math.sqrt(b),!(b<0)&&(f=(-h+y)/(2*u),0<f&&f<1&&c.push(f),p=(-h-y)/(2*u),0<p&&p<1&&c.push(p))}let _=c.length,S=_,v;for(;_--;)g=c[_],v=1-g,d[0][_]=v*v*v*t+3*v*v*g*n+3*v*g*g*s+g*g*g*a,d[1][_]=v*v*v*e+3*v*v*g*r+3*v*g*g*o+g*g*g*l;return d[0][S]=t,d[1][S]=e,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function _l(t,e,n,r){let s=Oi.abscissas[r-2],o=Oi.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,u=r&1?o[c++]*t(l):0;for(;c<d;){const h=a*s[c];u+=o[c++]*(t(l+h)+t(l-h))}return a*u}function wl(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?It(s-1,n):Math.max(s-1,0),l=e?It(s+1,n):Math.min(s+1,r),c=t[a],d=o,u=t[l];xl(c,d,u),d.command=s===0?ne.move:ne.curve}}function xl(t,e,n){const r=te.angleBetween(t,e),s=te.angleBetween(n,e);let o=te.distanceBetween(t,e),a=te.distanceBetween(n,e),l=(r+s)/2;return o<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(o*=.33,a*=.33,s<r?l+=et:l-=et,e.controls.left.x=Math.cos(l)*o,e.controls.left.y=Math.sin(l)*o,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}function Ks(t,e,n){return new te(2*t.x-(e.x+t.x)-(n?t.x:0),2*t.y-(e.y+t.y)-(n?t.y:0))}function hg(t,e,n,r,s,o,a){const l=Ct.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const u=d*o+s,h=n*Math.cos(u),m=r*Math.sin(u),g=new ve(h,m);g.command=ne.line}}var kl=Array.prototype.slice;function fg(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var J={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=kl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]=r[s]}return t},defaults:function(t){const e=kl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]===void 0&&(t[s]=r[s])}return t},each:function(t,e,n){const r=n||this,s=!fg(t)&&Object.keys(t),o=(s||t).length;for(let a=0;a<o;a++){const l=s?s[a]:a;e.call(r,t[l],l,t)}return t},performance:je.performance&&je.performance.now?je.performance:Date},Ot={hasEventListeners:typeof je.addEventListener=="function",bind:function(t,e,n,r){return this.hasEventListeners?t.addEventListener(e,n,!!r):t.attachEvent("on"+e,n),Ot},unbind:function(t,e,n,r){return Ot.hasEventListeners?t.removeEventListeners(e,n,!!r):t.detachEvent("on"+e,n),Ot},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,n=je.requestAnimationFrame;if(!n){for(let s=0;s<t.length;s++)n=je[t[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=je.setTimeout(d,l);e=a+l;function d(){s(a+l)}return c}return n}},zi=je.document?je.document.createElement("div"):{};zi.id="help-two-load",Object.defineProperty(Ot,"temp",{enumerable:!0,get:function(){return J.isElement(zi)&&!je.document.head.contains(zi)&&(zi.style.display="none",je.document.head.appendChild(zi)),zi}});var Et=class extends Error{constructor(e){super(),k(this,"name","Two.js"),k(this,"message"),this.message=e}},mg=je.devicePixelRatio||1;function gg(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function Gs(t){return mg/gg(t)}var Or=class{constructor(){k(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}},ht,qn=class extends Array{constructor(){super(),cl(this,ht,new U),arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return Nt(this,ht)}set _events(e){cg(this,ht,e)}get _bound(){return Nt(this,ht)._bound}set _bound(e){Nt(this,ht)._bound=e}addEventListener(){return Nt(this,ht).addEventListener.apply(this,arguments)}on(){return Nt(this,ht).on.apply(this,arguments)}bind(){return Nt(this,ht).bind.apply(this,arguments)}removeEventListener(){return Nt(this,ht).removeEventListener.apply(this,arguments)}off(){return Nt(this,ht).off.apply(this,arguments)}unbind(){return Nt(this,ht).unbind.apply(this,arguments)}dispatchEvent(){return Nt(this,ht).dispatchEvent.apply(this,arguments)}trigger(){return Nt(this,ht).trigger.apply(this,arguments)}listen(){return Nt(this,ht).listen.apply(this,arguments)}ignore(){return Nt(this,ht).ignore.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(U.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(U.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(U.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(U.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(U.Types.remove,e),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(U.Types.insert,n),this.trigger(U.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(U.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(U.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(e,n){const r=[];for(let s=0;s<this.length;s++){const o=this[s];let a;n?a=e.call(n,o,s):a=e(o,s),r.push(a)}return r}};ht=new WeakMap;var vl=class Yh extends U{constructor(){super(),k(this,"_flagId",!1),k(this,"_flagClassName",!1),k(this,"_renderer",{}),k(this,"_id",Ct.Identifier+Ct.uniqueId()),k(this,"_className",""),k(this,"classList",[]);for(let e in Cl)Object.defineProperty(this,e,Cl[e])}static fromObject(e){const n=new Yh().copy(e);return"id"in e&&(n.id=e.id),n}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return e.renderer&&typeof e.renderer.type=="string"&&(this.renderer.type=e.renderer.type),typeof e.className=="string"&&(this.className=e.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const e=this._renderer.type;return this._renderer={type:e},typeof this.unbind=="function"&&this.unbind(),this}};k(vl,"Properties",["renderer","id","className"]);var Li=vl,Cl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}},zr,Sl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};je.document&&(zr=document.createElement("a"));var Jt=class Ht extends Li{constructor(e,n){super(),k(this,"_flagSrc",!1),k(this,"_flagImage",!1),k(this,"_flagVideo",!1),k(this,"_flagLoaded",!1),k(this,"_flagRepeat",!1),k(this,"_flagOffset",!1),k(this,"_flagScale",!1),k(this,"_src",""),k(this,"_image",null),k(this,"_loaded",!1),k(this,"_repeat","no-repeat"),k(this,"_scale",1),k(this,"_offset",null);for(let r in Bl)Object.defineProperty(this,r,Bl[r]);if(this._renderer.type="texture",this._renderer.flagOffset=pg.bind(this),this._renderer.flagScale=yg.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new te,typeof n=="function"){const r=(function(){this.unbind(U.Types.load,r),typeof n=="function"&&n()}).bind(this);this.bind(U.Types.load,r)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const r=Object.prototype.toString.call(e);(r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]"||r==="[object HTMLVideoElement]"||r==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const n=new Ht().copy(e);return"id"in e&&(n.id=e.id),n}static getAbsoluteURL(e){return zr?(zr.href=e,zr.href):e}static loadHeadlessBuffer(e,n){e.image.onload=n,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const n=Ht.getAbsoluteURL(e);if(Ht.ImageRegistry.contains(n))return Ht.ImageRegistry.get(n);let r;return vt.Image?(r=new vt.Image,vt.shim(r,"img")):je.document?Sl.video.test(n)?r=document.createElement("video"):r=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),r.crossOrigin="anonymous",r.referrerPolicy="no-referrer",r}static load(e,n){let r=e.image,s=Ht.getTag(r);e._flagImage&&(/canvas/i.test(s)?Ht.Register.canvas(e,n):(e._src=!vt.isHeadless&&r.getAttribute("two-src")||r.src,Ht.Register[s](e,n))),e._flagSrc&&(r||(r=Ht.getImage(e.src),e.image=r),s=Ht.getTag(r),Ht.Register[s](e,n))}clone(){const e=new Ht(this.src);return e.repeat=this.repeat,e.offset.copy(this.offset),e.scale=this.scale,e}copy(e){return this.src=e.src,this.repeat=e.repeat,this.offset=typeof e.offset=="number"||e.offset instanceof te?e.offset:new te().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof te?e.scale:new te().copy(e.scale),this}toObject(){const e=super.toObject.call(this);return e.renderer.type="texture",e.src=this.src,e.repeat=this.repeat,e.offset=this.offset.toObject(),e.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),e}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(U.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Ht.load(this,(function(){this.loaded=!0,this.trigger(U.Types.change).trigger(U.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};k(Jt,"Properties",["src","loaded","repeat","scale","offset","image"]),k(Jt,"RegularExpressions",Sl),k(Jt,"ImageRegistry",new Or),k(Jt,"Register",{canvas:function(t,e){t._src="#"+t.id,Jt.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const n=t.image,r=function(o){!vt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),typeof e=="function"&&e()},s=function(o){throw!vt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new Et("unable to load "+t.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!vt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),t._src=Jt.getAbsoluteURL(t._src),!(!vt.isHeadless&&n&&n.getAttribute("two-src"))&&(vt.isHeadless||n.setAttribute("two-src",t.src),Jt.ImageRegistry.add(t.src,n),vt.isHeadless?Jt.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(vt.isHeadless)throw new Et("video textures are not implemented in headless environments.");const n=function(s){t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),t.image.width=t.image.videoWidth,t.image.height=t.image.videoHeight,typeof e=="function"&&e()},r=function(s){throw t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),new Et("unable to load "+t.src)};t._src=Jt.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),Jt.ImageRegistry.add(t.src,t.image)),t.image.readyState>=4?n():(t.image.addEventListener("canplaythrough",n,!1),t.image.addEventListener("error",r,!1),t.image.src=t.src,t.image.load())}});var Me=Jt,Bl={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=Me.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Me.ImageRegistry.contains(n)?this._image=Me.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(U.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(U.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof te&&this._scale.unbind(U.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof te&&this._scale.bind(U.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function pg(){this._flagOffset=!0}function yg(){this._flagScale=!0}var Zs=class dn extends Li{constructor(e,n,r){super(),k(this,"_flagOffset",!0),k(this,"_flagOpacity",!0),k(this,"_flagColor",!0),k(this,"_offset",0),k(this,"_opacity",1),k(this,"_color","#fff");for(let s in Tl)Object.defineProperty(this,s,Tl[s]);this._renderer.type="stop",this.offset=typeof e=="number"?e:dn.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof n=="string"?n:dn.Index<=0?"#fff":"#000",dn.Index=(dn.Index+1)%2}static fromObject(e){const n=new dn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<dn.Properties.length;n++){const r=dn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new dn;return J.each(dn.Properties,function(r){n[r]=this[r]},this),e&&e.stops&&e.stops.push(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",J.each(dn.Properties,n=>{e[n]=this[n]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};k(Zs,"Index",0),k(Zs,"Properties",["offset","opacity","color"]);var Xn=Zs,Tl={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},Qs=class Pi extends Li{constructor(e){super(),k(this,"_flagStops",!1),k(this,"_flagSpread",!1),k(this,"_flagUnits",!1),k(this,"_spread",""),k(this,"_units","");for(let n in Rl)Object.defineProperty(this,n,Rl[n]);this._renderer.type="gradient",this._renderer.flagStops=bg.bind(this),this._renderer.bindStops=_g.bind(this),this._renderer.unbindStops=wg.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let n=e.stops;n&&n.length>0&&(n=n.map(s=>s instanceof Xn?s:new Xn().copy(s)));const r=new Pi(n).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const n=this.stops.map(s=>s.clone()),r=new Pi(n);return J.each(Pi.Properties,s=>{r[s]=this[s]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let n=0;n<Pi.Properties.length;n++){const r=Pi.Properties[n];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(n=>n.toObject())};return J.each(Pi.Properties,n=>{e[n]=this[n]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};k(Qs,"Stop",Xn),k(Qs,"Properties",["spread","stops","units"]);var tt=Qs,Rl={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(U.Types.insert,e).unbind(U.Types.remove,n),this._stops=new qn((t||[]).slice(0)),this._stops.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._stops)}}};function bg(){this._flagStops=!0}function _g(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function wg(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var Js=class Nr extends tt{constructor(e,n,r,s,o){super(o),k(this,"_flagEndPoints",!1),k(this,"_left",null),k(this,"_right",null);for(let a in $l)Object.defineProperty(this,a,$l[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=xg.bind(this),this.left=new te,this.right=new te,typeof e=="number"&&(this.left.x=e),typeof n=="number"&&(this.left.y=n),typeof r=="number"&&(this.right.x=r),typeof s=="number"&&(this.right.y=s)}static fromObject(e){const n=new Nr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Nr.Properties.length;n++){const r=Nr.Properties[n];r in e&&(this[r]=e[r]instanceof te?e[r]:new te().copy(e[r]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new Nr(this.left._x,this.left._y,this.right._x,this.right._y,n);return J.each(tt.Properties,function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};k(Js,"Stop",Xn),k(Js,"Properties",["left","right"]);var qe=Js,$l={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof te&&this._left.unbind(U.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(U.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof te&&this._right.unbind(U.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(U.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function xg(){this._flagEndPoints=!0}var eo=class Ni extends tt{constructor(e,n,r,s,o,a){super(s),k(this,"_flagRadius",!1),k(this,"_flagCenter",!1),k(this,"_flagFocal",!1),k(this,"_radius",0),k(this,"_center",null),k(this,"_focal",null);for(let l in Pl)Object.defineProperty(this,l,Pl[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=kg.bind(this),this._renderer.flagFocal=vg.bind(this),this.center=new te,this.radius=typeof r=="number"?r:1,this.focal=new te,typeof e=="number"&&(this.center.x=e),typeof n=="number"&&(this.center.y=n),this.focal.copy(this.center),typeof o=="number"&&(this.focal.x=o),typeof a=="number"&&(this.focal.y=a)}static fromObject(e){const n=new Ni().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ni.Properties.length;n++){const r=Ni.Properties[n];r in e&&(/(center|focal)i/.test(r)?this[r]=e[r]instanceof te?e[r]:new te().copy(e[r]):typeof e[r]=="number"&&(this[r]=e[MediaKeySystemAccess]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new Ni(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return J.each(tt.Properties.concat(Ni.Properties),function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return J.each(Ni.Properties,function(n){e[n]=this[n]},this),e.center=this.center.toObject(),e.focal=this.focal.toObject(),e}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};k(eo,"Stop",Xn),k(eo,"Properties",["center","radius","focal"]);var Xe=eo,Pl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(U.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(U.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(U.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(U.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function kg(){this._flagCenter=!0}function vg(){this._flagFocal=!0}function Nl(t,e){if(e===0||e===1)return!0;const r=t._length*e;let s=0;for(let o=0;o<t._lengths.length;o++){const a=t._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Lr(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,s=0;r<t._lengths.length;r++){if(s+t._lengths[r]>=e)return e-=s,Math.max(r-1,0)+e/t._lengths[r];s+=t._lengths[r]}return-1}function El(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(m||t).x,d=(m||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),yl(r,l,s,c,o,d,a,u,n)}function Fl(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(m||t).x,d=(m||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),Us(r,l,s,c,o,d,a,u,n)}function ci(t){switch(t.renderer.type){case"texture":return Me.fromObject(t);case"gradient":return tt.fromObject(t);case"linear-gradient":return qe.fromObject(t);case"radial-gradient":return Xe.fromObject(t)}return t}var Cg=Math.cos,Sg=Math.sin,Al=Math.tan,to=[],Ml=class Wt extends U{constructor(e,n,r,s,o,a){super(),k(this,"elements",new un(9)),k(this,"manual",!1);let l=e;Array.isArray(l)||(l=Array.prototype.slice.call(arguments)),this.identity(),l.length>0&&this.set(l)}static Multiply(e,n,r){if(n.length<=3){const R=e;let w,B,x;const $=n[0]||0,P=n[1]||0,A=n[2]||0;return w=R[0]*$+R[1]*P+R[2]*A,B=R[3]*$+R[4]*P+R[5]*A,x=R[6]*$+R[7]*P+R[8]*A,[w,B,x]}const s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],u=e[6],h=e[7],m=e[8],g=n[0],f=n[1],p=n[2],b=n[3],y=n[4],_=n[5],S=n[6],v=n[7],T=n[8];return r=r||new un(9),r[0]=s*g+o*b+a*S,r[1]=s*f+o*y+a*v,r[2]=s*p+o*_+a*T,r[3]=l*g+c*b+d*S,r[4]=l*f+c*y+d*v,r[5]=l*p+c*_+d*T,r[6]=u*g+h*b+m*S,r[7]=u*f+h*y+m*v,r[8]=u*p+h*_+m*T,r}static fromObject(e){return new Wt().copy(e)}set(e,n,r,s,o,a,l,c,d){if(typeof n>"u"){const u=e;e=u[0],n=u[1],r=u[2],s=u[3],o=u[4],a=u[5],l=u[6],c=u[7],d=u[8]}return this.elements[0]=e,this.elements[1]=n,this.elements[2]=r,this.elements[3]=s,this.elements[4]=o,this.elements[5]=a,this.elements[6]=l,this.elements[7]=c,this.elements[8]=d,this.trigger(U.Types.change)}copy(e){return this.elements[0]=e.elements[0],this.elements[1]=e.elements[1],this.elements[2]=e.elements[2],this.elements[3]=e.elements[3],this.elements[4]=e.elements[4],this.elements[5]=e.elements[5],this.elements[6]=e.elements[6],this.elements[7]=e.elements[7],this.elements[8]=e.elements[8],this.manual=e.manual,this.trigger(U.Types.change)}identity(){return this.elements[0]=Wt.Identity[0],this.elements[1]=Wt.Identity[1],this.elements[2]=Wt.Identity[2],this.elements[3]=Wt.Identity[3],this.elements[4]=Wt.Identity[4],this.elements[5]=Wt.Identity[5],this.elements[6]=Wt.Identity[6],this.elements[7]=Wt.Identity[7],this.elements[8]=Wt.Identity[8],this.trigger(U.Types.change)}multiply(e,n,r,s,o,a,l,c,d){if(typeof n>"u")return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(U.Types.change);if(typeof r>"u"&&(r=1),typeof s>"u"){e=e||0,n=n||0,r=r||0,o=this.elements;const F=o[0]*e+o[1]*n+o[2]*r,N=o[3]*e+o[4]*n+o[5]*r,Y=o[6]*e+o[7]*n+o[8]*r;return[F,N,Y]}const u=this.elements,h=[e,n,r,s,o,a,l,c,d],m=u[0],g=u[1],f=u[2],p=u[3],b=u[4],y=u[5],_=u[6],S=u[7],v=u[8],T=h[0],R=h[1],w=h[2],B=h[3],x=h[4],$=h[5],P=h[6],A=h[7],V=h[8];return this.elements[0]=m*T+g*B+f*P,this.elements[1]=m*R+g*x+f*A,this.elements[2]=m*w+g*$+f*V,this.elements[3]=p*T+b*B+y*P,this.elements[4]=p*R+b*x+y*A,this.elements[5]=p*w+b*$+y*V,this.elements[6]=_*T+S*B+v*P,this.elements[7]=_*R+S*x+v*A,this.elements[8]=_*w+S*$+v*V,this.trigger(U.Types.change)}inverse(e){const n=this.elements;e=e||new Wt;const r=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],d=n[6],u=n[7],h=n[8],m=h*l-c*u,g=-h*a+c*d,f=u*a-l*d;let p=r*m+s*g+o*f;return p?(p=1/p,e.elements[0]=m*p,e.elements[1]=(-h*s+o*u)*p,e.elements[2]=(c*s-o*l)*p,e.elements[3]=g*p,e.elements[4]=(h*r-o*d)*p,e.elements[5]=(-c*r+o*a)*p,e.elements[6]=f*p,e.elements[7]=(-u*r+s*d)*p,e.elements[8]=(l*r-s*a)*p,e):null}scale(e,n){return arguments.length<=1&&(n=e),this.multiply(e,0,0,0,n,0,0,0,1)}rotate(e){const n=Cg(e),r=Sg(e);return this.multiply(n,-r,0,r,n,0,0,0,1)}translate(e,n){return this.multiply(1,0,e,0,1,n,0,0,1)}skewX(e){const n=Al(e);return this.multiply(1,n,0,0,1,0,0,0,1)}skewY(e){const n=Al(e);return this.multiply(1,0,0,n,1,0,0,0,1)}toString(e){return to.length=0,this.toTransformArray(e,to),to.map(Ae).join(" ")}toTransformArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],u=r[5];if(e){const h=r[6],m=r[7],g=r[8];if(s){n[0]=o,n[1]=c,n[2]=h,n[3]=a,n[4]=d,n[5]=m,n[6]=l,n[7]=u,n[8]=g;return}return[o,c,h,a,d,m,l,u,g]}if(s){n[0]=o,n[1]=c,n[2]=a,n[3]=d,n[4]=l,n[5]=u;return}return[o,c,a,d,l,u]}toArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],u=r[5];if(e){const h=r[6],m=r[7],g=r[8];if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=u,n[6]=h,n[7]=m,n[8]=g;return}return[o,a,l,c,d,u,h,m,g]}if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=u;return}return[o,a,l,c,d,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Wt().copy(this)}};k(Ml,"Identity",[1,0,0,0,1,0,0,0,1]);var Di=Ml;fl(Di);var Vl=class qa extends Li{constructor(){super(),k(this,"_flagMatrix",!0),k(this,"_flagScale",!1),k(this,"_matrix",null),k(this,"_worldMatrix",null),k(this,"_position",null),k(this,"_rotation",0),k(this,"_scale",1),k(this,"_skewX",0),k(this,"_skewY",0);for(let e in Dr)Object.defineProperty(this,e,Dr[e]);this._renderer.flagMatrix=Il.bind(this),this.isShape=!0,this.matrix=new Di,this.worldMatrix=new Di,this.position=new te,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const n=new qa().copy(e);return"id"in e&&(n.id=e.id),n}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return Dr.position.get.apply(this,arguments)}set translation(e){Dr.position.set.apply(this,arguments)}addTo(e){return e.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(e){return super.copy.call(this,e),"position"in e&&(e.position instanceof te?this.position=e.position:this.position.copy(e.position)),"rotation"in e&&(this.rotation=e.rotation),"scale"in e&&(this.scale=typeof e.scale=="number"||e.scale instanceof te?e.scale:new te(e.scale.x,e.scale.y)),"skewX"in e&&(this.skewX=e.skewX),"skewY"in e&&(this.skewY=e.skewY),"matrix"in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(e){const n=new qa;return n.position.copy(this.position),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer={type:"shape"},e.isShape=!0,e.translation=this.translation.toObject(),e.rotation=this.translation.rotation,e.scale=this.scale instanceof te?this.scale.toObject():this.scale,e.skewX=this.skewX,e.skewY=this.skewY,e.matrix=this.matrix.toObject(),e}_update(e){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof te?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),e&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};k(Vl,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Yn=Vl,Dr={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(U.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(U.Types.change,this._renderer.flagMatrix),Il.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof te&&this._scale.unbind(U.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof te&&this._scale.bind(U.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Xs(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Il(){this._flagMatrix=!0}var Hi=Math.min,Wi=Math.max,Bg=Math.ceil,Tg=Math.floor,Rg=new te,no=class ri extends Yn{constructor(e,n,r,s){super(),k(this,"_flagVertices",!0),k(this,"_flagLength",!0),k(this,"_flagFill",!0),k(this,"_flagStroke",!0),k(this,"_flagLinewidth",!0),k(this,"_flagOpacity",!0),k(this,"_flagVisible",!0),k(this,"_flagCap",!0),k(this,"_flagJoin",!0),k(this,"_flagMiter",!0),k(this,"_flagStrokeAttenuation",!0),k(this,"_flagMask",!1),k(this,"_flagClip",!1),k(this,"_length",0),k(this,"_fill","#fff"),k(this,"_stroke","#000"),k(this,"_linewidth",1),k(this,"_opacity",1),k(this,"_visible",!0),k(this,"_cap","round"),k(this,"_join","round"),k(this,"_miter",4),k(this,"_closed",!0),k(this,"_curved",!1),k(this,"_automatic",!0),k(this,"_beginning",0),k(this,"_ending",1),k(this,"_mask",null),k(this,"_clip",!1),k(this,"_dashes",null),k(this,"_strokeAttenuation",!0);for(let o in Ol)Object.defineProperty(this,o,Ol[o]);this._renderer.type="path",this._renderer.flagVertices=zl.bind(this),this._renderer.bindVertices=Ll.bind(this),this._renderer.unbindVertices=Dl.bind(this),this._renderer.flagFill=Hl.bind(this),this._renderer.flagStroke=Wl.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!n,this.curved=!!r,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!s,this.dashes=[],this.dashes.offset=0}static fromObject(e){const n=typeof e.fill=="string"?e.fill:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),s=new ri().copy(qs(js({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){if(super.copy.call(this,e),e.vertices){this.vertices=[];for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof ve?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new ve().copy(r))}}for(let n=0;n<ri.Properties.length;n++){const r=ri.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new ri;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<ri.Properties.length;r++){const s=ri.Properties[r];n[s]=this[s]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(n=>n.toObject()),J.each(ri.Properties,n=>{typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind(),n.controls&&(n.controls.left&&typeof n.controls.left.unbind=="function"&&n.controls.left.unbind(),n.controls.right&&typeof n.controls.right.unbind=="function"&&n.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),n=e.width/2,r=e.height/2,s=e.left+e.width/2,o=e.top+e.height/2;for(let a=0;a<this.vertices.length;a++){const l=this.vertices[a];l.x-=s,l.y-=o,l.x+=n,l.y+=r}return this.mask&&(this.mask.translation.x-=s,this.mask.translation.x+=n,this.mask.translation.y-=o,this.mask.translation.y+=r),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s];o.x-=n,o.y-=r}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getBoundingClientRect(e){let n,r,s,o,a,l,c=1/0,d=-1/0,u=1/0,h=-1/0;if(this._update(!0),n=e?this.matrix:this.worldMatrix,r=(this.linewidth||0)/2,s=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:m,scaleY:g}=li(n.elements[0],n.elements[3],n.elements[1],n.elements[4],n.elements[2],n.elements[5]);typeof m=="number"&&typeof g=="number"&&(r=Math.max(m,g)*(this.linewidth||0)/2)}else r*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(s<=0)return{width:0,height:0};for(o=0;o<s;o++){l=this._renderer.vertices[o],a=this._renderer.vertices[(o+s-1)%s];const[m,g]=n.multiply(a.x,a.y),[f,p]=n.multiply(l.x,l.y);if(a.controls&&l.controls){let b=a.controls.right.x,y=a.controls.right.y;a.relative&&(b+=a.x,y+=a.y);let[_,S]=n.multiply(b,y),v=l.controls.left.x,T=l.controls.left.y;l.relative&&(v+=l.x,T+=l.y);let[R,w]=n.multiply(v,T);const B=bl(m,g,_,S,R,w,f,p);u=Hi(B.min.y-r,u),c=Hi(B.min.x-r,c),d=Wi(B.max.x+r,d),h=Wi(B.max.y+r,h)}else o<=1&&(u=Hi(g-r,u),c=Hi(m-r,c),d=Wi(m+r,d),h=Wi(g+r,h)),u=Hi(p-r,u),c=Hi(f-r,c),d=Wi(f+r,d),h=Wi(p+r,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-u}}getPointAt(e,n){let r,s,o,a,l,c,d,u,h,m,g,f,p,b,y,_=this.length*Math.min(Math.max(e,0),1);const S=this.vertices.length,v=S-1;let T=null,R=null;for(let ee=0,I=this._lengths.length,z=0;ee<I;ee++){if(z+this._lengths[ee]>=_){this._closed?(r=It(ee,S),s=It(ee-1,S),ee===0&&(r=s,s=ee)):(r=ee,s=Math.min(Math.max(ee-1,0),v)),T=this.vertices[r],R=this.vertices[s],_-=z,this._lengths[ee]!==0?e=_/this._lengths[ee]:e=0;break}z+=this._lengths[ee]}if(T===null||R===null)return null;if(T){if(!R)return T}else return R;y=R.controls&&R.controls.right,b=T.controls&&T.controls.left,l=R.x,m=R.y,c=(y||R).x,g=(y||R).y,d=(b||T).x,f=(b||T).y,u=T.x,p=T.y,y&&R.relative&&(c+=R.x,g+=R.y),b&&T.relative&&(d+=T.x,f+=T.y),a=cr(e,l,c,d,u),h=cr(e,m,g,f,p);const w=Vt(l,c,e),B=Vt(m,g,e),x=Vt(c,d,e),$=Vt(g,f,e),P=Vt(d,u,e),A=Vt(f,p,e),V=Vt(w,x,e),F=Vt(B,$,e),N=Vt(x,P,e),Y=Vt($,A,e);return J.isObject(n)?(n.x=a,n.y=h,n instanceof ve&&(n.controls.left.x=V,n.controls.left.y=F,n.controls.right.x=N,n.controls.right.y=Y,(typeof n.relative!="boolean"||n.relative)&&(n.controls.left.x-=a,n.controls.left.y-=h,n.controls.right.x-=a,n.controls.right.y-=h)),n.t=e,n):(o=new ve(a,h,V-a,F-h,N-a,Y-h,this._curved?ne.curve:ne.line),o.t=e,o)}plot(){if(this.curved)return wl(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?ne.move:ne.line;return this}subdivide(e){this._update();const n=this.vertices.length-1,r=this._closed||this.vertices[n]._command===ne.close;let s=this.vertices[n],o=[],a;return J.each(this.vertices,function(l,c){if(c<=0&&!r){s=l;return}if(l.command===ne.move){o.push(new ve(s.x,s.y)),c>0&&(o[o.length-1].command=ne.line),s=l;return}a=Fl(l,s,e),o=o.concat(a),J.each(a,function(d,u){u<=0&&s.command===ne.move?d.command=ne.move:d.command=ne.line}),c>=n&&(this._closed&&this._automatic&&(s=l,a=Fl(l,s,e),o=o.concat(a),J.each(a,function(d,u){u<=0&&s.command===ne.move?d.command=ne.move:d.command=ne.line})),o.push(new ve(l.x,l.y)),o[o.length-1].command=r?ne.close:ne.line),s=l},this),this._automatic=!1,this._curved=!1,this.vertices=o,this}_updateLength(e,n){n||this._update();const s=this.vertices.length-1;let o=this.vertices[s],a=0;return typeof this._lengths>"u"&&(this._lengths=[]),J.each(this.vertices,function(l,c){if(c<=0||l.command===ne.move){o=l,this._lengths[c]=0;return}this._lengths[c]=El(l,o,e),a+=this._lengths[c],o=l},this),this._length=a,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,n=this._closed,r=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),o=Lr(this,r*this._length),a=Lr(this,s*this._length),l=Bg(o),c=Tg(a);let d,u,h,m,g,f;for(this._renderer.vertices.length=0,f=0;f<e;f++)this._renderer.collection.length<=f&&this._renderer.collection.push(new ve),f>c&&!u?(g=this._renderer.collection[f].copy(this._collection[f]),this.getPointAt(s,g),g.command=this._renderer.collection[f].command,this._renderer.vertices.push(g),u=g,h=this._collection[f-1],h&&h.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),h.relative?this._renderer.collection[f-1].controls.right.copy(h.controls.right).lerp(te.zero,1-g.t):this._renderer.collection[f-1].controls.right.copy(h.controls.right).lerp(h,1-g.t))):f>=l&&f<=c&&(g=this._renderer.collection[f].copy(this._collection[f]),this._renderer.vertices.push(g),f===c&&Nl(this,s)?(u=g,!n&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):f===l&&Nl(this,r)&&(d=g,d.command=ne.move,!n&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(f=l-1,g=this._renderer.collection[f].copy(this._collection[f]),this.getPointAt(r,g),g.command=ne.move,this._renderer.vertices.unshift(g),m=this._collection[f+1],m&&m.controls&&(g.controls.left.clear(),m.relative?this._renderer.collection[f+1].controls.left.copy(m.controls.left).lerp(te.zero,g.t):(Rg.copy(m),this._renderer.collection[f+1].controls.left.copy(m.controls.left).lerp(m,g.t))))}return Yn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,Yn.prototype.flagReset.call(this),this}};k(no,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),k(no,"Utils",{getCurveLength:El});var Ce=no,Ol={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof qe||this._fill instanceof Xe||this._fill instanceof Me)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof qe||this._fill instanceof Xe||this._fill instanceof Me)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof qe||this._stroke instanceof Xe||this._stroke instanceof Me)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof qe||this._stroke instanceof Xe||this._stroke instanceof Me)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";J.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(U.Types.insert,e).unbind(U.Types.remove,n),t instanceof qn?this._collection=t:this._collection=new qn(t||[]),this._collection.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,J.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function zl(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Ll(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Dl(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Hl(){this._flagFill=!0}function Wl(){this._flagStroke=!0}var jl=class Er extends Ce{constructor(e,n,r,s){const o=[new ve,new ve,new ve,new ve];super(o,!0,!1,!0),k(this,"_flagWidth",!1),k(this,"_flagHeight",!1),k(this,"_width",0),k(this,"_height",0),k(this,"_origin",null),this._renderer.type="rectangle";for(let a in ql)Object.defineProperty(this,a,ql[a]);this.width=typeof r=="number"?r:1,this.height=typeof s=="number"?s:1,this.origin=new te,typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n),this._update()}static fromObject(e){const n=new Er().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Er.Properties.length;n++){const r=Er.Properties[n];r in e&&(typeof e[r]=="number"?this[r]=e[r]:this[r]instanceof te&&this[r].copy(e[r]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,n=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new ve),this.vertices[0].set(-e,-n).sub(this._origin).command=ne.move,this.vertices[1].set(e,-n).sub(this._origin).command=ne.line,this.vertices[2].set(e,n).sub(this._origin).command=ne.line,this.vertices[3].set(-e,n).sub(this._origin).command=ne.line,this.vertices[4]&&(this.vertices[4].set(-e,-n).sub(this._origin).command=ne.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=new Er(0,0,this.width,this.height);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Ce.Properties.length;r++){const s=Ce.Properties[r];n[s]instanceof te?n[s].copy(this[s]):n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="rectangle",e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}};k(jl,"Properties",["width","height","origin"]);var Un=jl,ql={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(U.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(U.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Xl=class Fr extends Un{constructor(e,n,r,s,o,a){super(n,r,0,0),k(this,"_flagTexture",!1),k(this,"_flagColumns",!1),k(this,"_flagRows",!1),k(this,"_flagFrameRate",!1),k(this,"_flagIndex",!1),k(this,"_amount",1),k(this,"_duration",0),k(this,"_startTime",0),k(this,"_playing",!1),k(this,"_firstFrame",0),k(this,"_lastFrame",0),k(this,"_loop",!0),k(this,"_texture",null),k(this,"_columns",1),k(this,"_rows",1),k(this,"_frameRate",0),k(this,"_index",0),k(this,"_origin",null),this._renderer.type="sprite";for(let l in Yl)Object.defineProperty(this,l,Yl[l]);this.noStroke(),this.noFill(),e instanceof Me?this.texture=e:typeof e=="string"&&(this.texture=new Me(e)),this.origin=new te,this._update(),typeof s=="number"&&(this.columns=s),typeof o=="number"&&(this.rows=o),typeof a=="number"&&(this.frameRate=a),this.index=0}static fromObject(e){const n=new Fr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Fr.Properties.length;n++){const r=Fr.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=J.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(e){const n=new Fr(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&n.play(this._firstFrame,this._lastFrame),n.loop=this.loop,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="sprite",e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture,n=this._columns,r=this._rows;let s,o,a,l,c,d,u,h,m;if(e&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=e),e.loaded)){u=e.image.width,h=e.image.height,s=u/n,o=h/r,l=this._amount,this.width!==s&&(this.width=s),this.height!==o&&(this.height=o),this._playing&&this._frameRate>0&&(J.isNaN(this._lastFrame)&&(this._lastFrame=l-1),a=J.performance.now()-this._startTime,m=this._lastFrame+1,c=1e3*(m-this._firstFrame)/this._frameRate,this._loop?a=a%c:a=Math.min(a,c),d=Vt(this._firstFrame,m,a/c),d=Math.floor(d),d!==this._index&&(this._index=d,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const g=this._index%n,f=Math.floor(this._index/n),p=-s*g+(u-s)/2,b=-o*f+(h-o)/2;p!==e.offset.x&&(e.offset.x=p),b!==e.offset.y&&(e.offset.y=b)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};k(Xl,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var Hr=Xl,Yl={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},io,Ul=class extends qn{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),cl(this,io,{}),this.attach(e),this.on(U.Types.insert,this.attach),this.on(U.Types.remove,this.detach)}get ids(){return Nt(this,io)}attach(e){for(let n=0;n<e.length;n++){const r=e[n];r&&r.id&&(this.ids[r.id]=r)}return this}detach(e){for(let n=0;n<e.length;n++)delete this.ids[e[n].id];return this}};io=new WeakMap;var Kl=class Ei extends Ce{constructor(e,n,r,s,o,a,l){const c=l||Ct.Resolution*3,d=[];for(let u=0;u<c;u++)d.push(new ve);super(d,!0,!1,!0),k(this,"_flagStartAngle",!1),k(this,"_flagEndAngle",!1),k(this,"_flagInnerRadius",!1),k(this,"_flagOuterRadius",!1),k(this,"_startAngle",0),k(this,"_endAngle",ut),k(this,"_innerRadius",0),k(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let u in Gl)Object.defineProperty(this,u,Gl[u]);typeof r=="number"&&(this.innerRadius=r),typeof s=="number"&&(this.outerRadius=s),typeof o=="number"&&(this.startAngle=o),typeof a=="number"&&(this.endAngle=a),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ei().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ei.Properties.length;n++){const r=Ei.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,n=this._endAngle,r=this._innerRadius,s=this._outerRadius,o=It(e,ut)===It(n,ut),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,u=0,h,m,g,f,p,b,y,_,S;for(o?c--:a||(c-=2),h=0,m=c-1;h<c;h++){switch(g=h/m,f=l[u],p=g*(n-e)+e,b=(n-e)/c,y=s*Math.cos(p),_=s*Math.sin(p),h){case 0:d=ne.move;break;default:d=ne.curve}f.command=d,f.x=y,f.y=_,f.controls.left.clear(),f.controls.right.clear(),f.command===ne.curve&&(S=s*b/Math.PI,f.controls.left.x=S*Math.cos(p-et),f.controls.left.y=S*Math.sin(p-et),f.controls.right.x=S*Math.cos(p+et),f.controls.right.y=S*Math.sin(p+et),h===1&&f.controls.left.multiplyScalar(2),h===m&&f.controls.right.multiplyScalar(2)),u++}if(a){for(o?(l[u].command=ne.close,u++):(c--,m=c-1),h=0;h<c;h++)g=h/m,f=l[u],p=(1-g)*(n-e)+e,b=(n-e)/c,y=r*Math.cos(p),_=r*Math.sin(p),d=ne.curve,h<=0&&(d=o?ne.move:ne.line),f.command=d,f.x=y,f.y=_,f.controls.left.clear(),f.controls.right.clear(),f.command===ne.curve&&(S=r*b/Math.PI,f.controls.left.x=S*Math.cos(p+et),f.controls.left.y=S*Math.sin(p+et),f.controls.right.x=S*Math.cos(p-et),f.controls.right.y=S*Math.sin(p-et),h===1&&f.controls.left.multiplyScalar(2),h===m&&f.controls.right.multiplyScalar(2)),u++;l[u].copy(l[0]),l[u].command=ne.line}else o||(l[u].command=ne.line,l[u].x=0,l[u].y=0,u++,l[u].copy(l[0]),l[u].command=ne.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(e){const n=this.innerRadius,r=this.outerRadius,s=this.startAngle,o=this.endAngle,a=this.vertices.length,l=new Ei(0,0,n,r,s,o,a);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let c=0;c<Ce.Properties.length;c++){const d=Ce.Properties[c];l[d]=this[d]}return e&&e.add(l),l}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let n=0;n<Ei.Properties.length;n++){const r=Ei.Properties[n];e[r]=this[r]}return e}};k(Kl,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var ro=Kl,Gl={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},so=Math.cos,oo=Math.sin,Zl=class Fi extends Ce{constructor(e,n,r,s){const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new ve(0,0,0,0,0,0));super(a,!0,!0,!0),k(this,"_flagRadius",!1),k(this,"_radius",0),this._renderer.type="circle";for(let l in Ql)Object.defineProperty(this,l,Ql[l]);typeof r=="number"&&(this.radius=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Fi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Fi.Properties.length;n++){const r=Fi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(e*2)),r=this._radius,s=r*n;for(let o=0;o<this.vertices.length;o++){const l=o/e*ut,c=r*so(l),d=r*oo(l),u=s*so(l-et),h=s*oo(l-et),m=s*so(l+et),g=s*oo(l+et),f=this.vertices[o];f.command=o===0?ne.move:ne.curve,f.set(c,d),f.controls.left.set(u,h),f.controls.right.set(m,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=new Fi(0,0,this.radius,this.vertices.length);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Ce.Properties.length;r++){const s=Ce.Properties[r];n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let n=0;n<Fi.Properties.length;n++){const r=Fi.Properties[n];e[r]=this[r]}return e}};k(Zl,"Properties",["radius"]);var Wr=Zl,Ql={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},ao=Math.cos,lo=Math.sin,Jl=class Ai extends Ce{constructor(e,n,r,s,o){typeof s!="number"&&typeof r=="number"&&(s=r);const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new ve);super(l,!0,!0,!0),k(this,"_flagWidth",!1),k(this,"_flagHeight",!1),k(this,"_width",0),k(this,"_height",0),this._renderer.type="ellipse";for(let c in ec)Object.defineProperty(this,c,ec[c]);typeof r=="number"&&(this.width=r*2),typeof s=="number"&&(this.height=s*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ai().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(this.vertices.length*2)),r=this._width/2,s=this._height/2;for(let o=0;o<this.vertices.length;o++){const l=o/e*ut,c=r*ao(l),d=s*lo(l),u=r*n*ao(l-et),h=s*n*lo(l-et),m=r*n*ao(l+et),g=s*n*lo(l+et),f=this.vertices[o];f.command=o===0?ne.move:ne.curve,f.set(c,d),f.controls.left.set(u,h),f.controls.right.set(m,g)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=this.width/2,r=this.height/2,s=this.vertices.length,o=new Ai(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Ce.Properties.length;a++){const l=Ce.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];e[r]=this[r]}return e}};k(Jl,"Properties",["width","height"]);var jr=Jl,ec={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},$g=Math.ceil,Pg=Math.floor,tc=class si extends Yn{constructor(e){super(),k(this,"_flagVertices",!0),k(this,"_flagLength",!0),k(this,"_flagFill",!0),k(this,"_flagStroke",!0),k(this,"_flagLinewidth",!0),k(this,"_flagOpacity",!0),k(this,"_flagVisible",!0),k(this,"_flagSize",!0),k(this,"_flagSizeAttenuation",!0),k(this,"_flagStrokeAttenuation",!0),k(this,"_length",0),k(this,"_fill","#fff"),k(this,"_stroke","#000"),k(this,"_linewidth",1),k(this,"_opacity",1),k(this,"_visible",!0),k(this,"_size",1),k(this,"_sizeAttenuation",!1),k(this,"_beginning",0),k(this,"_ending",1),k(this,"_dashes",null),k(this,"_strokeAttenuation",!0),k(this,"noFill",Ce.prototype.noFill),k(this,"noStroke",Ce.prototype.noStroke),k(this,"corner",Ce.prototype.corner),k(this,"center",Ce.prototype.center),k(this,"getBoundingClientRect",Ce.prototype.getBoundingClientRect),k(this,"_updateLength",Ce.prototype._updateLength);for(let n in nc)Object.defineProperty(this,n,nc[n]);this._renderer.type="points",this._renderer.flagVertices=zl.bind(this),this._renderer.bindVertices=Ll.bind(this),this._renderer.unbindVertices=Dl.bind(this),this._renderer.flagFill=Hl.bind(this),this._renderer.flagStroke=Wl.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=e,this.dashes=[],this.dashes.offset=0}static fromObject(e){const n=typeof e.fill=="string"?e.fill:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),s=new si().copy(qs(js({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){super.copy.call(this,e);for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof ve?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new ve().copy(r))}for(let n=0;n<si.Properties.length;n++){const r=si.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new si;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<si.Properties.length;r++){const s=si.Properties[r];n[s]=this[s]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(n=>n.toObject()),J.each(si.Properties,function(n){typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(e){this._update();let n=[];for(let r=0;r<this.vertices.length;r++){const s=this.vertices[r],o=this.vertices[r-1];if(!o)continue;const a=s.x,l=s.y,c=o.x,d=o.y,u=Us(a,l,a,l,c,d,c,d,e);n=n.concat(u)}return this.vertices=n,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),n=Math.max(this._beginning,this._ending),r=Lr(this,e*this._length),s=Lr(this,n*this._length),o=$g(r),a=Pg(s);let l=0,c;this._renderer.vertices=[],this._renderer.collection=[];for(let d=0;d<this._collection.length;d++)d>=o&&d<=a&&(c=this._collection[d],this._renderer.collection.push(c),this._renderer.vertices[l*2+0]=c.x,this._renderer.vertices[l*2+1]=c.y,l++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};k(tc,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var co=tc,nc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof qe||this._fill instanceof Xe||this._fill instanceof Me)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof qe||this._fill instanceof Xe||this._fill instanceof Me)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof qe||this._stroke instanceof Xe||this._stroke instanceof Me)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof qe||this._stroke instanceof Xe||this._stroke instanceof Me)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(U.Types.insert,e).unbind(U.Types.remove,n),t instanceof qn?this._collection=t:this._collection=new qn(t||[]),this._collection.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}},Ng=Math.cos,Eg=Math.sin,ic=class Mi extends Ce{constructor(e,n,r,s){s=Math.max(s||0,3),super(),k(this,"_flagWidth",!1),k(this,"_flagHeight",!1),k(this,"_flagSides",!1),k(this,"_radius",0),k(this,"_width",0),k(this,"_height",0),k(this,"_sides",0),this._renderer.type="polygon";for(let o in rc)Object.defineProperty(this,o,rc[o]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.radius=r),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Mi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Mi.Properties.length;n++){const r=Mi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let s=0;s<n;s++){const o=(s+.5)/e,a=ut*o+Math.PI/2,l=this._width*Ng(a)/2,c=this._height*Eg(a)/2;s>=r?this.vertices.push(new ve(l,c)):this.vertices[s].set(l,c),this.vertices[s].command=s===0?ne.move:ne.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=new Mi(0,0,0,this.sides);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.width=this.width,n.height=this.height,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Ce.Properties.length;r++){const s=Ce.Properties[r];n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let n=0;n<Mi.Properties.length;n++){const r=Mi.Properties[n];e[r]=this[r]}return e}};k(ic,"Properties",["width","height","sides"]);var uo=ic,rc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},sc=class Vi extends Ce{constructor(e,n,r,s,o){typeof o>"u"&&typeof r=="number"&&typeof s=="number"&&(o=Math.floor(Math.min(r,s)/12));const a=[];for(let l=0;l<10;l++)a.push(new ve(0,0,0,0,0,0,l===0?ne.move:ne.curve));super(a),k(this,"_flagWidth",!1),k(this,"_flagHeight",!1),k(this,"_flagRadius",!1),k(this,"_width",0),k(this,"_height",0),k(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let l in oc)Object.defineProperty(this,l,oc[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Fg.bind(this),typeof r=="number"&&(this.width=r),typeof s=="number"&&(this.height=s),(typeof o=="number"||o instanceof te)&&(this.radius=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Vi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Vi.Properties.length;n++){const r=Vi.Properties[n];if(r in e){const s=e[r];/radius/i.test(r)?this[r]=typeof s=="number"||s instanceof te?s:new te().copy(s):typeof s=="number"&&(this[r]=s)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,n=this._height;let r,s;this._radius instanceof te?(r=this._radius.x,s=this._radius.y):(r=this._radius,s=this._radius);let o,a=e/2,l=n/2;o=this.vertices[0],o.x=-(a-r),o.y=-l,o=this.vertices[1],o.x=a-r,o.y=-l,o.controls.left.clear(),o.controls.right.x=r,o.controls.right.y=0,o=this.vertices[2],o.x=a,o.y=-(l-s),o.controls.right.clear(),o.controls.left.clear(),o=this.vertices[3],o.x=a,o.y=l-s,o.controls.left.clear(),o.controls.right.x=0,o.controls.right.y=s,o=this.vertices[4],o.x=a-r,o.y=l,o.controls.right.clear(),o.controls.left.clear(),o=this.vertices[5],o.x=-(a-r),o.y=l,o.controls.left.clear(),o.controls.right.x=-r,o.controls.right.y=0,o=this.vertices[6],o.x=-a,o.y=l-s,o.controls.left.clear(),o.controls.right.clear(),o=this.vertices[7],o.x=-a,o.y=-(l-s),o.controls.left.clear(),o.controls.right.x=0,o.controls.right.y=-s,o=this.vertices[8],o.x=-(a-r),o.y=-l,o.controls.left.clear(),o.controls.right.clear(),o=this.vertices[9],o.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=this.width,r=this.height,s=this.radius,o=new Vi(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Ce.Properties.length;a++){const l=Ce.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let n=0;n<Vi.Properties.length;n++){const r=Vi.Properties[n];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};k(sc,"Properties",["width","height","radius"]);var qr=sc,oc={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof te&&this._radius.unbind(U.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof te&&this._radius.bind(U.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Fg(){this._flagRadius=!0}var Ag=Math.cos,Mg=Math.sin,ac=class Ii extends Ce{constructor(e,n,r,s,o){arguments.length<=3&&(s=r,r=s/2),(typeof o!="number"||o<=0)&&(o=5),super(),k(this,"_flagInnerRadius",!1),k(this,"_flagOuterRadius",!1),k(this,"_flagSides",!1),k(this,"_innerRadius",0),k(this,"_outerRadius",0),k(this,"_sides",0),this._renderer.type="star";for(let a in lc)Object.defineProperty(this,a,lc[a]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.innerRadius=r),typeof s=="number"&&(this.outerRadius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ii().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ii.Properties.length;n++){const r=Ii.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let s=0;s<n;s++){const o=(s+.5)/e,a=ut*o,l=(s%2?this._outerRadius:this._innerRadius)/2,c=l*Ag(a),d=l*Mg(a);s>=r?this.vertices.push(new ve(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?ne.move:ne.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=this.innerRadius,r=this.outerRadius,s=this.sides,o=new Ii(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Ce.Properties.length;a++){const l=Ce.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let n=0;n<Ii.Properties.length;n++){const r=Ii.Properties[n];e[r]=this[r]}return e}};k(ac,"Properties",["innerRadius","outerRadius","sides"]);var ho=ac,lc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},fo,cc=Math.min,dc=Math.max;je.document&&(fo=document.createElement("canvas"));var mo=class jt extends Yn{constructor(e,n,r,s){super(),k(this,"_flagValue",!0),k(this,"_flagFamily",!0),k(this,"_flagSize",!0),k(this,"_flagLeading",!0),k(this,"_flagAlignment",!0),k(this,"_flagBaseline",!0),k(this,"_flagStyle",!0),k(this,"_flagWeight",!0),k(this,"_flagDecoration",!0),k(this,"_flagFill",!0),k(this,"_flagStroke",!0),k(this,"_flagLinewidth",!0),k(this,"_flagOpacity",!0),k(this,"_flagVisible",!0),k(this,"_flagMask",!1),k(this,"_flagClip",!1),k(this,"_flagDirection",!0),k(this,"_flagStrokeAttenuation",!0),k(this,"_value",""),k(this,"_family","sans-serif"),k(this,"_size",13),k(this,"_leading",17),k(this,"_alignment","center"),k(this,"_baseline","middle"),k(this,"_style","normal"),k(this,"_weight",500),k(this,"_decoration","none"),k(this,"_direction","ltr"),k(this,"_fill","#000"),k(this,"_stroke","none"),k(this,"_linewidth",1),k(this,"_opacity",1),k(this,"_visible",!0),k(this,"_mask",null),k(this,"_clip",!1),k(this,"_dashes",null),k(this,"_strokeAttenuation",!0);for(let o in uc)Object.defineProperty(this,o,uc[o]);if(this._renderer.type="text",this._renderer.flagFill=Vg.bind(this),this._renderer.flagStroke=Ig.bind(this),this.value=e,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this.dashes=[],this.dashes.offset=0,!J.isObject(s))return this;for(let o=0;o<jt.Properties.length;o++){const a=jt.Properties[o];a in s&&(this[a]=s[a])}}static Measure(e){if(fo){const n=fo.getContext("2d");n.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const r=n.measureText(e.value,0,0),s=r.actualBoundingBoxDescent+r.actualBoundingBoxAscent;return{width:r.width,height:s}}else{const n=this.value.length*this.size*jt.Ratio,r=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:n,height:r}}}static fromObject(e){const n=typeof e.fill=="string"?e.fill:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),s=new jt().copy(qs(js({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){super.copy.call(this,e);for(let n=0;n<jt.Properties.length;n++){const r=jt.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new jt(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let r=0;r<jt.Properties.length;r++){const s=jt.Properties[r];n[s]=this[s]}return this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let n=0;n<jt.Properties.length;n++){const r=jt.Properties[n];e[r]=this[r]}return e}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let n,r,s,o,a;this._update(!0),n=e?this.matrix:this.worldMatrix;const{width:l,height:c}=jt.Measure(this),d=(this._linewidth||0)/2;switch(this.alignment){case"left":r=-d,s=l+d;break;case"right":r=-(l+d),s=d;break;default:r=-(l/2+d),s=l/2+d}switch(this.baseline){case"middle":o=-(c/2+d),a=c/2+d;break;default:o=-(c+d),a=d}const[u,h]=n.multiply(r,o),[m,g]=n.multiply(r,a),[f,p]=n.multiply(s,o),[b,y]=n.multiply(s,a);return o=cc(h,g,p,y),r=cc(u,m,f,b),s=dc(u,m,f,b),a=dc(h,g,p,y),{top:o,left:r,right:s,bottom:a,width:s-r,height:a-o}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};k(mo,"Ratio",.6),k(mo,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var fn=mo,uc={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof tt||this._fill instanceof qe||this._fill instanceof Xe||this._fill instanceof Me)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof tt||this._fill instanceof qe||this._fill instanceof Xe||this._fill instanceof Me)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof tt||this._stroke instanceof qe||this._stroke instanceof Xe||this._stroke instanceof Me)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof tt||this._stroke instanceof qe||this._stroke instanceof Xe||this._stroke instanceof Me)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,J.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Vg(){this._flagFill=!0}function Ig(){this._flagStroke=!0}var go=class rr extends Un{constructor(e,n,r,s){super(n,r,0,0),k(this,"_flagTextures",!1),k(this,"_flagFrameRate",!1),k(this,"_flagIndex",!1),k(this,"_amount",1),k(this,"_duration",0),k(this,"_index",0),k(this,"_startTime",0),k(this,"_playing",!1),k(this,"_firstFrame",0),k(this,"_lastFrame",0),k(this,"_loop",!0),k(this,"_textures",null),k(this,"_frameRate",0),k(this,"_origin",null),this._renderer.type="image-sequence";for(let o in hc)Object.defineProperty(this,o,hc[o]);this._renderer.flagTextures=Og.bind(this),this._renderer.bindTextures=zg.bind(this),this._renderer.unbindTextures=Lg.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(fc.bind(this)):typeof e=="string"&&(this.textures=[fc(e)]),this.origin=new te,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=rr.DefaultFrameRate,this.index=0}static fromObject(e){const n=new rr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<rr.Properties.length;n++){const r=rr.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=J.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(e){const n=new rr(this.textures,this.translation.x,this.translation.y,this.frameRate);return n._loop=this._loop,this._playing&&n.play(),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image-sequence",e.textures=this.textures.map(function(n){return n.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let e=0;e<this.textures.length;e++){const n=this.textures[e];typeof n.dispose=="function"?n.dispose():typeof n.unbind=="function"&&n.unbind()}return this}_update(){const e=this._textures;let n,r,s,o,a,l,c,d;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(o=this._amount,J.isNaN(this._lastFrame)&&(this._lastFrame=o-1),s=J.performance.now()-this._startTime,d=this._lastFrame+1,a=1e3*(d-this._firstFrame)/this._frameRate,this._loop?s=s%a:s=Math.min(s,a),c=Vt(this._firstFrame,d,s/a),c=Math.floor(c),c!==this._index&&(this._index=c,l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r),this.fill=l,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Me))&&(l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r)),this.fill=l)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};k(go,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),k(go,"DefaultFrameRate",30);var po=go,hc={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(U.Types.insert,e).unbind(U.Types.remove,n),this._textures=new qn((t||[]).slice(0)),this._textures.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function Og(){this._flagTextures=!0}function zg(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Lg(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function fc(t){if(t instanceof Me)return t;if(typeof t=="string")return new Me(t)}var Xr=Math.min,Yr=Math.max,yo=class oi extends Yn{constructor(e){super(),k(this,"_flagAdditions",!1),k(this,"_flagSubtractions",!1),k(this,"_flagOrder",!1),k(this,"_flagOpacity",!0),k(this,"_flagBeginning",!1),k(this,"_flagEnding",!1),k(this,"_flagLength",!1),k(this,"_flagMask",!1),k(this,"_fill","#fff"),k(this,"_stroke","#000"),k(this,"_linewidth",1),k(this,"_opacity",1),k(this,"_visible",!0),k(this,"_cap","round"),k(this,"_join","round"),k(this,"_miter",4),k(this,"_closed",!0),k(this,"_curved",!1),k(this,"_automatic",!0),k(this,"_beginning",0),k(this,"_ending",1),k(this,"_length",0),k(this,"_mask",null),k(this,"_strokeAttenuation",!0);for(let n in mc)Object.defineProperty(this,n,mc[n]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let n=0;n<e.length;n++)gc.call(this,e[n],this)}static RemoveChildren(e){for(let n=0;n<e.length;n++)gc.call(this,e[n])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const n=new oi;for(let s=0;s<oi.Properties.length;s++){const o=oi.Properties[s];o in e&&(/(fill|stroke)/i.test(o)?n[o]=typeof e[o]=="string"?e[o]:ci(e[o]):n[o]=e[o])}return"mask"in e&&(n.mask=r(e.mask)),"id"in e&&(n.id=e.id),n.children=e.children.map(r),n;function r(s){if(s&&s.renderer)switch(s.renderer.type){case"arc-segment":return ro.fromObject(s);case"circle":return Wr.fromObject(s);case"element":return Li.fromObject(s);case"ellipse":return jr.fromObject(s);case"group":return oi.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return po.fromObject(s);case"path":return Ce.fromObject(s);case"points":return co.fromObject(s);case"polygon":return uo.fromObject(s);case"rectangle":return Un.fromObject(s);case"rounded-rectangle":return qr.fromObject(s);case"shape":return Yn.fromObject(s);case"sprite":return Hr.fromObject(s);case"star":return ho.fromObject(s);case"text":return fn.fromObject(s)}return s}}copy(e){super.copy.call(this,e),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let n=0;n<oi.Properties.length;n++){const r=oi.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new oi,r=this.children.map(function(s){return s.clone()});return n.add(r),n.opacity=this.opacity,this.mask&&(n.mask=this.mask),n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.className=this.className,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="group",e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,J.each(this.children,(n,r)=>{e.children[r]=n.toObject()},this),e}dispose(){if(super.dispose(),this.children)for(let e=0;e<this.children.length;e++){const n=this.children[e];typeof n.dispose=="function"&&n.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const e=this.getBoundingClientRect(!0);for(let n=0;n<this.children.length;n++){const r=this.children[n];r.translation.x-=e.left,r.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let s=0;s<this.children.length;s++){const o=this.children[s];o.isShape&&(o.translation.x-=n,o.translation.y-=r)}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getById(e){let n=null;function r(s){if(s.id===e)return s;if(s.children){if(s.children.ids[e])return s.children.ids[e];for(let o=0;o<s.children.length;o++)if(n=r(s.children[o]),n)return n}return null}return r(this)}getByClassName(e){const n=[];function r(s){if(Array.prototype.indexOf.call(s.classList,e)>=0&&n.push(s),s.children)for(let o=0;o<s.children.length;o++){const a=s.children[o];r(a)}return n}return r(this)}getByType(e){const n=[];function r(s){if(s instanceof e&&n.push(s),s.children)for(let o=0;o<s.children.length;o++){const a=s.children[o];r(a)}return n}return r(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let n=0;n<e.length;n++){const r=e[n];if(!(r&&r.id))continue;const s=Array.prototype.indexOf.call(this.children,r);s>=0&&this.children.splice(s,1),this.children.push(r)}return this}remove(e){const n=arguments.length,r=this.parent;if(n<=0&&r)return r.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let s=0;s<e.length;s++){const o=e[s];if(!o||!this.children.ids[o.id])continue;const a=this.children.indexOf(o);a>=0&&this.children.splice(a,1)}return this}getBoundingClientRect(e){let n,r,s,o,a,l;this._update(!0);let c=1/0,d=-1/0,u=1/0,h=-1/0;const m=/texture|gradient/i;r=e?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const f=this.children[g];if(!(!f.visible||m.test(f._renderer.type))&&(n=f.getBoundingClientRect(e),s=typeof n.top!="number"||J.isNaN(n.top)||!isFinite(n.top),o=typeof n.left!="number"||J.isNaN(n.left)||!isFinite(n.left),a=typeof n.right!="number"||J.isNaN(n.right)||!isFinite(n.right),l=typeof n.bottom!="number"||J.isNaN(n.bottom)||!isFinite(n.bottom),!(s||o||a||l)))if(e){const[p,b]=r.multiply(n.left,n.top),[y,_]=r.multiply(n.right,n.top),[S,v]=r.multiply(n.left,n.bottom),[T,R]=r.multiply(n.right,n.bottom);u=Xr(b,_,v,R,u),c=Xr(p,y,S,T,c),d=Yr(p,y,S,T,d),h=Yr(b,_,v,R,h)}else u=Xr(n.top,u),c=Xr(n.left,c),d=Yr(n.right,d),h=Yr(n.bottom,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-u}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){const e=arguments;return this.children.forEach(function(n){n.subdivide.apply(n,e)}),this}_update(){let e,n,r;if(this._flagBeginning||this._flagEnding){const s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=this.length;let l=0;const c=s*a,d=o*a;for(e=0;e<this.children.length;e++)r=this.children[e],n=r.length,c>l+n?(r.beginning=1,r.ending=1):d<l?(r.beginning=0,r.ending=0):c>l&&c<l+n?(r.beginning=(c-l)/n,r.ending=1):d>l&&d<l+n?(r.beginning=0,r.ending=(d-l)/n):(r.beginning=0,r.ending=1),l+=n}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};k(yo,"Children",Ul),k(yo,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var st=yo,mc={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=st.InsertChildren.bind(this),n=st.RemoveChildren.bind(this),r=st.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Ul(t),this._children.bind(U.Types.insert,e),this._children.bind(U.Types.remove,n),this._children.bind(U.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,J.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function gc(t,e){const n=t.parent;let r;if(n===e){s();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),o()),e){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function s(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}var Ur=class extends Ce{constructor(e,n,r,s){const o=[new ve(e,n),new ve(r,s)];super(o);for(let a in pc)Object.defineProperty(this,a,pc[a]);this.vertices[0].command=ne.move,this.vertices[1].command=ne.line,this.automatic=!1}};k(Ur,"Properties",["left","right"]);var pc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(J.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=ne.move;else{const e=new Et("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(J.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=ne.line;else{const e=new Et("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},mn={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},Dg={start:"left",middle:"center",end:"right"},yc=["id","class","transform","xmlns","viewBox"],Hg=["x","y","width","height","href","xlink:href"];function Wg(t){return Dg[t]}function jg(t){const e=t.getAttribute("dominant-baseline"),n=t.getAttribute("alignment-baseline");return e||n}function dr(t){return t.replace(/svg:/gi,"").toLowerCase()}function bc(t,e){if(e.x+=t.translateX,e.y+=t.translateY,e.x*=t.scaleX,e.y*=t.scaleY,t.rotation!==0){const n=e.length();e.x=n*Math.cos(t.rotation),e.y=n*Math.sin(t.rotation)}}function qg(t,e){e||(e={});const n=t.split(";");for(let r=0;r<n.length;r++){const s=n[r].split(":"),o=s[0],a=s[1];if(typeof o>"u"||typeof a>"u")continue;const l=o.replace(/\s/g,""),c=a.replace(/\s/g,"");e[l]=c}return e}function Xg(t){const e={},n=Yg(t),r=Math.max(n.length,t.style.length);for(let s=0;s<r;s++){const o=t.style[s],a=n[s];o&&(e[o]=t.style[o]),a&&(e[a]=t.getAttribute(a))}return e}function Yg(t){const e=t.getAttributeNames();for(let n=0;n<yc.length;n++){const r=yc[n],s=Array.prototype.indexOf.call(e,r);s>=0&&e.splice(s,1)}return e}function Ug(t,e){const n=e.split(/[\s,]/),r=-parseFloat(n[0]),s=-parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&s)for(let h=0;h<t.children.length;h++){const m=t.children[h];"translation"in m?m.translation.add(r,s):"x"in m?m.x=r:"y"in m&&(m.y=s)}const l=typeof t.x=="number",c=typeof t.y=="number",d=typeof t.width=="number",u=typeof t.height=="number";return l&&(t.translation.x+=t.x),c&&(t.translation.y+=t.y),(d||u)&&(t.scale=new te(1,1)),d&&(t.scale.x=t.width/o),u&&(t.scale.y=t.height/a),t.mask=new Un(0,0,o,a),t.mask.origin.set(-o/2,-a/2),t}function qt(t,e,n){const r={},s={},o={};let a,l,c,d,u,h,m,g,f,p,b,y,_,S,v,T,R;if(t===null)return r;if(je.getComputedStyle){const w=je.getComputedStyle(t);for(a=w.length;a--;)c=w[a],d=w[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<t.attributes.length;a++)h=t.attributes[a],/style/i.test(h.nodeName)?qg(h.value,o):s[h.nodeName]=h.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&J.defaults(r,n),J.extend(r,o,s),r.visible=!(typeof r.display>"u"&&/none/i.test(r.display))||typeof r.visibility>"u"&&/hidden/i.test(r.visibility);for(c in r)switch(d=r[c],c){case"gradientTransform":if(/none/i.test(d)||(l=t.gradientTransform&&t.gradientTransform.baseVal&&t.gradientTransform.baseVal.length>0?t.gradientTransform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;switch(m=li(l),e._renderer.type){case"linear-gradient":bc(m,e.left),bc(m,e.right);break;case"radial-gradient":e.center.x+=m.translateX,e.center.y+=m.translateY,e.focal.x+=m.translateX,e.focal.y+=m.translateY,e.radius*=Math.max(m.scaleX,m.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=t.transform&&t.transform.baseVal&&t.transform.baseVal.length>0?t.transform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;m=li(l),e.translation.set(m.translateX,m.translateY),e.rotation=Math.PI*(m.rotation/180),e.scale=new te(m.scaleX,m.scaleY),g=parseFloat((r.x+"").replace("px")),f=parseFloat((r.y+"").replace("px")),g&&(e.translation.x=g),f&&(e.translation.y=f);break;case"visible":if(e instanceof st){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof st){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof st){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof st){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof st){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof st){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(mn.cssBackgroundImage.test(d)&&(p=d.replace(mn.cssBackgroundImage,"$1"),He.defs.current&&He.defs.current.contains(p)&&(y=He.defs.current.get(p),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],_=dr(y.nodeName),e.mask=He[_].call(this,y,{}),e._renderer.type){case"text":case"path":e.position.add(e.mask.position),e.mask.position.clear();break}break;case"fill":case"stroke":u=(e instanceof st?"_":"")+c,mn.cssBackgroundImage.test(d)?(p=d.replace(mn.cssBackgroundImage,"$1"),He.defs.current&&He.defs.current.contains(p)?(y=He.defs.current.get(p),y.object||(_=dr(y.nodeName),y.object=He[_].call(this,y,{})),y=y.object):(b=Gg(this),y=b.getById(p)),e[u]=y):e[u]=d;break;case"id":e.id=d;break;case"class":case"className":e.classList=d.split(" "),e._flagClassName=!0;break;case"x":case"y":if(S=e instanceof tt,v=e instanceof qe,T=e instanceof Xe,S||v||T)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(R=new Et("only pixel values are supported with the "+c+" attribute."),console.warn(R.name,R.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof fn&&(e.family=d);break;case"font-size":e instanceof fn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(R=new Et("only pixel values are supported with the "+c+" attribute."),console.warn(R.name,R.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof fn&&(e.weight=d);break;case"font-style":e instanceof fn&&(e.style=d);break;case"text-decoration":e instanceof fn&&(e.decoration=d);break;case"line-height":e instanceof fn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function Kg(t,e){for(let n=0,r=t.childNodes.length;n<r;n++){const s=t.childNodes[n];!s.id||dr(t.nodeName)==="#text"||e.add(s.id,s)}}function Gg(t){for(;t.parent;)t=t.parent;return t.scene}var He={svg:function(t){const e=He.defs.current=new Or,n=t.getElementsByTagName("defs");for(let f=0;f<n.length;f++)Kg(n[f],e);const r=He.g.call(this,t),s=t.getAttribute("viewBox"),o=t.getAttribute("x"),a=t.getAttribute("y"),l=t.getAttribute("width"),c=t.getAttribute("height");r.defs=e;const d=s!==null,u=o!==null,h=a!==null,m=l!==null,g=c!==null;return u&&(r.x=parseFloat(o.replace(mn.unitSuffix,""))),h&&(r.y=parseFloat(a.replace(mn.unitSuffix,""))),m&&(r.width=parseFloat(l.replace(mn.unitSuffix,""))),g&&(r.height=parseFloat(c.replace(mn.unitSuffix,""))),d&&Ug(r,s),delete He.defs.current,r},defs:function(t){return null},use:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new Et("encountered <use /> with no href."),console.warn(n.name,n.message),null;const s=r.slice(1);if(!He.defs.current.contains(s))return n=new Et("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=He.defs.current.get(s).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],u=Hg.includes(d.nodeName),h=!a.hasAttribute(d.nodeName);(u||h)&&a.setAttribute(d.nodeName,d.value)}const l=dr(a.nodeName);return He[l].call(this,a,e)},g:function(t,e){const n=new st;qt.call(this,t,n,e),this.add(n);const r=Xg.call(this,t);for(let s=0,o=t.childNodes.length;s<o;s++){const a=t.childNodes[s],l=a.nodeName;if(!l)return;const c=dr(l);if(c in He){const d=He[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(t,e){let n;typeof t=="string"?n=t:n=t.getAttribute("points");const r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(o,a,l){r.push(new ve(parseFloat(a),parseFloat(l)))});const s=new Ce(r,!0);return s.stroke="none",s.fill="black",qt.call(this,t,s,e),s},polyline:function(t,e){const n=He.polygon.call(this,t,e);return n.closed=!1,n},path:function(t,e){let n;typeof t=="string"?(n=t,t=null):n=t.getAttribute("d");let r=[],s=!1,o=!1;if(n){let l=new ve,c,d,u=n.match(/[a-df-z][^a-df-z]*/gi);const h=u.length-1;J.each(u.slice(0),function(m,g){const f=m.slice(1).trim().match(mn.path),p=m[0],b=p.toLowerCase();let y,_,S,v,T;const R=[];switch(g===0&&(u=[]),b){case"h":case"v":f.length>1&&(y=1);break;case"m":case"l":case"t":f.length>2&&(y=2);break;case"s":case"q":f.length>4&&(y=4);break;case"c":f.length>6&&(y=6);break;case"a":f.length>7&&(y=7);break}if(y){for(_=0,S=f.length,T=0;_<S;_+=y){if(v=p,T>0)switch(p){case"m":v="l";break;case"M":v="L";break}R.push(v+f.slice(_,_+y).join(" ")),T++}u=Array.prototype.concat.apply(u,R)}else u.push(m)}),J.each(u,function(m,g){let f,p,b;const y=m[0],_=y.toLowerCase();d=m.slice(1).trim().match(mn.path),o=y===_;let S,v,T,R,w,B,x,$,P,A,V,F,N,Y,ee,I,z;switch(_){case"z":if(g>=h)s=!0;else{p=l.x,b=l.y,f=new ve(p,b,void 0,void 0,void 0,void 0,ne.close);for(let q=r.length-1;q>=0;q--){const W=r[q];if(/m/i.test(W.command)){l=W;break}}}break;case"m":case"l":c=void 0,p=parseFloat(d[0]),b=parseFloat(d[1]),f=new ve(p,b,void 0,void 0,void 0,void 0,/m/i.test(_)?ne.move:ne.line),o&&f.addSelf(l),l=f;break;case"h":case"v":A=/h/i.test(_)?"x":"y",V=/x/i.test(A)?"y":"x",f=new ve(void 0,void 0,void 0,void 0,void 0,void 0,ne.line),f[A]=parseFloat(d[0]),f[V]=l[V],o&&(f[A]+=l[A]),l=f;break;case"c":case"s":S=l.x,v=l.y,c||(c=new te),/c/i.test(_)?(T=parseFloat(d[0]),R=parseFloat(d[1]),w=parseFloat(d[2]),B=parseFloat(d[3]),x=parseFloat(d[4]),$=parseFloat(d[5])):(P=Ks(l,c,o),T=P.x,R=P.y,w=parseFloat(d[0]),B=parseFloat(d[1]),x=parseFloat(d[2]),$=parseFloat(d[3])),o&&(T+=S,R+=v,w+=S,B+=v,x+=S,$+=v),l.controls.right.set(T-l.x,R-l.y),f=new ve(x,$,w-x,B-$,void 0,void 0,ne.curve),l=f,c=f.controls.left;break;case"t":case"q":S=l.x,v=l.y,c||(c=new te),/q/i.test(_)?(T=parseFloat(d[0]),R=parseFloat(d[1]),w=parseFloat(d[0]),B=parseFloat(d[1]),x=parseFloat(d[2]),$=parseFloat(d[3])):(P=Ks(l,c,o),T=P.x,R=P.y,w=P.x,B=P.y,x=parseFloat(d[0]),$=parseFloat(d[1])),o&&(T+=S,R+=v,w+=S,B+=v,x+=S,$+=v),l.controls.right.set((T-l.x)*.33,(R-l.y)*.33),f=new ve(x,$,w-x,B-$,void 0,void 0,ne.curve),l=f,c=f.controls.left;break;case"a":S=l.x,v=l.y,N=parseFloat(d[0]),Y=parseFloat(d[1]),ee=parseFloat(d[2]),I=parseFloat(d[3]),z=parseFloat(d[4]),x=parseFloat(d[5]),$=parseFloat(d[6]),o&&(x+=S,$+=v),F=new ve(x,$),F.command=ne.arc,F.rx=N,F.ry=Y,F.xAxisRotation=ee,F.largeArcFlag=I,F.sweepFlag=z,f=F,l=F,c=void 0;break}f&&(Array.isArray(f)?r=r.concat(f):r.push(f))})}n=new Ce(r,s,void 0,!0),n.stroke="none",n.fill="black";const a=n.getBoundingClientRect(!0);return a.centroid={x:a.left+a.width/2,y:a.top+a.height/2},J.each(n.vertices,function(l){l.subSelf(a.centroid)}),qt.call(this,t,n,e),n.translation.addSelf(a.centroid),n},circle:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),s=parseFloat(t.getAttribute("r")),o=new Wr(0,0,s);return o.stroke="none",o.fill="black",qt.call(this,t,o,e),o.translation.x=n,o.translation.y=r,o},ellipse:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),s=parseFloat(t.getAttribute("rx")),o=parseFloat(t.getAttribute("ry")),a=new jr(0,0,s,o);return a.stroke="none",a.fill="black",qt.call(this,t,a,e),a.translation.x=n,a.translation.y=r,a},rect:function(t,e){const n=parseFloat(t.getAttribute("rx")),r=parseFloat(t.getAttribute("ry"));if(!J.isNaN(n)||!J.isNaN(r))return He["rounded-rect"](t);const s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new Un(0,0,s,o);return c.stroke="none",c.fill="black",qt.call(this,t,c,e),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(t,e){const n=parseFloat(t.getAttribute("rx"))||0,r=parseFloat(t.getAttribute("ry"))||0,s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new te(n,r),d=new qr(0,0,s,o,c);return d.stroke="none",d.fill="black",qt.call(this,t,d,e),d.translation.x+=a,d.translation.y+=l,d},line:function(t,e){const n=parseFloat(t.getAttribute("x1")),r=parseFloat(t.getAttribute("y1")),s=parseFloat(t.getAttribute("x2")),o=parseFloat(t.getAttribute("y2")),a=new Ur(n,r,s,o).noFill();return qt.call(this,t,a,e),a},lineargradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(t.getAttribute("x1")||0),o=parseFloat(t.getAttribute("y1")||0),a=parseFloat(t.getAttribute("x2")||0),l=parseFloat(t.getAttribute("y2")||0);const c=(a+s)/2,d=(l+o)/2;/userSpaceOnUse/i.test(n)&&(s-=c,o-=d,a-=c,l-=d);const u=[];for(let m=0;m<t.children.length;m++){const g=t.children[m];let f=g.getAttribute("offset");/%/gi.test(f)&&(f=parseFloat(f.replace(/%/gi,""))/100),f=parseFloat(f);let p=g.getAttribute("stop-color"),b=g.getAttribute("stop-opacity"),y=g.getAttribute("style"),_;p===null&&(_=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,p=_&&_.length>1?_[1]:void 0),b===null?(_=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=_&&_.length>1?parseFloat(_[1]):1):b=parseFloat(b),u.push(new Xn(f,p,b))}const h=new qe(s,o,a,l,u);return h.spread=r,h.units=n,qt.call(this,t,h,e),h},radialgradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(t.getAttribute("cx"))||0,o=parseFloat(t.getAttribute("cy"))||0,a=parseFloat(t.getAttribute("r")),l=parseFloat(t.getAttribute("fx")),c=parseFloat(t.getAttribute("fy"));J.isNaN(l)&&(l=s),J.isNaN(c)&&(c=o);const d=Math.abs(s+l)/2,u=Math.abs(o+c)/2;/userSpaceOnUse/i.test(n)&&(s-=d,o-=u,l-=d,c-=u);const h=[];for(let g=0;g<t.children.length;g++){const f=t.children[g];let p=f.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let b=f.getAttribute("stop-color"),y=f.getAttribute("stop-opacity"),_=f.getAttribute("style"),S;b===null&&(S=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,b=S&&S.length>1?S[1]:void 0),y===null?(S=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=S&&S.length>1?parseFloat(S[1]):1):y=parseFloat(y),h.push(new Xn(p,b,y))}const m=new Xe(s,o,a,h,l,c);return m.spread=r,m.units=n,qt.call(this,t,m,e),m},text:function(t,e){const n=Wg(t.getAttribute("text-anchor"))||"left",r=jg(t)||"baseline";let s="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?s=t.childNodes[0].textContent:s=t.textContent;const o=new fn(s);return qt.call(this,t,o,e),o.alignment=n,o.baseline=r,o},clippath:function(t,e){return He.defs.current&&!He.defs.current.contains(t.id)&&He.defs.current.add(t.id,t),null},image:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new Et("encountered <image /> with no href."),console.warn(n.name,n.message),null;const s=parseFloat(t.getAttribute("x"))||0,o=parseFloat(t.getAttribute("y"))||0,a=parseFloat(t.getAttribute("width")),l=parseFloat(t.getAttribute("height")),c=new Hr(r,s,o);return J.isNaN(a)||(c.width=a),J.isNaN(l)||(c.height=l),qt.call(this,t,c,e),c}};function _c(t,e){const n=new XMLHttpRequest;return n.open("GET",t),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&e(n.responseText)},n.send(),n}var bo=class Bn extends Un{constructor(e,n,r,s,o,a){super(n,r,s||1,o||1),k(this,"_flagTexture",!1),k(this,"_flagMode",!1),k(this,"_texture",null),k(this,"_mode","fill"),this._renderer.type="image";for(let l in xc)Object.defineProperty(this,l,xc[l]);this.noStroke(),this.noFill(),e instanceof Me?this.texture=e:typeof e=="string"&&(this.texture=new Me(e)),typeof a=="string"&&(this.mode=a),this._update()}static fromObject(e){const n=new Bn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Bn.Properties.length;n++){const r=Bn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Bn(this.texture,this.translation.x,this.translation.y,this.width,this.height);return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image",e.texture=this.texture.toObject(),e.mode=this.mode,e}dispose(){return super.dispose(),this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture;if(e&&(this._flagTexture&&(this.fill=e),e.loaded)){const n=e.image.width,r=e.image.height,s=this.width,o=this.height,a=s/n,l=o/r;switch(this._mode){case Bn.Modes.fill:{const c=Math.max(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="repeat";break}case Bn.Modes.fit:{const c=Math.min(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="no-repeat";break}case Bn.Modes.crop:break;case Bn.Modes.tile:{e.offset.x=(n-s)/2,e.offset.y=(r-o)/2,e.repeat="repeat";break}case Bn.Modes.stretch:default:e.scale=new te(a,l),e.offset.x=0,e.offset.y=0,e.repeat="repeat"}}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagTexture=this._flagMode=!1,this}};k(bo,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),k(bo,"Properties",["texture","mode"]);var wc=bo,xc={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},mode:{enumerable:!0,get:function(){return this._mode},set:function(t){this._mode=t,this._flagMode=!0}}},_o=[],wo=Math.max,Zg=Math.min,kc=Math.abs,Kr=Math.sin,Gr=Math.cos,Qg=Math.acos,Zr=Math.sqrt,Be={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(t){return t in Be?t:"path"},group:{renderChild:function(t){const e=Be.getRendererType(t._renderer.type);Be[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);const r=this._mask,s=Qr(e),o=!s||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=t,o&&(t.save(),s||t.transform(e[0],e[3],e[1],e[4],e[2],e[5])),r){const a=Be.getRendererType(r._renderer.type);Be[a].render.call(r,t,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Be.getRendererType(l._renderer.type);Be[c].render.call(l,t)}return o&&t.restore(),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t,e,n){let r,s,o,a,l,c,d,u,h,m,g,f,p,b,y,_,S,v,T,R,w,B,x,$,P,A,V,F,N,Y,ee,I,z,q;if(q=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,N=this._mask,Y=this._clip,l=this._opacity*(q||1),c=this._visible,!e&&(!c||Y||l===0))return this;if(J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,d=this._cap,u=this._join,h=this._miter,m=this._closed,g=this._renderer.vertices,f=g.length,p=f-1,ee=Qr(r),z=this.dashes,ee||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),N){const re=Be.getRendererType(N._renderer.type);Be[re].render.call(N,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const re=Be.getRendererType(a._renderer.type);Be[re].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const re=Be.getRendererType(s._renderer.type);Be[re].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=hn(this)),h&&(t.miterLimit=h),u&&(t.lineJoin=u),!m&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),z&&z.length>0&&(t.lineDashOffset=z.offset||0,t.setLineDash(z)),t.beginPath();let W,O,D,j,G,ue,oe;for(let re=0;re<f;re++)switch(_=g[re],V=_.x,F=_.y,_.command){case ne.close:t.closePath();break;case ne.arc:W=_.rx,O=_.ry,D=_.xAxisRotation,j=_.largeArcFlag,G=_.sweepFlag,b=m?It(re-1,f):wo(re-1,0),y=g[b],ue=y.x,oe=y.y,Be.renderSvgArcCommand(t,ue,oe,W,O,j,G,D,V,F);break;case ne.curve:b=m?It(re-1,f):Math.max(re-1,0),y=g[b],x=y.controls&&y.controls.right||te.zero,$=_.controls&&_.controls.left||te.zero,y._relative?(w=x.x+y.x,B=x.y+y.y):(w=x.x,B=x.y),_._relative?(T=$.x+_.x,R=$.y+_.y):(T=$.x,R=$.y),t.bezierCurveTo(w,B,T,R,V,F),re>=p&&m&&(S=v,P=_.controls&&_.controls.right||te.zero,A=S.controls&&S.controls.left||te.zero,_._relative?(w=P.x+_.x,B=P.y+_.y):(w=P.x,B=P.y),S._relative?(T=A.x+S.x,R=A.y+S.y):(T=A.x,R=A.y),V=S.x,F=S.y,t.bezierCurveTo(w,B,T,R,V,F));break;case ne.line:t.lineTo(V,F);break;case ne.move:v=_,t.moveTo(V,F);break}return m&&t.closePath(),!Y&&!n&&(Be.isHidden.test(a)||(I=a._renderer&&a._renderer.offset,I&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),I&&t.restore()),Be.isHidden.test(s)||(I=s._renderer&&s._renderer.offset,I&&(t.save(),t.translate(-s._renderer.offset.x,-s._renderer.offset.y),t.scale(s._renderer.scale.x,s._renderer.scale.y),t.lineWidth=o/s._renderer.scale.x),t.stroke(),I&&t.restore())),ee||t.restore(),Y&&!n&&t.clip(),z&&z.length>0&&t.setLineDash(_o),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,n){let r,s,o,a,l,c,d,u,h,m,g,f,p,b,y,_;if(_=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(_||1),c=this._visible,!e&&(!c||l===0))return this;if(J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,u=this._renderer.collection,h=u.length,p=Qr(r),y=this.dashes,d=this._size,p||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")t.fillStyle=a;else{const T=Be.getRendererType(a._renderer.type);Be[T].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const T=Be.getRendererType(s._renderer.type);Be[T].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=hn(this))}typeof l=="number"&&(t.globalAlpha=l),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),t.beginPath();let S=d*.5,v;this._sizeAttenuation||(v=this.worldMatrix.elements,v=li(v[0],v[3],v[1],v[4],v[2],v[5]),S/=Math.max(v.scaleX,v.scaleY));for(let T=0;T<h;T++)m=u[T],g=m.x,f=m.y,t.moveTo(g+S,f),t.arc(g,f,S,0,ut);return n||(Be.isHidden.test(a)||(b=a._renderer&&a._renderer.offset,b&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),b&&t.restore()),Be.isHidden.test(s)||(b=s._renderer&&s._renderer.offset,b&&(t.save(),t.translate(-s._renderer.offset.x,-s._renderer.offset.y),t.scale(s._renderer.scale.x,s._renderer.scale.y),t.lineWidth=o/s._renderer.scale.x),t.stroke(),b&&t.restore())),p||t.restore(),y&&y.length>0&&t.setLineDash(_o),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t,e,n){const r=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,s=this._opacity*r,o=this._visible,a=this._mask,l=this._clip;if(!e&&(!o||l||s===0))return this;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,u=this._linewidth,h=this._fill,m=this._decoration,g=this._direction,f=Qr(c),p=h._renderer&&h._renderer.offset&&d._renderer&&d._renderer.offset,b=this.dashes,y=Be.alignments[this._alignment]||this._alignment,_=Be.baselines[this._baseline]||this._baseline;let S,v,T,R,w,B,x,$,P,A,V;if(f||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const F=Be.getRendererType(a._renderer.type);Be[F].render.call(a,t,!0)}if(p||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=y,t.textBaseline=_,t.direction=g,h)if(typeof h=="string")t.fillStyle=h;else{const F=Be.getRendererType(h._renderer.type);Be[F].render.call(h,t,this),t.fillStyle=h._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const F=Be.getRendererType(d._renderer.type);Be[F].render.call(d,t,this),t.strokeStyle=d._renderer.effect}u&&(t.lineWidth=hn(this))}if(typeof s=="number"&&(t.globalAlpha=s),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),!l&&!n&&(Be.isHidden.test(h)||(h._renderer&&h._renderer.offset?(B=h._renderer.scale.x,x=h._renderer.scale.y,t.save(),t.translate(-h._renderer.offset.x,-h._renderer.offset.y),t.scale(B,x),S=this._size/h._renderer.scale.y,v=this._leading/h._renderer.scale.y,t.font=[this._style,this._weight,S+"px/",v+"px",this._family].join(" "),T=h._renderer.offset.x/h._renderer.scale.x,R=h._renderer.offset.y/h._renderer.scale.y,t.fillText(this.value,T,R),t.restore()):t.fillText(this.value,0,0)),Be.isHidden.test(d)||(d._renderer&&d._renderer.offset?(B=d._renderer.scale.x,x=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(B,x),S=this._size/d._renderer.scale.y,v=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,S+"px/",v+"px",this._family].join(" "),T=d._renderer.offset.x/d._renderer.scale.x,R=d._renderer.offset.y/d._renderer.scale.y,w=u/d._renderer.scale.x,t.lineWidth=w,t.strokeText(this.value,T,R),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(m)){const F=t.measureText(this.value);let N=1;switch(m){case"underline":P=F.actualBoundingBoxDescent,V=F.actualBoundingBoxDescent;break;case"strikethrough":P=0,V=0,N=.5;break}switch(_){case"top":P+=this._size*N,V+=this._size*N;break;case"baseline":case"bottom":P-=this._size*N,V-=this._size*N;break}switch(y){case"left":case"start":$=0,A=F.width;break;case"right":case"end":$=-F.width,A=0;break;default:$=-F.width/2,A=F.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo($,P),t.lineTo(A,V),t.stroke()}return f||t.restore(),l&&!n&&t.clip(),b&&b.length>0&&t.setLineDash(_o),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=t.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=t.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=t.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof te||(this._renderer.offset=new te),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,e&&(this._renderer.offset.x+=e.width/2,this._renderer.offset.y+=e.height/2,this._scale instanceof te?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),(this._flagScale||this._flagLoaded)&&(this._renderer.scale instanceof te||(this._renderer.scale=new te),this._scale instanceof te?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},renderSvgArcCommand:function(t,e,n,r,s,o,a,l,c,d){l=l*Math.PI/180,r=kc(r),s=kc(s);const u=(e-c)/2,h=(n-d)/2,m=Gr(l)*u+Kr(l)*h,g=-Kr(l)*u+Gr(l)*h,f=m*m,p=g*g;let b=r*r,y=s*s;const _=f/b+p/y;if(_>1){const F=Zr(_);r=F*r,s=F*s,b=r*r,y=s*s}const S=b*p+y*f,v=(b*y-S)/S;let T=Zr(wo(0,v));o===a&&(T=-T);const R=T*r*g/s,w=-T*s*m/r,B=Gr(l)*R-Kr(l)*w+(e+c)/2,x=Kr(l)*R+Gr(l)*w+(n+d)/2,$=vc(1,0,(m-R)/r,(g-w)/s),P=vc((m-R)/r,(g-w)/s,(-m-R)/r,(-g-w)/s)%ut,A=$+P;Jg(t,B,x,r,s,$,A,a===0,l)}},ft=class extends U{constructor(t){super();const e=t.smoothing!==!1;this.domElement=t.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=t.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=e),this.scene=new st,this.scene.parent=this}setSize(t,e,n){return this.width=t,this.height=e,this.ratio=typeof n>"u"?Gs(this.ctx):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&J.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(U.Types.resize,t,e,n)}render(){const t=this.ratio===1;return t||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Be.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};k(ft,"Utils",Be);function Jg(t,e,n,r,s,o,a,l,c){const d=a-o,u=Oi.Tolerance.epsilon,h=Math.abs(d)<u;let m=It(d,ut);m<u&&(h?m=0:m=ut),l===!0&&!h&&(m===ut?m=-ut:m=m-ut);for(let g=0;g<Ct.Resolution;g++){const f=g/(Ct.Resolution-1),p=o+f*m;let b=e+r*Math.cos(p),y=n+s*Math.sin(p);if(c!==0){const _=Math.cos(c),S=Math.sin(c),v=b-e,T=y-n;b=v*_-T*S+e,y=v*S+T*_+n}t.lineTo(b,y)}}function vc(t,e,n,r){const s=t*n+e*r,o=Zr(t*t+e*e)*Zr(n*n+r*r);let a=Qg(wo(-1,Zg(1,s/o)));return t*r-e*n<0&&(a=-a),a}function Qr(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var le={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},baselines:{top:"hanging",middle:"middle",bottom:"ideographic",baseline:"alphabetic"},createElement:function(t,e){const n=t,r=document.createElementNS(le.ns,n);return n==="svg"&&(e=J.defaults(e||{},{version:le.version})),e&&Object.keys(e).length>0&&le.setAttributes(r,e),r},setAttributes:function(t,e){const n=Object.keys(e);for(let r=0;r<n.length;r++)/href/.test(n[r])?t.setAttributeNS(le.xlink,n[r],e[n[r]]):t.setAttribute(n[r],e[n[r]]);return this},removeAttributes:function(t,e){for(let n in e)t.removeAttribute(n);return this},toString:function(t,e){let n=t.length,r=n-1,s,o="";for(let a=0;a<n;a++){const l=t[a],c=e?It(a-1,n):Math.max(a-1,0),d=t[c];let u,h,m,g,f,p,b,y,_,S,v,T,R,w,B,x=Ae(l.x),$=Ae(l.y);switch(l.command){case ne.close:u=ne.close;break;case ne.arc:v=l.rx,T=l.ry,R=l.xAxisRotation,w=l.largeArcFlag,B=l.sweepFlag,u=ne.arc+" "+v+" "+T+" "+R+" "+w+" "+B+" "+x+" "+$;break;case ne.curve:b=d.controls&&d.controls.right||te.zero,y=l.controls&&l.controls.left||te.zero,d.relative?(m=Ae(b.x+d.x),g=Ae(b.y+d.y)):(m=Ae(b.x),g=Ae(b.y)),l.relative?(f=Ae(y.x+l.x),p=Ae(y.y+l.y)):(f=Ae(y.x),p=Ae(y.y)),u=(a===0?ne.move:ne.curve)+" "+m+" "+g+" "+f+" "+p+" "+x+" "+$;break;case ne.move:s=l,u=ne.move+" "+x+" "+$;break;default:u=l.command+" "+x+" "+$}a>=r&&e&&(l.command===ne.curve&&(h=s,_=l.controls&&l.controls.right||l,S=h.controls&&h.controls.left||h,l.relative?(m=Ae(_.x+l.x),g=Ae(_.y+l.y)):(m=Ae(_.x),g=Ae(_.y)),h.relative?(f=Ae(S.x+h.x),p=Ae(S.y+h.y)):(f=Ae(S.x),p=Ae(S.y)),x=Ae(h.x),$=Ae(h.y),u+=" C "+m+" "+g+" "+f+" "+p+" "+x+" "+$),l.command!==ne.close&&(u+=" Z")),o+=u+" "}return o},pointsToString:function(t,e){let n="";const r=e*.5;for(let s=0;s<t.length;s++){const o=t[s].x,a=t[s].y-r;n+=ne.move+" "+o+" "+a+" ",n+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return n},getClip:function(t,e){let n=t._renderer.clip;return n||(n=t._renderer.clip=le.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&e.defs.appendChild(n),n},getRendererType:function(t){return t in le?t:"path"},defs:{update:function(t){const{defs:e}=t;if(e._flagUpdate){const n=Array.prototype.slice.call(e.children,0);for(let r=0;r<n.length;r++){const s=n[r],o=s.id,a=`[fill="url(#${o})"],[stroke="url(#${o})"],[clip-path="url(#${o})"]`;t.querySelector(a)||e.removeChild(s)}e._flagUpdate=!1}}},group:{appendChild:function(t){const e=t._renderer.elem;if(!e)return;const n=e.nodeName;!n||/(radial|linear)gradient/i.test(n)||t._clip||this.elem.appendChild(e)},removeChild:function(t){const e=t._renderer.elem;!e||e.parentNode!=this.elem||!e.nodeName||t._clip||this.elem.removeChild(e)},orderChild:function(t){this.elem.appendChild(t._renderer.elem)},renderChild:function(t){const e=le.getRendererType(t._renderer.type);le[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=le.createElement("g",{id:this.id}),t.appendChild(this._renderer.elem));const e=this._matrix.manual||this._flagMatrix,n={domElement:t,elem:this._renderer.elem};e&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const s=this.children[r],o=le.getRendererType(s._renderer.type);le[o].render.call(s,t)}if(this._flagId&&this._renderer.elem.setAttribute("id",this._id),this._flagOpacity&&this._renderer.elem.setAttribute("opacity",this._opacity),this._flagVisible&&this._renderer.elem.setAttribute("display",this._visible?"inline":"none"),this._flagClassName&&this._renderer.elem.setAttribute("class",this.classList.join(" ")),this._flagAdditions&&this.additions.forEach(le.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(le.group.removeChild,n),this._flagOrder&&this.children.forEach(le.group.orderChild,n),this._flagMask)if(this._mask){const r=le.getRendererType(this._mask._renderer.type);le[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.dataset&&Object.assign(this._renderer.elem.dataset,this.dataset),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices){const r=le.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=le.getRendererType(this._fill._renderer.type);le[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=le.getRendererType(this._stroke._renderer.type);le[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=hn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this._flagCap&&(e["stroke-linecap"]=this._cap),this._flagJoin&&(e["stroke-linejoin"]=this._join),this._flagMiter&&(e["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?le.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=le.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=le.getClip(this,t),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=le.getRendererType(this._mask._renderer.type);le[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const o=this.worldMatrix.elements,a=li(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=le.pointsToString(this._renderer.collection,r);e.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=le.getRendererType(this._fill._renderer.type);le[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=le.getRendererType(this._stroke._renderer.type);le[r].render.call(this._stroke,t,!0)}return this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=hn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?le.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=le.createElement("path",e),t.appendChild(this._renderer.elem)),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t){this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagFamily&&(e["font-family"]=this._family),this._flagSize&&(e["font-size"]=this._size),this._flagLeading&&(e["line-height"]=this._leading),this._flagAlignment&&(e["text-anchor"]=le.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=le.baselines[this._baseline]||this._baseline),this._flagStyle&&(e["font-style"]=this._style),this._flagWeight&&(e["font-weight"]=this._weight),this._flagDecoration&&(e["text-decoration"]=this._decoration),this._flagDirection&&(e.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=le.getRendererType(this._fill._renderer.type);le[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=le.getRendererType(this._stroke._renderer.type);le[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=hn(this)),this._flagOpacity&&(e.opacity=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?le.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=le.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=le.getClip(this,t),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=le.getRendererType(this._mask._renderer.type);le[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(t,e){J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagEndPoints&&(n.x1=this.left._x,n.y1=this.left._y,n.x2=this.right._x,n.y2=this.right._y),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?le.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=le.createElement("linearGradient",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?le.setAttributes(o._renderer.elem,a):o._renderer.elem=le.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagCenter&&(n.cx=this.center._x,n.cy=this.center._y),this._flagFocal&&(n.fx=this.focal._x,n.fy=this.focal._y),this._flagRadius&&(n.r=this._radius),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?le.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=le.createElement("radialGradient",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?le.setAttributes(o._renderer.elem,a):o._renderer.elem=le.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={},r={x:0,y:0},s=this.image;if(this._flagId&&(n.id=this._id),this._flagLoaded&&this.loaded)switch(s.nodeName.toLowerCase()){case"canvas":r.href=r["xlink:href"]=s.toDataURL("image/png");break;case"img":case"image":r.href=r["xlink:href"]=this.src;break}if((this._flagOffset||this._flagLoaded||this._flagScale)&&(n.x=this._offset.x,n.y=this._offset.y,s&&(n.x-=s.width/2,n.y-=s.height/2,this._scale instanceof te?(n.x*=this._scale.x,n.y*=this._scale.y):(n.x*=this._scale,n.y*=this._scale)),n.x>0&&(n.x*=-1),n.y>0&&(n.y*=-1)),(this._flagScale||this._flagLoaded||this._flagRepeat)&&(n.width=0,n.height=0,s)){switch(n.width=s.width,n.height=s.height,this._repeat){case"no-repeat":n.width+=1,n.height+=1;break}this._scale instanceof te?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),/no-repeat/i.test(this._repeat)?r.preserveAspectRatio="xMidYMid":r.preserveAspectRatio="none",r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?le.setAttributes(this._renderer.image,r):this._renderer.image=le.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&le.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=le.createElement("pattern",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},Cc=class extends U{constructor(t){super(),this.domElement=t.domElement||le.createElement("svg"),this.scene=new st,this.scene.parent=this,this.defs=le.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(t,e){return this.width=t,this.height=e,le.setAttributes(this.domElement,{width:t,height:e}),this.trigger(U.Types.resize,t,e)}render(){return le.group.render.call(this.scene,this.domElement),le.defs.update(this.domElement),this}};k(Cc,"Utils",le);var Xt={create:function(t,e,n){const r=t.createShader(t[n]);if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const o=t.getShaderInfoLog(r);throw t.deleteShader(r),new Et("unable to compile shader "+r+": "+o)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
41
41
  precision mediump float;
42
42
  attribute vec2 a_position;
43
43
 
@@ -100,7 +100,7 @@
100
100
  }
101
101
  gl_FragColor = texel;
102
102
  }
103
- `}},Jr=Di.Multiply,ep=[1,0,0,0,1,0,0,0,1],Kn=new un(9),tp=ft.Utils,Sc=new te,wo=new un([0,0,1,0,0,1,0,1,1,0,1,1]),_e={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:je.document?je.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Di,group:{removeChild:function(t,e){if(t.children)for(let n=0;n<t.children.length;n++)_e.group.removeChild(t.children[n],e);t._renderer.texture&&(e.deleteTexture(t._renderer.texture),delete t._renderer.texture),t._renderer.positionBuffer&&(e.deleteBuffer(t._renderer.positionBuffer),delete t._renderer.positionBuffer)},render:function(t,e){if(!this._visible)return;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.parent,r=n._matrix&&n._matrix.manual||n._flagMatrix,s=this._matrix.manual||this._flagMatrix;if((r||s)&&(this._renderer.matrix||(this._renderer.matrix=new un(9)),this._matrix.toTransformArray(!0,Kn),Jr(Kn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof te||(this._renderer.scale=new te),this._scale instanceof te?(this._renderer.scale.x=this._scale.x,this._renderer.scale.y=this._scale.y):(this._renderer.scale.x=this._scale,this._renderer.scale.y=this._scale),/renderer/i.test(n._renderer.type)||(this._renderer.scale.x*=n._renderer.scale.x,this._renderer.scale.y*=n._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const a=ft.Utils.getRendererType(this._mask._renderer.type);_e[a].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}this._flagOpacity=n._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);let o;if(this._flagSubtractions)for(o=0;o<this.subtractions.length;o++)_e.group.removeChild(this.subtractions[o],t);for(o=0;o<this.children.length;o++){const a=this.children[o],l=ft.Utils.getRendererType(a._renderer.type);_e[l].render.call(a,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let n,r,s,o,a,l,c,d,u,h,m,g,f,p;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,S=t.renderer.ratio,v=Sc.copy(e._renderer.scale).multiply(S),T=e._stroke,R=e._linewidth,w=e._fill,B=e._renderer.opacity||e._opacity,x=e._cap,$=e._join,P=e._miter,A=e._closed,V=e.dashes,F=b.length,N=F-1;y.width=Math.max(Math.ceil(e._renderer.rect.width*v.x),1),y.height=Math.max(Math.ceil(e._renderer.rect.height*v.y),1);const Y=e._renderer.rect.centroid,ee=Y.x,I=Y.y;if(_.clearRect(0,0,y.width,y.height),w)if(typeof w=="string")_.fillStyle=w;else{const oe=ft.Utils.getRendererType(w._renderer.type);_e[oe].render.call(w,_,e),_.fillStyle=w._renderer.effect}if(T){if(typeof T=="string")_.strokeStyle=T;else{const oe=ft.Utils.getRendererType(T._renderer.type);_e[oe].render.call(T,_,e),_.strokeStyle=T._renderer.effect}R&&(_.lineWidth=hn(e)),P&&(_.miterLimit=P),$&&(_.lineJoin=$),!A&&x&&(_.lineCap=x)}typeof B=="number"&&(_.globalAlpha=B),V&&V.length>0&&(_.lineDashOffset=V.offset||0,_.setLineDash(V));let z,q,W,O,D,j,G,ue;_.save(),_.scale(v.x,v.y),_.translate(ee,I),_.beginPath();for(let oe=0;oe<b.length;oe++){const re=b[oe];switch(g=re.x,f=re.y,re.command){case ne.close:_.closePath();break;case ne.arc:q=re.rx,W=re.ry,O=re.xAxisRotation,D=re.largeArcFlag,j=re.sweepFlag,n=A?It(oe-1,F):Math.max(oe-1,0),r=b[n],G=r.x,ue=r.y,tp.renderSvgArcCommand(_,G,ue,q,W,D,j,O,g,f);break;case ne.curve:n=A?It(oe-1,F):Math.max(oe-1,0),r=b[n],d=r.controls&&r.controls.right||te.zero,u=re.controls&&re.controls.left||te.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),re._relative?(o=u.x+re.x,a=u.y+re.y):(o=u.x,a=u.y),_.bezierCurveTo(l,c,o,a,g,f),oe>=N&&A&&(s=z,h=re.controls&&re.controls.right||te.zero,m=s.controls&&s.controls.left||te.zero,re._relative?(l=h.x+re.x,c=h.y+re.y):(l=h.x,c=h.y),s._relative?(o=m.x+s.x,a=m.y+s.y):(o=m.x,a=m.y),g=s.x,f=s.y,_.bezierCurveTo(l,c,o,a,g,f));break;case ne.line:_.lineTo(g,f);break;case ne.move:z=re,_.moveTo(g,f);break}}A&&_.closePath(),_e.isHidden.test(w)||(p=w._renderer&&w._renderer.offset,p&&(_.save(),_.translate(-w._renderer.offset.x,-w._renderer.offset.y),_.scale(w._renderer.scale.x,w._renderer.scale.y)),_.fill(),p&&_.restore()),_e.isHidden.test(T)||(p=T._renderer&&T._renderer.offset,p&&(_.save(),_.translate(-T._renderer.offset.x,-T._renderer.offset.y),_.scale(T._renderer.scale.x,T._renderer.scale.y),_.lineWidth=R/T._renderer.scale.x),_.stroke(),p&&_.restore()),_.restore()},getBoundingClientRect:function(t,e,n){let r=1/0,s=-1/0,o=1/0,a=-1/0,l,c;t.forEach(function(d){const u=d.x,h=d.y,m=d.controls;let g,f,p,b,y,_;o=Math.min(h,o),r=Math.min(u,r),s=Math.max(u,s),a=Math.max(h,a),d.controls&&(y=m.left,_=m.right,!(!y||!_)&&(g=d._relative?y.x+u:y.x,f=d._relative?y.y+h:y.y,p=d._relative?_.x+u:_.x,b=d._relative?_.y+h:_.y,!(!g||!f||!p||!b)&&(o=Math.min(f,b,o),r=Math.min(g,p,r),s=Math.max(g,p,s),a=Math.max(f,b,a))))}),typeof e=="number"&&(o-=e,r-=e,s+=e,a+=e),l=s-r,c=a-o,n.top=o,n.left=r,n.right=s,n.bottom=a,n.width=l,n.height=c,n.centroid||(n.centroid={}),n.centroid.x=-r,n.centroid.y=-o},render:function(t,e,n){if(!this._visible||!this._opacity)return this;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=ft.Utils.getRendererType(this._renderer.type),o=e[s],a=r._matrix.manual||r._flagMatrix,l=this._matrix.manual||this._flagMatrix,c=this._renderer.parent!==r,d=this._flagVertices||this._flagFill||this._fill instanceof qe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Xe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof qe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Xe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagCap||this._flagJoin||this._flagMiter||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(a||l||c){this._renderer.matrix||(this._renderer.matrix=new un(9)),this._matrix.toTransformArray(!0,Kn),Jr(Kn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof te||(this._renderer.scale=new te);let h,m;this._scale instanceof te?(h=this._scale.x*r._renderer.scale.x,m=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,m=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=m<0?-m:m,c&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const h=ft.Utils.getRendererType(this._mask._renderer.type);_e[h].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,_e.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),_e.updateTexture.call(_e,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;e.current!==o&&(t.useProgram(o),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,wo,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const u=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,u.left,u.top,u.right,u.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(t,e){let n;const r=this.canvas,s=this.ctx,o=t.renderer.ratio,a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,h=e._size*o;let m=h;_e.isHidden.test(a)||(m+=l),r.width=ml(m),r.height=r.width;const g=m/r.width,f=r.width/2,p=r.height/2;if(s.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")s.fillStyle=c;else{const b=ft.Utils.getRendererType(c._renderer.type);_e[b].render.call(c,s,e),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const b=ft.Utils.getRendererType(a._renderer.type);_e[b].render.call(a,s,e),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=hn(e)/g)}typeof d=="number"&&(s.globalAlpha=d),u&&u.length>0&&(s.lineDashOffset=u.offset||0,s.setLineDash(u)),s.save(),s.translate(f,p),s.scale(_e.precision,_e.precision),s.beginPath(),s.arc(0,0,h/g*.5,0,ut),s.restore(),closed&&s.closePath(),_e.isHidden.test(c)||(n=c._renderer&&c._renderer.offset,n&&(s.save(),s.translate(-c._renderer.offset.x,-c._renderer.offset.y),s.scale(c._renderer.scale.x,c._renderer.scale.y)),s.fill(),n&&s.restore()),_e.isHidden.test(a)||(n=a._renderer&&a._renderer.offset,n&&(s.save(),s.translate(-a._renderer.offset.x,-a._renderer.offset.y),s.scale(a._renderer.scale.x,a._renderer.scale.y),s.lineWidth=l/a._renderer.scale.x),s.stroke(),n&&s.restore())},render:function(t,e,n){if(!this._visible||!this._opacity)return this;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size;const s=n||this.parent,o=e[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=s._matrix.manual||s._flagMatrix,u=this._matrix.manual||this._flagMatrix,h=this._renderer.parent!==s,m=this._renderer.vertices,g=this._renderer.collection.length,f=this._flagVertices,p=this._flagFill||this._fill instanceof qe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Xe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof qe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Xe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||s._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||u||h){this._renderer.matrix||(this._renderer.matrix=new un(9)),this._matrix.toTransformArray(!0,Kn),Jr(Kn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof te||(this._renderer.scale=new te);let b,y;this._scale instanceof te?(b=this._scale.x*s._renderer.scale.x,y=this._scale.y*s._renderer.scale.y):(b=this._scale*s._renderer.scale.x,y=this._scale*s._renderer.scale.y),this._renderer.scale.x=b<0?-b:b,this._renderer.scale.y=y<0?-y:y,h&&(this._renderer.parent=s)}if(f){const b=this._renderer.positionBuffer;b&&t.deleteBuffer(b),this._renderer.positionBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this._renderer.positionBuffer),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,m,t.STATIC_DRAW)}return p?(this._renderer.opacity=this._opacity*s._renderer.opacity,_e.updateTexture.call(_e,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(_e.isHidden.test(l)||(r+=c),r/=_e.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),e.current!==o&&(t.useProgram(o),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture),t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform1f(o.size,r*e.resolution.ratio),t.drawArrays(t.POINTS,0,g),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(t,e){const n=this.canvas,r=this.ctx,s=t.renderer.ratio,o=Sc.copy(e._renderer.scale).multiply(s),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,h=e._decoration,m=e._direction;n.width=Math.max(Math.ceil(e._renderer.rect.width*o.x),1),n.height=Math.max(Math.ceil(e._renderer.rect.height*o.y),1);const g=e._renderer.rect.centroid,f=g.x,p=g.y;let b,y,_,S,v,T,R,w,B,x,$;const P=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),P||(r.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=m,c)if(typeof c=="string")r.fillStyle=c;else{const A=ft.Utils.getRendererType(c._renderer.type);_e[A].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const A=ft.Utils.getRendererType(a._renderer.type);_e[A].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=hn(e))}if(typeof d=="number"&&(r.globalAlpha=d),u&&u.length>0&&(r.lineDashOffset=u.offset||0,r.setLineDash(u)),r.save(),r.scale(o.x,o.y),r.translate(f,p),_e.isHidden.test(c)||(c._renderer&&c._renderer.offset?(T=c._renderer.scale.x,R=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(T,R),b=e._size/c._renderer.scale.y,y=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,S=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,S),r.restore()):r.fillText(e.value,0,0)),_e.isHidden.test(a)||(a._renderer&&a._renderer.offset?(T=a._renderer.scale.x,R=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(T,R),b=e._size/a._renderer.scale.y,y=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,S=a._renderer.offset.y/a._renderer.scale.y,v=l/a._renderer.scale.x,r.lineWidth=v,r.strokeText(e.value,_,S),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(h)){const A=r.measureText(e.value);switch(h){case"underline":B=A.actualBoundingBoxDescent,$=A.actualBoundingBoxDescent;break;case"strikethrough":B=0,$=0;break}w=-A.width/2,x=A.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(w,B),r.lineTo(x,$),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const n=_e.ctx;n.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),n.textAlign="center",n.textBaseline=ft.Utils.baselines[t._baseline]||t._baseline;const r=n.measureText(t._value);let s=r.width,o=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!_e.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(_e.alignments[t._alignment]||t._alignment){case _e.alignments.left:t.direction==="ltr"?(e.left=0,e.right=s):(e.left=-s,e.right=0);break;case _e.alignments.right:t.direction==="ltr"?(e.left=-s,e.right=0):(e.left=0,e.right=s);break;default:e.left=-a,e.right=a}switch(t._baseline){case"bottom":e.top=-o,e.bottom=0;break;case"top":e.top=0,e.bottom=o;break;case"baseline":e.top=-l*1.5,e.bottom=l*.5;break;default:e.top=-l,e.bottom=l}e.width=s,e.height=o,e.centroid||(e.centroid={}),e.centroid.x=a,e.centroid.y=l},render:function(t,e,n){if(!this._visible||!this._opacity)return this;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=e[this._renderer.type],o=r._matrix.manual||r._flagMatrix,a=this._matrix.manual||this._flagMatrix,l=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof qe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Xe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof qe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Xe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagScale||this._flagValue||this._flagFamily||this._flagSize||this._flagLeading||this._flagAlignment||this._flagBaseline||this._flagStyle||this._flagWeight||this._flagDecoration||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(o||a||l){this._renderer.matrix||(this._renderer.matrix=new un(9)),this._matrix.toTransformArray(!0,Kn),Jr(Kn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof te||(this._renderer.scale=new te);let u,h;this._scale instanceof te?(u=this._scale.x*r._renderer.scale.x,h=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,h=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=h<0?-h:h,l&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const u=ft.Utils.getRendererType(this._mask._renderer.type);_e[u].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,_e.text.getBoundingClientRect(this,this._renderer.rect),_e.updateTexture.call(_e,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;e.current!==s&&(t.useProgram(s),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s.position),t.bufferData(t.ARRAY_BUFFER,wo,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),e.current=s),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return t.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),t.uniform4f(s.rect,d.left,d.top,d.right,d.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=t.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=t.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=t.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof te||(this._renderer.offset=new te),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,n&&(this._renderer.offset.x+=n.width/2,this._renderer.offset.y+=n.height/2,this._scale instanceof te?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),this._flagScale||this._flagLoaded){this._renderer.scale instanceof te||(this._renderer.scale=new te);let r,s;this._scale instanceof te?(r=this._scale.x,s=this._scale.y):(r=this._scale,s=this._scale),this._renderer.scale.x=r<0?-r:r,this._renderer.scale.y=s<0?-s:s}return J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const n=ft.Utils.getRendererType(e._renderer.type);if(this[n].updateCanvas.call(_e,t,e),this.canvas.width<=0||this.canvas.height<=0){e._renderer.texture&&t.deleteTexture(e._renderer.texture),delete e._renderer.texture;return}e._renderer.texture||(e._renderer.texture=t.createTexture()),t.bindTexture(t.TEXTURE_2D,e._renderer.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.canvas),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)},program:{create:function(t,e){let n,r,s;if(n=t.createProgram(),J.each(e,function(o){t.attachShader(n,o)}),t.linkProgram(n),r=t.getProgramParameter(n,t.LINK_STATUS),!r)throw s=t.getProgramInfoLog(n),t.deleteProgram(n),new Et("unable to link program: "+s);return n}},extensions:{init:function(t){const e={},n=["EXT_texture_filter_anisotropic","WEBGL_compressed_texture_s3tc","OES_texture_float_linear","WEBGL_multisampled_render_to_texture"];for(let r=0;r<n.length;r++){const s=n[r];e[s]=_e.extensions.get(t,s)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new Or};_e.ctx=_e.canvas.getContext("2d");var Bc=class extends U{constructor(t){super();let e,n,r,s;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(_e.canvas=t.offscreenElement,_e.ctx=_e.canvas.getContext("2d")),this.scene=new ot,this.scene.parent=this,this._renderer={type:"renderer",matrix:new un(ep),scale:1,opacity:1},this._flagMatrix=!0,t=J.defaults(t||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=t.overdraw,e=this.ctx=this.domElement.getContext("webgl",t)||this.domElement.getContext("experimental-webgl",t),!this.ctx)throw new Et("unable to create a webgl context. Try using another renderer.");r=Xt.create(e,Xt.path.vertex,Xt.types.vertex),s=Xt.create(e,Xt.path.fragment,Xt.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=_e.program.create(e,[r,s]),this.programs.text=this.programs.path,e.extensions=_e.extensions.init(e),e.renderer=this,n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.rect=e.getUniformLocation(n,"u_rect");const o=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,o),e.vertexAttribPointer(n.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n.position),e.bufferData(e.ARRAY_BUFFER,wo,e.STATIC_DRAW),r=Xt.create(e,Xt.points.vertex,Xt.types.vertex),s=Xt.create(e,Xt.points.fragment,Xt.types.fragment),n=this.programs.points=_e.program.create(e,[r,s]),n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.size=e.getUniformLocation(n,"u_size"),e.enable(e.BLEND),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}setSize(t,e,n){let r,s;const o=this.ctx;return this.width=t,this.height=e,this.ratio=typeof n>"u"?Ks(o):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,J.isObject(this.domElement.style)&&J.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=t*this.ratio,s=e*this.ratio,o.viewport(0,0,r,s),this.programs.resolution.width=r,this.programs.resolution.height=s,this.programs.resolution.ratio=this.ratio,this.programs.resolution.flagged=!0,this.trigger(U.Types.resize,t,e,n)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),_e.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};k(Bc,"Utils",_e);var np=J.extend({Error:Et,getRatio:Ks,read:He,xhr:_c},J,kt,dl,ul),xe=class Ar{constructor(e){k(this,"_events",new U),k(this,"type",""),k(this,"renderer",null),k(this,"scene",null),k(this,"width",0),k(this,"height",0),k(this,"frameCount",0),k(this,"timeDelta",0),k(this,"playing",!1);const n=J.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Ar.Types.svg,autostart:!1});if(J.each(n,function(r,s){/fullscreen/i.test(s)||/autostart/i.test(s)||(this[s]=r)},this),J.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Ar.Types[r])}this.renderer=new Ar[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=ip.bind(this),this.fit.domElement=window,this.fit.attached=!0,J.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),J.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Ot.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=rp.bind(this),J.extend(this.renderer.domElement.style,{display:"block"})):typeof n.width=="number"&&typeof n.height=="number"&&(this.renderer.setSize(n.width,n.height,this.ratio),this.width=n.width,this.height=n.height),this.renderer.bind(U.Types.resize,sp.bind(this)),this.scene=this.renderer.scene,Ar.Instances.push(this),n.autostart&&ur.init()}get _bound(){return this._events._bound}set _bound(e){this._events._bound=e}addEventListener(){return this._events.addEventListener.apply(this,arguments)}on(){return this._events.addEventListener.apply(this,arguments)}bind(){return this._events.addEventListener.apply(this,arguments)}removeEventListener(){return this._events.removeEventListener.apply(this,arguments)}off(){return this._events.removeEventListener.apply(this,arguments)}unbind(){return this._events.removeEventListener.apply(this,arguments)}dispatchEvent(){return this._events.dispatchEvent.apply(this,arguments)}trigger(){return this._events.dispatchEvent.apply(this,arguments)}listen(){return this._events.listen.apply(this,arguments)}ignore(){return this._events.ignore.apply(this,arguments)}appendTo(e){return e.appendChild(this.renderer.domElement),this.fit&&(this.fit.domElement!==window&&(this.fit.domElement=e,this.fit.attached=!1),this.update()),this}play(){return this.playing=!0,ur.init(),this.trigger(U.Types.play)}pause(){return this.playing=!1,this.trigger(U.Types.pause)}setPlaying(e){this.playing=e}release(e){let n,r,s;if(typeof e>"u")return this.release(this.scene);if(typeof e.unbind=="function"&&e.unbind(),typeof e.fill=="object"&&"unbind"in e.fill&&e.fill.unbind(),typeof e.stroke=="object"&&"unbind"in e.stroke&&e.stroke.unbind(),e.vertices){if(typeof e.vertices.unbind=="function")try{e.vertices.unbind()}catch{}for(n=0;n<e.vertices.length;n++)r=e.vertices[n],typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}if(e.children){for(n=0;n<e.children.length;n++)s=e.children[n],this.release(s);if(typeof e.children.unbind=="function")try{e.children.unbind()}catch{}}if(e._renderer){if(e._renderer.elem&&e._renderer.elem.parentNode&&(e._renderer.elem.parentNode.removeChild(e._renderer.elem),delete e._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const o=this.renderer.ctx;e._renderer.texture&&(o.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(o.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer),e._renderer.effect&&(e._renderer.effect=null)}this.type==="CanvasRenderer"&&e._renderer.context&&delete e._renderer.context}return e}update(){const e=!!this._lastFrame,n=J.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Ot.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const r=this.width,s=this.height,o=this.renderer;return(r!==o.width||s!==o.height)&&o.setSize(r,s,this.ratio),this.trigger(U.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(U.Types.render,this.frameCount++)}add(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.add(e),this}remove(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.remove(e),this}clear(){return this.scene.remove(this.scene.children),this}makeLine(e,n,r,s){const o=new Ur(e,n,r,s);return this.scene.add(o),o}makeArrow(e,n,r,s,o){const a=typeof o=="number"?o:10,l=Math.atan2(s-n,r-e),c=[new ve(e,n,void 0,void 0,void 0,void 0,ne.move),new ve(r,s,void 0,void 0,void 0,void 0,ne.line),new ve(r-a*Math.cos(l-Math.PI/4),s-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,ne.line),new ve(r,s,void 0,void 0,void 0,void 0,ne.move),new ve(r-a*Math.cos(l+Math.PI/4),s-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,ne.line)],d=new Ce(c,!1,!1,!0);return d.noFill(),d.cap="round",d.join="round",this.scene.add(d),d}makeRectangle(e,n,r,s){const o=new Un(e,n,r,s);return this.scene.add(o),o}makeRoundedRectangle(e,n,r,s,o){const a=new qr(e,n,r,s,o);return this.scene.add(a),a}makeCircle(e,n,r,s){const o=new Wr(e,n,r,s);return this.scene.add(o),o}makeEllipse(e,n,r,s,o){const a=new jr(e,n,r,s,o);return this.scene.add(a),a}makeStar(e,n,r,s,o){const a=new uo(e,n,r,s,o);return this.scene.add(a),a}makeCurve(e){const n=arguments.length;if(!Array.isArray(e)){e=[];for(let a=0;a<n;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];e.push(new ve(l,c))}}const r=arguments[n-1],s=new Ce(e,!(typeof r=="boolean"&&r),!0),o=s.getBoundingClientRect();return s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makePolygon(e,n,r,s){const o=new co(e,n,r,s);return this.scene.add(o),o}makeArcSegment(e,n,r,s,o,a,l){const c=new io(e,n,r,s,o,a,l);return this.scene.add(c),c}makePoints(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let o=0;o<n;o+=2){const a=arguments[o];if(typeof a!="number")break;const l=arguments[o+1];r.push(new te(a,l))}}const s=new lo(r);return this.scene.add(s),s}makePath(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let l=0;l<n;l+=2){const c=arguments[l];if(typeof c!="number")break;const d=arguments[l+1];r.push(new ve(c,d))}}const s=arguments[n-1],o=new Ce(r,!(typeof s=="boolean"&&s)),a=o.getBoundingClientRect();return typeof a.top=="number"&&typeof a.left=="number"&&typeof a.right=="number"&&typeof a.bottom=="number"&&o.center().translation.set(a.left+a.width/2,a.top+a.height/2),this.scene.add(o),o}makeText(e,n,r,s){const o=new fn(e,n,r,s);return this.add(o),o}makeLinearGradient(e,n,r,s){const o=Array.prototype.slice.call(arguments,4),a=new qe(e,n,r,s,o);return this.add(a),a}makeRadialGradient(e,n,r){const s=Array.prototype.slice.call(arguments,3),o=new Xe(e,n,r,s);return this.add(o),o}makeSprite(e,n,r,s,o,a,l){const c=new Hr(e,n,r,s,o,a);return l&&c.play(),this.add(c),c}makeImage(e,n,r,s,o,a){const l=new wc(e,n,r,s,o,a);return this.add(l),l}makeImageSequence(e,n,r,s,o){const a=new go(e,n,r,s);return o&&a.play(),this.add(a),a}makeTexture(e,n){return new Me(e,n)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const n=new ot;return this.scene.add(n),n.add(e),n}interpret(e,n,r){const s=e.tagName.toLowerCase();if(r=typeof r<"u"?r:!0,!(s in He))return null;const o=He[s].call(this,e);return r?this.add(n&&o instanceof ot?o.children:o):o.parent&&o.remove(),o}load(e,n){const r=new ot;let s,o,a;const l=(function(c){for(Ot.temp.innerHTML=c,o=0;o<Ot.temp.children.length;o++)s=Ot.temp.children[o],a=this.interpret(s,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Ot.temp.children.length<=1?Ot.temp.children[0]:Ot.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(_c(e,l),r):(l(e),r)}};k(xe,"NextFrameId",vt.NextFrameId),k(xe,"Types",vt.Types),k(xe,"Version",vt.Version),k(xe,"PublishDate",vt.PublishDate),k(xe,"Identifier",vt.Identifier),k(xe,"Resolution",vt.Resolution),k(xe,"AutoCalculateImportedMatrices",vt.AutoCalculateImportedMatrices),k(xe,"Instances",vt.Instances),k(xe,"uniqueId",vt.uniqueId),k(xe,"Anchor",ve),k(xe,"Collection",qn),k(xe,"Events",U),k(xe,"Group",ot),k(xe,"Matrix",Di),k(xe,"Path",Ce),k(xe,"Registry",Or),k(xe,"Element",Li),k(xe,"Shape",Yn),k(xe,"Text",fn),k(xe,"Vector",te),k(xe,"Gradient",tt),k(xe,"Image",wc),k(xe,"ImageSequence",go),k(xe,"LinearGradient",qe),k(xe,"RadialGradient",Xe),k(xe,"Sprite",Hr),k(xe,"Stop",Xn),k(xe,"Texture",Me),k(xe,"ArcSegment",io),k(xe,"Circle",Wr),k(xe,"Ellipse",jr),k(xe,"Line",Ur),k(xe,"Points",lo),k(xe,"Polygon",co),k(xe,"Rectangle",Un),k(xe,"RoundedRectangle",qr),k(xe,"Star",uo),k(xe,"CanvasRenderer",ft),k(xe,"SVGRenderer",Cc),k(xe,"WebGLRenderer",Bc),k(xe,"Commands",ne),k(xe,"Utils",np);var gn=xe;function ip(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function rp(){const t=this.renderer.domElement.parentElement;if(!t){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const e=t.getBoundingClientRect(),n=this.width=e.width,r=this.height=e.height;this.renderer.setSize(n,r,this.ratio)}function sp(t,e){this.width=t,this.height=e,this.trigger(U.Types.resize,t,e)}var ur=Ot.getRequestAnimationFrame();function Tc(){for(let t=0;t<gn.Instances.length;t++){const e=gn.Instances[t];e.playing&&e.update()}gn.NextFrameId=ur(Tc)}ur.init=function(){Tc(),ur.init=function(){}};let pn;typeof window<"u"?pn=window:typeof global<"u"?pn=global:typeof self<"u"&&(pn=self);let Rc;const di=Math.PI*2,at=Math.PI*.5;function op(t,e,n,r,s,o){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,s=t.e,o=t.f):a=t,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function ap(t){Rc=t}function lp(t,e){e=e&&e.identity()||new Rc;let n=t;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function Yt(t,e,n){return n*(e-t)+t}function ji(t,e){for(;t<0;)t+=e;return t%e}const $c=pn.Float32Array||Array,cp=Math.floor;function yn(t){return cp(t*1e6)/1e6}const me={move:"M",line:"L",curve:"C",close:"Z"};class Q{constructor(){C(this,"_events",{});C(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){e=r[s];let a=this._events[e];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let u=a[c];u=u.handler?u.handler:u,n!==u&&l.push(u)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,n,r){const s=this;e&&(o.obj=e,o.name=n,o.handler=r,e.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(e,n,r){return e.off(n,r),this}}C(Q,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),C(Q,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Pc={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(Q.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(Q.Types.change))}}},ct=class ct extends Q{constructor(n=0,r=0){super();C(this,"_x",0);C(this,"_y",0);for(let s in Pc)Object.defineProperty(this,s,Pc[s]);this.x=n,this.y=r}static add(n,r){return new ct(n.x+r.x,n.y+r.y)}static sub(n,r){return new ct(n.x-r.x,n.y-r.y)}static subtract(n,r){return ct.sub(n,r)}static ratioBetween(n,r){return(n.x*r.x+n.y*r.y)/(n.length()*r.length())}static angleBetween(n,r){if(arguments.length>=4){const a=arguments[0]-arguments[2],l=arguments[1]-arguments[3];return Math.atan2(l,a)}const s=n.x-r.x,o=n.y-r.y;return Math.atan2(o,s)}static distanceBetween(n,r){return Math.sqrt(ct.distanceBetweenSquared(n,r))}static distanceBetweenSquared(n,r){const s=n.x-r.x,o=n.y-r.y;return s*s+o*o}set(n,r){return this.x=n,this.y=r,this}copy(n){return this.x=n.x,this.y=n.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new ct(this.x,this.y)}add(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x+=n,this.y+=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x+=n.x,this.y+=n.y):(this.x+=n,this.y+=r),this)}addSelf(n){return this.add.apply(this,arguments)}sub(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x-=n,this.y-=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x-=n.x,this.y-=n.y):(this.x-=n,this.y-=r),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(n){return this.sub.apply(this,arguments)}subtractSelf(n){return this.sub.apply(this,arguments)}multiply(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x*=n,this.y*=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x*=n.x,this.y*=n.y):(this.x*=n,this.y*=r),this)}multiplySelf(n){return this.multiply.apply(this,arguments)}multiplyScalar(n){return this.multiply(n)}divide(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x/=n,this.y/=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x/=n.x,this.y/=n.y):(this.x/=n,this.y/=r),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(n){return this.divide.apply(this,arguments)}divideScalar(n){return this.divide(n)}negate(){return this.multiply(-1)}dot(n){return this.x*n.x+this.y*n.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(n){return Math.sqrt(this.distanceToSquared(n))}distanceToSquared(n){const r=this.x-n.x,s=this.y-n.y;return r*r+s*s}setLength(n){return this.normalize().multiplyScalar(n)}equals(n,r){return r=typeof r>"u"?1e-4:r,this.distanceTo(n)<r}lerp(n,r){const s=(n.x-this.x)*r+this.x,o=(n.y-this.y)*r+this.y;return this.set(s,o)}isZero(n){return n=typeof n>"u"?1e-4:n,this.length()<n}toString(){return this.x+", "+this.y}toObject(){return{x:yn(this.x),y:yn(this.y)}}rotate(n){const r=this.x,s=this.y,o=Math.cos(n),a=Math.sin(n);return this.x=r*o-s*a,this.y=r*a+s*o,this}};C(ct,"zero",new ct),C(ct,"left",new ct(-1,0)),C(ct,"right",new ct(1,0)),C(ct,"up",new ct(0,-1)),C(ct,"down",new ct(0,1));let pe=ct;class Re extends pe{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=me.move){super(n,r);C(this,"controls",{left:new pe,right:new pe});C(this,"_command",me.move);C(this,"_relative",!0);C(this,"_rx",0);C(this,"_ry",0);C(this,"_xAxisRotation",0);C(this,"_largeArcFlag",0);C(this,"_sweepFlag",1);for(let u in Nc)Object.defineProperty(this,u,Nc[u]);this.command=c,this.relative=!0;const d=Re.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(Q.Types.change,d),this.controls.right.set(a,l).addEventListener(Q.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(Q.Types.change)}}static fromObject(n){return new Re().copy(n)}copy(n){return this.x=n.x,this.y=n.y,typeof n.command=="string"&&(this.command=n.command),n.controls&&(n.controls.left&&this.controls.left.copy(n.controls.left),n.controls.right&&this.controls.right.copy(n.controls.right)),typeof n.relative=="boolean"&&(this.relative=n.relative),typeof n.rx=="number"&&(this.rx=n.rx),typeof n.ry=="number"&&(this.ry=n.ry),typeof n.xAxisRotation=="number"&&(this.xAxisRotation=n.xAxisRotation),typeof n.largeArcFlag=="number"&&(this.largeArcFlag=n.largeArcFlag),typeof n.sweepFlag=="number"&&(this.sweepFlag=n.sweepFlag),this}clone(){return new Re().copy(this)}toObject(){return{x:yn(this.x),y:yn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:yn(this.rx),ry:yn(this.ry),xAxisRotation:yn(this.xAxisRotation),largeArcFlag:yn(this.largeArcFlag),sweepFlag:yn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Nc={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(Q.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(Q.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(Q.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(Q.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(Q.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(Q.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(Q.Types.change))}}};let dp=0;const xo={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return dp++}},es={RecursionLimit:16,abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function ts(t,e,n,r,s){const o=1-t;return o*o*o*e+3*o*o*t*n+3*o*t*t*r+t*t*t*s}function Ec(t,e,n,r,s,o,a,l,c){c=c||es.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Re(a,l)];const u=[];for(let h=0;h<d;h++){const m=h/d,g=ts(m,t,n,s,a),f=ts(m,e,r,o,l);u.push(new Re(g,f))}return u}function up(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-s)+3*(a-t),u=6*(t+s)-12*n,h=3*(n-t),m=9*(r-o)+3*(l-e),g=6*(e+o)-12*r,f=3*(r-e);function p(b){const y=(d*b+u)*b+h,_=(m*b+g)*b+f;return Math.sqrt(y*y+_*_)}return fp(p,0,1,c||es.RecursionLimit)}function hp(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let u,h,m,g,f,p,b,y;for(let T=0;T<2;++T){if(T===0?(h=6*t-12*n+6*s,u=-3*t+9*n-9*s+3*a,m=3*n-3*t):(h=6*e-12*r+6*o,u=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;g=-m/h,0<g&&g<1&&c.push(g);continue}b=h*h-4*m*u,y=Math.sqrt(b),!(b<0)&&(f=(-h+y)/(2*u),0<f&&f<1&&c.push(f),p=(-h-y)/(2*u),0<p&&p<1&&c.push(p))}let _=c.length,S=_,v;for(;_--;)g=c[_],v=1-g,d[0][_]=v*v*v*t+3*v*v*g*n+3*v*g*g*s+g*g*g*a,d[1][_]=v*v*v*e+3*v*v*g*r+3*v*g*g*o+g*g*g*l;return d[0][S]=t,d[1][S]=e,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function fp(t,e,n,r){let s=es.abscissas[r-2],o=es.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,u=r&1?o[c++]*t(l):0;for(;c<d;){const h=a*s[c];u+=o[c++]*(t(l+h)+t(l-h))}return a*u}function mp(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?ji(s-1,n):Math.max(s-1,0),l=e?ji(s+1,n):Math.min(s+1,r),c=t[a],d=o,u=t[l];gp(c,d,u),d.command=s===0?me.move:me.curve}}function gp(t,e,n){const r=pe.angleBetween(t,e),s=pe.angleBetween(n,e);let o=pe.distanceBetween(t,e),a=pe.distanceBetween(n,e),l=(r+s)/2;return o<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(o*=.33,a*=.33,s<r?l+=at:l-=at,e.controls.left.x=Math.cos(l)*o,e.controls.left.y=Math.sin(l)*o,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}let hr=(Bi=class extends Q{constructor(){super();C(this,"_flagId",!1);C(this,"_flagClassName",!1);C(this,"_renderer",{});C(this,"_id",xo.Identifier+xo.uniqueId());C(this,"_className","");C(this,"classList",[]);for(let n in Fc)Object.defineProperty(this,n,Fc[n])}static fromObject(n){const r=new Bi().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return n.renderer&&typeof n.renderer.type=="string"&&(this.renderer.type=n.renderer.type),typeof n.className=="string"&&(this.className=n.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const n=this._renderer.type;return this._renderer={type:n},typeof this.unbind=="function"&&this.unbind(),this}},C(Bi,"Properties",["renderer","id","className"]),Bi);const Fc={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}};class ns extends Error{constructor(n){super();C(this,"name","Two.js");C(this,"message");this.message=n}}class pp{constructor(){C(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}}let is;const Ac={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};pn.document&&(is=document.createElement("a"));const Ue=class Ue extends hr{constructor(n,r){super();C(this,"_flagSrc",!1);C(this,"_flagImage",!1);C(this,"_flagVideo",!1);C(this,"_flagLoaded",!1);C(this,"_flagRepeat",!1);C(this,"_flagOffset",!1);C(this,"_flagScale",!1);C(this,"_src","");C(this,"_image",null);C(this,"_loaded",!1);C(this,"_repeat","no-repeat");C(this,"_scale",1);C(this,"_offset",null);for(let s in Mc)Object.defineProperty(this,s,Mc[s]);if(this._renderer.type="texture",this._renderer.flagOffset=yp.bind(this),this._renderer.flagScale=bp.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new pe,typeof r=="function"){const s=(function(){this.unbind(Q.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(Q.Types.load,s)}if(typeof n=="string")this.src=n;else if(typeof n=="object"){const s=Object.prototype.toString.call(n);(s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]"||s==="[object HTMLVideoElement]"||s==="[object Image]")&&(this.image=n)}this._update()}fromObject(n){const r=new Ue().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return is?(is.href=n,is.href):n}static loadHeadlessBuffer(n,r){n.image.onload=r,n.image.src=n.src}static getTag(n){return n&&n.nodeName&&n.nodeName.toLowerCase()||"img"}static getImage(n){const r=Ue.getAbsoluteURL(n);if(Ue.ImageRegistry.contains(r))return Ue.ImageRegistry.get(r);let s;return pn.document?Ac.video.test(r)?s=document.createElement("video"):s=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),s.crossOrigin="anonymous",s.referrerPolicy="no-referrer",s}static load(n,r){let s=n.image,o=Ue.getTag(s);n._flagImage&&(/canvas/i.test(o)?Ue.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,Ue.Register[o](n,r))),n._flagSrc&&(s||(s=Ue.getImage(n.src),n.image=s),o=Ue.getTag(s),Ue.Register[o](n,r))}clone(){const n=new Ue(this.src);return n.repeat=this.repeat,n.offset.copy(this.offset),n.scale=this.scale,n}copy(n){return this.src=n.src,this.repeat=n.repeat,this.offset=typeof n.offset=="number"||n.offset instanceof pe?n.offset:new pe().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof pe?n.scale:new pe().copy(n.scale),this}toObject(){const n=super.toObject.call(this);return n.renderer.type="texture",n.src=this.src,n.repeat=this.repeat,n.offset=this.offset.toObject(),n.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),n}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(Q.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Ue.load(this,(function(){this.loaded=!0,this.trigger(Q.Types.change).trigger(Q.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};C(Ue,"Properties",["src","loaded","repeat","scale","offset","image"]),C(Ue,"RegularExpressions",Ac),C(Ue,"ImageRegistry",new pp),C(Ue,"Register",{canvas:function(n,r){n._src="#"+n.id,Ue.ImageRegistry.add(n.src,n.image),typeof r=="function"&&r()},img:function(n,r){const s=n.image,o=function(l){s.removeEventListener&&typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),typeof r=="function"&&r()},a=function(l){throw typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),new ns("unable to load "+n.src)};typeof s.width=="number"&&s.width>0&&typeof s.height=="number"&&s.height>0?o():typeof s.addEventListener=="function"&&(s.addEventListener("load",o,!1),s.addEventListener("error",a,!1)),n._src=Ue.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),Ue.ImageRegistry.add(n.src,s),n.image.src=n.src)},video:function(n,r){const s=function(a){n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),n.image.width=n.image.videoWidth,n.image.height=n.image.videoHeight,typeof r=="function"&&r()},o=function(a){throw n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),new ns("unable to load "+n.src)};n._src=Ue.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),Ue.ImageRegistry.add(n.src,n.image)),n.image.readyState>=4?s():(n.image.addEventListener("canplaythrough",s,!1),n.image.addEventListener("error",o,!1),n.image.src=n.src,n.image.load())}});let Ye=Ue;const Mc={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=Ye.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Ye.ImageRegistry.contains(n)?this._image=Ye.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(Q.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(Q.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof pe&&this._scale.unbind(Q.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof pe&&this._scale.bind(Q.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function yp(){this._flagOffset=!0}function bp(){this._flagScale=!0}class ui extends Array{constructor(){super();Wa(this,dt,new Q);arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return $t(this,dt)}set _events(n){Xh(this,dt,n)}get _bound(){return $t(this,dt)._bound}set _bound(n){$t(this,dt)._bound=n}addEventListener(){return $t(this,dt).addEventListener.apply(this,arguments)}on(){return $t(this,dt).on.apply(this,arguments)}bind(){return $t(this,dt).bind.apply(this,arguments)}removeEventListener(){return $t(this,dt).removeEventListener.apply(this,arguments)}off(){return $t(this,dt).off.apply(this,arguments)}unbind(){return $t(this,dt).unbind.apply(this,arguments)}dispatchEvent(){return $t(this,dt).dispatchEvent.apply(this,arguments)}trigger(){return $t(this,dt).trigger.apply(this,arguments)}listen(){return $t(this,dt).listen.apply(this,arguments)}ignore(){return $t(this,dt).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(Q.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(Q.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(Q.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(Q.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(Q.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(Q.Types.insert,r),this.trigger(Q.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(Q.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(Q.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(n,r){const s=[];for(let o=0;o<this.length;o++){const a=this[o];let l;r?l=n.call(r,a,o):l=n(a,o),s.push(l)}return s}}dt=new WeakMap;const Vc=Array.prototype.slice;function _p(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const Pe={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=Vc.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]=r[s]}return t},defaults:function(t){const e=Vc.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]===void 0&&(t[s]=r[s])}return t},each:function(t,e,n){const r=n||this,s=!_p(t)&&Object.keys(t),o=(s||t).length;for(let a=0;a<o;a++){const l=s?s[a]:a;e.call(r,t[l],l,t)}return t},performance:pn.performance&&pn.performance.now?pn.performance:Date},At=class At extends hr{constructor(n,r,s){super();C(this,"_flagOffset",!0);C(this,"_flagOpacity",!0);C(this,"_flagColor",!0);C(this,"_offset",0);C(this,"_opacity",1);C(this,"_color","#fff");for(let o in Ic)Object.defineProperty(this,o,Ic[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:At.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:At.Index<=0?"#fff":"#000",At.Index=(At.Index+1)%2}static fromObject(n){const r=new At().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<At.Properties.length;r++){const s=At.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new At;return Pe.each(At.Properties,function(s){r[s]=this[s]},this),n&&n.stops&&n.stops.push(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="stop",Pe.each(At.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};C(At,"Index",0),C(At,"Properties",["offset","opacity","color"]);let hi=At;const Ic={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},kn=class kn extends hr{constructor(n){super();C(this,"_flagStops",!1);C(this,"_flagSpread",!1);C(this,"_flagUnits",!1);C(this,"_spread","");C(this,"_units","");for(let r in Oc)Object.defineProperty(this,r,Oc[r]);this._renderer.type="gradient",this._renderer.flagStops=wp.bind(this),this._renderer.bindStops=xp.bind(this),this._renderer.unbindStops=kp.bind(this),this.spread="pad",this.units="objectBoundingBox",n&&(this.stops=n)}static fromObject(n){let r=n.stops;r&&r.length>0&&(r=r.map(o=>o instanceof hi?o:new hi().copy(o)));const s=new kn(r).copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new kn(r);return Pe.each(kn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Pe.each(kn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(Q.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};C(kn,"Stop",hi),C(kn,"Properties",["spread","stops","units"]);let nt=kn;const Oc={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(Q.Types.insert,e).unbind(Q.Types.remove,n),this._stops=new ui((t||[]).slice(0)),this._stops.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._stops)}}};function wp(){this._flagStops=!0}function xp(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function kp(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const ti=class ti extends nt{constructor(n,r,s,o,a){super(a);C(this,"_flagEndPoints",!1);C(this,"_left",null);C(this,"_right",null);for(let l in zc)Object.defineProperty(this,l,zc[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=vp.bind(this),this.left=new pe,this.right=new pe,typeof n=="number"&&(this.left.x=n),typeof r=="number"&&(this.left.y=r),typeof s=="number"&&(this.right.x=s),typeof o=="number"&&(this.right.y=o)}static fromObject(n){const r=new ti().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<ti.Properties.length;r++){const s=ti.Properties[r];s in n&&(this[s]=n[s]instanceof pe?n[s]:new pe().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new ti(this.left._x,this.left._y,this.right._x,this.right._y,r);return Pe.each(nt.Properties,function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return n.left=this.left.toObject(),n.right=this.right.toObject(),n}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(Q.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};C(ti,"Stop",hi),C(ti,"Properties",["left","right"]);let Ct=ti;const zc={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof pe&&this._left.unbind(Q.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(Q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof pe&&this._right.unbind(Q.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(Q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function vp(){this._flagEndPoints=!0}const vn=class vn extends nt{constructor(n,r,s,o,a,l){super(o);C(this,"_flagRadius",!1);C(this,"_flagCenter",!1);C(this,"_flagFocal",!1);C(this,"_radius",0);C(this,"_center",null);C(this,"_focal",null);for(let c in Lc)Object.defineProperty(this,c,Lc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Cp.bind(this),this._renderer.flagFocal=Sp.bind(this),this.center=new pe,this.radius=typeof s=="number"?s:1,this.focal=new pe,typeof n=="number"&&(this.center.x=n),typeof r=="number"&&(this.center.y=r),this.focal.copy(this.center),typeof a=="number"&&(this.focal.x=a),typeof l=="number"&&(this.focal.y=l)}static fromObject(n){const r=new vn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<vn.Properties.length;r++){const s=vn.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof pe?n[s]:new pe().copy(n[s]):typeof n[s]=="number"&&(this[s]=n[MediaKeySystemAccess]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new vn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Pe.each(nt.Properties.concat(vn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Pe.each(vn.Properties,function(r){n[r]=this[r]},this),n.center=this.center.toObject(),n.focal=this.focal.toObject(),n}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(Q.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};C(vn,"Stop",hi),C(vn,"Properties",["center","radius","focal"]);let St=vn;const Lc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(Q.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(Q.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(Q.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(Q.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Cp(){this._flagCenter=!0}function Sp(){this._flagFocal=!0}function Dc(t,e){if(e===0||e===1)return!0;const r=t._length*e;let s=0;for(let o=0;o<t._lengths.length;o++){const a=t._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function rs(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,s=0;r<t._lengths.length;r++){if(s+t._lengths[r]>=e)return e-=s,Math.max(r-1,0)+e/t._lengths[r];s+=t._lengths[r]}return-1}function Hc(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(m||t).x,d=(m||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),up(r,l,s,c,o,d,a,u,n)}function Wc(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(m||t).x,d=(m||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),Ec(r,l,s,c,o,d,a,u,n)}function fi(t){switch(t.renderer.type){case"texture":return Ye.fromObject(t);case"gradient":return nt.fromObject(t);case"linear-gradient":return Ct.fromObject(t);case"radial-gradient":return St.fromObject(t)}return t}const Bp=Math.cos,Tp=Math.sin,jc=Math.tan,ko=[],Tt=class Tt extends Q{constructor(n,r,s,o,a,l){super();C(this,"elements",new $c(9));C(this,"manual",!1);let c=n;Array.isArray(c)||(c=Array.prototype.slice.call(arguments)),this.identity(),c.length>0&&this.set(c)}static Multiply(n,r,s){if(r.length<=3){const w=n;let B,x,$;const P=r[0]||0,A=r[1]||0,V=r[2]||0;return B=w[0]*P+w[1]*A+w[2]*V,x=w[3]*P+w[4]*A+w[5]*V,$=w[6]*P+w[7]*A+w[8]*V,[B,x,$]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],u=n[5],h=n[6],m=n[7],g=n[8],f=r[0],p=r[1],b=r[2],y=r[3],_=r[4],S=r[5],v=r[6],T=r[7],R=r[8];return s=s||new $c(9),s[0]=o*f+a*y+l*v,s[1]=o*p+a*_+l*T,s[2]=o*b+a*S+l*R,s[3]=c*f+d*y+u*v,s[4]=c*p+d*_+u*T,s[5]=c*b+d*S+u*R,s[6]=h*f+m*y+g*v,s[7]=h*p+m*_+g*T,s[8]=h*b+m*S+g*R,s}static fromObject(n){return new Tt().copy(n)}set(n,r,s,o,a,l,c,d,u){if(typeof r>"u"){const h=n;n=h[0],r=h[1],s=h[2],o=h[3],a=h[4],l=h[5],c=h[6],d=h[7],u=h[8]}return this.elements[0]=n,this.elements[1]=r,this.elements[2]=s,this.elements[3]=o,this.elements[4]=a,this.elements[5]=l,this.elements[6]=c,this.elements[7]=d,this.elements[8]=u,this.trigger(Q.Types.change)}copy(n){return this.elements[0]=n.elements[0],this.elements[1]=n.elements[1],this.elements[2]=n.elements[2],this.elements[3]=n.elements[3],this.elements[4]=n.elements[4],this.elements[5]=n.elements[5],this.elements[6]=n.elements[6],this.elements[7]=n.elements[7],this.elements[8]=n.elements[8],this.manual=n.manual,this.trigger(Q.Types.change)}identity(){return this.elements[0]=Tt.Identity[0],this.elements[1]=Tt.Identity[1],this.elements[2]=Tt.Identity[2],this.elements[3]=Tt.Identity[3],this.elements[4]=Tt.Identity[4],this.elements[5]=Tt.Identity[5],this.elements[6]=Tt.Identity[6],this.elements[7]=Tt.Identity[7],this.elements[8]=Tt.Identity[8],this.trigger(Q.Types.change)}multiply(n,r,s,o,a,l,c,d,u){if(typeof r>"u")return this.elements[0]*=n,this.elements[1]*=n,this.elements[2]*=n,this.elements[3]*=n,this.elements[4]*=n,this.elements[5]*=n,this.elements[6]*=n,this.elements[7]*=n,this.elements[8]*=n,this.trigger(Q.Types.change);if(typeof s>"u"&&(s=1),typeof o>"u"){n=n||0,r=r||0,s=s||0,a=this.elements;const N=a[0]*n+a[1]*r+a[2]*s,Y=a[3]*n+a[4]*r+a[5]*s,ee=a[6]*n+a[7]*r+a[8]*s;return[N,Y,ee]}const h=this.elements,m=[n,r,s,o,a,l,c,d,u],g=h[0],f=h[1],p=h[2],b=h[3],y=h[4],_=h[5],S=h[6],v=h[7],T=h[8],R=m[0],w=m[1],B=m[2],x=m[3],$=m[4],P=m[5],A=m[6],V=m[7],F=m[8];return this.elements[0]=g*R+f*x+p*A,this.elements[1]=g*w+f*$+p*V,this.elements[2]=g*B+f*P+p*F,this.elements[3]=b*R+y*x+_*A,this.elements[4]=b*w+y*$+_*V,this.elements[5]=b*B+y*P+_*F,this.elements[6]=S*R+v*x+T*A,this.elements[7]=S*w+v*$+T*V,this.elements[8]=S*B+v*P+T*F,this.trigger(Q.Types.change)}inverse(n){const r=this.elements;n=n||new Tt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],u=r[6],h=r[7],m=r[8],g=m*c-d*h,f=-m*l+d*u,p=h*l-c*u;let b=s*g+o*f+a*p;return b?(b=1/b,n.elements[0]=g*b,n.elements[1]=(-m*o+a*h)*b,n.elements[2]=(d*o-a*c)*b,n.elements[3]=f*b,n.elements[4]=(m*s-a*u)*b,n.elements[5]=(-d*s+a*l)*b,n.elements[6]=p*b,n.elements[7]=(-h*s+o*u)*b,n.elements[8]=(c*s-o*l)*b,n):null}scale(n,r){return arguments.length<=1&&(r=n),this.multiply(n,0,0,0,r,0,0,0,1)}rotate(n){const r=Bp(n),s=Tp(n);return this.multiply(r,-s,0,s,r,0,0,0,1)}translate(n,r){return this.multiply(1,0,n,0,1,r,0,0,1)}skewX(n){const r=jc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=jc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return ko.length=0,this.toTransformArray(n,ko),ko.map(yn).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],u=s[4],h=s[5];if(n){const m=s[6],g=s[7],f=s[8];if(o){r[0]=a,r[1]=d,r[2]=m,r[3]=l,r[4]=u,r[5]=g,r[6]=c,r[7]=h,r[8]=f;return}return[a,d,m,l,u,g,c,h,f]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=u,r[4]=c,r[5]=h;return}return[a,d,l,u,c,h]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],u=s[4],h=s[5];if(n){const m=s[6],g=s[7],f=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h,r[6]=m,r[7]=g,r[8]=f;return}return[a,l,c,d,u,h,m,g,f]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h;return}return[a,l,c,d,u,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Tt().copy(this)}};C(Tt,"Identity",[1,0,0,0,1,0,0,0,1]);let fr=Tt;ap(fr);const Pr=class Pr extends hr{constructor(){super();C(this,"_flagMatrix",!0);C(this,"_flagScale",!1);C(this,"_matrix",null);C(this,"_worldMatrix",null);C(this,"_position",null);C(this,"_rotation",0);C(this,"_scale",1);C(this,"_skewX",0);C(this,"_skewY",0);for(let n in ss)Object.defineProperty(this,n,ss[n]);this._renderer.flagMatrix=qc.bind(this),this.isShape=!0,this.matrix=new fr,this.worldMatrix=new fr,this.position=new pe,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new Pr().copy(n);return"id"in n&&(r.id=n.id),r}get renderer(){return this._renderer}set renderer(n){this._renderer=n}get translation(){return ss.position.get.apply(this,arguments)}set translation(n){ss.position.set.apply(this,arguments)}addTo(n){return n.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(n){return super.copy.call(this,n),"position"in n&&(n.position instanceof pe?this.position=n.position:this.position.copy(n.position)),"rotation"in n&&(this.rotation=n.rotation),"scale"in n&&(this.scale=typeof n.scale=="number"||n.scale instanceof pe?n.scale:new pe(n.scale.x,n.scale.y)),"skewX"in n&&(this.skewX=n.skewX),"skewY"in n&&(this.skewY=n.skewY),"matrix"in n&&n.matrix.manual&&(this.matrix.copy(n.matrix),this.matrix.manual=!0),this}clone(n){const r=new Pr;return r.position.copy(this.position),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer={type:"shape"},n.isShape=!0,n.translation=this.translation.toObject(),n.rotation=this.translation.rotation,n.scale=this.scale instanceof pe?this.scale.toObject():this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.matrix=this.matrix.toObject(),n}_update(n){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof pe?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),n&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};C(Pr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Rn=Pr;const ss={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(Q.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(Q.Types.change,this._renderer.flagMatrix),qc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof pe&&this._scale.unbind(Q.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof pe&&this._scale.bind(Q.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return lp(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function qc(){this._flagMatrix=!0}const qi=Math.min,Xi=Math.max,Rp=Math.ceil,$p=Math.floor,Pp=new pe,nn=class nn extends Rn{constructor(n,r,s,o){super();C(this,"_flagVertices",!0);C(this,"_flagLength",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagCap",!0);C(this,"_flagJoin",!0);C(this,"_flagMiter",!0);C(this,"_flagStrokeAttenuation",!0);C(this,"_flagMask",!1);C(this,"_flagClip",!1);C(this,"_length",0);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_cap","round");C(this,"_join","round");C(this,"_miter",4);C(this,"_closed",!0);C(this,"_curved",!1);C(this,"_automatic",!0);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_mask",null);C(this,"_clip",!1);C(this,"_dashes",null);C(this,"_strokeAttenuation",!0);for(let a in Xc)Object.defineProperty(this,a,Xc[a]);this._renderer.type="path",this._renderer.flagVertices=Yc.bind(this),this._renderer.bindVertices=Uc.bind(this),this._renderer.unbindVertices=Kc.bind(this),this._renderer.flagFill=Gc.bind(this),this._renderer.flagStroke=Zc.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!s,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=n,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(n.stroke),o=new nn().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){if(super.copy.call(this,n),n.vertices){this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Re?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Re().copy(s))}}for(let r=0;r<nn.Properties.length;r++){const s=nn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new nn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<nn.Properties.length;s++){const o=nn.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="path",n.vertices=this.vertices.map(r=>r.toObject()),Pe.each(nn.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const n=this.getBoundingClientRect(!0),r=n.width/2,s=n.height/2,o=n.left+n.width/2,a=n.top+n.height/2;for(let l=0;l<this.vertices.length;l++){const c=this.vertices[l];c.x-=o,c.y-=a,c.x+=r,c.y+=s}return this.mask&&(this.mask.translation.x-=o,this.mask.translation.x+=r,this.mask.translation.y-=a,this.mask.translation.y+=s),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getBoundingClientRect(n){let r,s,o,a,l,c,d=1/0,u=-1/0,h=1/0,m=-1/0;if(this._update(!0),r=n?this.matrix:this.worldMatrix,s=(this.linewidth||0)/2,o=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:g,scaleY:f}=op(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof g=="number"&&typeof f=="number"&&(s=Math.max(g,f)*(this.linewidth||0)/2)}else s*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(o<=0)return{width:0,height:0};for(a=0;a<o;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+o-1)%o];const[g,f]=r.multiply(l.x,l.y),[p,b]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,_=l.controls.right.y;l.relative&&(y+=l.x,_+=l.y);let[S,v]=r.multiply(y,_),T=c.controls.left.x,R=c.controls.left.y;c.relative&&(T+=c.x,R+=c.y);let[w,B]=r.multiply(T,R);const x=hp(g,f,S,v,w,B,p,b);h=qi(x.min.y-s,h),d=qi(x.min.x-s,d),u=Xi(x.max.x+s,u),m=Xi(x.max.y+s,m)}else a<=1&&(h=qi(f-s,h),d=qi(g-s,d),u=Xi(g+s,u),m=Xi(f+s,m)),h=qi(b-s,h),d=qi(p-s,d),u=Xi(p+s,u),m=Xi(b+s,m)}return{top:h,left:d,right:u,bottom:m,width:u-d,height:m-h}}getPointAt(n,r){let s,o,a,l,c,d,u,h,m,g,f,p,b,y,_,S=this.length*Math.min(Math.max(n,0),1);const v=this.vertices.length,T=v-1;let R=null,w=null;for(let I=0,z=this._lengths.length,q=0;I<z;I++){if(q+this._lengths[I]>=S){this._closed?(s=ji(I,v),o=ji(I-1,v),I===0&&(s=o,o=I)):(s=I,o=Math.min(Math.max(I-1,0),T)),R=this.vertices[s],w=this.vertices[o],S-=q,this._lengths[I]!==0?n=S/this._lengths[I]:n=0;break}q+=this._lengths[I]}if(R===null||w===null)return null;if(R){if(!w)return R}else return w;_=w.controls&&w.controls.right,y=R.controls&&R.controls.left,c=w.x,g=w.y,d=(_||w).x,f=(_||w).y,u=(y||R).x,p=(y||R).y,h=R.x,b=R.y,_&&w.relative&&(d+=w.x,f+=w.y),y&&R.relative&&(u+=R.x,p+=R.y),l=ts(n,c,d,u,h),m=ts(n,g,f,p,b);const B=Yt(c,d,n),x=Yt(g,f,n),$=Yt(d,u,n),P=Yt(f,p,n),A=Yt(u,h,n),V=Yt(p,b,n),F=Yt(B,$,n),N=Yt(x,P,n),Y=Yt($,A,n),ee=Yt(P,V,n);return Pe.isObject(r)?(r.x=l,r.y=m,r instanceof Re&&(r.controls.left.x=F,r.controls.left.y=N,r.controls.right.x=Y,r.controls.right.y=ee,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=m,r.controls.right.x-=l,r.controls.right.y-=m)),r.t=n,r):(a=new Re(l,m,F-l,N-m,Y-l,ee-m,this._curved?me.curve:me.line),a.t=n,a)}plot(){if(this.curved)return mp(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?me.move:me.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===me.close;let o=this.vertices[r],a=[],l;return Pe.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===me.move){a.push(new Re(o.x,o.y)),d>0&&(a[a.length-1].command=me.line),o=c;return}l=Wc(c,o,n),a=a.concat(l),Pe.each(l,function(u,h){h<=0&&o.command===me.move?u.command=me.move:u.command=me.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=Wc(c,o,n),a=a.concat(l),Pe.each(l,function(u,h){h<=0&&o.command===me.move?u.command=me.move:u.command=me.line})),a.push(new Re(c.x,c.y)),a[a.length-1].command=s?me.close:me.line),o=c},this),this._automatic=!1,this._curved=!1,this.vertices=a,this}_updateLength(n,r){r||this._update();const o=this.vertices.length-1;let a=this.vertices[o],l=0;return typeof this._lengths>"u"&&(this._lengths=[]),Pe.each(this.vertices,function(c,d){if(d<=0||c.command===me.move){a=c,this._lengths[d]=0;return}this._lengths[d]=Hc(c,a,n),l+=this._lengths[d],a=c},this),this._length=l,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const n=this._collection.length,r=this._closed,s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=rs(this,s*this._length),l=rs(this,o*this._length),c=Rp(a),d=$p(l);let u,h,m,g,f,p;for(this._renderer.vertices.length=0,p=0;p<n;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Re),p>d&&!h?(f=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,f),f.command=this._renderer.collection[p].command,this._renderer.vertices.push(f),h=f,m=this._collection[p-1],m&&m.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f),m.relative?this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(pe.zero,1-f.t):this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(m,1-f.t))):p>=c&&p<=d&&(f=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(f),p===d&&Dc(this,o)?(h=f,!r&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):p===c&&Dc(this,s)&&(u=f,u.command=me.move,!r&&u.controls&&(u.relative?u.controls.left.clear():u.controls.left.copy(u))));c>0&&!u&&(p=c-1,f=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(s,f),f.command=me.move,this._renderer.vertices.unshift(f),g=this._collection[p+1],g&&g.controls&&(f.controls.left.clear(),g.relative?this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(pe.zero,f.t):(Pp.copy(g),this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(g,f.t))))}return Rn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,Rn.prototype.flagReset.call(this),this}};C(nn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),C(nn,"Utils",{getCurveLength:Hc});let Ne=nn;const Xc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof Ye)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof Ye)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof Ye)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof Ye)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";Pe.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Q.Types.insert,e).unbind(Q.Types.remove,n),t instanceof ui?this._collection=t:this._collection=new ui(t||[]),this._collection.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Pe.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Yc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Uc(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Kc(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Gc(){this._flagFill=!0}function Zc(){this._flagStroke=!0}const Np=Math.ceil,Ep=Math.floor,Cn=class Cn extends Rn{constructor(n){super();C(this,"_flagVertices",!0);C(this,"_flagLength",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagSize",!0);C(this,"_flagSizeAttenuation",!0);C(this,"_flagStrokeAttenuation",!0);C(this,"_length",0);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_size",1);C(this,"_sizeAttenuation",!1);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_dashes",null);C(this,"_strokeAttenuation",!0);C(this,"noFill",Ne.prototype.noFill);C(this,"noStroke",Ne.prototype.noStroke);C(this,"corner",Ne.prototype.corner);C(this,"center",Ne.prototype.center);C(this,"getBoundingClientRect",Ne.prototype.getBoundingClientRect);C(this,"_updateLength",Ne.prototype._updateLength);for(let r in Qc)Object.defineProperty(this,r,Qc[r]);this._renderer.type="points",this._renderer.flagVertices=Yc.bind(this),this._renderer.bindVertices=Uc.bind(this),this._renderer.unbindVertices=Kc.bind(this),this._renderer.flagFill=Gc.bind(this),this._renderer.flagStroke=Zc.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=n,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(n.stroke),o=new Cn().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Re?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Re().copy(s))}for(let r=0;r<Cn.Properties.length;r++){const s=Cn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Cn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<Cn.Properties.length;s++){const o=Cn.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="points",n.vertices=this.vertices.map(r=>r.toObject()),Pe.each(Cn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(n){this._update();let r=[];for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s],a=this.vertices[s-1];if(!a)continue;const l=o.x,c=o.y,d=a.x,u=a.y,h=Ec(l,c,l,c,d,u,d,u,n);r=r.concat(h)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=rs(this,n*this._length),o=rs(this,r*this._length),a=Np(s),l=Ep(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let u=0;u<this._collection.length;u++)u>=a&&u<=l&&(d=this._collection[u],this._renderer.collection.push(d),this._renderer.vertices[c*2+0]=d.x,this._renderer.vertices[c*2+1]=d.y,c++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};C(Cn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let os=Cn;const Qc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof Ye)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof Ye)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof Ye)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof Ye)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Q.Types.insert,e).unbind(Q.Types.remove,n),t instanceof ui?this._collection=t:this._collection=new ui(t||[]),this._collection.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};class Jc extends ui{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);Wa(this,As,{});this.attach(n),this.on(Q.Types.insert,this.attach),this.on(Q.Types.remove,this.detach)}get ids(){return $t(this,As)}attach(n){for(let r=0;r<n.length;r++){const s=n[r];s&&s.id&&(this.ids[s.id]=s)}return this}detach(n){for(let r=0;r<n.length;r++)delete this.ids[n[r].id];return this}}As=new WeakMap;const Fn=class Fn extends Ne{constructor(n,r,s,o,a,l,c){const d=c||xo.Resolution*3,u=[];for(let h=0;h<d;h++)u.push(new Re);super(u,!0,!1,!0);C(this,"_flagStartAngle",!1);C(this,"_flagEndAngle",!1);C(this,"_flagInnerRadius",!1);C(this,"_flagOuterRadius",!1);C(this,"_startAngle",0);C(this,"_endAngle",di);C(this,"_innerRadius",0);C(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let h in ed)Object.defineProperty(this,h,ed[h]);typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Fn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Fn.Properties.length;r++){const s=Fn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,s=this._innerRadius,o=this._outerRadius,a=ji(n,di)===ji(r,di),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,u,h=0,m,g,f,p,b,y,_,S,v;for(a?d--:l||(d-=2),m=0,g=d-1;m<d;m++){switch(f=m/g,p=c[h],b=f*(r-n)+n,y=(r-n)/d,_=o*Math.cos(b),S=o*Math.sin(b),m){case 0:u=me.move;break;default:u=me.curve}p.command=u,p.x=_,p.y=S,p.controls.left.clear(),p.controls.right.clear(),p.command===me.curve&&(v=o*y/Math.PI,p.controls.left.x=v*Math.cos(b-at),p.controls.left.y=v*Math.sin(b-at),p.controls.right.x=v*Math.cos(b+at),p.controls.right.y=v*Math.sin(b+at),m===1&&p.controls.left.multiplyScalar(2),m===g&&p.controls.right.multiplyScalar(2)),h++}if(l){for(a?(c[h].command=me.close,h++):(d--,g=d-1),m=0;m<d;m++)f=m/g,p=c[h],b=(1-f)*(r-n)+n,y=(r-n)/d,_=s*Math.cos(b),S=s*Math.sin(b),u=me.curve,m<=0&&(u=a?me.move:me.line),p.command=u,p.x=_,p.y=S,p.controls.left.clear(),p.controls.right.clear(),p.command===me.curve&&(v=s*y/Math.PI,p.controls.left.x=v*Math.cos(b+at),p.controls.left.y=v*Math.sin(b+at),p.controls.right.x=v*Math.cos(b-at),p.controls.right.y=v*Math.sin(b-at),m===1&&p.controls.left.multiplyScalar(2),m===g&&p.controls.right.multiplyScalar(2)),h++;c[h].copy(c[0]),c[h].command=me.line}else a||(c[h].command=me.line,c[h].x=0,c[h].y=0,h++,c[h].copy(c[0]),c[h].command=me.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.startAngle,a=this.endAngle,l=this.vertices.length,c=new Fn(0,0,r,s,o,a,l);c.translation.copy(this.translation),c.rotation=this.rotation,c.scale=this.scale,c.skewX=this.skewX,c.skewY=this.skewY,this.matrix.manual&&c.matrix.copy(this.matrix);for(let d=0;d<Ne.Properties.length;d++){const u=Ne.Properties[d];c[u]=this[u]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<Fn.Properties.length;r++){const s=Fn.Properties[r];n[s]=this[s]}return n}};C(Fn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let vo=Fn;const ed={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},Co=Math.cos,So=Math.sin,An=class An extends Ne{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new Re(0,0,0,0,0,0));super(l,!0,!0,!0);C(this,"_flagRadius",!1);C(this,"_radius",0);this._renderer.type="circle";for(let c in td)Object.defineProperty(this,c,td[c]);typeof s=="number"&&(this.radius=s),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new An().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<An.Properties.length;r++){const s=An.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagRadius){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(n*2)),s=this._radius,o=s*r;for(let a=0;a<this.vertices.length;a++){const c=a/n*di,d=s*Co(c),u=s*So(c),h=o*Co(c-at),m=o*So(c-at),g=o*Co(c+at),f=o*So(c+at),p=this.vertices[a];p.command=a===0?me.move:me.curve,p.set(d,u),p.controls.left.set(h,m),p.controls.right.set(g,f)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new An(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="circle";for(let r=0;r<An.Properties.length;r++){const s=An.Properties[r];n[s]=this[s]}return n}};C(An,"Properties",["radius"]);let Bo=An;const td={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},To=Math.cos,Ro=Math.sin,Mn=class Mn extends Ne{constructor(n,r,s,o,a){typeof o!="number"&&typeof s=="number"&&(o=s);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new Re);super(c,!0,!0,!0);C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_width",0);C(this,"_height",0);this._renderer.type="ellipse";for(let d in nd)Object.defineProperty(this,d,nd[d]);typeof s=="number"&&(this.width=s*2),typeof o=="number"&&(this.height=o*2),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Mn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Mn.Properties.length;r++){const s=Mn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(this.vertices.length*2)),s=this._width/2,o=this._height/2;for(let a=0;a<this.vertices.length;a++){const c=a/n*di,d=s*To(c),u=o*Ro(c),h=s*r*To(c-at),m=o*r*Ro(c-at),g=s*r*To(c+at),f=o*r*Ro(c+at),p=this.vertices[a];p.command=a===0?me.move:me.curve,p.set(d,u),p.controls.left.set(h,m),p.controls.right.set(g,f)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=this.width/2,s=this.height/2,o=this.vertices.length,a=new Mn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="ellipse";for(let r=0;r<Mn.Properties.length;r++){const s=Mn.Properties[r];n[s]=this[s]}return n}};C(Mn,"Properties",["width","height"]);let $o=Mn;const nd={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},Fp=Math.cos,Ap=Math.sin,Vn=class Vn extends Ne{constructor(n,r,s,o){o=Math.max(o||0,3);super();C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_flagSides",!1);C(this,"_radius",0);C(this,"_width",0);C(this,"_height",0);C(this,"_sides",0);this._renderer.type="polygon";for(let a in id)Object.defineProperty(this,a,id[a]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.radius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Vn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Vn.Properties.length;r++){const s=Vn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const n=this._sides,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=di*a+Math.PI/2,c=this._width*Fp(l)/2,d=this._height*Ap(l)/2;o>=s?this.vertices.push(new Re(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?me.move:me.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=new Vn(0,0,0,this.sides);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,r.width=this.width,r.height=this.height,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="polygon";for(let r=0;r<Vn.Properties.length;r++){const s=Vn.Properties[r];n[s]=this[s]}return n}};C(Vn,"Properties",["width","height","sides"]);let Po=Vn;const id={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},Ti=class Ti extends Ne{constructor(n,r,s,o){const a=[new Re,new Re,new Re,new Re];super(a,!0,!1,!0);C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_width",0);C(this,"_height",0);C(this,"_origin",null);this._renderer.type="rectangle";for(let l in rd)Object.defineProperty(this,l,rd[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new pe,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new Ti().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ti.Properties.length;r++){const s=Ti.Properties[r];s in n&&(typeof n[s]=="number"?this[s]=n[s]:this[s]instanceof pe&&this[s].copy(n[s]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const n=this._width/2,r=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new Re),this.vertices[0].set(-n,-r).sub(this._origin).command=me.move,this.vertices[1].set(n,-r).sub(this._origin).command=me.line,this.vertices[2].set(n,r).sub(this._origin).command=me.line,this.vertices[3].set(-n,r).sub(this._origin).command=me.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=me.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new Ti(0,0,this.width,this.height);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]instanceof pe?r[o].copy(this[o]):r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="rectangle",n.width=this.width,n.height=this.height,n.origin=this.origin.toObject(),n}};C(Ti,"Properties",["width","height","origin"]);let mr=Ti;const rd={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(Q.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(Q.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},In=class In extends Ne{constructor(n,r,s,o,a){typeof a>"u"&&typeof s=="number"&&typeof o=="number"&&(a=Math.floor(Math.min(s,o)/12));const l=[];for(let c=0;c<10;c++)l.push(new Re(0,0,0,0,0,0,c===0?me.move:me.curve));super(l);C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_flagRadius",!1);C(this,"_width",0);C(this,"_height",0);C(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in sd)Object.defineProperty(this,c,sd[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Mp.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),(typeof a=="number"||a instanceof pe)&&(this.radius=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new In().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<In.Properties.length;r++){const s=In.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof pe?o:new pe().copy(o):typeof o=="number"&&(this[s]=o)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const n=this._width,r=this._height;let s,o;this._radius instanceof pe?(s=this._radius.x,o=this._radius.y):(s=this._radius,o=this._radius);let a,l=n/2,c=r/2;a=this.vertices[0],a.x=-(l-s),a.y=-c,a=this.vertices[1],a.x=l-s,a.y=-c,a.controls.left.clear(),a.controls.right.x=s,a.controls.right.y=0,a=this.vertices[2],a.x=l,a.y=-(c-o),a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[3],a.x=l,a.y=c-o,a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=o,a=this.vertices[4],a.x=l-s,a.y=c,a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[5],a.x=-(l-s),a.y=c,a.controls.left.clear(),a.controls.right.x=-s,a.controls.right.y=0,a=this.vertices[6],a.x=-l,a.y=c-o,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[7],a.x=-l,a.y=-(c-o),a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=-o,a=this.vertices[8],a.x=-(l-s),a.y=-c,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[9],a.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=this.width,s=this.height,o=this.radius,a=new In(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="rounded-rectangle";for(let r=0;r<In.Properties.length;r++){const s=In.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};C(In,"Properties",["width","height","radius"]);let No=In;const sd={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof pe&&this._radius.unbind(Q.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof pe&&this._radius.bind(Q.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Mp(){this._flagRadius=!0}const Vp=Math.cos,Ip=Math.sin,On=class On extends Ne{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();C(this,"_flagInnerRadius",!1);C(this,"_flagOuterRadius",!1);C(this,"_flagSides",!1);C(this,"_innerRadius",0);C(this,"_outerRadius",0);C(this,"_sides",0);this._renderer.type="star";for(let l in od)Object.defineProperty(this,l,od[l]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.sides=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new On().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<On.Properties.length;r++){const s=On.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const n=this._sides*2,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=di*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*Vp(l),u=c*Ip(l);o>=s?this.vertices.push(new Re(d,u)):this.vertices[o].set(d,u),this.vertices[o].command=o===0?me.move:me.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.sides,a=new On(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="star";for(let r=0;r<On.Properties.length;r++){const s=On.Properties[r];n[s]=this[s]}return n}};C(On,"Properties",["innerRadius","outerRadius","sides"]);let Eo=On;const od={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}};let Fo;const ad=Math.min,ld=Math.max;pn.document&&(Fo=document.createElement("canvas"));const bt=class bt extends Rn{constructor(n,r,s,o){super();C(this,"_flagValue",!0);C(this,"_flagFamily",!0);C(this,"_flagSize",!0);C(this,"_flagLeading",!0);C(this,"_flagAlignment",!0);C(this,"_flagBaseline",!0);C(this,"_flagStyle",!0);C(this,"_flagWeight",!0);C(this,"_flagDecoration",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagMask",!1);C(this,"_flagClip",!1);C(this,"_flagDirection",!0);C(this,"_flagStrokeAttenuation",!0);C(this,"_value","");C(this,"_family","sans-serif");C(this,"_size",13);C(this,"_leading",17);C(this,"_alignment","center");C(this,"_baseline","middle");C(this,"_style","normal");C(this,"_weight",500);C(this,"_decoration","none");C(this,"_direction","ltr");C(this,"_fill","#000");C(this,"_stroke","none");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_mask",null);C(this,"_clip",!1);C(this,"_dashes",null);C(this,"_strokeAttenuation",!0);for(let a in cd)Object.defineProperty(this,a,cd[a]);if(this._renderer.type="text",this._renderer.flagFill=Op.bind(this),this._renderer.flagStroke=zp.bind(this),this.value=n,typeof r=="number"&&(this.translation.x=r),typeof s=="number"&&(this.translation.y=s),this.dashes=[],this.dashes.offset=0,!Pe.isObject(o))return this;for(let a=0;a<bt.Properties.length;a++){const l=bt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(Fo){const r=Fo.getContext("2d");r.font=[n._style,n._weight,`${n._size}px/${n._leading}px`,n._family].join(" ");const s=r.measureText(n.value,0,0),o=s.actualBoundingBoxDescent+s.actualBoundingBoxAscent;return{width:s.width,height:o}}else{const r=this.value.length*this.size*bt.Ratio,s=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:s}}}static fromObject(n){const r=typeof n.fill=="string"?n.fill:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(n.stroke),o=new bt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<bt.Properties.length;r++){const s=bt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new bt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<bt.Properties.length;s++){const o=bt.Properties[s];r[o]=this[o]}return this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);n.renderer.type="text";for(let r=0;r<bt.Properties.length;r++){const s=bt.Properties[r];n[s]=this[s]}return n}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(n){let r,s,o,a,l;this._update(!0),r=n?this.matrix:this.worldMatrix;const{width:c,height:d}=bt.Measure(this),u=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-u,o=c+u;break;case"right":s=-(c+u),o=u;break;default:s=-(c/2+u),o=c/2+u}switch(this.baseline){case"middle":a=-(d/2+u),l=d/2+u;break;default:a=-(d+u),l=u}const[h,m]=r.multiply(s,a),[g,f]=r.multiply(s,l),[p,b]=r.multiply(o,a),[y,_]=r.multiply(o,l);return a=ad(m,f,b,_),s=ad(h,g,p,y),o=ld(h,g,p,y),l=ld(m,f,b,_),{top:a,left:s,right:o,bottom:l,width:o-s,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};C(bt,"Ratio",.6),C(bt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let Yi=bt;const cd={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof Ye)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof Ye)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof Ye)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof Ye)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Pe.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Op(){this._flagFill=!0}function zp(){this._flagStroke=!0}const zn=class zn extends mr{constructor(n,r,s,o){super(r,s,0,0);C(this,"_flagTextures",!1);C(this,"_flagFrameRate",!1);C(this,"_flagIndex",!1);C(this,"_amount",1);C(this,"_duration",0);C(this,"_index",0);C(this,"_startTime",0);C(this,"_playing",!1);C(this,"_firstFrame",0);C(this,"_lastFrame",0);C(this,"_loop",!0);C(this,"_textures",null);C(this,"_frameRate",0);C(this,"_origin",null);this._renderer.type="image-sequence";for(let a in dd)Object.defineProperty(this,a,dd[a]);this._renderer.flagTextures=Lp.bind(this),this._renderer.bindTextures=Dp.bind(this),this._renderer.unbindTextures=Hp.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(ud.bind(this)):typeof n=="string"&&(this.textures=[ud(n)]),this.origin=new pe,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=zn.DefaultFrameRate,this.index=0}static fromObject(n){const r=new zn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<zn.Properties.length;r++){const s=zn.Properties[r];s in n&&(this[s]=n[s])}return this}play(n,r,s){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Pe.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof s=="function"?this._onLastFrame=s:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(n){const r=new zn(this.textures,this.translation.x,this.translation.y,this.frameRate);return r._loop=this._loop,this._playing&&r.play(),n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="image-sequence",n.textures=this.textures.map(function(r){return r.toObject()}),n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let n=0;n<this.textures.length;n++){const r=this.textures[n];typeof r.dispose=="function"?r.dispose():typeof r.unbind=="function"&&r.unbind()}return this}_update(){const n=this._textures;let r,s,o,a,l,c,d,u;return n&&(this._flagTextures&&(this._amount=n.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(a=this._amount,Pe.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=Pe.performance.now()-this._startTime,u=this._lastFrame+1,l=1e3*(u-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),d=Yt(this._firstFrame,u,o/l),d=Math.floor(d),d!==this._index&&(this._index=d,c=n[this._index],c.loaded&&(r=c.image.width,s=c.image.height,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s),this.fill=c,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Ye))&&(c=n[this._index],c.loaded&&(r=c.image.width,s=c.image.height,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s)),this.fill=c)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};C(zn,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),C(zn,"DefaultFrameRate",30);let Ao=zn;const dd={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(Q.Types.insert,e).unbind(Q.Types.remove,n),this._textures=new ui((t||[]).slice(0)),this._textures.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function Lp(){this._flagTextures=!0}function Dp(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Hp(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function ud(t){if(t instanceof Ye)return t;if(typeof t=="string")return new Ye(t)}const Ri=class Ri extends mr{constructor(n,r,s,o,a,l){super(r,s,0,0);C(this,"_flagTexture",!1);C(this,"_flagColumns",!1);C(this,"_flagRows",!1);C(this,"_flagFrameRate",!1);C(this,"_flagIndex",!1);C(this,"_amount",1);C(this,"_duration",0);C(this,"_startTime",0);C(this,"_playing",!1);C(this,"_firstFrame",0);C(this,"_lastFrame",0);C(this,"_loop",!0);C(this,"_texture",null);C(this,"_columns",1);C(this,"_rows",1);C(this,"_frameRate",0);C(this,"_index",0);C(this,"_origin",null);this._renderer.type="sprite";for(let c in hd)Object.defineProperty(this,c,hd[c]);this.noStroke(),this.noFill(),n instanceof Ye?this.texture=n:typeof n=="string"&&(this.texture=new Ye(n)),this.origin=new pe,this._update(),typeof o=="number"&&(this.columns=o),typeof a=="number"&&(this.rows=a),typeof l=="number"&&(this.frameRate=l),this.index=0}static fromObject(n){const r=new Ri().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ri.Properties.length;r++){const s=Ri.Properties[r];s in n&&(this[s]=n[s])}return this}play(n,r,s){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Pe.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof s=="function"?this._onLastFrame=s:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(n){const r=new Ri(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&r.play(this._firstFrame,this._lastFrame),r.loop=this.loop,r.firstFrame=this.firstFrame,r.lastFrame=this.lastFrame,n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="sprite",n.texture=this.texture.toObject(),n.columns=this.columns,n.rows=this.rows,n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const n=this._texture,r=this._columns,s=this._rows;let o,a,l,c,d,u,h,m,g;if(n&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=n),n.loaded)){h=n.image.width,m=n.image.height,o=h/r,a=m/s,c=this._amount,this.width!==o&&(this.width=o),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&(Pe.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=Pe.performance.now()-this._startTime,g=this._lastFrame+1,d=1e3*(g-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),u=Yt(this._firstFrame,g,l/d),u=Math.floor(u),u!==this._index&&(this._index=u,u>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const f=this._index%r,p=Math.floor(this._index/r),b=-o*f+(h-o)/2,y=-a*p+(m-a)/2;b!==n.offset.x&&(n.offset.x=b),y!==n.offset.y&&(n.offset.y=y)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};C(Ri,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let Mo=Ri;const hd={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},as=Math.min,ls=Math.max,rn=class rn extends Rn{constructor(n){super();C(this,"_flagAdditions",!1);C(this,"_flagSubtractions",!1);C(this,"_flagOrder",!1);C(this,"_flagOpacity",!0);C(this,"_flagBeginning",!1);C(this,"_flagEnding",!1);C(this,"_flagLength",!1);C(this,"_flagMask",!1);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_cap","round");C(this,"_join","round");C(this,"_miter",4);C(this,"_closed",!0);C(this,"_curved",!1);C(this,"_automatic",!0);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_length",0);C(this,"_mask",null);C(this,"_strokeAttenuation",!0);for(let r in fd)Object.defineProperty(this,r,fd[r]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(n)?n:Array.prototype.slice.call(arguments)}static InsertChildren(n){for(let r=0;r<n.length;r++)md.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)md.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new rn;for(let o=0;o<rn.Properties.length;o++){const a=rn.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:fi(n[a]):r[a]=n[a])}return"mask"in n&&(r.mask=s(n.mask)),"id"in n&&(r.id=n.id),r.children=n.children.map(s),r;function s(o){if(o&&o.renderer)switch(o.renderer.type){case"arc-segment":return vo.fromObject(o);case"circle":return Bo.fromObject(o);case"element":return hr.fromObject(o);case"ellipse":return $o.fromObject(o);case"group":return rn.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return Ao.fromObject(o);case"path":return Ne.fromObject(o);case"points":return os.fromObject(o);case"polygon":return Po.fromObject(o);case"rectangle":return mr.fromObject(o);case"rounded-rectangle":return No.fromObject(o);case"shape":return Rn.fromObject(o);case"sprite":return Mo.fromObject(o);case"star":return Eo.fromObject(o);case"text":return Yi.fromObject(o)}return o}}copy(n){super.copy.call(this,n),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let r=0;r<rn.Properties.length;r++){const s=rn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new rn,s=this.children.map(function(o){return o.clone()});return r.add(s),r.opacity=this.opacity,this.mask&&(r.mask=this.mask),r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.className=this.className,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="group",n.children=[],n.opacity=this.opacity,n.className=this.className,n.mask=this.mask?this.mask.toObject():null,Pe.each(this.children,(r,s)=>{n.children[s]=r.toObject()},this),n}dispose(){if(super.dispose(),this.children)for(let n=0;n<this.children.length;n++){const r=this.children[n];typeof r.dispose=="function"&&r.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const n=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const s=this.children[r];s.translation.x-=n.left,s.translation.y-=n.top}return this.mask&&(this.mask.translation.x-=n.left,this.mask.translation.y-=n.top),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.children.length;o++){const a=this.children[o];a.isShape&&(a.translation.x-=r,a.translation.y-=s)}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getById(n){let r=null;function s(o){if(o.id===n)return o;if(o.children){if(o.children.ids[n])return o.children.ids[n];for(let a=0;a<o.children.length;a++)if(r=s(o.children[a]),r)return r}return null}return s(this)}getByClassName(n){const r=[];function s(o){if(Array.prototype.indexOf.call(o.classList,n)>=0&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}getByType(n){const r=[];function s(o){if(o instanceof n&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}add(n){n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let r=0;r<n.length;r++){const s=n[r];if(!(s&&s.id))continue;const o=Array.prototype.indexOf.call(this.children,s);o>=0&&this.children.splice(o,1),this.children.push(s)}return this}remove(n){const r=arguments.length,s=this.parent;if(r<=0&&s)return s.remove(this),this;n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let o=0;o<n.length;o++){const a=n[o];if(!a||!this.children.ids[a.id])continue;const l=this.children.indexOf(a);l>=0&&this.children.splice(l,1)}return this}getBoundingClientRect(n){let r,s,o,a,l,c;this._update(!0);let d=1/0,u=-1/0,h=1/0,m=-1/0;const g=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let f=0;f<this.children.length;f++){const p=this.children[f];if(!(!p.visible||g.test(p._renderer.type))&&(r=p.getBoundingClientRect(n),o=typeof r.top!="number"||Pe.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Pe.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Pe.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Pe.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[b,y]=s.multiply(r.left,r.top),[_,S]=s.multiply(r.right,r.top),[v,T]=s.multiply(r.left,r.bottom),[R,w]=s.multiply(r.right,r.bottom);h=as(y,S,T,w,h),d=as(b,_,v,R,d),u=ls(b,_,v,R,u),m=ls(y,S,T,w,m)}else h=as(r.top,h),d=as(r.left,d),u=ls(r.right,u),m=ls(r.bottom,m)}return{top:h,left:d,right:u,bottom:m,width:u-d,height:m-h}}noFill(){return this.children.forEach(function(n){n.noFill()}),this}noStroke(){return this.children.forEach(function(n){n.noStroke()}),this}subdivide(){const n=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,n)}),this}_update(){let n,r,s;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=o*l,u=a*l;for(n=0;n<this.children.length;n++)s=this.children[n],r=s.length,d>c+r?(s.beginning=1,s.ending=1):u<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):u>c&&u<c+r?(s.beginning=0,s.ending=(u-c)/r):(s.beginning=0,s.ending=1),c+=r}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};C(rn,"Children",Jc),C(rn,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let $n=rn;const fd={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=$n.InsertChildren.bind(this),n=$n.RemoveChildren.bind(this),r=$n.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Jc(t),this._children.bind(Q.Types.insert,e),this._children.bind(Q.Types.remove,n),this._children.bind(Q.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Pe.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function md(t,e){const n=t.parent;let r;if(n===e){s();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),o()),e){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function s(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}class cs extends Ne{constructor(e,n,r,s){const o=[new Re(e,n),new Re(r,s)];super(o);for(let a in gd)Object.defineProperty(this,a,gd[a]);this.vertices[0].command=me.move,this.vertices[1].command=me.line,this.automatic=!1}}C(cs,"Properties",["left","right"]);const gd={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(Pe.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=me.move;else{const e=new ns("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(Pe.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=me.line;else{const e=new ns("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class Vo{constructor(e=0,n=0){this.x=e,this.y=n}}class bn{constructor(e=10,n=0,r="A"){C(this,"start",new Vo);C(this,"end",new Vo);this.width=e,this.angle=n,this.label=r}}const Le={line:{color:"#000",size:5},previewLine:{color:"#000",size:2},anchorPoint:{color:"#FF8000",size:12,strokeSize:20},lineLabel:{color:"#FF8000",size:22,rotation:-.5},angleLabel:{size:22,color:"#088c00",rotation:-.5},colorSideLabel:{size:20,color:"#439227"}},Wp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function jp(t,e){return i.openBlock(),i.createElementBlock("svg",Wp,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"},null,-1)])])}const ds=i.markRaw({name:"ion-close",render:jp}),qp={class:"mr-3 flex flex-col gap-2"},Xp=["onClick"],Yp={class:"h-full p-2"},Up={},Kp=i.defineComponent({...Up,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(t,{emit:e}){const n=t,r=i.ref(!1),s=i.useTemplateRef("drawing-template-containers"),o=i.useTemplateRef("drawing-custom-template-containers"),a=e,l=c=>{r.value=!0,a("remove-custom-template",c,()=>{r.value=!1})};return i.onMounted(()=>{var c,d;(c=n.settings.templates)==null||c.forEach((u,h)=>{var g;const m=(g=s.value)==null?void 0:g.at(h);m&&a("init-draw-template",m,u)}),(d=n.settings.customTemplates)==null||d.forEach((u,h)=>{var g;const m=(g=o.value)==null?void 0:g.at(h);m&&a("init-draw-template",m,u)})}),i.watch(()=>[...n.settings.customTemplates],(c,d)=>{i.nextTick(()=>{c.forEach((u,h)=>{var m;if(!(d!=null&&d.includes(u))){const g=(m=o.value)==null?void 0:m.at(h);g&&a("init-draw-template",g,u)}}),d.length>c.length&&d.forEach((u,h)=>{var g;const m=(g=o.value)==null?void 0:g.at(h);m&&(m.innerHTML="",a("init-draw-template",m,u))})})},{deep:!0}),(c,d)=>{const u=ds;return i.openBlock(),i.createBlock(i.unref(L.NScrollbar),{style:{width:"auto"},trigger:"none",class:"max-h-[19rem] md:max-h-[40rem] w-auto"},{default:i.withCtx(()=>[i.createElementVNode("div",qp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.settings.allTemplates,(h,m)=>(i.openBlock(),i.createElementBlock("div",{key:`${h.id}-${m}`,class:"group relative"},[i.createVNode(i.unref(L.NPopover),{trigger:"hover",placement:"right"},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":m===t.selectTemplateIndex}]),onClick:g=>a("template:select",m)},[i.createElementVNode("div",Yp,[i.createElementVNode("div",{ref_for:!0,ref:h.isCustom&&h.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Xp)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.label),1)]),_:2},1024),h.isCustom&&!h.isNewRec()?(i.openBlock(),i.createBlock(i.unref(L.NButton),{key:0,size:"tiny",quaternary:"",loading:r.value,disabled:r.value,circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:g=>l(m)},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["loading","disabled","onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),pd=Wn(Kp,[["__scopeId","data-v-afccb364"]]),Gp={class:"flex gap-3 min-w-[20rem] relative"},Zp={class:"kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},Qp={ref:"drawing-container",class:"size-full"},Jp={},yd=i.defineComponent({...Jp,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select","remove-custom-template"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,u=i.computed(()=>n.value.configuratorParams.linesAngles.map((I,z)=>new bn(n.value.configuratorParams.linesWidths[z],I,`A-${z+1}`))),h=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),m=i.computed(()=>{var I,z;return n.value.configuratorParams.startTailType&&((I=n.settings.startTailConfigs)!=null&&I[n.value.configuratorParams.startTailType])?(z=n.settings.startTailConfigs)==null?void 0:z[n.value.configuratorParams.startTailType].points:[]}),g=i.computed(()=>{var z;const I=n.value.configuratorParams.endTailType!==void 0&&((z=n.settings.endTailConfigs)==null?void 0:z[n.value.configuratorParams.endTailType]);return!I||!I.points?[]:I.points.map((q,W)=>Array.isArray(q)?new bn(q[0],q[1],`A-${W+1}`):new bn(q.width,q.angle,`A-${W+1}`))}),f=(I,z=!1)=>{I[0].start.x=0,I[0].start.y=0;let q=0;for(let W=0;W<I.length;W++){const O=I[W],D=I[W-1]??new bn(0,q);q+=!z||W>1?D.angle:0;const j=(!z||W>0?O.angle:0)+q;if(I[W].end.x=O.width*Math.cos(j*Math.PI/180)+I[W].start.x,I[W].end.y=O.width*Math.sin(j*Math.PI/180)+I[W].start.y,W<I.length-1){const G=W+1;I[G].start.x=I[W].end.x,I[G].start.y=I[W].end.y}}return I},p=(I,z,q,W,O=!1)=>{let D=f([...q,...W]);z.length>0&&(D=[...f(z),...D]);let j=0,G=0,ue=0,oe=0;D.forEach(Fe=>{j=Math.min(j,Fe.start.x,Fe.end.x),G=Math.min(G,Fe.start.y,Fe.end.y),ue=Math.max(ue,Fe.start.x,Fe.end.x),oe=Math.max(oe,Fe.start.y,Fe.end.y)});let re,Ee;j===0&&G===0&&ue===0&&oe===0?(re=1,Ee=1):(re=I.width/Math.abs(ue-j),Ee=(O?I.height:I.height-Le.colorSideLabel.size)/Math.abs(oe-G));const We=Math.min(re,Ee);return j=j<0?-j*We:0,G=G<0?-G*We:0,[We,j,G]},b=I=>{const z=new os([I]);return z._size=Le.anchorPoint.size,z.fill=Le.anchorPoint.color,z.stroke="transparent",z._linewidth=Le.anchorPoint.strokeSize,l.push(z),z},y=(I,z)=>{if(l=[],n.settings.allowChangeFirstPoint){const q=I[0],W=new pe(q.vertices[0].x,q.vertices[0].y);W.bind(Q.Types.change,()=>{q.vertices[0].copy(W)});const O=b(W);z.add(O)}I.forEach((q,W)=>{const O=I[W+1],D=new pe(q.vertices[1].x,q.vertices[1].y);D.bind(Q.Types.change,()=>{q.vertices[1].copy(D),O!==void 0&&O.vertices[0].copy(D)});const j=b(D);z.add(j)})},_=I=>I*(Math.PI/180),S=(I,z,q)=>{const W=z.vertices.length-1;I.position.x=z.vertices[W].x,I.position.y=z.vertices[W].y;const O=Math.atan2(z.vertices[W].y-z.vertices[0].y,z.vertices[W].x-z.vertices[0].x);I.rotation=_(q)+O},v=(I,z,q)=>{if(z.vertices[0]===void 0)return;I.position.x=z.vertices[0].x,I.position.y=z.vertices[0].y;const W=z.vertices.length-1,O=Math.atan2(z.vertices[W].y-z.vertices[0].y,z.vertices[W].x-z.vertices[0].x);I.rotation=_(q)+O},T=(I,z,q)=>{const W=new $n;if(I.length===0)return W;const O=[];return[...I].reverse().forEach((D,j)=>{j!==0&&D.angle>0&&(D.angle*=-1),O.push(D)}),I=f(O,!0),v(W,z,I[0].angle),[z.vertices[0],z.vertices[1]].forEach(D=>{D.bind(Q.Types.change,()=>{v(W,z,I[0].angle)})}),I.forEach(D=>{const j=D.start.x*q,G=D.end.x*q,ue=D.start.y*q,oe=D.end.y*q,re=new cs(j,ue,G,oe);re.linewidth=Le.line.size,re.stroke=Le.line.color,W.add(re)}),W},R=(I,z,q)=>{const W=new $n;return I.length===0||(I=f(I,!0),S(W,z,I[0].angle),[z.vertices[0],z.vertices[1]].forEach(O=>{O.bind(Q.Types.change,()=>{S(W,z,I[0].angle)})}),I.forEach(O=>{const D=O.start.x*q,j=O.end.x*q,G=O.start.y*q,ue=O.end.y*q,oe=new cs(D,G,j,ue);oe.linewidth=Le.line.size,oe.stroke=Le.line.color,W.add(oe)})),W},w=(I,z,q,W)=>{const O=z.vertices[0].x+(z.vertices[1].x-z.vertices[0].x)/2-8*Math.sin(I.angle*Math.PI/180),D=z.vertices[0].y+(z.vertices[1].y-z.vertices[0].y)/2-8*Math.cos(I.angle*Math.PI/180),j=new Yi(I.label,O+10,D-10);let G;j.size=Le.lineLabel.size,j.weight=600,j.fill=Le.lineLabel.color,j.id+=1,j.rotation=Le.lineLabel.rotation,W>0&&(G=new Yi(`${I.angle}°`,z.vertices[0].x+25,z.vertices[0].y-25),G.size=Le.angleLabel.size,G.weight=600,G.fill=Le.angleLabel.color,G.rotation=Le.angleLabel.rotation,G.id+=W,o.push(G),q.add(G)),q.add(j),x(j,z,0,G),x(j,z,1)},B=()=>{const{size:I}=Le.colorSideLabel,z=0,q=0,W=h.value?I/2:I/2-I,O=h.value?I/2-I:I/2,D=new $n;if(!c)return D;const j=5,G=Math.atan2(O-W,q-z),ue=[new Re(z,W,0,0,0,0,gn.Commands.move),new Re(q,O,0,0,0,0,gn.Commands.line),new Re(q-j*Math.cos(G-Math.PI/4),O-j*Math.sin(G-Math.PI/4),0,0,0,0,gn.Commands.line),new Re(q,O,0,0,0,0,gn.Commands.move),new Re(q-j*Math.cos(G+Math.PI/4),O-j*Math.sin(G+Math.PI/4),0,0,0,0,gn.Commands.line)],oe=new Ne(ue,!1,!1,!0);oe.noFill(),oe.cap="round",oe.join="round",oe.linewidth=I/7,oe.stroke=Le.colorSideLabel.color,D.add(oe);const re=new Yi(h.value?"Цвет снизу":"Цвет сверху",10,0);re.size=I,re.weight=600,re.fill=Le.colorSideLabel.color,re.alignment="left",D.add(re);const Ee=D.getBoundingClientRect();return D.position.x=(c.width-Ee.width)*d+10,D.position.y=h.value?c.height+Ee.height*2:Ee.height/2,D},x=(I,z,q,W)=>{z.vertices[q].bind(Q.Types.change,()=>{const O=z.vertices.length-1,D=Math.atan2(z.vertices[0].y-z.vertices[O].y,z.vertices[0].x-z.vertices[O].x)*180/Math.PI,j=z.vertices[0].x+(z.vertices[O].x-z.vertices[0].x)/2-8*Math.sin(D*Math.PI/180),G=z.vertices[0].y+(z.vertices[O].y-z.vertices[0].y)/2-8*Math.cos(D*Math.PI/180);I.position.x=j+10,I.position.y=G-10,I.rotation=-.5,W&&(W.position.x=z.vertices[0].x+25,W.position.y=z.vertices[0].y-25)})},$=(I,z,q,W,O=!1)=>{var Gt;if(I.clear(),q.length===0){I.update();return}const D=f(q),[j,G,ue]=p(I,z,D,W,O),oe=new $n,re=new Array,Ee=new Array;O||(o=[],a=[]),D.forEach((Te,sn)=>{const on=Te.start.x*j+G,Rt=Te.end.x*j+G,Lt=Te.start.y*j+ue,an=Te.end.y*j+ue,wt=new cs(on,Lt,Rt,an);wt.linewidth=O?Le.previewLine.size:Le.line.size,wt.stroke=O?Le.previewLine.color:Le.line.color,a.push(wt),re.push(wt),oe.add(wt),!O&&Te.label!==""&&w(Te,wt,oe,sn)});const We=re.at(-1);let Fe=oe.getBoundingClientRect();if(!O){const Te=B();Ee.push(Te)}if(z.length>0){const Te=T(z,re[0],j);oe.add(Te)}if(W.length>0&&We){const Te=R(W,We,j);oe.add(Te)}if(Ee.push(oe),I.makeGroup(Ee),Fe=oe.getBoundingClientRect(),oe.position.x=0-Fe.left+(I.width-Fe.width)/(2*(O?1:d)),oe.position.y=0-Fe.top+(I.height-Fe.height)/(2*(O?1:d)),I.update(),!O){const Te=((Gt=n.value.configuratorParams)==null?void 0:Gt.colorSide)==="top";oe.position.y=oe.position.y+Le.colorSideLabel.size*Number(Te),y(re,oe),I.update()}},P=(I,z)=>{if(I&&!z.isNewRec()){const q=new gn({width:I.scrollWidth,height:I.scrollHeight});q.appendTo(I),$(q,[],z.points,[],!0)}},A=()=>{c&&$(c,m.value,u.value,g.value,!1)},V=I=>I*(180/Math.PI),F=(I,z)=>{const q=I[1].x-I[0].x,W=I[1].y-I[0].y,O=z[1].x-z[0].x,D=z[1].y-z[0].y;let j=Math.atan2(q*D-W*O,q*O+W*D);return j=V(j),Math.round(j)*-1},N=I=>{const z=a.map((q,W,O)=>{const D=O[W-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let j=Math.ceil(q._length/I/n.settings.lineWidthStep)*n.settings.lineWidthStep;const G=o[W-1];j<(O.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(j=O.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),j>n.settings.maxLineWidth&&(j=n.settings.maxLineWidth);const ue=F(q.vertices,D.vertices);return G&&(G.value=`${ue}°`),new bn(j,ue,`A-${W+1}`)});r("pointer:move",z)},Y=I=>{let z=null,q;const W=G=>{z=l.find(ue=>{const oe=ue.renderer;return(oe==null?void 0:oe.elem)===G.target}),[q]=p(I,m.value,u.value.map(ue=>ue),g.value)},O=G=>{if(z){const ue=z.renderer,oe=ue==null?void 0:ue.elem;if(!oe)return;const re=oe.getBoundingClientRect();z.vertices[0].x-=re.x-(G instanceof MouseEvent?G.clientX:G.targetTouches[0].clientX)+Le.anchorPoint.size/2,z.vertices[0].y-=re.y-(G instanceof MouseEvent?G.clientY:G.targetTouches[0].clientY)+Le.anchorPoint.size/2,N(q),I.update()}},D=()=>{z&&r("pointer:up",u.value),z=null},j=s.value;j&&(j.addEventListener("touchstart",W,{passive:!0}),j.addEventListener("touchend",D,{passive:!0}),j.addEventListener("mousedown",W),j.addEventListener("mouseup",D),j.addEventListener("mousemove",O),j.addEventListener("touchmove",O,{passive:!0}))},ee=(I,z)=>{r("remove-custom-template",I,z)};return i.onMounted(()=>{s.value&&(c=new gn({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{A()},{deep:!0,immediate:!0}),Y(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(I,z)=>(i.openBlock(),i.createElementBlock("div",Gp,[i.createVNode(pd,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":z[0]||(z[0]=q=>r("template:select",q)),onInitDrawTemplate:P,onRemoveCustomTemplate:ee},null,8,["select-template-index","settings"]),i.createElementVNode("div",Zp,[i.createElementVNode("div",Qp,null,512)])]))}});class Ui extends Z.Identity{constructor(n,r){super();C(this,"label","");C(this,"points",[]);C(this,"isCustom",!1);C(this,"id",-1);C(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>M.isArray(s)?new bn(s[0],s[1],`A-${o+1}`):new bn(s.width,s.angle,`A-${o+1}`)),this.isCustom=n.isCustom):(this.label="-- Новая конфигурация --",this.points=[new bn(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class Io extends Ui{constructor(n){super(n);C(this,"isDefault");this.isDefault=n.isDefault??!1}}class bd{constructor(e){C(this,"minLineWidth");C(this,"maxLineWidth");C(this,"lineWidthStep");C(this,"minLineAngle");C(this,"maxLineAngle");C(this,"lineAngleStep");C(this,"stripMinWidth");C(this,"stripMaxWidth");C(this,"stripMinLength");C(this,"stripMaxLength");C(this,"allowShowTable");C(this,"showOnlyTemplates");C(this,"templates");C(this,"customTemplates",[]);C(this,"startTailConfigs");C(this,"endTailConfigs");C(this,"bendCountForExtended");C(this,"extendedProductCatalog");C(this,"allowChangeFirstPoint");C(this,"allowSaveTemplates");C(this,"userTemplatesPrefix");C(this,"lengthStep");C(this,"canSetDopProdaga");var n,r;this.minLineWidth=e.minLineWidth,this.maxLineWidth=e.maxLineWidth,this.lineWidthStep=e.lineWidthStep,this.minLineAngle=e.minLineAngle,this.maxLineAngle=e.maxLineAngle,this.lineAngleStep=e.lineAngleStep,this.stripMinWidth=e.stripMinWidth,this.stripMaxWidth=e.stripMaxWidth,this.stripMinLength=e.stripMinLength,this.stripMaxLength=e.stripMaxLength,this.allowShowTable=e.allowShowTable,this.showOnlyTemplates=e.showOnlyTemplates,this.templates=e.templates.map(s=>new Ui(s)),this.templates.forEach((s,o)=>{s.id=o}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(s=>new Io(s)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(s=>new Io(s)))??[],this.bendCountForExtended=e.bendCountForExtended,this.extendedProductCatalog=e.extendedProductCatalog,this.allowChangeFirstPoint=e.allowChangeFirstPoint,this.allowSaveTemplates=e.allowSaveTemplates,this.userTemplatesPrefix=e.userTemplatesPrefix,this.lengthStep=e.lengthStep,this.canSetDopProdaga=e.canSetDopProdaga,this.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).filter(([,s])=>s.id!==-1).map(([s,o])=>{const a=new Ui(o);return a.isCustom=!0,a.id=+s,a}):[],this.customTemplates.some(s=>s.isCustom&&s.isNewRec())||this.customTemplates.push(new Ui({label:"-- Новая конфигурация --",points:[new bn(this.stripMinWidth,0,"A-1")],isCustom:!0,id:-1,guid:""})))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findLast(s=>!s.isNewRec()),r=new Ui(e);r.isCustom=!0,r.id=n?n.id+1:0,this.customTemplates.splice(-1,0,r)}removeCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===e);n!==-1&&this.customTemplates.splice(n,1)}}const ey={class:"flex flex-col gap-3"},ty={class:"grid gap-5 md:grid-cols-5"},ny={},_d=i.defineComponent({...ny,__name:"kozyrek-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref(new bd(n.settings)),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),u=i.ref({quantity:{},marker:{},length:{}}),h=i.ref(0),m=i.useTemplateRef("kozyrek-configurator-params-form"),g=(x=0)=>{var P;const $=(P=c.value.allTemplates)==null?void 0:P.at(x);$!==void 0&&(h.value=x,l.value.configuratorParams.linesWidths=$.points.map(A=>M.isArray(A)?A[0]:A.width),l.value.configuratorParams.linesAngles=$.points.map(A=>M.isArray(A)?A[1]:A.angle),S()),y(l.value.configuratorParams)},f=async()=>{const x=prompt("Введите название шаблона:");if(!x)return;a.value=!0;const $={label:x,points:l.value.configuratorParams.linesWidths.map((A,V)=>[A,l.value.configuratorParams.linesAngles[V]])},P=A=>{A&&(c.value.addCustomTemplate($),h.value=c.value.allTemplates.length-2),a.value=!1};n.eventEmitter.emit("configurator:create-template",{category:n.cartItem.category,template:$,callback:P})},p=async(x,$)=>{var V;const P=(V=c.value.allTemplates)==null?void 0:V.at(x);if(!P||!P.isCustom)return;const A=F=>{F&&(c.value.removeCustomTemplate(P.id),g()),$==null||$()};n.eventEmitter.emit("configurator:remove-template",{category:n.cartItem.category,templateId:P.id,callback:A})},b=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(h.value=c.value.allTemplates.length-1)},y=async x=>{var $,P;l.value.product=new Z.ClientProduct,(P=($=m.value)==null?void 0:$.formReference)==null||P.validate(A=>{A||(S(),s.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:x,validationFieldResultData:u.value,callback:V=>{V?l.value.product=V:u.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},s.value=!1}}))}).catch(M.noop)},_=async()=>{var x,$;($=(x=m.value)==null?void 0:x.formReference)==null||$.validate(P=>{P||(o.value=!0,r("submit",l.value,u.value,()=>{o.value=!1,i.nextTick(()=>{var A,V;(V=(A=m.value)==null?void 0:A.formReference)==null||V.restoreValidation()})}))}).catch(M.noop)},S=()=>{const x={quantity:u.value.quantity,marker:u.value.marker};l.value.configuratorParams.linesWidths.forEach(($,P)=>{x[`lines_widths[${P+1}]`]={},x[`lines_angles[${P+1}]`]={}}),u.value=x},v=x=>{d.value.linesWidths=x.map($=>$.width),d.value.linesAngles=x.map($=>$.angle)},T=x=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,S(),b(),y(l.value.configuratorParams)},R=(x,$)=>{d.value.linesWidths=x,d.value.linesAngles=$},w=x=>{const $=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,P=0;l.value.configuratorParams.linesWidths.splice(x+1,0,$),l.value.configuratorParams.linesAngles.splice(x+1,0,P),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],S(),b(),y(l.value.configuratorParams)},B=x=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(x,1),l.value.configuratorParams.linesAngles.splice(x,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],S(),b(),y(l.value.configuratorParams))};return i.onBeforeMount(()=>{g()}),i.watch(()=>n.cartItem,x=>{l.value=new Z.OrderItemBase(x),g()}),(x,$)=>{const P=L.NButton;return i.openBlock(),i.createElementBlock("div",ey,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(P,{key:0,type:"tertiary",class:"self-end",onClick:$[0]||($[0]=A=>r("click:view-switch"))},{default:i.withCtx(()=>[...$[3]||($[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",ty,[i.createVNode(yd,{value:l.value,"select-template-index":h.value,settings:c.value,class:"h-fit col-span-3","onPointer:up":T,"onPointer:move":v,"onTemplate:select":g,onRemoveCustomTemplate:p},null,8,["value","select-template-index","settings"]),i.createVNode(il,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":$[1]||($[1]=A=>l.value=A),"preview-params":d.value,validation:u.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":h.value,class:"col-span-2","onUpdate:params":$[2]||($[2]=A=>y(A)),"onUpdate:preview":R,onSubmit:_,"onClick:saveTemplate":f,"onClick:addLine":w,"onClick:removeLine":B},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])])}}}),iy={class:"flex flex-col items-center justify-between rounded-xl"},ry={class:"img-preview relative flex justify-center"},sy={},oy=i.defineComponent({...sy,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(t,{emit:e}){const n=t,r=i.computed(()=>{const{height:o}=n.configuratorParams,a=M.keys(n.settings.crossbarCount).reverse().find(l=>{const c=n.settings.crossbarCount[Number(l)];return o>=c});if(a!==void 0)return String(Number(a)+1)}),s=e;return(o,a)=>{const l=L.NButton;return i.openBlock(),i.createElementBlock("div",iy,[i.createElementVNode("div",ry,[a[1]||(a[1]=i.createElementVNode("div",{class:"window"},null,-1)),i.createElementVNode("div",{class:i.normalizeClass(["net",`net-${t.configuratorParams.netType}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["frame",`frame-${t.configuratorParams.color}`])},null,2),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${t.configuratorParams.color}`])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["mount",`mount-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["cut-preview",`cut-preview-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2)]),i.createVNode(l,{type:"primary",class:"block justify-self-center",onClick:a[0]||(a[0]=c=>s("open-instructions"))},{default:i.withCtx(()=>[...a[2]||(a[2]=[i.createTextVNode(" Руководство по замеру ",-1)])]),_:1})])}}}),Oo=Wn(oy,[["__scopeId","data-v-a67fd61e"]]),ay={key:0,class:"flex items-baseline gap-1"},ly={key:0,class:"flex items-baseline gap-1"},cy={key:1},dy={class:"text-lg font-semibold"},uy={key:2,class:"text-red-500 text-sm mb-2"},hy={class:"flex gap-3"},fy={},wd=i.defineComponent({...fy,__name:"mosquito-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:instructions-toggle","click:show-preview-drawer"],setup(t,{expose:e,emit:n}){var w;const r=t,s=n,o=i.computed(()=>xt.isPhoneDevice()),a=i.useTemplateRef("form-reference"),l=i.useTemplateRef("width-form-item-reference"),c=i.useTemplateRef("height-form-item-reference"),d=i.useTemplateRef("width-input-reference"),u=i.ref(M.cloneDeep(r.value)),h=i.computed(()=>r.settings.widthOverlaps[u.value.configuratorParams.mountType]??0),m=i.computed(()=>r.settings.heightOverlaps[u.value.configuratorParams.mountType]??0),g=i.computed(()=>r.settings.maxWidths[u.value.configuratorParams.netType]),f=i.computed(()=>r.settings.maxHeights[u.value.configuratorParams.netType]),p=i.computed(()=>u.value.configuratorParams.width?u.value.configuratorParams.width+h.value:0),b=i.computed(()=>u.value.configuratorParams.height?u.value.configuratorParams.height+m.value:0),y=i.ref(r.settings.canSetDopProdaga??!1),_=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth-h.value),ae.max(g.value-h.value),ae.step(1),De.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[ae.required,ae.min(r.settings.minHeight-m.value),ae.max(f.value-m.value),ae.step(1),De.serverValidation(r.validation.height.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),De.serverValidation(r.validation.quantity.feedback)],marker:[De.serverValidation(r.validation.marker.feedback)]})),S=i.computed(()=>{var V;const B=p.value,x=b.value,{quantity:$}=r.value,P=((V=r.value.product)==null?void 0:V.costRub)||0;if(!B||!x||!$||P===0)return null;const A=B*x/1e6;return(P*$*A).toLocaleString("ru-ru",{minimumFractionDigits:2})}),v=i.computed(()=>{const B=p.value,x=b.value,$=!!(B&&B>=r.settings.minWidth&&B<=r.settings.maxWidths[u.value.configuratorParams.netType]),P=!!(x&&x>=r.settings.minHeight&&x<=r.settings.maxHeights[u.value.configuratorParams.netType]),A=!!(r.value.quantity&&r.value.quantity>0);return $&&P&&A}),T=(B,x)=>{var A,V;const $=u.value.configuratorParams;B&&B in $&&($[B]=x);const P={...$,width:p.value??0,height:b.value??0};B==="width"&&((A=l.value)==null||A.validate().catch(M.noop)),B==="height"&&((V=c.value)==null||V.validate().catch(M.noop)),i.nextTick(()=>{var N,Y;!((N=l.value)!=null&&N.validationErrored)&&!((Y=c.value)!=null&&Y.validationErrored)&&P.height&&P.width&&s("update:params",P),R("configuratorParams",P)})},R=(B,x)=>{const $=new Z.OrderItemBase(r.value);$[B]=x,B==="configuratorParams"&&($.product=new Z.ClientProduct),s("update:value",$)};return i.watch(()=>r.value,B=>{const x=M.cloneDeep(i.toRaw(B)),$=x.configuratorParams.mountType,P=r.settings.widthOverlaps[$]??0,A=r.settings.heightOverlaps[$]??0;x.configuratorParams.width&&x.configuratorParams.width>0&&(x.configuratorParams.width-=P),x.configuratorParams.height&&x.configuratorParams.height>0&&(x.configuratorParams.height-=A),u.value=x},{deep:!0}),i.onMounted(()=>{var B;(B=d.value)==null||B.select()}),e({validate:(w=a.value)==null?void 0:w.validate,formReference:a}),(B,x)=>{const $=L.NCheckbox;return i.openBlock(),i.createBlock(i.unref(L.NForm),{ref:"form-reference",model:u.value,rules:_.value,class:"flex flex-col gap-2 px-4 md:max-w-96 sc-hide-empty-feedback-message",onKeydown:x[25]||(x[25]=i.withKeys(i.withModifiers(P=>s("submit",u.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NSelect),{value:u.value.configuratorParams.netType,"onUpdate:value":[x[0]||(x[0]=P=>u.value.configuratorParams.netType=P),x[1]||(x[1]=P=>T("netType",P))],options:t.settings.netType.map(P=>({label:t.settings.descriptions.net_type[P],value:P}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(L.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NSelect),{value:u.value.configuratorParams.color,"onUpdate:value":[x[2]||(x[2]=P=>u.value.configuratorParams.color=P),x[3]||(x[3]=P=>T("color",P))],options:t.settings.color.map(P=>({label:t.settings.descriptions.color[P],value:P}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(L.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NSelect),{value:u.value.configuratorParams.mountType,"onUpdate:value":[x[4]||(x[4]=P=>u.value.configuratorParams.mountType=P),x[5]||(x[5]=P=>T("mountType",P))],options:t.settings.mountType.map(P=>({label:t.settings.descriptions.mount_type[P],value:P}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(L.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-h.value} ${g.value?" до "+(g.value-h.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&p.value>=t.settings.minWidth&&p.value<=t.settings.maxWidths[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",ay,[i.createVNode(i.unref(L.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(p.value),1)]),_:1}),i.createVNode(i.unref(L.NButton),{quaternary:"",type:"info",size:"tiny",onClick:x[10]||(x[10]=P=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...x[26]||(x[26]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{ref:"width-input-reference",value:u.value.configuratorParams.width,"onUpdate:value":[x[6]||(x[6]=P=>u.value.configuratorParams.width=P),x[9]||(x[9]=P=>T("width",P))],parse:i.unref(Pt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:x[7]||(x[7]=P=>i.unref(st)(P)),onInput:x[8]||(x[8]=P=>i.unref(Oe)(t.validation,"width")),onFocus:i.unref(ze)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(L.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-m.value} ${f.value?" до "+(f.value-m.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&b.value>=t.settings.minHeight&&b.value<=t.settings.maxHeights[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",ly,[i.createVNode(i.unref(L.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(b.value),1)]),_:1}),i.createVNode(i.unref(L.NButton),{quaternary:"",type:"info",size:"tiny",onClick:x[15]||(x[15]=P=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...x[27]||(x[27]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:u.value.configuratorParams.height,"onUpdate:value":[x[11]||(x[11]=P=>u.value.configuratorParams.height=P),x[14]||(x[14]=P=>T("height",P))],parse:i.unref(Pt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:x[12]||(x[12]=P=>i.unref(st)(P)),onInput:x[13]||(x[13]=P=>i.unref(Oe)(t.validation,"height")),onFocus:i.unref(ze)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(L.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:u.value.quantity,"onUpdate:value":[x[16]||(x[16]=P=>u.value.quantity=P),x[19]||(x[19]=P=>R("quantity",P??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:x[17]||(x[17]=P=>i.unref(st)(P,!1)),onInput:x[18]||(x[18]=P=>i.unref(Oe)(t.validation,"quantity")),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(L.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:x[20]||(x[20]=P=>i.unref(Oe)(t.validation,"marker")),"onUpdate:value":x[21]||(x[21]=P=>{u.value.marker=P??null,R("marker",P??null)}),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),y.value?(i.openBlock(),i.createBlock($,{key:0,checked:u.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":x[22]||(x[22]=P=>{u.value.isAdditionalSale=P??!1,R("isAdditionalSale",P??!1)})},{default:i.withCtx(()=>[...x[28]||(x[28]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(lr,{"is-product-searching":t.isProductSearching,product:u.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),S.value?(i.openBlock(),i.createElementBlock("div",cy,[x[29]||(x[29]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",dy,i.toDisplayString(S.value)+" ₽",1)])):i.createCommentVNode("",!0),v.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",uy," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",hy,[i.createVNode(i.unref(L.NButton),{loading:t.isSubmitProcessing,disabled:!v.value||u.value.product.isNewRec(),type:"primary",class:"self-start",onClick:x[23]||(x[23]=P=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),o.value?(i.openBlock(),i.createBlock(i.unref(L.NButton),{key:0,type:"default",onClick:x[24]||(x[24]=P=>s("click:show-preview-drawer"))},{default:i.withCtx(()=>[...x[30]||(x[30]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["model","rules"])}}}),my="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",gy="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",py="/img/configurators/mosquitto/measurement-instructions/mount.png",yy="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",by="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",_y={class:"flex flex-col gap-6"},wy={class:"flex gap-4"},xy={class:"flex flex-col gap-2"},ky={class:"flex gap-4"},vy={class:"flex flex-col gap-2"},Cy={class:"flex gap-4"},Sy={class:"flex flex-col gap-2"},By={},xd=i.defineComponent({...By,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=xt.initRefDependingOnDeviceResolution("small","small","medium"),r=xt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=e;return(a,l)=>{const c=L.NText;return i.openBlock(),i.createBlock(i.unref(L.NModal),{show:t.show,"show-icon":!1,size:i.unref(n),style:i.normalizeStyle(`width: ${s.value}px`),title:"Руководство по замеру","action-class":"grid grid-cols-2 !justify-between",preset:"dialog",onClose:l[0]||(l[0]=d=>o("update:show",!1)),onEsc:l[1]||(l[1]=d=>o("update:show",!1)),onMaskClick:l[2]||(l[2]=d=>o("update:show",!1))},{default:i.withCtx(()=>[i.createElementVNode("div",_y,[i.createVNode(c,{type:"error",class:"text-base font-medium"},{default:i.withCtx(()=>[...l[3]||(l[3]=[i.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ",-1)])]),_:1}),l[22]||(l[22]=i.createElementVNode("div",{class:"grid gap-6 md:grid-cols-2"},[i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:my,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер ширины"),i.createElementVNode("span",null,"Замерить по ширине световой проем оконной рамы. Размер учитывать c точностью до 1 мм")])]),i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:gy,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер высоты"),i.createElementVNode("span",null,"Замерить по высоте световой проем оконной рамы. Размер учитывать с точностью до 1 мм")])])],-1)),i.createElementVNode("div",wy,[l[9]||(l[9]=i.createElementVNode("img",{src:py,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",xy,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.frame)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=i.createElementVNode("br",null,null,-1)),l[7]||(l[7]=i.createTextVNode(" Крепления находятся на раме сетки. ",-1))])])]),i.createElementVNode("div",ky,[l[15]||(l[15]=i.createElementVNode("img",{src:yy,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",vy,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:",-1)),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=i.createElementVNode("br",null,null,-1)),l[13]||(l[13]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])]),i.createElementVNode("div",Cy,[l[21]||(l[21]=i.createElementVNode("img",{src:by,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Sy,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_metal)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=i.createElementVNode("br",null,null,-1)),l[19]||(l[19]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])])])]),_:1},8,["show","size","style"])}}}),Ty={class:"grid md:grid-cols-2"},Ry={},kd=i.defineComponent({...Ry,__name:"mosquito-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>xt.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.useTemplateRef("mosquito-configurator-form"),d=i.ref({width:{},height:{},quantity:{},marker:{}}),u=i.ref(!1),h=i.ref(!1),m=i.computed(()=>i.inject("debounce-input-time",300)),g=M.debounce(async p=>{var b,y;l.value.product=new Z.ClientProduct,(y=(b=c.value)==null?void 0:b.formReference)==null||y.validate(_=>{_||(u.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:p,validationFieldResultData:d.value,callback:S=>{S?l.value.product=S:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},u.value=!1}}))}).catch(M.noop)},m.value),f=()=>{h.value=!0,r("submit",l.value,d.value,()=>{h.value=!1})};return i.watch(()=>n.cartItem,p=>{l.value=p},{deep:!0}),(p,b)=>{const y=ds;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(xd,{show:a.value,"onUpdate:show":b[0]||(b[0]=_=>a.value=_),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",Ty,[s.value?(i.openBlock(),i.createBlock(i.unref(L.NDrawer),{key:1,show:o.value,"onUpdate:show":b[4]||(b[4]=_=>o.value=_),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(L.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:b[2]||(b[2]=_=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(y)]),_:1})]),default:i.withCtx(()=>[i.createVNode(Oo,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:b[3]||(b[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(Oo,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:b[1]||(b[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(wd,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":b[5]||(b[5]=_=>l.value=_),validation:d.value,settings:t.settings,"is-product-searching":u.value,"is-submit-processing":h.value,"onUpdate:params":b[6]||(b[6]=_=>i.unref(g)(_)),onSubmit:b[7]||(b[7]=_=>f()),"onClick:instructionsToggle":b[8]||(b[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":b[9]||(b[9]=_=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),$y={},vd=i.defineComponent({...$y,__name:"strip-configurator-line-item",props:{value:{},index:{},path:{},settings:{},product:{default:void 0},addLineButtonDisabled:{type:Boolean,default:!1},removeLineButtonDisabled:{type:Boolean,default:!1},suggestionOption:{default:void 0},autoFocus:{type:Boolean,default:!1},validation:{}},emits:["update:value","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.useTemplateRef("width-input-element"),a=i.ref(!1),l=i.ref(r.value),c=i.useTemplateRef("form-item-reference"),d=i.computed(()=>{var m;return!((m=c.value)!=null&&m.validationErrored)}),u=m=>{l.value=m,s("update:value",m,r.index,a)},h=()=>{var m;(m=o.value)==null||m.select()};return i.watch(()=>r.value,m=>{l.value=m}),i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{h()})}),e({isValid:d,formItemReference:c}),(m,g)=>{const f=nl,p=Ds;return i.openBlock(),i.createBlock(i.unref(L.NFormItem),{ref:"form-item-reference",path:t.path,label:`Полоса №${t.index+1}, мм`,class:"sc-hide-empty-feedback-message"},{feedback:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(lr,{key:0,"is-product-searching":a.value,product:t.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(L.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:u},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:i.unref(Pt),placeholder:"Введите ширину",onKeydown:g[0]||(g[0]=b=>i.unref(st)(b)),onInput:g[1]||(g[1]=b=>i.unref(Oe)(t.validation,`linesWidths.${t.index}`)),onFocus:i.unref(ze),"onUpdate:value":u},null,8,["value","parse","onFocus"])]),_:1},8,["options"]),i.createVNode(i.unref(L.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:g[2]||(g[2]=b=>s("click:add-line",t.index))},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"]),i.createVNode(i.unref(L.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:g[3]||(g[3]=b=>s("click:remove-line",t.index))},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),_:1},8,["path","label"])}}}),Py={class:"my-2 flex w-full flex-col"},Ny={key:1},Ey={class:"text-lg font-semibold"},Fy={class:"flex gap-3"},Ay={},Cd=i.defineComponent({...Ay,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){var _;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("line-items-reference"),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>{const S={length:[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(r.settings.lengthStep),De.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),De.serverValidation(r.validation.quantity.feedback)],marker:[De.serverValidation(r.validation.marker.feedback)]};return M.forEach(l.value,(v,T)=>{var R;S[`configuratorParams.linesWidths.${T}`]=[ae.required,ae.min(r.settings.minLineWidth),ae.step(r.settings.lineWidthStep),De.serverValidation((R=r.validation[`linesWidths.${T}`])==null?void 0:R.feedback)]}),S}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((S,v)=>(S??0)+(v??0),0)),h=i.computed(()=>r.settings.width-u.value),m=i.computed(()=>!r.value.some(({product:S})=>!S||S.isNewRec())),g=i.computed(()=>r.isSubmitProcessing||!m.value||h.value<=0||l.value.length>=r.settings.maxLinesCount||r.value.some(S=>S.product.isNewRec())),f=i.computed(()=>S=>h.value===0?void 0:[{label:`${(h.value>0?"Остаток +":"Излишек ")+h.value} мм.`,key:h.value+S}]),p=i.computed(()=>{const{length:S}=r.value[0];return!S||u.value!==r.settings.width?null:(M.reduce(r.value,(T,R)=>{var B;const w=((B=R.product)==null?void 0:B.costRub)||0;return T+w},0)*r.value[0].quantity*S).toLocaleString("ru-ru",{minimumFractionDigits:2})}),b=(S,v,T)=>{var w,B,x;l.value[v].product.id=-1;const{configuratorParams:R}=l.value[v];R.linesWidths[v]=S,y("configuratorParams",R),(x=(B=(w=a.value)==null?void 0:w.at(v))==null?void 0:B.formItemReference)==null||x.validate().catch(M.noop),i.nextTick(()=>{var $,P;(P=($=a.value)==null?void 0:$.at(v))!=null&&P.isValid&&s("update:params",R,v,T)})},y=(S,v)=>{l.value.forEach(T=>{T[S]=v}),s("update:value",l.value)};return i.watch(()=>r.value,S=>{l.value=M.cloneDeep(S)},{deep:!0}),e({validate:(_=o.value)==null?void 0:_.validate,formReference:o}),(S,v)=>{const T=L.NCheckbox;return i.openBlock(),i.createBlock(i.unref(L.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:v[15]||(v[15]=i.withKeys(i.withModifiers(R=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var R;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(w,B)=>{var x,$;return i.openBlock(),i.createBlock(vd,{key:B,ref_for:!0,ref:"line-items-reference",value:((x=w.configuratorParams)==null?void 0:x.linesWidths.at(B))??null,"auto-focus":!0,index:B,path:`configuratorParams.linesWidths.${B}`,product:w.product,settings:t.settings,validation:t.validation,"suggestion-option":f.value((($=w.configuratorParams)==null?void 0:$.linesWidths.at(B))??0),"add-line-button-disabled":h.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some(P=>P.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"onUpdate:value":b,"onClick:addLine":v[0]||(v[0]=P=>s("click:add-line",P)),"onClick:removeLine":v[1]||(v[1]=P=>s("click:remove-line",P))},null,8,["value","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled"])}),128)),i.createElementVNode("div",Py,[h.value<0?(i.openBlock(),i.createBlock(i.unref(L.NText),{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(t.settings.width),1)]),_:1})):i.createCommentVNode("",!0),m.value&&l.value.length===t.settings.maxLinesCount&&h.value>0?(i.openBlock(),i.createBlock(i.unref(L.NText),{key:1,type:"error"},{default:i.withCtx(()=>[...v[16]||(v[16]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[v[17]||(v[17]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(L.NText),{type:h.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(t.settings.width)+" мм ",1)])]),i.createVNode(i.unref(L.NButton),{disabled:g.value,type:"primary",class:"self-center",onClick:v[2]||(v[2]=w=>s("click:add-line",l.value.length))},{default:i.withCtx(()=>[...v[18]||(v[18]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),i.createVNode(i.unref(L.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:l.value[0].length,"onUpdate:value":[v[3]||(v[3]=w=>l.value[0].length=w),v[6]||(v[6]=w=>y("length",w))],parse:i.unref(Pt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:v[4]||(v[4]=w=>i.unref(st)(w,!1)),onInput:v[5]||(v[5]=w=>i.unref(Oe)(t.validation,"length")),onFocus:i.unref(ze)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(L.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[v[7]||(v[7]=w=>l.value[0].quantity=w),v[10]||(v[10]=w=>y("quantity",w))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:v[8]||(v[8]=w=>i.unref(st)(w,!1)),onInput:v[9]||(v[9]=w=>i.unref(Oe)(t.validation,"quantity")),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(L.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:v[11]||(v[11]=w=>i.unref(Oe)(t.validation,"marker")),"onUpdate:value":v[12]||(v[12]=w=>{l.value[0].marker=w??null,y("marker",w??null)}),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(T,{key:0,checked:l.value[0].isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":v[13]||(v[13]=w=>{l.value[0].isAdditionalSale=w??!1,y("isAdditionalSale",w??!1)})},{default:i.withCtx(()=>[...v[19]||(v[19]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("div",Ny,[v[20]||(v[20]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Ey,i.toDisplayString(p.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",Fy,[i.createVNode(i.unref(L.NButton),{loading:t.isSubmitProcessing,disabled:!m.value||h.value!=0||!((R=l.value[0])!=null&&R.length)||l.value[0].length>t.settings.maxLength||l.value[0].length<t.settings.minLength||l.value[0].quantity===0,type:"primary",class:"self-start",onClick:v[14]||(v[14]=w=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])}}}),My={class:"flex grow flex-col"},Vy=["src"],Iy={class:"w-full"},Oy={},Sd=i.defineComponent({...Oy,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",My,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center py-5",alt:"Штрипс"},null,8,Vy),i.createElementVNode("div",Iy,[i.createTextVNode(" Число полос можно указать от "+i.toDisplayString(t.settings.minLinesCount)+" до "+i.toDisplayString(t.settings.maxLinesCount)+". ",1),n[0]||(n[0]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Минимальная ширина полосы "+i.toDisplayString(t.settings.minLineWidth)+" мм. ",1),n[1]||(n[1]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина всех полос "+i.toDisplayString(t.settings.width)+" мм. ",1),n[2]||(n[2]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Шаг ширины полосы - "+i.toDisplayString(t.settings.lineWidthStep)+" мм. ",1)])]))}}),zy={class:"flex flex-col gap-2"},Ly={class:"w-104 flex grow flex-col px-5"},Dy={},Bd=i.defineComponent({...Dy,__name:"strip-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("strip-configurator-form"),o=i.ref(n.cartItems),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.computed(()=>i.inject("debounce-input-time",300)),d=i.computed(()=>{var f;return(f=o.value[0].configuratorParams)==null?void 0:f.linesWidths.reduce((p,b)=>(p??0)+(b??0),0)}),u=f=>{f===void 0&&(f=o.value.length-1);const p=o.value.at(0);if(!p)return;p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(f+1,0,null),o.value.forEach(y=>{y.configuratorParams.linesWidths=p.configuratorParams.linesWidths});const b=new Z.OrderItemBase({quantity:(p==null?void 0:p.quantity)??1,category:p==null?void 0:p.category,length:(p==null?void 0:p.length)??n.settings.minLength,marker:p==null?void 0:p.marker,configuratorParams:{linesWidths:p==null?void 0:p.configuratorParams.linesWidths}});o.value=o.value.toSpliced(f+1,0,b)},h=f=>{const p=o.value.at(0);p&&(p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(f,1),o.value.forEach(b=>{b.configuratorParams.linesWidths=p.configuratorParams.linesWidths}),o.value=o.value.toSpliced(f,1),delete a[`linesWidths.${f}`],delete a[`linesWidths.${f}`])},m=M.debounce(async(f,p,b)=>{const y={linesWidths:f.linesWidths.at(p)};b.value=!0,a.value[`linesWidths.${p}`]={},o.value[p].product=new Z.ClientProduct,n.eventEmitter.emit("configurator:search-product",{category:o.value[p].category,params:y,validationFieldResultData:a.value,callback:_=>{_?(o.value[p].product=_,p===o.value.length-1&&o.value.length<n.settings.maxLinesCount&&d.value&&d.value<n.settings.width&&u()):(o.value[p].product=new Z.ClientProduct,a.value[`linesWidths.${p}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},b.value=!1),b.value=!1}})},c.value),g=async()=>{var f,p;(p=(f=s.value)==null?void 0:f.formReference)==null||p.validate(b=>{if(!b){l.value=!0;const y=o.value.at(0);if(!y)return;r("submit",y,a.value,()=>{l.value=!1,i.nextTick(()=>{var _,S;(S=(_=s.value)==null?void 0:_.formReference)==null||S.restoreValidation()})})}}).catch(M.noop)};return i.watch(()=>n.cartItems,f=>{o.value=f.map(p=>new Z.OrderItemBase(p))}),(f,p)=>{const b=L.NButton;return i.openBlock(),i.createElementBlock("div",zy,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(b,{key:0,type:"tertiary",class:"self-center",onClick:p[0]||(p[0]=y=>r("click:view-switch"))},{default:i.withCtx(()=>[...p[3]||(p[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Ly,[i.createVNode(Sd,{value:o.value,"onUpdate:value":p[1]||(p[1]=y=>o.value=y),settings:t.settings},null,8,["value","settings"]),i.createVNode(Cd,{ref:"strip-configurator-form",value:o.value,"onUpdate:value":p[2]||(p[2]=y=>o.value=y),validation:a.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":i.unref(m),onSubmit:g,"onClick:addLine":u,"onClick:removeLine":h},null,8,["value","validation","settings","is-submit-processing","onUpdate:params"])])])}}}),Hy={class:"flex flex-col gap-3"},Wy={},Td=i.defineComponent({...Wy,__name:"metal-for-doors-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit"],setup(t,{expose:e,emit:n}){var g;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("first-input-element"),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth),...r.settings.maxWidth?[ae.max(r.settings.maxWidth)]:[],ae.step(1),De.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(1),De.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),De.serverValidation(r.validation.quantity.feedback)],marker:[De.serverValidation(r.validation.marker.feedback)]})),d=i.ref(r.settings.canSetDopProdaga??!1),u=()=>{s("update:params",l.value.configuratorParams),h("configuratorParams",l.value.configuratorParams)},h=(f,p)=>{const b=new Z.OrderItemBase(r.value);b[f]=p,f==="configuratorParams"&&(b.product=new Z.ClientProduct),s("update:value",b)},m=()=>{var f;(f=a.value)==null||f.select()};return i.watch(()=>r.value,f=>{l.value=M.cloneDeep(f)},{deep:!0}),i.onMounted(()=>{r.value.isNewRec()&&i.nextTick(()=>{m()})}),e({validate:(g=o.value)==null?void 0:g.validate,formReference:o}),(f,p)=>{const b=L.NCheckbox;return i.openBlock(),i.createBlock(i.unref(L.NForm),{ref:"form-reference",model:l.value,rules:c.value,disabled:t.isSubmitProcessing,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:p[13]||(p[13]=i.withKeys(i.withModifiers(y=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[p[0]||(p[0]=y=>l.value.configuratorParams.width=y),u],class:"w-full",parse:i.unref(Pt),"show-button":!1,placeholder:"Введите ширину",onKeydown:p[1]||(p[1]=y=>i.unref(st)(y)),onInput:p[2]||(p[2]=y=>i.unref(Oe)(t.validation,"width")),onFocus:i.unref(ze)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(L.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[p[3]||(p[3]=y=>l.value.configuratorParams.length=y),u],placeholder:"Введите длину",parse:i.unref(Pt),"show-button":!1,class:"w-full",onKeydown:p[4]||(p[4]=y=>i.unref(st)(y)),onInput:p[5]||(p[5]=y=>i.unref(Oe)(t.validation,"length")),onFocus:i.unref(ze)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(L.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:p[6]||(p[6]=y=>i.unref(st)(y,!1)),onInput:p[7]||(p[7]=y=>i.unref(Oe)(t.validation,"quantity")),"onUpdate:value":p[8]||(p[8]=y=>h("quantity",y??0)),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(L.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInput),{value:t.value.marker??null,placeholder:"Введите маркировку",onInput:p[9]||(p[9]=y=>i.unref(Oe)(t.validation,"marker")),"onUpdate:value":p[10]||(p[10]=y=>h("marker",y??null)),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(b,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":p[11]||(p[11]=y=>{l.value.isAdditionalSale=y??!1,h("isAdditionalSale",y??!1)})},{default:i.withCtx(()=>[...p[14]||(p[14]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(lr,{"is-product-searching":t.isProductSearching,product:t.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),i.createElementVNode("div",Hy,[i.createVNode(i.unref(L.NButton),{disabled:t.value.product.isNewRec()||t.isProductSearching||t.isSubmitProcessing||t.value.length===0||t.value.width===0||t.value.quantity===0,type:"primary",class:"self-start",onClick:p[12]||(p[12]=y=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"])}}}),jy={class:"flex flex-col gap-2 w-72"},qy={},Rd=i.defineComponent({...qy,__name:"metal-for-doors-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("metal-for-doors-configurator-form"),o=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.ref(!1),d=i.computed(()=>i.inject("debounce-input-time",300)),u=M.debounce(async m=>{var g,f;o.value.product=new Z.ClientProduct,(f=(g=s.value)==null?void 0:g.formReference)==null||f.validate(p=>{p||(l.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:m,validationFieldResultData:a.value,callback:b=>{b?o.value.product=b:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(M.noop)},d.value),h=async()=>{var m,g;(g=(m=s.value)==null?void 0:m.formReference)==null||g.validate(f=>{f||(c.value=!0,r("submit",o.value,a.value,()=>{c.value=!1,i.nextTick(()=>{var p,b;(b=(p=s.value)==null?void 0:p.formReference)==null||b.restoreValidation()})}))}).catch(M.noop)};return i.watch(()=>n.cartItem,m=>{o.value=new Z.OrderItemBase(m)},{deep:!0}),(m,g)=>{const f=L.NButton;return i.openBlock(),i.createElementBlock("div",jy,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(f,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=p=>r("click:view-switch"))},{default:i.withCtx(()=>[...g[4]||(g[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Td,{ref:"metal-for-doors-configurator-form",value:o.value,"onUpdate:value":g[1]||(g[1]=p=>o.value=p),validation:a.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":g[2]||(g[2]=p=>i.unref(u)(p)),onSubmit:g[3]||(g[3]=p=>h())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),Xy={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Yy(t,e){return i.openBlock(),i.createElementBlock("svg",Xy,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 112v288m144-144H112"},null,-1)])])}const Uy=i.markRaw({name:"ion-add",render:Yy}),Ky={key:0,class:"ml-2 text-gray-500 text-sm"},Gy={class:"font-bold"},Zy={key:1,class:"flex flex-col gap-3"},Qy={class:"w-full text-sm"},Jy={"form-array-name":"items",class:"flex flex-col gap-3"},e0={class:"grid grow grid-cols-3 gap-2 items-start"},t0={key:0,class:"flex flex-wrap items-end gap-2"},n0={class:"whitespace-nowrap text-xl font-bold"},i0={key:0,class:"whitespace-nowrap text-lg text-gray-500"},r0={class:"font-bold"},s0={class:"font-bold"},o0={class:"flex gap-3"},a0={},$d=i.defineComponent({...a0,__name:"sandwich-configurator-form",props:{value:{},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","add-item","remove-item"],setup(t,{expose:e,emit:n}){var V;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.ref(M.cloneDeep(r.value)),l=i.computed(()=>r.value.category),c=i.ref(null),d=i.ref(null),u=i.computed(()=>l.value.products??[]),h=i.computed(()=>u.value.map(F=>({label:F.name,value:F.id}))),m=i.ref(null),g=i.ref(!1),f=i.computed(()=>i.inject("debounce-default-time",300)),p=i.computed(()=>{var F,N;return(N=(F=c.value)==null?void 0:F.properties)!=null&&N.width?ae.max(c.value.properties.width):null}),b=i.computed(()=>{var F,N;return(N=(F=c.value)==null?void 0:F.properties)!=null&&N.length?ae.max(c.value.properties.length):null}),y=i.computed(()=>{const F={marker:[De.serverValidation(r.validation.marker.feedback)]};return a.value.configuratorParams.items.forEach((N,Y)=>{var ee,I,z,q,W,O,D;F[`configuratorParams.items.${Y}.width`]=[ae.required,ae.min(r.settings.minWidth),...(I=(ee=c.value)==null?void 0:ee.properties)!=null&&I.width?[ae.max(c.value.properties.width)]:[],ae.step(1),De.serverValidation((z=r.validation[`items.${Y}.width`])==null?void 0:z.feedback)],F[`configuratorParams.items.${Y}.length`]=[ae.required,ae.min(r.settings.minLength),...(W=(q=c.value)==null?void 0:q.properties)!=null&&W.length?[ae.max(c.value.properties.length)]:[],ae.step(1),De.serverValidation((O=r.validation[`items.${Y}.length`])==null?void 0:O.feedback)],F[`configuratorParams.items.${Y}.count`]=[ae.required,ae.min(1),ae.step(1),De.serverValidation((D=r.validation[`items.${Y}.count`])==null?void 0:D.feedback)]}),F}),_=i.ref(r.settings.canSetDopProdaga??!1),S=i.computed(()=>a.value.configuratorParams.items.some(F=>{var N,Y;return!c.value||!F.width||F.width<r.settings.minWidth||F.width>(((N=c.value.properties)==null?void 0:N.width)??0)||F.length===0||F.length<r.settings.minLength||F.length>(((Y=c.value.properties)==null?void 0:Y.length)??0)||!F.count||F.count<1})),v=i.computed(()=>!c.value||S.value||a.value.configuratorParams.items.length===0),T=i.ref(null),R=F=>{if(!F){c.value=null,d.value=null,a.value.product=new Z.ClientProduct,m.value=null;return}const N=u.value.find(Y=>Y.id===F);N&&(c.value=N,d.value=F,a.value.product=N,A("product",a.value.product),a.value.configuratorParams.items.forEach(Y=>{var ee,I;(ee=N.properties)!=null&&ee.width&&Y.width>N.properties.width&&(Y.width=N.properties.width),(I=N.properties)!=null&&I.length&&Y.length>N.properties.length&&(Y.length=N.properties.length)}),w())},w=M.debounce(async()=>{var F;if(!c.value||a.value.configuratorParams.items.length===0||S.value){m.value=null;return}(F=o.value)==null||F.validate(N=>{if(N){m.value=null;return}if(g.value=!0,!c.value||!l.value){m.value=null,g.value=!1;return}r.eventEmitter.emit("configurator:calculate",{category:l.value,params:{productId:c.value.id,items:a.value.configuratorParams.items},callback:Y=>{Y?(m.value=Y,a.value.configuratorParams.calculationId=Y.id,a.value.quantity=Y.quantity,i.nextTick(()=>{A("quantity",Y.quantity)})):(a.value.configuratorParams.calculationId="",a.value.quantity=0,m.value=null),A("configuratorParams",a.value.configuratorParams),B(),g.value=!1}})}).catch(()=>{m.value=null,g.value=!1})},f.value),B=()=>{var N;if(!((N=c.value)!=null&&N.costRub)||!m.value){T.value=null;return}const F=m.value.quantity*c.value.costRub;T.value=Math.round(F*100)/100},x=F=>{var Y,ee;const N=a.value.configuratorParams.items[F];c.value&&((Y=c.value.properties)!=null&&Y.width&&N.width>c.value.properties.width&&(N.width=c.value.properties.width),(ee=c.value.properties)!=null&&ee.length&&N.length>c.value.properties.length&&(N.length=c.value.properties.length)),A("configuratorParams",a.value.configuratorParams),w()},$=()=>{a.value.configuratorParams.calculationId="",a.value.configuratorParams.items.push({width:0,length:0,count:1}),A("configuratorParams",a.value.configuratorParams),w(),s("add-item",a.value.configuratorParams.items.length)},P=F=>{a.value.configuratorParams.items.splice(F,1),A("configuratorParams",a.value.configuratorParams),w(),s("remove-item",F)},A=(F,N)=>{const Y=new Z.OrderItemBase(r.value);Y[F]=N,s("update:value",Y)};return i.watch(()=>r.value,F=>{const N=M.cloneDeep(i.toRaw(F));(!N.configuratorParams.items||N.configuratorParams.items.length===0)&&(N.configuratorParams.items=[{width:0,length:0,count:1}]),a.value=N,r.value.product&&!r.value.product.isNewRec()&&(c.value=r.value.product,d.value=r.value.product.id),r.value.product.isNewRec()&&(c.value=null,d.value=null)},{deep:!0}),i.onMounted(()=>{r.value.product&&!r.value.product.isNewRec()&&(c.value=r.value.product,d.value=r.value.product.id),a.value.configuratorParams.items.length>0&&c.value&&w()}),e({validate:(V=o.value)==null?void 0:V.validate,formReference:o}),(F,N)=>{const Y=Ds,ee=Uy;return i.openBlock(),i.createBlock(i.unref(L.NForm),{ref:"form-reference",model:a.value,rules:y.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:N[8]||(N[8]=i.withKeys(i.withModifiers(I=>s("submit",a.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var I,z,q;return[i.createVNode(i.unref(L.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NSelect),{value:d.value,"onUpdate:value":[N[0]||(N[0]=W=>d.value=W),R],options:h.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),c.value?(i.openBlock(),i.createElementBlock("div",Ky,[N[9]||(N[9]=i.createTextVNode(" Стоимость: ",-1)),i.createElementVNode("span",Gy,i.toDisplayString((I=c.value.costRub)==null?void 0:I.toLocaleString())+" "+i.toDisplayString(c.value.currency.symbol)+"/шт.",1)])):i.createCommentVNode("",!0),c.value&&p.value&&b.value?(i.openBlock(),i.createElementBlock("div",Zy,[N[14]||(N[14]=i.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),i.createElementVNode("div",Qy,[i.createTextVNode(" Минимальная ширина: "+i.toDisplayString(t.settings.minWidth)+" мм. ",1),N[10]||(N[10]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Максимальная ширина: "+i.toDisplayString((z=c.value.properties)==null?void 0:z.width)+" мм. ",1),N[11]||(N[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Минимальная длина: "+i.toDisplayString(t.settings.minLength)+" мм. ",1),N[12]||(N[12]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Максимальная длина: "+i.toDisplayString((q=c.value.properties)==null?void 0:q.length)+" мм. ",1)]),i.createElementVNode("div",Jy,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value.configuratorParams.items,(W,O)=>(i.openBlock(),i.createElementBlock("div",{key:O,class:"flex grow gap-2"},[i.createElementVNode("div",e0,[i.createVNode(i.unref(L.NFormItem),{path:`configuratorParams.items.${O}.width`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:a.value.configuratorParams.items[O].width,"onUpdate:value":[D=>a.value.configuratorParams.items[O].width=D,D=>x(O)],parse:i.unref(Pt),"show-button":!1,placeholder:"Ширина",class:"w-full",onKeydown:N[1]||(N[1]=D=>i.unref(st)(D)),onInput:D=>i.unref(Oe)(t.validation,`items.${O}.width`),onFocus:i.unref(ze)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(L.NFormItem),{path:`configuratorParams.items.${O}.length`,label:"Длина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:a.value.configuratorParams.items[O].length,"onUpdate:value":[D=>a.value.configuratorParams.items[O].length=D,D=>x(O)],parse:i.unref(Pt),"show-button":!1,placeholder:"Длина",class:"w-full",onKeydown:N[2]||(N[2]=D=>i.unref(st)(D)),onInput:D=>i.unref(Oe)(t.validation,`items.${O}.length`),onFocus:i.unref(ze)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(L.NFormItem),{path:`configuratorParams.items.${O}.count`,label:"Количество, шт"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:a.value.configuratorParams.items[O].count,"onUpdate:value":[D=>a.value.configuratorParams.items[O].count=D,D=>x(O)],parse:i.unref(Pt),"show-button":!1,placeholder:"Количество",class:"w-full",onKeydown:N[3]||(N[3]=D=>i.unref(st)(D,!1)),onInput:D=>i.unref(Oe)(t.validation,`items.${O}.count`),onFocus:i.unref(ze)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"])]),i.createVNode(i.unref(L.NButton),{disabled:a.value.configuratorParams.items.length<=1,type:"error",size:"medium",class:"mt-5",onClick:D=>P(O)},{default:i.withCtx(()=>[i.createVNode(Y)]),_:1},8,["disabled","onClick"])]))),128))]),i.createVNode(i.unref(L.NButton),{disabled:S.value,type:"default",class:"self-center",onClick:$},{default:i.withCtx(()=>[i.createVNode(ee),N[13]||(N[13]=i.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])])):c.value?(i.openBlock(),i.createBlock(i.unref(L.NText),{key:2,type:"error"},{default:i.withCtx(()=>[...N[15]||(N[15]=[i.createTextVNode(" Расчет по продукту невозможен. Обратитесь к менеджеру. ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(i.unref(L.NFormItem),{path:"marker",label:"Маркировка распила"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInput),{value:a.value.marker??null,placeholder:"Введите маркировку распила",onInput:N[4]||(N[4]=W=>i.unref(Oe)(t.validation,"marker")),"onUpdate:value":N[5]||(N[5]=W=>A("marker",W??null)),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),_.value?(i.openBlock(),i.createBlock(i.unref(L.NCheckbox),{key:3,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":N[6]||(N[6]=W=>{a.value.isAdditionalSale=W??!1,A("isAdditionalSale",W??!1)})},{default:i.withCtx(()=>[...N[16]||(N[16]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(i.unref(L.NSpin),{show:g.value,size:"small",class:"grow"},{default:i.withCtx(()=>{var W;return[m.value&&c.value&&T.value?(i.openBlock(),i.createElementBlock("div",t0,[i.createElementVNode("div",null,[N[17]||(N[17]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",n0,i.toDisplayString(T.value.toLocaleString())+" "+i.toDisplayString(c.value.currency.symbol),1)]),m.value.quantity&&c.value?(i.openBlock(),i.createElementBlock("div",i0,[i.createElementVNode("span",r0,"("+i.toDisplayString(m.value.quantity)+" шт.",1),N[18]||(N[18]=i.createTextVNode(" x ",-1)),i.createElementVNode("span",s0,i.toDisplayString((W=c.value.costRub)==null?void 0:W.toLocaleString())+" "+i.toDisplayString(c.value.currency.symbol)+"/шт.)",1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]}),_:1},8,["show"]),i.createElementVNode("div",o0,[i.createVNode(i.unref(L.NButton),{loading:t.isSubmitProcessing,disabled:v.value||!m.value||g.value,type:"primary",class:"self-start",onClick:N[7]||(N[7]=W=>s("submit",a.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])}}}),l0={class:"flex flex-col gap-2"},c0={class:"w-104 flex grow flex-col px-5"},d0={},Pd=i.defineComponent({...d0,__name:"sandwich-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("sandwich-configurator-form"),o=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{},product:{}}),l=i.ref(!1),c=async()=>{var h,m;(m=(h=s.value)==null?void 0:h.formReference)==null||m.validate(g=>{if(!g){l.value=!0;const f=M.cloneDeep(o.value);"items"in f.configuratorParams&&delete f.configuratorParams.items,r("submit",f,a.value,()=>{l.value=!1,i.nextTick(()=>{var p,b;(b=(p=s.value)==null?void 0:p.formReference)==null||b.restoreValidation()})})}}).catch(M.noop)},d=h=>{a.value[`items.${h}.width`]={},a.value[`items.${h}.length`]={},a.value[`items.${h}.count`]={}},u=h=>{delete a.value[`items.${h}.width`],delete a.value[`items.${h}.length`],delete a.value[`items.${h}.count`]};return i.onMounted(()=>{n.cartItem.configuratorParams.items.forEach((h,m)=>{a.value[`items.${m}.width`]={},a.value[`items.${m}.length`]={},a.value[`items.${m}.count`]={}})}),i.watch(()=>n.cartItem,h=>{o.value=new Z.OrderItemBase(h)},{deep:!0}),(h,m)=>{const g=L.NButton;return i.openBlock(),i.createElementBlock("div",l0,[t.settings.allowShowTable&&o.value.isNewRec()?(i.openBlock(),i.createBlock(g,{key:0,type:"tertiary",class:"self-center",onClick:m[0]||(m[0]=f=>r("click:view-switch"))},{default:i.withCtx(()=>[...m[2]||(m[2]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",c0,[i.createVNode($d,{ref:"sandwich-configurator-form",value:o.value,"onUpdate:value":m[1]||(m[1]=f=>o.value=f),validation:a.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":l.value,onSubmit:c,onAddItem:d,onRemoveItem:u},null,8,["value","validation","settings","event-emitter","is-submit-processing"])])])}}}),u0={key:0,class:"flex justify-center p-4"},h0={key:1,class:"p-4 text-center text-red-500"},f0={key:2,class:"flex justify-center"},m0={class:"!bg-white p-4 m-2 rounded-md w-max"},g0={key:3,class:"p-4 text-center text-gray-500"},p0={},Nd=i.defineComponent({...p0,__name:"dynamic-configurator",props:{eventEmitter:{},settings:{},editor:{},cartItem:{},category:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(null),s=i.ref(e.cartItem??null),o=i.ref(null),a=()=>{var u,h,m;if(!e.settings){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const d={category:((u=e.cartItem)==null?void 0:u.category)??e.category,configurator:e.editor,quantity:1};switch(e.editor){case"kozyrek":{const g=e.settings;s.value=new Z.OrderItemBase({...d,configuratorParams:{length:g.stripMinLength,linesAngles:[],linesWidths:[],startTailType:M.some(g.startTailConfigs,f=>f.isDefault)?(h=g.startTailConfigs)==null?void 0:h.findIndex(f=>f.isDefault):void 0,endTailType:M.some(g.endTailConfigs,f=>f.isDefault)?(m=g.endTailConfigs)==null?void 0:m.findIndex(f=>f.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const g=e.settings;s.value=new Z.OrderItemBase({...d,configuratorParams:{width:0,height:0,netType:g.netType[0]||"",color:g.color[0]||"",mountType:g.mountType[0]||""}});break}case"strip":{const g=e.settings;o.value=[new Z.OrderItemBase({...d,length:g.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const g=e.settings;s.value=new Z.OrderItemBase({...d,configuratorParams:{width:g.minWidth,length:g.minLength}});break}case"sandwich":{s.value=new Z.OrderItemBase({...d,configuratorParams:{calculationId:"",items:[{width:0,length:0,count:1}]}});break}default:r.value=`Неподдерживаемый тип конфигуратора: ${e.editor}.`}s.value&&(s.value.marker=void 0)},l=(d,u,h)=>{const m=g=>{h==null||h(),g&&a()};e.eventEmitter.emit("configurator:submit",{cartItem:d,callback:m,validation:u})},c=()=>{e.category&&e.eventEmitter.emit("configurator:click-view-switch",{category:e.category})};return i.onMounted(()=>{e.cartItem||a()}),(d,u)=>{const h=L.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[n.value?(i.openBlock(),i.createElementBlock("div",u0,[i.createVNode(h,{size:"large"})])):r.value?(i.openBlock(),i.createElementBlock("div",h0,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0),t.settings!==null&&(s.value!==null||o.value!==null)?(i.openBlock(),i.createElementBlock("div",f0,[i.createElementVNode("div",m0,[t.editor==="kozyrek"?(i.openBlock(),i.createBlock(_d,{key:0,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":c,onSubmit:l},null,8,["event-emitter","settings","cart-item"])):t.editor==="mosquitto"?(i.openBlock(),i.createBlock(kd,{key:1,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,onSubmit:l},null,8,["event-emitter","settings","cart-item"])):t.editor==="strip"?(i.openBlock(),i.createBlock(Bd,{key:2,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":o.value,"onClick:viewSwitch":c,onSubmit:l},null,8,["event-emitter","settings","cart-items"])):t.editor==="metal_for_doors"?(i.openBlock(),i.createBlock(Rd,{key:3,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":c,onSubmit:l},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich"?(i.openBlock(),i.createBlock(Pd,{key:4,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":c,onSubmit:l},null,8,["event-emitter","settings","cart-item"])):i.createCommentVNode("",!0)])])):(i.openBlock(),i.createElementBlock("div",g0,' Конфигуратор "'+i.toDisplayString(t.editor)+'" не поддерживается. ',1))],64)}}});var us=(t=>(t.Kozyrek="kozyrek",t.Mosquitto="mosquitto",t.Strip="strip",t.MetalForDoors="metal_for_doors",t.Sandwich="sandwich",t))(us||{});function Ed(t){return Object.values(us).includes(t)}function Fd(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==us.Sandwich?!0:t.properties.configuratorSettings!==void 0&&M.isArray(t.products)&&t.products.length>0}const y0={key:0,class:"pt-0.5"},b0={key:0},_0={class:"line-through"},w0={key:0},x0={key:1},k0={class:"flex flex-row gap-1"},v0={key:0},C0={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},S0={class:"flex flex-col gap-2.5 sm:flex-row"},B0={class:"mt-2"},T0={key:1,class:"flex flex-col"},R0={},$0=i.defineComponent({...R0,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function],default:!1},showCategoryRequiredButton:{type:[Boolean,String,Function],default:!1},showCategoryPinButton:{type:[Boolean,String,Function],default:!1},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function],default:!1},canShowConfigurator:{type:[Boolean,Function],default:!1},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(Mr,"medium"),r=i.computed(()=>{var j;return(j=e==null?void 0:e.filteredItems)==null?void 0:j[e.categoryItem.id]}),s=i.computed(()=>{var j,G;return M.isArray((j=e.categoryItem)==null?void 0:j.categories)&&((G=e.categoryItem.categories)==null?void 0:G.length)>0}),o=i.computed(()=>{var j;return M.isArray((j=e.categoryItem)==null?void 0:j.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([j,G])=>`${G} руб./${P(j)}`).join(", ")),l=i.computed(()=>M.isUndefined(e.filteredItems)||r.value==="*"?o.value:o.value.filter(j=>{var ue;const G=(ue=r.value)==null?void 0:ue.products;return M.isArray(G)&&G.includes(j.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>M.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),u=i.computed(()=>M.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),h=i.computed(()=>M.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),m=i.computed(()=>M.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),g=i.computed(()=>{var j,G,ue;return((j=e.categoryItem.properties)==null?void 0:j.configurator)!==void 0&&Ed((G=e.categoryItem.properties)==null?void 0:G.configurator)&&Fd(e.categoryItem)&&((ue=e.categoryItem.properties)==null?void 0:ue.configuratorSettings)!==void 0&&(M.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),f=i.computed(()=>g.value&&(M.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)),p=i.computed(()=>M.isNil(e.categoryContextButtonsConfig)?[]:M.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),b=i.computed(()=>new Z.ClientCategory(e.categoryItem)),y=i.ref(!1),_=i.ref(!1),S=i.computed(()=>!M.isUndefined(e.isCategoryItemSelected)),v=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),T=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),R=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),w=i.computed(()=>W.value&&xt.getDeviceTypeByResolution()===Ge.laptop?"auto":"fixed"),B=i.useTemplateRef("collapse-item-reference"),x=i.computed(()=>{var j,G;return(G=(j=e.categoryItem.properties)==null?void 0:j.templateCost)==null?void 0:G.priceCoefficient}),$=i.computed(()=>{var j,G;return(G=(j=e.categoryItem.properties)==null?void 0:j.templateCost)==null?void 0:G.increasePercent}),P=(j,G="ru-RU")=>0 .toLocaleString(G,{style:"currency",currency:j,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),A=j=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:j,target:B.value})},V=(j,G)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:G,isLoadingState:y,target:B.value})},F=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:B.value})},N=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:B.value})},Y=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:B.value})},ee=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:B.value})},I=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:B.value})},z=j=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:j,target:B.value})},q=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},W=i.ref(0),O=i.computed(()=>W.value&&o.value.length>0?Im(o.value,{eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,isProductItemSelected:e.isProductItemSelected,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.categoryItem.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig}):[]),D=M.debounce(()=>{W.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",D)}),window.addEventListener("resize",D),D(),(j,G)=>{const ue=L.NCheckbox,oe=bf,re=L.NTooltip,Ee=gf,We=L.NTag,Fe=hf,Gt=cf,Te=L.NButton,sn=of,on=Ka,Rt=Ua,Lt=Ya,an=Xa,wt=L.NDropdown,Ln=L.NDataTable,ln=L.NAlert,Zt=L.NSpin;return i.openBlock(),i.createBlock(Ga,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":V},{"pre-arrow":i.withCtx(()=>{var $e,K;return[S.value?(i.openBlock(),i.createElementBlock("div",y0,[i.createVNode(ue,{checked:v.value,indeterminate:R.value,disabled:T.value,"onUpdate:checked":A},null,8,["checked","indeterminate","disabled"])])):i.createCommentVNode("",!0),!d.value&&(($e=b.value)!=null&&$e.isDisabled)?(i.openBlock(),i.createBlock(re,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(oe,{class:"pt-1.5"})]),default:i.withCtx(()=>[G[1]||(G[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((K=b.value)==null?void 0:K.isFavorite)??!1?(i.openBlock(),i.createBlock(re,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Ee,{class:"pt-1.5"})]),default:i.withCtx(()=>[G[2]||(G[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var $e,K,se,Ie,ni;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":($e=b.value)==null?void 0:$e.isDisabled})},[i.createVNode(re,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[G[3]||(G[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:G[0]||(G[0]=i.withModifiers((...Je)=>i.unref(M.noop)&&i.unref(M.noop)(...Je),["prevent","stop"]))},[(K=t.categoryItem.properties)!=null&&K.m2Price?(i.openBlock(),i.createBlock(We,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((se=t.categoryItem.properties)==null?void 0:se.templateCost)&&t.categoryItem.properties.m2PriceRetail&&$.value}),round:""},{default:i.withCtx(()=>{var Je;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(Je=t.categoryItem.properties)!=null&&Je.templateCost&&t.categoryItem.properties.m2PriceRetail&&$.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[$.value?(i.openBlock(),i.createBlock(We,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[$.value?(i.openBlock(),i.createElementBlock("span",b0,i.toDisplayString($.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(We,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",_0,i.toDisplayString(t.categoryItem.properties.m2PriceRetail)+" руб./м2",1)]),_:1},8,["size"])]),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0)]}),_:1},8,["size","class"])):(Ie=t.categoryItem.properties)!=null&&Ie.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[x.value||$.value?(i.openBlock(),i.createBlock(We,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var Je;return[x.value?(i.openBlock(),i.createElementBlock("span",w0,i.toDisplayString((Je=x.value)==null?void 0:Je.name),1)):i.createCommentVNode("",!0),$.value?(i.openBlock(),i.createElementBlock("span",x0,i.toDisplayString($.value>0?"+":"")+i.toDisplayString($.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(We,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),u.value&&((ni=b.value)!=null&&ni.manager)?(i.openBlock(),i.createBlock(We,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:ee},{default:i.withCtx(()=>[i.createVNode(re,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Je,Dt;return[i.createElementVNode("span",k0,[i.createVNode(Fe),i.createTextVNode(" "+i.toDisplayString((Dt=(Je=b.value)==null?void 0:Je.manager)==null?void 0:Dt.name),1)])]}),default:i.withCtx(()=>{var Je,Dt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((Dt=(Je=b.value)==null?void 0:Je.manager)==null?void 0:Dt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",v0,[i.createElementVNode("ul",C0,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},($e,K)=>(i.openBlock(),i.createElementBlock("li",{key:K}," ("+i.toDisplayString(K)+"): "+i.toDisplayString($e),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.categoryItem.properties,($e,K)=>(i.openBlock(),i.createElementBlock("li",{key:K}," ("+i.toDisplayString(K)+"): "+i.toDisplayString($e),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var $e;return[i.createElementVNode("div",S0,[d.value?(i.openBlock(),i.createBlock(re,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),onClick:F},{default:i.withCtx(()=>{var K;return[(K=b.value)!=null&&K.isDisabled?(i.openBlock(),i.createBlock(oe,{key:1})):(i.openBlock(),i.createBlock(Gt,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var K;return[(K=b.value)!=null&&K.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(b.value.hidingComment?`. Причина: '${b.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),u.value&&!(($e=b.value)!=null&&$e.manager)?(i.openBlock(),i.createBlock(re,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),onClick:Y},{default:i.withCtx(()=>[i.createVNode(sn)]),_:1},8,["size"])]),default:i.withCtx(()=>{var K,se,Ie;return[(K=b.value)!=null&&K.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((Ie=(se=b.value)==null?void 0:se.manager)==null?void 0:Ie.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),h.value?(i.openBlock(),i.createBlock(re,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,disabled:h.value==="disabled",size:i.unref(n),onClick:N},{default:i.withCtx(()=>{var K;return[(K=b.value)!=null&&K.isRequired?(i.openBlock(),i.createBlock(Rt,{key:1})):(i.openBlock(),i.createBlock(on,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[G[4]||(G[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(re,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),type:"primary",onClick:I},{default:i.withCtx(()=>[i.createVNode(Lt)]),_:1},8,["size"])]),default:i.withCtx(()=>[G[5]||(G[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(wt,{key:4,options:p.value,size:i.unref(n),trigger:"click",onSelect:z},{default:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(an)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(j.$slots,"default",{},()=>{var $e,K,se;return[i.createElementVNode("div",B0,[s.value?(i.openBlock(),i.createBlock(Md,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?(($e=r.value)==null?void 0:$e.categories)??{}:void 0,"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator,"can-show-configurator":t.canShowConfigurator},null,8,["categories-items","has-products","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator","can-show-configurator"])):i.createCommentVNode("",!0)]),g.value&&f.value?(i.openBlock(),i.createBlock(Nd,{key:0,"event-emitter":t.eventEmitter,settings:(K=t.categoryItem.properties)==null?void 0:K.configuratorSettings,editor:(se=t.categoryItem.properties)==null?void 0:se.configurator,category:t.categoryItem},null,8,["event-emitter","settings","editor","category"])):c.value?(i.openBlock(),i.createElementBlock("div",T0,[g.value?(i.openBlock(),i.createBlock(Te,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:q},{default:i.withCtx(()=>[...G[6]||(G[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Ln,{columns:O.value,data:l.value,bordered:!0,loading:y.value,remote:!0,"row-key":Ie=>Ie.id,"table-layout":w.value,class:"mt-2"},null,8,["columns","data","loading","row-key","table-layout"])])):i.createCommentVNode("",!0),!y.value&&!_.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(ln,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createBlock(ln,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createBlock(Zt,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...G[7]||(G[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),P0=Wn($0,[["__scopeId","data-v-3560e7d3"]]),N0={class:"sc-collapse flex w-full flex-col"},E0={},Ad=i.defineComponent({...E0,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(t,{emit:e}){const n=t,r=e,s=(o,a)=>{r("on-item-header-click",o,a)};return i.provide("itemHeaderClickHandler",s),i.provide("defaultExpandedNames",n.defaultExpandedNames),i.provide("expandedNames",n.expandedNames),(o,a)=>(i.openBlock(),i.createElementBlock("div",N0,[i.renderSlot(o.$slots,"default")]))}}),F0={},Md=i.defineComponent({...F0,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function]},canShowConfigurator:{type:[Boolean,Function]},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(Mr,"medium"),r=i.computed(()=>M.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(o=>{var a;return!!((a=e.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(M.isUndefined(a))return;const l=a[o.id];if(l==="*")return;const c={};return c[o.id]=structuredClone(i.toRaw(l)),c};return(o,a)=>{const l=L.NSpin,c=L.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(Ad,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(P0,{key:d.id,"category-item":d,"event-emitter":t.eventEmitter,"filtered-items":s(d,t.filteredItems),"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator,"can-show-configurator":t.canShowConfigurator},null,8,["category-item","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator","can-show-configurator"]))),128))]),_:1})):t.loading?(i.openBlock(),i.createBlock(l,{key:1,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...a[0]||(a[0]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0),!t.hasProducts&&!t.loading&&t.categoriesItems.length>0&&r.value.length===0?(i.openBlock(),i.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):i.createCommentVNode("",!0)],64)}}}),A0={},Vd=i.defineComponent({...A0,__name:"reference-select",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean},referenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1},sortOptionsByLabel:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=new Z.Reference,l=i.computed(()=>{const g=o.value?[]:a,f=M.isUndefined(r.value)?g:r.value;return M.isArray(f)?f.map(p=>p.id):f==null?void 0:f.id}),c=i.computed(()=>Mt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue)),d=g=>{var f;if(M.isArray(g)){const p=g.length>0?g.map(b=>{var y;return(y=c.value.find(_=>_.value===b))==null?void 0:y.item}):[];s("update:value",p)}else{const p=g===a.id||(f=c.value.find(b=>b.value===g))==null?void 0:f.item;s("update:value",p)}},u=i.useTemplateRef("select-component");return e({focus:()=>{var g;return(g=u.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=u.value)==null?void 0:g.blur()}}),(g,f)=>(i.openBlock(),i.createBlock(i.unref(L.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:o.value,options:c.value,placeholder:"",class:"w-full","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),M0={},V0=i.defineComponent({...M0,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(t,{emit:e}){var S,v;const n=t,r=e,s=()=>{const T=Z.PriceCoefficient.getRetailPriceCoefficient();return M.unset(T,"isNewRec"),T},o=T=>!T||T.id===s().id,a=i.computed(()=>{var T;return((T=n.catalogItem)==null?void 0:T.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=T=>{var R,w,B,x;return T.id===s().id?(R=l.value)==null?void 0:R.getRetailCost():(x=(B=(w=l.value)==null?void 0:w.priceCoefficients)==null?void 0:B.find($=>$.coefficient.id===T.id))==null?void 0:x.cost},d=i.computed(()=>{var R;const T=[...((R=Z.useReferencesStore().priceCoefficientsReference)==null?void 0:R.map(w=>structuredClone(i.toRaw(w))))??[],s()];return a.value&&T.forEach(w=>{var x;const B=c(w);B?w.name+=` (${B} ${(x=l.value)==null?void 0:x.currency.symbol})`:w.name=""}),T.filter(w=>w.name!=="")}),u=i.ref(n.value.coefficient),h=i.ref(((v=(S=n.value)==null?void 0:S.value)==null?void 0:v.toString())??null),m=i.ref(null),g=i.computed(()=>{var T,R;return(R=(T=l.value)==null?void 0:T.priceCoefficients)==null?void 0:R.find(w=>w.coefficient.slug===Z.PriceCoefficientEnum.K0)}),f=i.ref(void 0),p=()=>{var R,w,B;f.value=void 0;let T=Number.parseFloat(((R=h.value)==null?void 0:R.replace(",","."))??"");if(T=Number.isNaN(T)?void 0:T,a.value)if(u.value||h.value){const x=s(),$=c(u.value??x)??0,P=$+$*((T??0)/100);m.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(P),P>(((w=l.value)==null?void 0:w.getRetailCost())??P)&&(f.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),g.value&&P<(((B=g.value)==null?void 0:B.cost)??0)&&(f.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else m.value=null;r("update:value",{value:Number.isNaN(T)?void 0:T,coefficient:o(u.value)?void 0:structuredClone(i.toRaw(u.value))})},b=T=>{M.isArray(T)||(u.value=T,h.value=null,!u.value&&h.value&&(u.value=s()),p())},y=()=>{u.value||(u.value=s()),p()},_=T=>{var w,B,x,$,P,A;const R=Number.parseFloat((T==null?void 0:T.replace(",","."))??"");if(a.value){let V=0;if(R<=0)u.value=void 0,h.value=null;else if(g.value&&R<(((w=g.value)==null?void 0:w.cost)??0))u.value=(B=g.value)==null?void 0:B.coefficient,V=(R-g.value.cost)*100/g.value.cost,f.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(R>(((x=l.value)==null?void 0:x.getRetailCost())??R)){u.value=s();const F=(($=l.value)==null?void 0:$.getRetailCost())??0;V=(R-F)*100/F,f.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const F=(A=(P=l.value)==null?void 0:P.priceCoefficients)==null?void 0:A.filter(N=>N.cost<R);if(F&&F.length>0){const N=F.at(-1);u.value=N==null?void 0:N.coefficient,V=(R-((N==null?void 0:N.cost)??0))*100/((N==null?void 0:N.cost)??1)}f.value={validationStatus:void 0,feedback:void 0}}h.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(V),r("update:value",{value:Number.isNaN(V)?void 0:V,coefficient:o(u.value)?void 0:structuredClone(i.toRaw(u.value))})}else r("update:value",{value:Number.isNaN(R)?void 0:R,coefficient:void 0})};return i.onMounted(()=>{var T,R,w,B;n.calculationType===Z.CalculationTypeEnum.m2Cost?m.value=((R=(T=n.value)==null?void 0:T.value)==null?void 0:R.toString())??null:!((w=n.value)!=null&&w.coefficient)&&((B=n.value)!=null&&B.value)&&(u.value=s()),p()}),(T,R)=>{var x,$,P;const w=L.NInput,B=L.NInputGroup;return i.openBlock(),i.createBlock(i.unref(L.NFormItem),{"show-label":!i.unref(M.isNil)(t.label),label:t.label,"show-feedback":!i.unref(M.isNil)(((x=f.value)==null?void 0:x.feedback)??t.feedback),feedback:(($=f.value)==null?void 0:$.feedback)??t.feedback,"validation-status":((P=f.value)==null?void 0:P.validationStatus)??t.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==i.unref(Z.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==i.unref(Z.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(B,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(Vd,{class:"w-full min-w-0 flex-1",value:u.value,"reference-list":d.value,clearable:t.clearable,disabled:t.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":b},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(w,{value:h.value,"onUpdate:value":[R[0]||(R[0]=A=>h.value=A),y],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[R[3]||(R[3]=i.createTextVNode("%",-1))]),_:2},[h.value&&!h.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[R[2]||(R[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||t.calculationType===i.unref(Z.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(w,{key:1,value:m.value,"onUpdate:value":[R[1]||(R[1]=A=>m.value=A),_],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var A;return[i.createTextVNode(i.toDisplayString((A=l.value)==null?void 0:A.currency.symbol),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),I0={key:0,class:"flex flex-row gap-2.5"},O0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},z0={},Id=i.defineComponent({...z0,__name:"base-dialog",props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:"small",scale:.98},tablet:{size:"small",scale:.9},default:{size:"medium",scale:.7}})},modalWidth:{default:void 0},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})},trapFocus:{type:Boolean,default:!0}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=xt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=xt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>r.modalWidth??window.innerWidth*c.value),u=()=>{s("opening"),o.value=!0,s("update:show",o.value)},h=(g="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let f=!1;s("closing",g,()=>{f=!0}),f||(o.value=!1,s("update:show",o.value))},m=()=>{s("accept",f=>{a.value=f})};return i.watch(()=>r.show,g=>{g?u():h("other")}),i.watch(()=>r.processing,g=>{a.value=g}),e({open:u,close:h,acceptHandler:m}),(g,f)=>{const p=L.NButton,b=L.NModal;return i.openBlock(),i.createBlock(b,{loading:a.value,show:o.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:t.title,"trap-focus":t.trapFocus??!0,"action-class":g.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:f[1]||(f[1]=y=>h("header")),onEsc:f[2]||(f[2]=y=>h("esc")),onMaskClick:f[3]||(f[3]=y=>h("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(g.$slots,"default")]),_:2},[g.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(g.$slots,"header")]),key:"0"}:void 0,g.$slots.action||g.$slots["extra-action"]||t.acceptButton.show||t.cancelButton.show?{name:"action",fn:i.withCtx(()=>[g.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",I0,[i.renderSlot(g.$slots,"extra-action")])):i.createCommentVNode("",!0),g.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",O0,[i.renderSlot(g.$slots,"action",{disabled:a.value}),t.acceptButton.show??!0?(i.openBlock(),i.createBlock(p,{key:0,disabled:a.value||!t.valid,size:i.unref(l),type:"primary",onClick:m},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),t.cancelButton.show??!0?(i.openBlock(),i.createBlock(p,{key:1,size:i.unref(l),type:"default",onClick:f[0]||(f[0]=y=>h("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","trap-focus","action-class"])}}}),L0={class:"text-sm"},D0={},H0=i.defineComponent({...D0,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:n}){const r=i.useTemplateRef("form-reference"),s=i.useTemplateRef("base-dialog-reference"),o=i.ref(null),a=i.computed(()=>{var w,B,x;return((w=o.value)==null?void 0:w.unit.isLinear)&&((x=(B=o.value)==null?void 0:B.properties)==null?void 0:x.isLengthConfigurator)}),l=i.ref(void 0),c=i.ref(void 0),d=i.ref(!0),u=i.ref(null),h=n,m=()=>({length:{},quantity:{},marker:{}}),g=i.ref(m()),f=i.ref(!1),p=i.computed(()=>{var P,A,V,F;if(!o.value)return{};const w=Z.UnitsHelper.getProductLengthMultiplicity(o.value),B=Z.UnitsHelper.getProductMultiplicity(o.value),x=((A=(P=o.value)==null?void 0:P.properties)==null?void 0:A.minLength)||w,$=(F=(V=o.value)==null?void 0:V.properties)==null?void 0:F.maxLength;return{length:[ae.required,ae.min(x??.1),ae.max($),ae.step(w),De.serverValidation(g.value.length.feedback)],quantity:[ae.required,ae.min(B),ae.step(B),De.serverValidation(g.value.quantity.feedback)],marker:[De.serverValidation(g.value.marker.feedback)]}}),b=i.computed(()=>{var w,B,x;return o.value?((w=o.value.properties)==null?void 0:w.lengthStep)??((B=o.value.properties)!=null&&B.ignoreMinCountCheck?0:((x=o.value.properties)==null?void 0:x.minCount)??0):0}),y=i.computed(()=>{var x,$,P,A,V,F,N,Y,ee;if(!o.value)return"";const w=(($=(x=o.value)==null?void 0:x.properties)==null?void 0:$.minLength)??((A=(P=o.value)==null?void 0:P.properties)!=null&&A.ignoreMinCountCheck?0:(F=(V=o.value)==null?void 0:V.properties)==null?void 0:F.minCount),B=(Y=(N=o.value)==null?void 0:N.properties)==null?void 0:Y.maxLength;return w||B?`(${w?`от ${w}`:""}${w&&B?" ":""}${B?`до ${B}`:""} ${(ee=o.value)==null?void 0:ee.unit.name})`:""}),_=w=>{var A,V;if(!((V=(A=o.value)==null?void 0:A.properties)!=null&&V.isLengthConfigurator)||!u.value||M.isNil(w)||b.value===0)return;const B=w/b.value,x=Math.round(B),$=Z.UnitsHelper.getProductMultiplicity(o.value),P=Math.max(x,$);u.value.quantity=P},S=w=>{var P,A,V,F;if(!((A=(P=o.value)==null?void 0:P.properties)!=null&&A.isLengthConfigurator)||!u.value||M.isNil(w)||b.value===0)return;const B=w*b.value,x=((V=o.value.properties)==null?void 0:V.minLength)||Z.UnitsHelper.getProductLengthMultiplicity(o.value),$=(F=o.value.properties)==null?void 0:F.maxLength;x!==void 0&&B<x?u.value.length=x:$!==void 0&&B>$?u.value.length=$:u.value.length=B},v=async w=>{var x;const B=M.cloneDeep(u.value);try{await((x=r.value)==null?void 0:x.validate($=>{if(!$){if(!o.value||!B)return;Z.UnitsHelper.productIsMeasurable(o.value)||delete B.length,a.value&&b.value&&(B.length=b.value),f.value=!0,h("submit",B,g.value,()=>{f.value=!1,w(!1),i.nextTick(()=>{var P;(P=r.value)==null||P.validate(M.noop).catch(M.noop)})})}}))}catch{}},T=()=>{o.value=null,l.value=void 0,u.value=null,g.value=m()};return e({show:(w,B)=>{var x,$,P,A,V;if(o.value=w,l.value=B==null?void 0:B.cartItemData,c.value=B==null?void 0:B.orderId,d.value=(B==null?void 0:B.canSetDopProdaga)??!1,u.value=new Z.OrderItemBase((B==null?void 0:B.cartItemData)??new Z.OrderItemBase({product:w,quantity:Z.UnitsHelper.productIsMeasurable(o.value)?1:((x=w==null?void 0:w.properties)==null?void 0:x.minCount)??1,length:(($=w==null?void 0:w.properties)==null?void 0:$.minLength)||((P=w==null?void 0:w.properties)!=null&&P.ignoreMinCountCheck?0:(A=w==null?void 0:w.properties)==null?void 0:A.minCount)||0})),(V=w==null?void 0:w.properties)!=null&&V.isLengthConfigurator&&u.value&&b.value>0){const F=b.value,N=u.value.quantity||1;u.value.length=N*F}},closeDialog:T}),(w,B)=>{var V;const x=L.NFormItem,$=L.NInputGroupLabel,P=L.NInputGroup,A=L.NCheckbox;return i.openBlock(),i.createBlock(Id,{ref:"base-dialog-reference",show:!i.unref(M.isNil)(o.value)&&!i.unref(M.isNil)(u.value),title:`${l.value?"Изменение":"Добавление"} товара ${(V=o.value)==null?void 0:V.name} в ${c.value?` заказ №${c.value}`:"корзину"}`,"accept-button":{show:!0,text:l.value?"Изменить":"Добавить"},processing:f.value,"modal-width":500,onAccept:v,onClosing:T},{default:i.withCtx(()=>{var F;return[o.value&&u.value?(i.openBlock(),i.createBlock(i.unref(L.NForm),{key:0,ref:"form-reference",model:u.value,rules:p.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:i.withKeys(i.withModifiers((F=s.value)==null?void 0:F.acceptHandler,["prevent"]),["enter"])},{default:i.withCtx(()=>[i.unref(Z.UnitsHelper).productIsMeasurable(o.value)?(i.openBlock(),i.createBlock(x,{key:0,path:"length",label:`Метраж, ${y.value+o.value.unit.name}`},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:u.value.length,"onUpdate:value":[B[0]||(B[0]=N=>u.value.length=N),_],parse:i.unref(Pt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:B[1]||(B[1]=N=>i.unref(qa)(N,".",!1)),onInput:B[2]||(B[2]=N=>i.unref(Oe)(g.value,"length")),onFocus:i.unref(ze)},null,8,["value","parse","onFocus"])]),_:1},8,["label"])):i.createCommentVNode("",!0),i.createVNode(x,{path:"quantity",label:"Количество, шт."},{default:i.withCtx(()=>[i.createVNode(P,null,i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:u.value.quantity,"onUpdate:value":[B[3]||(B[3]=N=>u.value.quantity=N),S],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:B[4]||(B[4]=N=>i.unref(st)(N,!1)),onInput:B[5]||(B[5]=N=>i.unref(Oe)(g.value,"quantity")),onFocus:i.unref(ze)},null,8,["value","onFocus"]),a.value?(i.openBlock(),i.createBlock($,{key:0,class:"bg-orange-100 font-bold"},{default:i.withCtx(()=>[i.createTextVNode(" x "+i.toDisplayString(b.value)+" "+i.toDisplayString(o.value.unit.name),1)]),_:1})):i.createCommentVNode("",!0)]),_:2},[!g.value.quantity.feedback&&i.unref(Z.UnitsHelper).getProductMultiplicity(o.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",L0,"Количество должно быть кратно "+i.toDisplayString(i.unref(Z.UnitsHelper).getProductMultiplicity(o.value)),1)]),key:"0"}:void 0]),1024)]),_:1}),i.unref(Z.UnitsHelper).productIsMeasurable(o.value)?(i.openBlock(),i.createBlock(x,{key:1,path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:B[6]||(B[6]=N=>i.unref(Oe)(g.value,"marker")),"onUpdate:value":B[7]||(B[7]=N=>u.value.marker=N??null),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1})):i.createCommentVNode("",!0),d.value?(i.openBlock(),i.createBlock(A,{key:2,checked:u.value.isAdditionalSale,"onUpdate:checked":B[8]||(B[8]=N=>u.value.isAdditionalSale=N),"true-value":!0,"false-value":!1},{default:i.withCtx(()=>[...B[9]||(B[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0)]),_:1},8,["model","rules","onKeydown"])):i.createCommentVNode("",!0)]}),_:1},8,["show","title","accept-button","processing"])}}}),W0={class:"flex flex-row gap-1"},j0={class:"sc-client-name flex flex-col gap-1 text-base"},q0=["href"],X0={key:1,class:"text-sc-grey"},Y0={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},U0={key:0},K0={key:1,class:"text-sm"},G0={},hs=i.defineComponent({...G0,__name:"client-name-with-short-info",props:{client:{},nameLink:{default:void 0},popoverPosition:{default:void 0},showCityAndRegion:{type:Boolean,default:!0},showSalesDirection:{type:Boolean,default:!1},showClientInfoIcon:{type:Boolean,default:!1}},emits:["click:client-name","click:client-info"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>n.client.lastLoginAt?Hn.format(n.client.lastLoginAt,Z.useBaseConfigStateStore().config.dateFormats.uiDateWithTime):""),o=a=>{M.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=zs,d=L.NButton,u=L.NPopover;return i.openBlock(),i.createElementBlock("div",W0,[t.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=h=>a.$emit("click:client-info",t.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(u,{disabled:i.unref(M.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",j0,[i.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=h=>o(h))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!t.client.isActive})},i.toDisplayString(t.client.name),3),t.showSalesDirection&&t.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!t.client.isActive})}," ("+i.toDisplayString(t.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),t.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",X0," [ Деактивирован ] "))],8,q0),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",Y0," г. "+i.toDisplayString(t.client.city.name)+", "+i.toDisplayString(t.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[t.client.alternativeName?(i.openBlock(),i.createElementBlock("div",U0,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",K0," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),Z0={class:"text-base"},Q0={},Od=i.defineComponent({...Q0,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",Z0,i.toDisplayString(t.contragent.name),1))}}),J0={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eb(t,e){return i.openBlock(),i.createElementBlock("svg",J0,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),i.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)])])}const tb=i.markRaw({name:"tabler-mail",render:eb}),nb=["href"],ib={},rb=i.defineComponent({...ib,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=tb;return i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showEmailIcon})},[t.showEmailIcon?(i.openBlock(),i.createBlock(r,{key:0})):i.createCommentVNode("",!0),i.createElementVNode("a",{href:`mailto:${t.email}`,class:"no-underline"},i.toDisplayString(t.email),9,nb)],2)}}}),sb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ob(t,e){return i.openBlock(),i.createElementBlock("svg",sb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M444 49.9C431.3 38.2 379.9.9 265.3.4c0 0-135.1-8.1-200.9 52.3C27.8 89.3 14.9 143 13.5 209.5s-3.1 191.1 117 224.9h.1l-.1 51.6s-.8 20.9 13 25.1c16.6 5.2 26.4-10.7 42.3-27.8c8.7-9.4 20.7-23.2 29.8-33.7c82.2 6.9 145.3-8.9 152.5-11.2c16.6-5.4 110.5-17.4 125.7-142c15.8-128.6-7.6-209.8-49.8-246.5M457.9 287c-12.9 104-89 110.6-103 115.1c-6 1.9-61.5 15.7-131.2 11.2c0 0-52 62.7-68.2 79c-5.3 5.3-11.1 4.8-11-5.7c0-6.9.4-85.7.4-85.7q-.15 0 0 0C43.1 372.7 49.1 266.6 50.2 211.1s11.6-101 42.6-131.6c55.7-50.5 170.4-43 170.4-43c96.9.4 143.3 29.6 154.1 39.4c35.7 30.6 53.9 103.8 40.6 211.1m-139-80.8c.4 8.6-12.5 9.2-12.9.6c-1.1-22-11.4-32.7-32.6-33.9c-8.6-.5-7.8-13.4.7-12.9c27.9 1.5 43.4 17.5 44.8 46.2m20.3 11.3c1-42.4-25.5-75.6-75.8-79.3c-8.5-.6-7.6-13.5.9-12.9c58 4.2 88.9 44.1 87.8 92.5c-.1 8.6-13.1 8.2-12.9-.3m47 13.4c.1 8.6-12.9 8.7-12.9.1c-.6-81.5-54.9-125.9-120.8-126.4c-8.5-.1-8.5-12.9 0-12.9c73.7.5 133 51.4 133.7 139.2M374.9 329v.2c-10.8 19-31 40-51.8 33.3l-.2-.3c-21.1-5.9-70.8-31.5-102.2-56.5c-16.2-12.8-31-27.9-42.4-42.4c-10.3-12.9-20.7-28.2-30.8-46.6c-21.3-38.5-26-55.7-26-55.7c-6.7-20.8 14.2-41 33.3-51.8h.2c9.2-4.8 18-3.2 23.9 3.9c0 0 12.4 14.8 17.7 22.1c5 6.8 11.7 17.7 15.2 23.8c6.1 10.9 2.3 22-3.7 26.6l-12 9.6c-6.1 4.9-5.3 14-5.3 14s17.8 67.3 84.3 84.3c0 0 9.1.8 14-5.3l9.6-12c4.6-6 15.7-9.8 26.6-3.7c14.7 8.3 33.4 21.2 45.8 32.9c7 5.7 8.6 14.4 3.8 23.6"},null,-1)])])}const zd=i.markRaw({name:"fa6-brands-viber",render:ob}),ab={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},lb=["id"],cb=["id"],db=["fill"],ub=["fill"];function hb(t,e){return i.openBlock(),i.createElementBlock("svg",ab,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGBRLHCcSy,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)])],8,lb),i.createElementVNode("linearGradient",{id:t.idMap.SVGHW6lecxh,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[1]||(e[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)])],8,cb)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGBRLHCcSy+")",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"},null,8,db),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGHW6lecxh+")",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"},null,8,ub),e[2]||(e[2]=i.createElementVNode("path",{fill:"#FFF",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"},null,-1))])}const Ld=i.markRaw({name:"logos-whatsapp-icon",render:hb,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),fb={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},mb=["id"],gb=["fill"];function pb(t,e){return i.openBlock(),i.createElementBlock("svg",fb,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGuySfwdaH,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)])],8,mb)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGuySfwdaH+")",d:"M128 0C94.06 0 61.48 13.494 37.5 37.49A128.04 128.04 0 0 0 0 128c0 33.934 13.5 66.514 37.5 90.51C61.48 242.506 94.06 256 128 256s66.52-13.494 90.5-37.49c24-23.996 37.5-56.576 37.5-90.51s-13.5-66.514-37.5-90.51C194.52 13.494 161.94 0 128 0"},null,8,gb),e[1]||(e[1]=i.createElementVNode("path",{fill:"#FFF",d:"M57.94 126.648q55.98-24.384 74.64-32.152c35.56-14.786 42.94-17.354 47.76-17.441c1.06-.017 3.42.245 4.96 1.49c1.28 1.05 1.64 2.47 1.82 3.467c.16.996.38 3.266.2 5.038c-1.92 20.24-10.26 69.356-14.5 92.026c-1.78 9.592-5.32 12.808-8.74 13.122c-7.44.684-13.08-4.912-20.28-9.63c-11.26-7.386-17.62-11.982-28.56-19.188c-12.64-8.328-4.44-12.906 2.76-20.386c1.88-1.958 34.64-31.748 35.26-34.45c.08-.338.16-1.598-.6-2.262c-.74-.666-1.84-.438-2.64-.258c-1.14.256-19.12 12.152-54 35.686c-5.1 3.508-9.72 5.218-13.88 5.128c-4.56-.098-13.36-2.584-19.9-4.708c-8-2.606-14.38-3.984-13.82-8.41c.28-2.304 3.46-4.662 9.52-7.072"},null,-1))])}const Dd=i.markRaw({name:"logos-telegram",render:pb,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),yb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function bb(t,e){return i.openBlock(),i.createElementBlock("svg",yb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M391 480c-19.52 0-46.94-7.06-88-30c-49.93-28-88.55-53.85-138.21-103.38C116.91 298.77 93.61 267.79 61 208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82 73.38 58.16 62.65 74.11 52a176.3 176.3 0 0 1 28.64-15.2c1-.43 1.93-.84 2.76-1.21c4.95-2.23 12.45-5.6 21.95-2c6.34 2.38 12 7.25 20.86 16c18.17 17.92 43 57.83 52.16 77.43c6.15 13.21 10.22 21.93 10.23 31.71c0 11.45-5.76 20.28-12.75 29.81c-1.31 1.79-2.61 3.5-3.87 5.16c-7.61 10-9.28 12.89-8.18 18.05c2.23 10.37 18.86 41.24 46.19 68.51s57.31 42.85 67.72 45.07c5.38 1.15 8.33-.59 18.65-8.47c1.48-1.13 3-2.3 4.59-3.47c10.66-7.93 19.08-13.54 30.26-13.54h.06c9.73 0 18.06 4.22 31.86 11.18c18 9.08 59.11 33.59 77.14 51.78c8.77 8.84 13.66 14.48 16.05 20.81c3.6 9.53.21 17-2 22c-.37.83-.78 1.74-1.21 2.75a176.5 176.5 0 0 1-15.29 28.58c-10.63 15.9-21.4 28.21-39.38 36.58A67.4 67.4 0 0 1 391 480"},null,-1)])])}const Hd=i.markRaw({name:"ion-call",render:bb}),_b={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wb(t,e){return i.openBlock(),i.createElementBlock("svg",_b,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2m10 3a2 2 0 0 1 2 2m-2-6a6 6 0 0 1 6 6"},null,-1)])])}const xb=i.markRaw({name:"tabler-phone-call",render:wb}),kb={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},vb=["href"],Cb=["href"],Sb=["href"],Bb=["href"],Tb={},Rb=i.defineComponent({...Tb,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{try{return e.phone?sr.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=i.computed(()=>{var l;return M.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return M.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return M.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=xb,u=Hd,h=Dd,m=Ld,g=zd;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",{class:i.normalizeClass({"border-xl relative inline-flex items-center rounded px-2":r.value&&a.value,"min-w-10":!0}),onClick:c[0]||(c[0]=f=>a.value=!a.value),onFocusout:c[1]||(c[1]=f=>a.value=!1),onMouseleave:c[2]||(c[2]=f=>a.value=!1)},[i.createElementVNode("div",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showPhoneIcon})},[t.showPhoneIcon?(i.openBlock(),i.createBlock(d,{key:0})):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(s.value),1)],2),r.value&&a.value?(i.openBlock(),i.createElementBlock("div",kb,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${o.value}`,class:"text-blue-600 hover:animate-pulse hover:text-blue-600"},[i.createVNode(u)],8,vb)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(h)],8,Cb)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(m)],8,Sb)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:animate-pulse hover:text-purple-600"},[i.createVNode(g)],8,Bb)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),$b={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Pb(t,e){return i.openBlock(),i.createElementBlock("svg",$b,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m20 8l-8 5l-8-5V6l8 5l8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2"},null,-1)])])}const Nb=i.markRaw({name:"mdi-envelope",render:Pb}),Eb={class:"flex flex-col gap-1"},Fb={key:0,class:"mb-2 flex flex-col text-base"},Ab={key:0,class:"text-sc-dark-grey text-sm"},Mb={key:1,class:"whitespace-nowrap text-sm"},Vb={key:2,class:"whitespace-nowrap text-sm"},Ib={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Ob=["href"],zb=["href"],Lb=["href"],Db=["href"],Hb=["href"],Wb={key:0,class:"flex flex-col text-base"},jb={key:0,class:"text-sc-dark-grey text-sm"},qb={key:1,class:"mt-2 text-sm"},Xb={key:0,class:"-mt-1"},Yb={},Ub=i.defineComponent({...Yb,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{try{return e.contact.phone?sr.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),r=i.computed(()=>{var c;return M.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return M.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return M.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||e.contact.email),l=i.ref(!1);return(c,d)=>{var b,y;const u=Hd,h=Dd,m=Ld,g=zd,f=Nb,p=L.NPopover;return i.openBlock(),i.createElementBlock("div",Eb,[i.createVNode(p,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var _,S,v,T;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(_=t.contact)!=null&&_.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${t.classes}`),style:i.normalizeStyle(t.styles),onMouseenter:d[0]||(d[0]=R=>l.value=!0),onFocusin:d[1]||(d[1]=R=>l.value=!0),onMouseleave:d[2]||(d[2]=R=>l.value=!1),onFocusout:d[3]||(d[3]=R=>l.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(S=t.contact)!=null&&S.position)?(i.openBlock(),i.createElementBlock("div",Fb,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(v=t.contact)!=null&&v.position?(i.openBlock(),i.createElementBlock("span",Ab,i.toDisplayString((T=t.contact)==null?void 0:T.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.contact.phone?(i.openBlock(),i.createElementBlock("div",Mb,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",Vb,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",Ib,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${o.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[i.createVNode(u)],8,Ob)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(h)],8,zb)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(m)],8,Lb)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[i.createVNode(g)],8,Db)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(f)],8,Hb)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var _,S,v,T;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",Wb,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(_=t.contact)!=null&&_.position?(i.openBlock(),i.createElementBlock("span",jb,i.toDisplayString((S=t.contact)==null?void 0:S.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(v=t.contact)!=null&&v.comment?(i.openBlock(),i.createElementBlock("div",qb,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((T=t.contact)==null?void 0:T.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((b=t.contact)!=null&&b.comment)?(i.openBlock(),i.createElementBlock("div",Xb,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((y=t.contact)==null?void 0:y.comment),1)])):i.createCommentVNode("",!0)])}}});class Kb{constructor(e){C(this,"minHeight");C(this,"maxHeights");C(this,"minWidth");C(this,"maxWidths");C(this,"netType");C(this,"color");C(this,"mountType");C(this,"descriptions");C(this,"crossbarCount");C(this,"heightOverlaps");C(this,"widthOverlaps");C(this,"canSetDopProdaga");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=Os.objectToSnake(e.descriptions),this.maxHeights=e.maxHeights,this.maxWidths=e.maxWidths,this.minHeight=e.minHeight,this.minWidth=e.minWidth,this.mountType=e.mountType,this.netType=e.netType,this.heightOverlaps=Os.objectToSnake(e.heightOverlaps),this.widthOverlaps=Os.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}const Gb={class:"flex flex-wrap gap-2"},Zb={class:"flex flex-col"},Qb={class:"flex flex-col"},Jb={},e_=i.defineComponent({...Jb,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>Z.useBaseConfigStateStore().config.dateFormats.uiDate},disabled:{default:()=>({from:!1,to:!1})},predefinedDateRanges:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1}},emits:["update:date-range"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>{if(n.predefinedDateRanges)return n.predefinedDateRanges;if(n.useDefaultPredefinedDateRanges){const a={};return M.forOwn(Z.DateTimeProvider.defaultDateRanges(),(l,c)=>{a[c]={label:l.label,from:l.from??void 0,to:l.to??void 0}}),a}}),o=(a,l)=>{r("update:date-range",{from:a?Hn.startOfDay(new Date(a)):void 0,to:l?Hn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var u,h,m,g,f,p;const c=L.NButton,d=L.NDatePicker;return i.openBlock(),i.createElementBlock("div",Gb,[i.createVNode(d,{value:((h=(u=t.dateRange)==null?void 0:u.from)==null?void 0:h.getTime())??null,clearable:t.clearable,"is-date-disabled":b=>{var y,_;return((y=t.dateRange)==null?void 0:y.to)&&b>((_=t.dateRange)==null?void 0:_.to)},disabled:(m=t.disabled)==null?void 0:m.from,format:t.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[0]||(l[0]=b=>{var y,_;return o(b,(_=(y=t.dateRange)==null?void 0:y.to)==null?void 0:_.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",Zb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(b,y)=>(i.openBlock(),i.createBlock(c,{key:y,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var S,v;return o((S=b==null?void 0:b.from)==null?void 0:S.getTime(),(v=b==null?void 0:b.to)==null?void 0:v.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"]),i.createVNode(d,{value:((f=(g=t.dateRange)==null?void 0:g.to)==null?void 0:f.getTime())??null,clearable:t.clearable,"is-date-disabled":b=>{var y,_;return((y=t.dateRange)==null?void 0:y.from)&&b<((_=t.dateRange)==null?void 0:_.from)},disabled:(p=t.disabled)==null?void 0:p.to,format:t.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[1]||(l[1]=b=>{var y,_;return o((_=(y=t.dateRange)==null?void 0:y.from)==null?void 0:_.getTime(),b)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",Qb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(b,y)=>(i.openBlock(),i.createBlock(c,{key:y,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var S,v;return o((S=b==null?void 0:b.from)==null?void 0:S.getTime(),(v=b==null?void 0:b.to)==null?void 0:v.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"])])}}}),t_={class:"sc-lbl-date text-nowrap"},n_={},zo=i.defineComponent({...n_,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>Hn.format(e.date,Z.useBaseConfigStateStore().config.dateFormats.uiDate)),r=i.computed(()=>Hn.format(e.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",t_,i.toDisplayString(n.value),1),i.createElementVNode("span",{class:i.normalizeClass([{"text-sc-grey":t.isTimeSecondary,"ml-1":!t.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)],2))}}),i_={class:"flex flex-row gap-2.5"},r_={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},s_={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},o_={class:"mb-0.5 sm:mb-0 sm:ml-3"},a_={},l_=i.defineComponent({...a_,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=ds,s=L.NButton,o=L.NPopover;return i.openBlock(),i.createElementBlock("div",i_,[i.createElementVNode("div",r_,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",s_,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",o_,[t.showCloseButton?(i.openBlock(),i.createBlock(o,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(s,{size:"small",type:"error",onClick:n[0]||(n[0]=a=>e.$emit("close"))},{default:i.withCtx(()=>[i.createVNode(r)]),_:1})]),default:i.withCtx(()=>[n[1]||(n[1]=i.createTextVNode(" Закрыть ",-1))]),_:1})):i.createCommentVNode("",!0)])])])])}}}),c_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function d_(t,e){return i.openBlock(),i.createElementBlock("svg",c_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m176 272l80 80l80-80M256 48v288"},null,-1)])])}const u_=i.markRaw({name:"ion-download-outline",render:d_}),h_={},f_=i.defineComponent({...h_,__name:"single-file-upload-selector",props:{draggedAreaText:{},accept:{},isError:{type:Boolean}},emits:["update:file"],setup(t,{emit:e}){const n=t,r=e,s=i.ref([]),o=i.computed(()=>s.value.map(l=>(l.status=n.isError?"error":"finished",l))),a=l=>{s.value=l;const c={name:"",content:""};if(l.length===0){r("update:file",null);return}const d=l[0];c.name=d.name;const u=new FileReader;u.addEventListener("load",()=>{c.content=u.result??"",r("update:file",c)}),u.readAsDataURL(d.file)};return(l,c)=>{const d=u_;return i.openBlock(),i.createBlock(i.unref(L.NUpload),{"file-list":o.value,"default-upload":!1,max:1,"show-retry-button":!1,action:"",accept:t.accept,"directory-dnd":"",class:"content-center","onUpdate:fileList":a},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NUploadDragger),null,{default:i.withCtx(()=>[i.renderSlot(l.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(d,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(t.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3},8,["file-list","accept"])}}}),m_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function g_(t,e){return i.openBlock(),i.createElementBlock("svg",m_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"square","stroke-miterlimit":"10","stroke-width":"44",d:"M465 127L241 384l-92-92m-9 93l-93-93m316-165L236 273"},null,-1)])])}const p_=i.markRaw({name:"ion-checkmark-done-sharp",render:g_}),y_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function b_(t,e){return i.openBlock(),i.createElementBlock("svg",y_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 128h80m-384 0h240m64 256h80m-384 0h240m-96-128h240m-384 0h80"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"128",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"176",cy:"256",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"384",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)])])}const __=i.markRaw({name:"ion-options-outline",render:b_}),w_={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},x_={class:"flex-auto"},k_={class:"sticky top-0 flex flex-none flex-col justify-start gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},v_={class:"flex flex-none flex-col-reverse justify-end gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},C_={},Lo=i.defineComponent({...C_,__name:"inline-view",props:{disabled:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!1},showApplyButton:{type:Boolean,default:!1},showCancelButton:{type:Boolean,default:!1}},emits:["edit","apply","cancel"],setup(t,{emit:e}){const n=e,r=i.ref(!1),s=()=>{n("edit")},o=()=>{r.value=!1},a=()=>{r.value=!0,n("apply",o)},l=()=>{n("cancel",o)};return(c,d)=>{const u=__,h=L.NButton,m=L.NPopover,g=p_,f=ds;return i.openBlock(),i.createElementBlock("div",w_,[i.createElementVNode("div",x_,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",k_,[i.createElementVNode("div",v_,[t.showEditButton?(i.openBlock(),i.createBlock(m,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[0]||(d[0]=i.createTextVNode(" Редактировать данные ",-1))]),_:1})):i.createCommentVNode("",!0),t.showApplyButton?(i.openBlock(),i.createBlock(m,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),t.showCancelButton?(i.openBlock(),i.createBlock(m,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),S_={},Wd=i.defineComponent({...S_,__name:"inline-editable-item",props:{disabled:{type:Boolean,default:!1},showEditor:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!0}},emits:["editor:apply","editor:cancel"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.showEditor),o=l=>{r("editor:apply",d=>{s.value=!d,l()})},a=l=>{s.value=!1,l(),r("editor:cancel")};return i.onMounted(()=>{i.watch(()=>n.showEditor,l=>{s.value=l})}),(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[s.value?(i.openBlock(),i.createBlock(Lo,{key:1,disabled:t.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:o,onCancel:a},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-editor-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"editor")]),_:3},8,["disabled"])):(i.openBlock(),i.createBlock(Lo,{key:0,disabled:t.disabled,"show-edit-button":t.showEditButton,onEdit:c[0]||(c[0]=d=>s.value=!0)},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-viewer-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"viewer")]),_:3},8,["disabled","show-edit-button"]))]))}}),B_={},T_=i.defineComponent({...B_,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.value),o=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=M.debounce(()=>r("update:value",s.value),o.value),l=c=>{s.value=c,a()};return i.watch(()=>n.value,c=>{s.value=c}),(c,d)=>(i.openBlock(),i.createBlock(i.unref(L.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=u=>s.value=u),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),R_={},$_=i.defineComponent({...R_,__name:"debounced-input-number",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:500},placeholder:{default:""},min:{default:void 0},max:{default:void 0},step:{default:1},validator:{type:Function,default:void 0},parse:{type:Function,default:void 0},showButton:{type:Boolean,default:!0}},emits:["update:value","keydown","input","focus"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=M.debounce(()=>s("update:value",o.value),a.value),c=g=>{o.value=g,l()};i.watch(()=>r.value,g=>{o.value=g});const d=i.ref(null);return e({focus:()=>{var g;return(g=d.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=d.value)==null?void 0:g.blur()},select:()=>{var g;return(g=d.value)==null?void 0:g.select()}}),(g,f)=>(i.openBlock(),i.createBlock(i.unref(L.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value??null,clearable:t.clearable,parse:t.parse,"show-button":t.showButton,placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,validator:t.validator,"onUpdate:value":c,onKeydown:f[0]||(f[0]=p=>s("keydown",p)),onInput:f[1]||(f[1]=p=>s("input",p)),onFocus:f[2]||(f[2]=p=>s("focus",p))},{prefix:i.withCtx(()=>[i.renderSlot(g.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),P_={},N_=i.defineComponent({...P_,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref((n.value??"").replaceAll(/\D*/g,"")),o=M.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(M.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(M.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof sr.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}n.debounceTime?o(d):r("update:value",d)},l=c=>{const d=c.replaceAll(/\D*/g,"");try{const u=sr.parsePhoneNumberWithError(`+${d}`);u.isValid()?s.value=u.format("E.164"):u.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(u){if(u instanceof sr.ParseError)s.value=d;else throw u}};return i.watch(()=>n.value,c=>{var d;(c==null?void 0:c.replaceAll(/\D*/g,""))!==((d=s.value)==null?void 0:d.replaceAll(/\D*/g,""))&&l(c)},{immediate:!0}),i.onBeforeMount(()=>l(s.value??"")),(c,d)=>(i.openBlock(),i.createBlock(i.unref(Uh.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=u=>s.value=u),a],"auto-default-country":!1,"auto-format":!0,"default-country":t.defaultCountry,disabled:t.disabled,"input-options":{placeholder:t.placeholder},"preferred-countries":t.preferredCountries,"only-countries":t.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),E_=Wn(N_,[["__scopeId","data-v-751dbb0e"]]),F_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function A_(t,e){return i.openBlock(),i.createElementBlock("svg",F_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"},null,-1)])])}const M_=i.markRaw({name:"tabler-external-link",render:A_}),V_={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},I_=["href"],O_={},z_=i.defineComponent({...O_,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=M_,s=L.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(M.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",V_,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,I_),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),L_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function D_(t,e){return i.openBlock(),i.createElementBlock("svg",L_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 256H176"},null,-1)])])}const H_=i.markRaw({name:"ion-remove-circle-outline",render:D_});let fs=[];const jd=new WeakMap;function W_(){fs.forEach(t=>t(...jd.get(t))),fs=[]}function qd(t,...e){jd.set(t,e),!fs.includes(t)&&fs.push(t)===1&&requestAnimationFrame(W_)}function gr(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function pr(t){return t.composedPath()[0]||null}function yr(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function br(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function en(t,e){const n=t.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw new Error("[seemly/getMargin]:"+t+" is not a valid value.")}return e===void 0?r:r[e]}const Xd={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",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:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",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:"#F00",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:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function j_(t,e,n){e/=100,n/=100;let r=(s,o=(s+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function q_(t,e,n){e/=100,n/=100;let r=e*Math.min(n,1-n),s=(o,a=(o+t/30)%12)=>n-r*Math.max(Math.min(a-3,9-a,1),-1);return[s(0)*255,s(8)*255,s(4)*255]}const _n="^\\s*",wn="\\s*$",Gn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",zt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",mi="([0-9A-Fa-f])",gi="([0-9A-Fa-f]{2})",Yd=new RegExp(`${_n}hsl\\s*\\(${zt},${Gn},${Gn}\\)${wn}`),Ud=new RegExp(`${_n}hsv\\s*\\(${zt},${Gn},${Gn}\\)${wn}`),Kd=new RegExp(`${_n}hsla\\s*\\(${zt},${Gn},${Gn},${zt}\\)${wn}`),Gd=new RegExp(`${_n}hsva\\s*\\(${zt},${Gn},${Gn},${zt}\\)${wn}`),X_=new RegExp(`${_n}rgb\\s*\\(${zt},${zt},${zt}\\)${wn}`),Y_=new RegExp(`${_n}rgba\\s*\\(${zt},${zt},${zt},${zt}\\)${wn}`),U_=new RegExp(`${_n}#${mi}${mi}${mi}${wn}`),K_=new RegExp(`${_n}#${gi}${gi}${gi}${wn}`),G_=new RegExp(`${_n}#${mi}${mi}${mi}${mi}${wn}`),Z_=new RegExp(`${_n}#${gi}${gi}${gi}${gi}${wn}`);function Ft(t){return parseInt(t,16)}function Q_(t){try{let e;if(e=Kd.exec(t))return[gs(e[1]),Zn(e[5]),Zn(e[9]),yi(e[13])];if(e=Yd.exec(t))return[gs(e[1]),Zn(e[5]),Zn(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function J_(t){try{let e;if(e=Gd.exec(t))return[gs(e[1]),Zn(e[5]),Zn(e[9]),yi(e[13])];if(e=Ud.exec(t))return[gs(e[1]),Zn(e[5]),Zn(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function pi(t){try{let e;if(e=K_.exec(t))return[Ft(e[1]),Ft(e[2]),Ft(e[3]),1];if(e=X_.exec(t))return[mt(e[1]),mt(e[5]),mt(e[9]),1];if(e=Y_.exec(t))return[mt(e[1]),mt(e[5]),mt(e[9]),yi(e[13])];if(e=U_.exec(t))return[Ft(e[1]+e[1]),Ft(e[2]+e[2]),Ft(e[3]+e[3]),1];if(e=Z_.exec(t))return[Ft(e[1]),Ft(e[2]),Ft(e[3]),yi(Ft(e[4])/255)];if(e=G_.exec(t))return[Ft(e[1]+e[1]),Ft(e[2]+e[2]),Ft(e[3]+e[3]),yi(Ft(e[4]+e[4])/255)];if(t in Xd)return pi(Xd[t]);if(Yd.test(t)||Kd.test(t)){const[n,r,s,o]=Q_(t);return[...q_(n,r,s),o]}else if(Ud.test(t)||Gd.test(t)){const[n,r,s,o]=J_(t);return[...j_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function e1(t){return t>1?1:t<0?0:t}function Do(t,e,n,r){return`rgba(${mt(t)}, ${mt(e)}, ${mt(n)}, ${e1(r)})`}function Ho(t,e,n,r,s){return mt((t*e*(1-r)+n*r)/s)}function t1(t,e){Array.isArray(t)||(t=pi(t)),Array.isArray(e)||(e=pi(e));const n=t[3],r=e[3],s=yi(n+r-n*r);return Do(Ho(t[0],n,e[0],r,s),Ho(t[1],n,e[1],r,s),Ho(t[2],n,e[2],r,s),s)}function Ve(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:pi(t);return typeof e.alpha=="number"?Do(n,r,s,e.alpha):Do(n,r,s,o)}function ms(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:pi(t),{lightness:a=1,alpha:l=1}=e;return n1([n*a,r*a,s*a,o*l])}function yi(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function gs(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function mt(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Zn(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function n1(t){const[e,n,r]=t;return 3 in t?`rgba(${mt(e)}, ${mt(n)}, ${mt(r)}, ${yi(t[3])})`:`rgba(${mt(e)}, ${mt(n)}, ${mt(r)}, 1)`}function i1(t=8){return Math.random().toString(16).slice(2,2+t)}function Zd(t){return Array.isArray(t)?t:[t]}const Wo={STOP:"STOP"};function Qd(t,e){const n=e(t);t.children!==void 0&&n!==Wo.STOP&&t.children.forEach(r=>Qd(r,e))}function r1(t,e={}){const{preserveGroup:n=!1}=e,r=[],s=n?a=>{a.isLeaf||(r.push(a.key),o(a.children))}:a=>{a.isLeaf||(a.isGroup||r.push(a.key),o(a.children))};function o(a){a.forEach(s)}return o(t),r}function s1(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function o1(t){return t.children}function a1(t){return t.key}function l1(){return!1}function c1(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function d1(t){return t.disabled===!0}function u1(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function h1(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function jo(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function qo(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function f1(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function m1(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function g1(t){return(t==null?void 0:t.type)==="group"}function p1(t){const e=new Map;return t.forEach((n,r)=>{e.set(n.key,r)}),n=>{var r;return(r=e.get(n))!==null&&r!==void 0?r:null}}class y1 extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function b1(t,e,n,r){return ps(e.concat(t),n,r,!1)}function _1(t,e){const n=new Set;return t.forEach(r=>{const s=e.treeNodeMap.get(r);if(s!==void 0){let o=s.parent;for(;o!==null&&!(o.disabled||n.has(o.key));)n.add(o.key),o=o.parent}}),n}function w1(t,e,n,r){const s=ps(e,n,r,!1),o=ps(t,n,r,!0),a=_1(t,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function Xo(t,e){const{checkedKeys:n,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=t;if(!a)return r!==void 0?{checkedKeys:f1(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:m1(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:u}=e;let h;s!==void 0?h=w1(s,n,e,d):r!==void 0?h=b1(r,n,e,d):h=ps(n,e,d,!1);const m=c==="parent",g=c==="child"||l,f=h,p=new Set,b=Math.max.apply(null,Array.from(u.keys()));for(let y=b;y>=0;y-=1){const _=y===0,S=u.get(y);for(const v of S){if(v.isLeaf)continue;const{key:T,shallowLoaded:R}=v;if(g&&R&&v.children.forEach($=>{!$.disabled&&!$.isLeaf&&$.shallowLoaded&&f.has($.key)&&f.delete($.key)}),v.disabled||!R)continue;let w=!0,B=!1,x=!0;for(const $ of v.children){const P=$.key;if(!$.disabled){if(x&&(x=!1),f.has(P))B=!0;else if(p.has(P)){B=!0,w=!1;break}else if(w=!1,B)break}}w&&!x?(m&&v.children.forEach($=>{!$.disabled&&f.has($.key)&&f.delete($.key)}),f.add(T)):B&&p.add(T),_&&g&&f.has(T)&&f.delete(T)}}return{checkedKeys:Array.from(f),indeterminateKeys:Array.from(p)}}function ps(t,e,n,r){const{treeNodeMap:s,getChildren:o}=e,a=new Set,l=new Set(t);return t.forEach(c=>{const d=s.get(c);d!==void 0&&Qd(d,u=>{if(u.disabled)return Wo.STOP;const{key:h}=u;if(!a.has(h)&&(a.add(h),l.add(h),u1(u.rawNode,o))){if(r)return Wo.STOP;if(!n)throw new y1}})}),l}function x1(t,{includeGroup:e=!1,includeSelf:n=!0},r){var s;const o=r.treeNodeMap;let a=t==null?null:(s=o.get(t))!==null&&s!==void 0?s:null;const l={keyPath:[],treeNodePath:[],treeNode:a};if(a!=null&&a.ignored)return l.treeNode=null,l;for(;a;)!a.ignored&&(e||!a.isGroup)&&l.treeNodePath.push(a),a=a.parent;return l.treeNodePath.reverse(),n||l.treeNodePath.pop(),l.keyPath=l.treeNodePath.map(c=>c.key),l}function k1(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function v1(t,e){const n=t.siblings,r=n.length,{index:s}=t;return e?n[(s+1)%r]:s===n.length-1?null:n[s+1]}function Jd(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const s=e==="prev"?C1:v1,o={reverse:e==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===t){if(!a)a=!0;else if(!t.disabled&&!t.isGroup){l=t;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const u=Yo(d,o);u!==null?l=u:c(s(d,n))}else{const u=s(d,!1);if(u!==null)c(u);else{const h=S1(d);h!=null&&h.isGroup?c(s(h,n)):n&&c(s(d,!0))}}}}return c(t),l}function C1(t,e){const n=t.siblings,r=n.length,{index:s}=t;return e?n[(s-1+r)%r]:s===0?null:n[s-1]}function S1(t){return t.parent}function Yo(t,e={}){const{reverse:n=!1}=e,{children:r}=t;if(r){const{length:s}=r,o=n?s-1:0,a=n?-1:s,l=n?-1:1;for(let c=o;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const u=Yo(d,e);if(u!==null)return u}else return d}}return null}const B1={getChild(){return this.ignored?null:Yo(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return Jd(this,"next",t)},getPrev(t={}){return Jd(this,"prev",t)}};function T1(t,e){const n=e?new Set(e):void 0,r=[];function s(o){o.forEach(a=>{r.push(a),!(a.isLeaf||!a.children||a.ignored)&&(a.isGroup||n===void 0||n.has(a.key))&&s(a.children)})}return s(t),r}function R1(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var $1={};function eu(t,e,n,r,s,o=null,a=0){const l=[];return t.forEach((c,d)=>{var u;$1.NODE_ENV!=="production"&&h1(c,s)&&console.error("[treemate]: node",c,"is invalid");const h=Object.create(r);if(h.rawNode=c,h.siblings=l,h.level=a,h.index=d,h.isFirstChild=d===0,h.isLastChild=d+1===t.length,h.parent=o,!h.ignored){const m=s(c);Array.isArray(m)&&(h.children=eu(m,e,n,r,s,h,a+1))}l.push(h),e.set(h.key,h),n.has(a)||n.set(a,[]),(u=n.get(a))===null||u===void 0||u.push(h)}),l}function P1(t,e={}){var n;const r=new Map,s=new Map,{getDisabled:o=d1,getIgnored:a=l1,getIsGroup:l=g1,getKey:c=a1}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:o1,u=e.ignoreEmptyChildren?v=>{const T=d(v);return Array.isArray(T)?T.length?T:null:T}:d,h=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return s1(this.rawNode,u)},get shallowLoaded(){return c1(this.rawNode,u)},get ignored(){return a(this.rawNode)},contains(v){return R1(this,v)}},B1),m=eu(t,r,s,h,u);function g(v){if(v==null)return null;const T=r.get(v);return T&&!T.isGroup&&!T.ignored?T:null}function f(v){if(v==null)return null;const T=r.get(v);return T&&!T.ignored?T:null}function p(v,T){const R=f(v);return R?R.getPrev(T):null}function b(v,T){const R=f(v);return R?R.getNext(T):null}function y(v){const T=f(v);return T?T.getParent():null}function _(v){const T=f(v);return T?T.getChild():null}const S={treeNodes:m,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:u,getFlattenedNodes(v){return T1(m,v)},getNode:g,getPrev:p,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return k1(m)},getPath(v,T={}){return x1(v,T,S)},getCheckedKeys(v,T={}){const{cascade:R=!0,leafOnly:w=!1,checkStrategy:B="all",allowNotLoaded:x=!1}=T;return Xo({checkedKeys:jo(v),indeterminateKeys:qo(v),cascade:R,leafOnly:w,checkStrategy:B,allowNotLoaded:x},S)},check(v,T,R={}){const{cascade:w=!0,leafOnly:B=!1,checkStrategy:x="all",allowNotLoaded:$=!1}=R;return Xo({checkedKeys:jo(T),indeterminateKeys:qo(T),keysToCheck:v==null?[]:Zd(v),cascade:w,leafOnly:B,checkStrategy:x,allowNotLoaded:$},S)},uncheck(v,T,R={}){const{cascade:w=!0,leafOnly:B=!1,checkStrategy:x="all",allowNotLoaded:$=!1}=R;return Xo({checkedKeys:jo(T),indeterminateKeys:qo(T),keysToUncheck:v==null?[]:Zd(v),cascade:w,leafOnly:B,checkStrategy:x,allowNotLoaded:$},S)},getNonLeafKeys(v={}){return r1(m,v)}};return S}function ys(t){return t.composedPath()[0]}const N1={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function E1(t,e,n){if(t==="mousemoveoutside"){const r=s=>{e.contains(ys(s))||n(s)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const s=a=>{r=!e.contains(ys(a))},o=a=>{r&&(e.contains(ys(a))||n(a))};return{mousedown:s,mouseup:o,touchstart:s,touchend:o}}return console.error(`[evtd/create-trap-handler]: name \`${t}\` is invalid. This could be a bug of evtd.`),{}}function tu(t,e,n){const r=N1[t];let s=r.get(e);s===void 0&&r.set(e,s=new WeakMap);let o=s.get(n);return o===void 0&&s.set(n,o=E1(t,e,n)),o}function F1(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=tu(t,e,n);return Object.keys(s).forEach(o=>{Bt(o,document,s[o],r)}),!0}return!1}function A1(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=tu(t,e,n);return Object.keys(s).forEach(o=>{it(o,document,s[o],r)}),!0}return!1}function M1(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const t=new WeakMap,e=new WeakMap;function n(){t.set(this,!0)}function r(){t.set(this,!0),e.set(this,!0)}function s(w,B,x){const $=w[B];return w[B]=function(){return x.apply(w,arguments),$.apply(w,arguments)},w}function o(w,B){w[B]=Event.prototype[B]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var w;return(w=a.get(this))!==null&&w!==void 0?w:null}function d(w,B){l!==void 0&&Object.defineProperty(w,"currentTarget",{configurable:!0,enumerable:!0,get:B??l.get})}const u={bubble:{},capture:{}},h={};function m(){const w=function(B){const{type:x,eventPhase:$,bubbles:P}=B,A=ys(B);if($===2)return;const V=$===1?"capture":"bubble";let F=A;const N=[];for(;F===null&&(F=window),N.push(F),F!==window;)F=F.parentNode||null;const Y=u.capture[x],ee=u.bubble[x];if(s(B,"stopPropagation",n),s(B,"stopImmediatePropagation",r),d(B,c),V==="capture"){if(Y===void 0)return;for(let I=N.length-1;I>=0&&!t.has(B);--I){const z=N[I],q=Y.get(z);if(q!==void 0){a.set(B,z);for(const W of q){if(e.has(B))break;W(B)}}if(I===0&&!P&&ee!==void 0){const W=ee.get(z);if(W!==void 0)for(const O of W){if(e.has(B))break;O(B)}}}}else if(V==="bubble"){if(ee===void 0)return;for(let I=0;I<N.length&&!t.has(B);++I){const z=N[I],q=ee.get(z);if(q!==void 0){a.set(B,z);for(const W of q){if(e.has(B))break;W(B)}}}}o(B,"stopPropagation"),o(B,"stopImmediatePropagation"),d(B)};return w.displayName="evtdUnifiedHandler",w}function g(){const w=function(B){const{type:x,eventPhase:$}=B;if($!==2)return;const P=h[x];P!==void 0&&P.forEach(A=>A(B))};return w.displayName="evtdUnifiedWindowEventHandler",w}const f=m(),p=g();function b(w,B){const x=u[w];return x[B]===void 0&&(x[B]=new Map,window.addEventListener(B,f,w==="capture")),x[B]}function y(w){return h[w]===void 0&&(h[w]=new Set,window.addEventListener(w,p)),h[w]}function _(w,B){let x=w.get(B);return x===void 0&&w.set(B,x=new Set),x}function S(w,B,x,$){const P=u[B][x];if(P!==void 0){const A=P.get(w);if(A!==void 0&&A.has($))return!0}return!1}function v(w,B){const x=h[w];return!!(x!==void 0&&x.has(B))}function T(w,B,x,$){let P;if(typeof $=="object"&&$.once===!0?P=Y=>{R(w,B,P,$),x(Y)}:P=x,F1(w,B,P,$))return;const V=$===!0||typeof $=="object"&&$.capture===!0?"capture":"bubble",F=b(V,w),N=_(F,B);if(N.has(P)||N.add(P),B===window){const Y=y(w);Y.has(P)||Y.add(P)}}function R(w,B,x,$){if(A1(w,B,x,$))return;const A=$===!0||typeof $=="object"&&$.capture===!0,V=A?"capture":"bubble",F=b(V,w),N=_(F,B);if(B===window&&!S(B,A?"bubble":"capture",w,x)&&v(w,x)){const ee=h[w];ee.delete(x),ee.size===0&&(window.removeEventListener(w,p),h[w]=void 0)}N.has(x)&&N.delete(x),N.size===0&&F.delete(B),F.size===0&&(window.removeEventListener(w,f,V==="capture"),u[V][w]=void 0)}return{on:T,off:R}}const{on:Bt,off:it}=M1(),Ki="@@mmoContext",V1={mounted(t,{value:e}){t[Ki]={handler:void 0},typeof e=="function"&&(t[Ki].handler=e,Bt("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Ki];typeof e=="function"?n.handler?n.handler!==e&&(it("mousemoveoutside",t,n.handler),n.handler=e,Bt("mousemoveoutside",t,e)):(t[Ki].handler=e,Bt("mousemoveoutside",t,e)):n.handler&&(it("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Ki];e&&it("mousemoveoutside",t,e),t[Ki].handler=void 0}},Gi="@@coContext",bs={mounted(t,{value:e,modifiers:n}){t[Gi]={handler:void 0},typeof e=="function"&&(t[Gi].handler=e,Bt("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Gi];typeof e=="function"?r.handler?r.handler!==e&&(it("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,Bt("clickoutside",t,e,{capture:n.capture})):(t[Gi].handler=e,Bt("clickoutside",t,e,{capture:n.capture})):r.handler&&(it("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Gi];n&&it("clickoutside",t,n,{capture:e.capture}),t[Gi].handler=void 0}};function I1(t,e){console.error(`[vdirs/${t}]: ${e}`)}class O1{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,n){const{elementZIndex:r}=this;if(n!==void 0){e.style.zIndex=`${n}`,r.delete(e);return}const{nextZIndex:s}=this;r.has(e)&&r.get(e)+1===this.nextZIndex||(e.style.zIndex=`${s}`,r.set(e,s),this.nextZIndex=s+1,this.squashState())}unregister(e,n){const{elementZIndex:r}=this;r.has(e)?r.delete(e):n===void 0&&I1("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){const e=Array.from(this.elementZIndex.entries());e.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,e.forEach(n=>{const r=n[0],s=this.nextZIndex++;`${s}`!==r.style.zIndex&&(r.style.zIndex=`${s}`)})}}const Uo=new O1,Zi="@@ziContext",nu={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n;t[Zi]={enabled:!!s,initialized:!1},s&&(Uo.ensureZIndex(t,r),t[Zi].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n,o=t[Zi].enabled;s&&!o&&(Uo.ensureZIndex(t,r),t[Zi].initialized=!0),t[Zi].enabled=!!s},unmounted(t,e){if(!t[Zi].initialized)return;const{value:n={}}=e,{zIndex:r}=n;Uo.unregister(t,r)}};function z1(t){const e=i.ref(!!t.value);if(e.value)return i.readonly(e);const n=i.watch(t,r=>{r&&(e.value=!0,n())});return i.readonly(e)}function Ut(t){const e=i.computed(t),n=i.ref(e.value);return i.watch(e,r=>{n.value=r}),typeof t=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){t.set(r)}}}const L1=typeof window<"u";let Qi,_r;(()=>{var t,e;Qi=L1?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,_r=!1,Qi!==void 0?Qi.then(()=>{_r=!0}):_r=!0})();function D1(t){if(_r)return;let e=!1;i.onMounted(()=>{_r||Qi==null||Qi.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Ko(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function _s(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function iu(t,e){return i.computed(()=>{for(const n of e)if(t[n]!==void 0)return t[n];return t[e[e.length-1]]})}const H1=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function W1(){return H1}function Go(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function Zo(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){Zo(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Zo(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function ru(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const s=Zo(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let Qn=null;function su(){if(Qn===null&&(Qn=document.getElementById("v-binder-view-measurer"),Qn===null)){Qn=document.createElement("div"),Qn.id="v-binder-view-measurer";const{style:t}=Qn;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(Qn)}return Qn.getBoundingClientRect()}function j1(t,e){const n=su();return{top:e,left:t,height:0,width:0,right:n.width-t,bottom:n.height-e}}function Qo(t){const e=t.getBoundingClientRect(),n=su();return{left:e.left-n.left,top:e.top-n.top,bottom:n.height+n.top-e.bottom,right:n.width+n.left-e.right,width:e.width,height:e.height}}function q1(t){return t.nodeType===9?null:t.parentNode}function ou(t){if(t===null)return null;const e=q1(t);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(n+s+r))return e}return ou(e)}const au=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(t){var e;i.provide("VBinder",(e=i.getCurrentInstance())===null||e===void 0?void 0:e.proxy);const n=i.inject("VBinder",null),r=i.ref(null),s=y=>{r.value=y,n&&t.syncTargetWithParent&&n.setTargetRef(y)};let o=[];const a=()=>{let y=r.value;for(;y=ou(y),y!==null;)o.push(y);for(const _ of o)Bt("scroll",_,h,!0)},l=()=>{for(const y of o)it("scroll",y,h,!0);o=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},u=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},h=()=>{qd(m)},m=()=>{c.forEach(y=>y())},g=new Set,f=y=>{g.size===0&&Bt("resize",window,b),g.has(y)||g.add(y)},p=y=>{g.has(y)&&g.delete(y),g.size===0&&it("resize",window,b)},b=()=>{g.forEach(y=>y())};return i.onBeforeUnmount(()=>{it("resize",window,b),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:u,addResizeListener:f,removeResizeListener:p}},render(){return Go("binder",this.$slots)}}),lu=i.defineComponent({name:"Target",setup(){const{setTargetRef:t,syncTarget:e}=i.inject("VBinder");return{syncTarget:e,setTargetDirective:{mounted:t,updated:t}}},render(){const{syncTarget:t,setTargetDirective:e}=this;return t?i.withDirectives(ru("follower",this.$slots),[[e]]):ru("follower",this.$slots)}}),X1="@css-render/vue3-ssr";function Y1(t,e){return`<style cssr-id="${t}">
103
+ `}},Jr=Di.Multiply,ep=[1,0,0,0,1,0,0,0,1],Kn=new un(9),tp=ft.Utils,Sc=new te,xo=new un([0,0,1,0,0,1,0,1,1,0,1,1]),_e={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:je.document?je.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Di,group:{removeChild:function(t,e){if(t.children)for(let n=0;n<t.children.length;n++)_e.group.removeChild(t.children[n],e);t._renderer.texture&&(e.deleteTexture(t._renderer.texture),delete t._renderer.texture),t._renderer.positionBuffer&&(e.deleteBuffer(t._renderer.positionBuffer),delete t._renderer.positionBuffer)},render:function(t,e){if(!this._visible)return;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.parent,r=n._matrix&&n._matrix.manual||n._flagMatrix,s=this._matrix.manual||this._flagMatrix;if((r||s)&&(this._renderer.matrix||(this._renderer.matrix=new un(9)),this._matrix.toTransformArray(!0,Kn),Jr(Kn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof te||(this._renderer.scale=new te),this._scale instanceof te?(this._renderer.scale.x=this._scale.x,this._renderer.scale.y=this._scale.y):(this._renderer.scale.x=this._scale,this._renderer.scale.y=this._scale),/renderer/i.test(n._renderer.type)||(this._renderer.scale.x*=n._renderer.scale.x,this._renderer.scale.y*=n._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const a=ft.Utils.getRendererType(this._mask._renderer.type);_e[a].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}this._flagOpacity=n._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);let o;if(this._flagSubtractions)for(o=0;o<this.subtractions.length;o++)_e.group.removeChild(this.subtractions[o],t);for(o=0;o<this.children.length;o++){const a=this.children[o],l=ft.Utils.getRendererType(a._renderer.type);_e[l].render.call(a,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let n,r,s,o,a,l,c,d,u,h,m,g,f,p;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,S=t.renderer.ratio,v=Sc.copy(e._renderer.scale).multiply(S),T=e._stroke,R=e._linewidth,w=e._fill,B=e._renderer.opacity||e._opacity,x=e._cap,$=e._join,P=e._miter,A=e._closed,V=e.dashes,F=b.length,N=F-1;y.width=Math.max(Math.ceil(e._renderer.rect.width*v.x),1),y.height=Math.max(Math.ceil(e._renderer.rect.height*v.y),1);const Y=e._renderer.rect.centroid,ee=Y.x,I=Y.y;if(_.clearRect(0,0,y.width,y.height),w)if(typeof w=="string")_.fillStyle=w;else{const oe=ft.Utils.getRendererType(w._renderer.type);_e[oe].render.call(w,_,e),_.fillStyle=w._renderer.effect}if(T){if(typeof T=="string")_.strokeStyle=T;else{const oe=ft.Utils.getRendererType(T._renderer.type);_e[oe].render.call(T,_,e),_.strokeStyle=T._renderer.effect}R&&(_.lineWidth=hn(e)),P&&(_.miterLimit=P),$&&(_.lineJoin=$),!A&&x&&(_.lineCap=x)}typeof B=="number"&&(_.globalAlpha=B),V&&V.length>0&&(_.lineDashOffset=V.offset||0,_.setLineDash(V));let z,q,W,O,D,j,G,ue;_.save(),_.scale(v.x,v.y),_.translate(ee,I),_.beginPath();for(let oe=0;oe<b.length;oe++){const re=b[oe];switch(g=re.x,f=re.y,re.command){case ne.close:_.closePath();break;case ne.arc:q=re.rx,W=re.ry,O=re.xAxisRotation,D=re.largeArcFlag,j=re.sweepFlag,n=A?It(oe-1,F):Math.max(oe-1,0),r=b[n],G=r.x,ue=r.y,tp.renderSvgArcCommand(_,G,ue,q,W,D,j,O,g,f);break;case ne.curve:n=A?It(oe-1,F):Math.max(oe-1,0),r=b[n],d=r.controls&&r.controls.right||te.zero,u=re.controls&&re.controls.left||te.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),re._relative?(o=u.x+re.x,a=u.y+re.y):(o=u.x,a=u.y),_.bezierCurveTo(l,c,o,a,g,f),oe>=N&&A&&(s=z,h=re.controls&&re.controls.right||te.zero,m=s.controls&&s.controls.left||te.zero,re._relative?(l=h.x+re.x,c=h.y+re.y):(l=h.x,c=h.y),s._relative?(o=m.x+s.x,a=m.y+s.y):(o=m.x,a=m.y),g=s.x,f=s.y,_.bezierCurveTo(l,c,o,a,g,f));break;case ne.line:_.lineTo(g,f);break;case ne.move:z=re,_.moveTo(g,f);break}}A&&_.closePath(),_e.isHidden.test(w)||(p=w._renderer&&w._renderer.offset,p&&(_.save(),_.translate(-w._renderer.offset.x,-w._renderer.offset.y),_.scale(w._renderer.scale.x,w._renderer.scale.y)),_.fill(),p&&_.restore()),_e.isHidden.test(T)||(p=T._renderer&&T._renderer.offset,p&&(_.save(),_.translate(-T._renderer.offset.x,-T._renderer.offset.y),_.scale(T._renderer.scale.x,T._renderer.scale.y),_.lineWidth=R/T._renderer.scale.x),_.stroke(),p&&_.restore()),_.restore()},getBoundingClientRect:function(t,e,n){let r=1/0,s=-1/0,o=1/0,a=-1/0,l,c;t.forEach(function(d){const u=d.x,h=d.y,m=d.controls;let g,f,p,b,y,_;o=Math.min(h,o),r=Math.min(u,r),s=Math.max(u,s),a=Math.max(h,a),d.controls&&(y=m.left,_=m.right,!(!y||!_)&&(g=d._relative?y.x+u:y.x,f=d._relative?y.y+h:y.y,p=d._relative?_.x+u:_.x,b=d._relative?_.y+h:_.y,!(!g||!f||!p||!b)&&(o=Math.min(f,b,o),r=Math.min(g,p,r),s=Math.max(g,p,s),a=Math.max(f,b,a))))}),typeof e=="number"&&(o-=e,r-=e,s+=e,a+=e),l=s-r,c=a-o,n.top=o,n.left=r,n.right=s,n.bottom=a,n.width=l,n.height=c,n.centroid||(n.centroid={}),n.centroid.x=-r,n.centroid.y=-o},render:function(t,e,n){if(!this._visible||!this._opacity)return this;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=ft.Utils.getRendererType(this._renderer.type),o=e[s],a=r._matrix.manual||r._flagMatrix,l=this._matrix.manual||this._flagMatrix,c=this._renderer.parent!==r,d=this._flagVertices||this._flagFill||this._fill instanceof qe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Xe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof qe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Xe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagCap||this._flagJoin||this._flagMiter||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(a||l||c){this._renderer.matrix||(this._renderer.matrix=new un(9)),this._matrix.toTransformArray(!0,Kn),Jr(Kn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof te||(this._renderer.scale=new te);let h,m;this._scale instanceof te?(h=this._scale.x*r._renderer.scale.x,m=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,m=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=m<0?-m:m,c&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const h=ft.Utils.getRendererType(this._mask._renderer.type);_e[h].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,_e.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),_e.updateTexture.call(_e,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;e.current!==o&&(t.useProgram(o),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,xo,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const u=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,u.left,u.top,u.right,u.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(t,e){let n;const r=this.canvas,s=this.ctx,o=t.renderer.ratio,a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,h=e._size*o;let m=h;_e.isHidden.test(a)||(m+=l),r.width=ml(m),r.height=r.width;const g=m/r.width,f=r.width/2,p=r.height/2;if(s.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")s.fillStyle=c;else{const b=ft.Utils.getRendererType(c._renderer.type);_e[b].render.call(c,s,e),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const b=ft.Utils.getRendererType(a._renderer.type);_e[b].render.call(a,s,e),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=hn(e)/g)}typeof d=="number"&&(s.globalAlpha=d),u&&u.length>0&&(s.lineDashOffset=u.offset||0,s.setLineDash(u)),s.save(),s.translate(f,p),s.scale(_e.precision,_e.precision),s.beginPath(),s.arc(0,0,h/g*.5,0,ut),s.restore(),closed&&s.closePath(),_e.isHidden.test(c)||(n=c._renderer&&c._renderer.offset,n&&(s.save(),s.translate(-c._renderer.offset.x,-c._renderer.offset.y),s.scale(c._renderer.scale.x,c._renderer.scale.y)),s.fill(),n&&s.restore()),_e.isHidden.test(a)||(n=a._renderer&&a._renderer.offset,n&&(s.save(),s.translate(-a._renderer.offset.x,-a._renderer.offset.y),s.scale(a._renderer.scale.x,a._renderer.scale.y),s.lineWidth=l/a._renderer.scale.x),s.stroke(),n&&s.restore())},render:function(t,e,n){if(!this._visible||!this._opacity)return this;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size;const s=n||this.parent,o=e[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=s._matrix.manual||s._flagMatrix,u=this._matrix.manual||this._flagMatrix,h=this._renderer.parent!==s,m=this._renderer.vertices,g=this._renderer.collection.length,f=this._flagVertices,p=this._flagFill||this._fill instanceof qe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Xe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof qe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Xe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||s._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||u||h){this._renderer.matrix||(this._renderer.matrix=new un(9)),this._matrix.toTransformArray(!0,Kn),Jr(Kn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof te||(this._renderer.scale=new te);let b,y;this._scale instanceof te?(b=this._scale.x*s._renderer.scale.x,y=this._scale.y*s._renderer.scale.y):(b=this._scale*s._renderer.scale.x,y=this._scale*s._renderer.scale.y),this._renderer.scale.x=b<0?-b:b,this._renderer.scale.y=y<0?-y:y,h&&(this._renderer.parent=s)}if(f){const b=this._renderer.positionBuffer;b&&t.deleteBuffer(b),this._renderer.positionBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this._renderer.positionBuffer),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,m,t.STATIC_DRAW)}return p?(this._renderer.opacity=this._opacity*s._renderer.opacity,_e.updateTexture.call(_e,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(_e.isHidden.test(l)||(r+=c),r/=_e.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),e.current!==o&&(t.useProgram(o),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture),t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform1f(o.size,r*e.resolution.ratio),t.drawArrays(t.POINTS,0,g),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(t,e){const n=this.canvas,r=this.ctx,s=t.renderer.ratio,o=Sc.copy(e._renderer.scale).multiply(s),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,h=e._decoration,m=e._direction;n.width=Math.max(Math.ceil(e._renderer.rect.width*o.x),1),n.height=Math.max(Math.ceil(e._renderer.rect.height*o.y),1);const g=e._renderer.rect.centroid,f=g.x,p=g.y;let b,y,_,S,v,T,R,w,B,x,$;const P=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),P||(r.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=m,c)if(typeof c=="string")r.fillStyle=c;else{const A=ft.Utils.getRendererType(c._renderer.type);_e[A].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const A=ft.Utils.getRendererType(a._renderer.type);_e[A].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=hn(e))}if(typeof d=="number"&&(r.globalAlpha=d),u&&u.length>0&&(r.lineDashOffset=u.offset||0,r.setLineDash(u)),r.save(),r.scale(o.x,o.y),r.translate(f,p),_e.isHidden.test(c)||(c._renderer&&c._renderer.offset?(T=c._renderer.scale.x,R=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(T,R),b=e._size/c._renderer.scale.y,y=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,S=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,S),r.restore()):r.fillText(e.value,0,0)),_e.isHidden.test(a)||(a._renderer&&a._renderer.offset?(T=a._renderer.scale.x,R=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(T,R),b=e._size/a._renderer.scale.y,y=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,S=a._renderer.offset.y/a._renderer.scale.y,v=l/a._renderer.scale.x,r.lineWidth=v,r.strokeText(e.value,_,S),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(h)){const A=r.measureText(e.value);switch(h){case"underline":B=A.actualBoundingBoxDescent,$=A.actualBoundingBoxDescent;break;case"strikethrough":B=0,$=0;break}w=-A.width/2,x=A.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(w,B),r.lineTo(x,$),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const n=_e.ctx;n.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),n.textAlign="center",n.textBaseline=ft.Utils.baselines[t._baseline]||t._baseline;const r=n.measureText(t._value);let s=r.width,o=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!_e.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(_e.alignments[t._alignment]||t._alignment){case _e.alignments.left:t.direction==="ltr"?(e.left=0,e.right=s):(e.left=-s,e.right=0);break;case _e.alignments.right:t.direction==="ltr"?(e.left=-s,e.right=0):(e.left=0,e.right=s);break;default:e.left=-a,e.right=a}switch(t._baseline){case"bottom":e.top=-o,e.bottom=0;break;case"top":e.top=0,e.bottom=o;break;case"baseline":e.top=-l*1.5,e.bottom=l*.5;break;default:e.top=-l,e.bottom=l}e.width=s,e.height=o,e.centroid||(e.centroid={}),e.centroid.x=a,e.centroid.y=l},render:function(t,e,n){if(!this._visible||!this._opacity)return this;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=e[this._renderer.type],o=r._matrix.manual||r._flagMatrix,a=this._matrix.manual||this._flagMatrix,l=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof qe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Xe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Me&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof qe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Xe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Me&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagScale||this._flagValue||this._flagFamily||this._flagSize||this._flagLeading||this._flagAlignment||this._flagBaseline||this._flagStyle||this._flagWeight||this._flagDecoration||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(o||a||l){this._renderer.matrix||(this._renderer.matrix=new un(9)),this._matrix.toTransformArray(!0,Kn),Jr(Kn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof te||(this._renderer.scale=new te);let u,h;this._scale instanceof te?(u=this._scale.x*r._renderer.scale.x,h=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,h=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=h<0?-h:h,l&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const u=ft.Utils.getRendererType(this._mask._renderer.type);_e[u].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,_e.text.getBoundingClientRect(this,this._renderer.rect),_e.updateTexture.call(_e,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;e.current!==s&&(t.useProgram(s),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s.position),t.bufferData(t.ARRAY_BUFFER,xo,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),e.current=s),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return t.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),t.uniform4f(s.rect,d.left,d.top,d.right,d.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=t.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=t.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;J.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=t.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof te||(this._renderer.offset=new te),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,n&&(this._renderer.offset.x+=n.width/2,this._renderer.offset.y+=n.height/2,this._scale instanceof te?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),this._flagScale||this._flagLoaded){this._renderer.scale instanceof te||(this._renderer.scale=new te);let r,s;this._scale instanceof te?(r=this._scale.x,s=this._scale.y):(r=this._scale,s=this._scale),this._renderer.scale.x=r<0?-r:r,this._renderer.scale.y=s<0?-s:s}return J.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const n=ft.Utils.getRendererType(e._renderer.type);if(this[n].updateCanvas.call(_e,t,e),this.canvas.width<=0||this.canvas.height<=0){e._renderer.texture&&t.deleteTexture(e._renderer.texture),delete e._renderer.texture;return}e._renderer.texture||(e._renderer.texture=t.createTexture()),t.bindTexture(t.TEXTURE_2D,e._renderer.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.canvas),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)},program:{create:function(t,e){let n,r,s;if(n=t.createProgram(),J.each(e,function(o){t.attachShader(n,o)}),t.linkProgram(n),r=t.getProgramParameter(n,t.LINK_STATUS),!r)throw s=t.getProgramInfoLog(n),t.deleteProgram(n),new Et("unable to link program: "+s);return n}},extensions:{init:function(t){const e={},n=["EXT_texture_filter_anisotropic","WEBGL_compressed_texture_s3tc","OES_texture_float_linear","WEBGL_multisampled_render_to_texture"];for(let r=0;r<n.length;r++){const s=n[r];e[s]=_e.extensions.get(t,s)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new Or};_e.ctx=_e.canvas.getContext("2d");var Bc=class extends U{constructor(t){super();let e,n,r,s;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(_e.canvas=t.offscreenElement,_e.ctx=_e.canvas.getContext("2d")),this.scene=new st,this.scene.parent=this,this._renderer={type:"renderer",matrix:new un(ep),scale:1,opacity:1},this._flagMatrix=!0,t=J.defaults(t||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=t.overdraw,e=this.ctx=this.domElement.getContext("webgl",t)||this.domElement.getContext("experimental-webgl",t),!this.ctx)throw new Et("unable to create a webgl context. Try using another renderer.");r=Xt.create(e,Xt.path.vertex,Xt.types.vertex),s=Xt.create(e,Xt.path.fragment,Xt.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=_e.program.create(e,[r,s]),this.programs.text=this.programs.path,e.extensions=_e.extensions.init(e),e.renderer=this,n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.rect=e.getUniformLocation(n,"u_rect");const o=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,o),e.vertexAttribPointer(n.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n.position),e.bufferData(e.ARRAY_BUFFER,xo,e.STATIC_DRAW),r=Xt.create(e,Xt.points.vertex,Xt.types.vertex),s=Xt.create(e,Xt.points.fragment,Xt.types.fragment),n=this.programs.points=_e.program.create(e,[r,s]),n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.size=e.getUniformLocation(n,"u_size"),e.enable(e.BLEND),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}setSize(t,e,n){let r,s;const o=this.ctx;return this.width=t,this.height=e,this.ratio=typeof n>"u"?Gs(o):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,J.isObject(this.domElement.style)&&J.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=t*this.ratio,s=e*this.ratio,o.viewport(0,0,r,s),this.programs.resolution.width=r,this.programs.resolution.height=s,this.programs.resolution.ratio=this.ratio,this.programs.resolution.flagged=!0,this.trigger(U.Types.resize,t,e,n)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),_e.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};k(Bc,"Utils",_e);var np=J.extend({Error:Et,getRatio:Gs,read:He,xhr:_c},J,vt,dl,ul),xe=class Ar{constructor(e){k(this,"_events",new U),k(this,"type",""),k(this,"renderer",null),k(this,"scene",null),k(this,"width",0),k(this,"height",0),k(this,"frameCount",0),k(this,"timeDelta",0),k(this,"playing",!1);const n=J.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Ar.Types.svg,autostart:!1});if(J.each(n,function(r,s){/fullscreen/i.test(s)||/autostart/i.test(s)||(this[s]=r)},this),J.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Ar.Types[r])}this.renderer=new Ar[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=ip.bind(this),this.fit.domElement=window,this.fit.attached=!0,J.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),J.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Ot.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=rp.bind(this),J.extend(this.renderer.domElement.style,{display:"block"})):typeof n.width=="number"&&typeof n.height=="number"&&(this.renderer.setSize(n.width,n.height,this.ratio),this.width=n.width,this.height=n.height),this.renderer.bind(U.Types.resize,sp.bind(this)),this.scene=this.renderer.scene,Ar.Instances.push(this),n.autostart&&ur.init()}get _bound(){return this._events._bound}set _bound(e){this._events._bound=e}addEventListener(){return this._events.addEventListener.apply(this,arguments)}on(){return this._events.addEventListener.apply(this,arguments)}bind(){return this._events.addEventListener.apply(this,arguments)}removeEventListener(){return this._events.removeEventListener.apply(this,arguments)}off(){return this._events.removeEventListener.apply(this,arguments)}unbind(){return this._events.removeEventListener.apply(this,arguments)}dispatchEvent(){return this._events.dispatchEvent.apply(this,arguments)}trigger(){return this._events.dispatchEvent.apply(this,arguments)}listen(){return this._events.listen.apply(this,arguments)}ignore(){return this._events.ignore.apply(this,arguments)}appendTo(e){return e.appendChild(this.renderer.domElement),this.fit&&(this.fit.domElement!==window&&(this.fit.domElement=e,this.fit.attached=!1),this.update()),this}play(){return this.playing=!0,ur.init(),this.trigger(U.Types.play)}pause(){return this.playing=!1,this.trigger(U.Types.pause)}setPlaying(e){this.playing=e}release(e){let n,r,s;if(typeof e>"u")return this.release(this.scene);if(typeof e.unbind=="function"&&e.unbind(),typeof e.fill=="object"&&"unbind"in e.fill&&e.fill.unbind(),typeof e.stroke=="object"&&"unbind"in e.stroke&&e.stroke.unbind(),e.vertices){if(typeof e.vertices.unbind=="function")try{e.vertices.unbind()}catch{}for(n=0;n<e.vertices.length;n++)r=e.vertices[n],typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}if(e.children){for(n=0;n<e.children.length;n++)s=e.children[n],this.release(s);if(typeof e.children.unbind=="function")try{e.children.unbind()}catch{}}if(e._renderer){if(e._renderer.elem&&e._renderer.elem.parentNode&&(e._renderer.elem.parentNode.removeChild(e._renderer.elem),delete e._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const o=this.renderer.ctx;e._renderer.texture&&(o.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(o.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer),e._renderer.effect&&(e._renderer.effect=null)}this.type==="CanvasRenderer"&&e._renderer.context&&delete e._renderer.context}return e}update(){const e=!!this._lastFrame,n=J.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Ot.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const r=this.width,s=this.height,o=this.renderer;return(r!==o.width||s!==o.height)&&o.setSize(r,s,this.ratio),this.trigger(U.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(U.Types.render,this.frameCount++)}add(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.add(e),this}remove(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.remove(e),this}clear(){return this.scene.remove(this.scene.children),this}makeLine(e,n,r,s){const o=new Ur(e,n,r,s);return this.scene.add(o),o}makeArrow(e,n,r,s,o){const a=typeof o=="number"?o:10,l=Math.atan2(s-n,r-e),c=[new ve(e,n,void 0,void 0,void 0,void 0,ne.move),new ve(r,s,void 0,void 0,void 0,void 0,ne.line),new ve(r-a*Math.cos(l-Math.PI/4),s-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,ne.line),new ve(r,s,void 0,void 0,void 0,void 0,ne.move),new ve(r-a*Math.cos(l+Math.PI/4),s-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,ne.line)],d=new Ce(c,!1,!1,!0);return d.noFill(),d.cap="round",d.join="round",this.scene.add(d),d}makeRectangle(e,n,r,s){const o=new Un(e,n,r,s);return this.scene.add(o),o}makeRoundedRectangle(e,n,r,s,o){const a=new qr(e,n,r,s,o);return this.scene.add(a),a}makeCircle(e,n,r,s){const o=new Wr(e,n,r,s);return this.scene.add(o),o}makeEllipse(e,n,r,s,o){const a=new jr(e,n,r,s,o);return this.scene.add(a),a}makeStar(e,n,r,s,o){const a=new ho(e,n,r,s,o);return this.scene.add(a),a}makeCurve(e){const n=arguments.length;if(!Array.isArray(e)){e=[];for(let a=0;a<n;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];e.push(new ve(l,c))}}const r=arguments[n-1],s=new Ce(e,!(typeof r=="boolean"&&r),!0),o=s.getBoundingClientRect();return s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makePolygon(e,n,r,s){const o=new uo(e,n,r,s);return this.scene.add(o),o}makeArcSegment(e,n,r,s,o,a,l){const c=new ro(e,n,r,s,o,a,l);return this.scene.add(c),c}makePoints(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let o=0;o<n;o+=2){const a=arguments[o];if(typeof a!="number")break;const l=arguments[o+1];r.push(new te(a,l))}}const s=new co(r);return this.scene.add(s),s}makePath(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let l=0;l<n;l+=2){const c=arguments[l];if(typeof c!="number")break;const d=arguments[l+1];r.push(new ve(c,d))}}const s=arguments[n-1],o=new Ce(r,!(typeof s=="boolean"&&s)),a=o.getBoundingClientRect();return typeof a.top=="number"&&typeof a.left=="number"&&typeof a.right=="number"&&typeof a.bottom=="number"&&o.center().translation.set(a.left+a.width/2,a.top+a.height/2),this.scene.add(o),o}makeText(e,n,r,s){const o=new fn(e,n,r,s);return this.add(o),o}makeLinearGradient(e,n,r,s){const o=Array.prototype.slice.call(arguments,4),a=new qe(e,n,r,s,o);return this.add(a),a}makeRadialGradient(e,n,r){const s=Array.prototype.slice.call(arguments,3),o=new Xe(e,n,r,s);return this.add(o),o}makeSprite(e,n,r,s,o,a,l){const c=new Hr(e,n,r,s,o,a);return l&&c.play(),this.add(c),c}makeImage(e,n,r,s,o,a){const l=new wc(e,n,r,s,o,a);return this.add(l),l}makeImageSequence(e,n,r,s,o){const a=new po(e,n,r,s);return o&&a.play(),this.add(a),a}makeTexture(e,n){return new Me(e,n)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const n=new st;return this.scene.add(n),n.add(e),n}interpret(e,n,r){const s=e.tagName.toLowerCase();if(r=typeof r<"u"?r:!0,!(s in He))return null;const o=He[s].call(this,e);return r?this.add(n&&o instanceof st?o.children:o):o.parent&&o.remove(),o}load(e,n){const r=new st;let s,o,a;const l=(function(c){for(Ot.temp.innerHTML=c,o=0;o<Ot.temp.children.length;o++)s=Ot.temp.children[o],a=this.interpret(s,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Ot.temp.children.length<=1?Ot.temp.children[0]:Ot.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(_c(e,l),r):(l(e),r)}};k(xe,"NextFrameId",Ct.NextFrameId),k(xe,"Types",Ct.Types),k(xe,"Version",Ct.Version),k(xe,"PublishDate",Ct.PublishDate),k(xe,"Identifier",Ct.Identifier),k(xe,"Resolution",Ct.Resolution),k(xe,"AutoCalculateImportedMatrices",Ct.AutoCalculateImportedMatrices),k(xe,"Instances",Ct.Instances),k(xe,"uniqueId",Ct.uniqueId),k(xe,"Anchor",ve),k(xe,"Collection",qn),k(xe,"Events",U),k(xe,"Group",st),k(xe,"Matrix",Di),k(xe,"Path",Ce),k(xe,"Registry",Or),k(xe,"Element",Li),k(xe,"Shape",Yn),k(xe,"Text",fn),k(xe,"Vector",te),k(xe,"Gradient",tt),k(xe,"Image",wc),k(xe,"ImageSequence",po),k(xe,"LinearGradient",qe),k(xe,"RadialGradient",Xe),k(xe,"Sprite",Hr),k(xe,"Stop",Xn),k(xe,"Texture",Me),k(xe,"ArcSegment",ro),k(xe,"Circle",Wr),k(xe,"Ellipse",jr),k(xe,"Line",Ur),k(xe,"Points",co),k(xe,"Polygon",uo),k(xe,"Rectangle",Un),k(xe,"RoundedRectangle",qr),k(xe,"Star",ho),k(xe,"CanvasRenderer",ft),k(xe,"SVGRenderer",Cc),k(xe,"WebGLRenderer",Bc),k(xe,"Commands",ne),k(xe,"Utils",np);var gn=xe;function ip(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function rp(){const t=this.renderer.domElement.parentElement;if(!t){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const e=t.getBoundingClientRect(),n=this.width=e.width,r=this.height=e.height;this.renderer.setSize(n,r,this.ratio)}function sp(t,e){this.width=t,this.height=e,this.trigger(U.Types.resize,t,e)}var ur=Ot.getRequestAnimationFrame();function Tc(){for(let t=0;t<gn.Instances.length;t++){const e=gn.Instances[t];e.playing&&e.update()}gn.NextFrameId=ur(Tc)}ur.init=function(){Tc(),ur.init=function(){}};let pn;typeof window<"u"?pn=window:typeof global<"u"?pn=global:typeof self<"u"&&(pn=self);let Rc;const di=Math.PI*2,ot=Math.PI*.5;function op(t,e,n,r,s,o){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,s=t.e,o=t.f):a=t,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function ap(t){Rc=t}function lp(t,e){e=e&&e.identity()||new Rc;let n=t;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function Yt(t,e,n){return n*(e-t)+t}function ji(t,e){for(;t<0;)t+=e;return t%e}const $c=pn.Float32Array||Array,cp=Math.floor;function yn(t){return cp(t*1e6)/1e6}const me={move:"M",line:"L",curve:"C",close:"Z"};class Q{constructor(){C(this,"_events",{});C(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){e=r[s];let a=this._events[e];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let u=a[c];u=u.handler?u.handler:u,n!==u&&l.push(u)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,n,r){const s=this;e&&(o.obj=e,o.name=n,o.handler=r,e.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(e,n,r){return e.off(n,r),this}}C(Q,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),C(Q,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Pc={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(Q.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(Q.Types.change))}}},ct=class ct extends Q{constructor(n=0,r=0){super();C(this,"_x",0);C(this,"_y",0);for(let s in Pc)Object.defineProperty(this,s,Pc[s]);this.x=n,this.y=r}static add(n,r){return new ct(n.x+r.x,n.y+r.y)}static sub(n,r){return new ct(n.x-r.x,n.y-r.y)}static subtract(n,r){return ct.sub(n,r)}static ratioBetween(n,r){return(n.x*r.x+n.y*r.y)/(n.length()*r.length())}static angleBetween(n,r){if(arguments.length>=4){const a=arguments[0]-arguments[2],l=arguments[1]-arguments[3];return Math.atan2(l,a)}const s=n.x-r.x,o=n.y-r.y;return Math.atan2(o,s)}static distanceBetween(n,r){return Math.sqrt(ct.distanceBetweenSquared(n,r))}static distanceBetweenSquared(n,r){const s=n.x-r.x,o=n.y-r.y;return s*s+o*o}set(n,r){return this.x=n,this.y=r,this}copy(n){return this.x=n.x,this.y=n.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new ct(this.x,this.y)}add(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x+=n,this.y+=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x+=n.x,this.y+=n.y):(this.x+=n,this.y+=r),this)}addSelf(n){return this.add.apply(this,arguments)}sub(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x-=n,this.y-=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x-=n.x,this.y-=n.y):(this.x-=n,this.y-=r),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(n){return this.sub.apply(this,arguments)}subtractSelf(n){return this.sub.apply(this,arguments)}multiply(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x*=n,this.y*=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x*=n.x,this.y*=n.y):(this.x*=n,this.y*=r),this)}multiplySelf(n){return this.multiply.apply(this,arguments)}multiplyScalar(n){return this.multiply(n)}divide(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x/=n,this.y/=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x/=n.x,this.y/=n.y):(this.x/=n,this.y/=r),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(n){return this.divide.apply(this,arguments)}divideScalar(n){return this.divide(n)}negate(){return this.multiply(-1)}dot(n){return this.x*n.x+this.y*n.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(n){return Math.sqrt(this.distanceToSquared(n))}distanceToSquared(n){const r=this.x-n.x,s=this.y-n.y;return r*r+s*s}setLength(n){return this.normalize().multiplyScalar(n)}equals(n,r){return r=typeof r>"u"?1e-4:r,this.distanceTo(n)<r}lerp(n,r){const s=(n.x-this.x)*r+this.x,o=(n.y-this.y)*r+this.y;return this.set(s,o)}isZero(n){return n=typeof n>"u"?1e-4:n,this.length()<n}toString(){return this.x+", "+this.y}toObject(){return{x:yn(this.x),y:yn(this.y)}}rotate(n){const r=this.x,s=this.y,o=Math.cos(n),a=Math.sin(n);return this.x=r*o-s*a,this.y=r*a+s*o,this}};C(ct,"zero",new ct),C(ct,"left",new ct(-1,0)),C(ct,"right",new ct(1,0)),C(ct,"up",new ct(0,-1)),C(ct,"down",new ct(0,1));let pe=ct;class Re extends pe{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=me.move){super(n,r);C(this,"controls",{left:new pe,right:new pe});C(this,"_command",me.move);C(this,"_relative",!0);C(this,"_rx",0);C(this,"_ry",0);C(this,"_xAxisRotation",0);C(this,"_largeArcFlag",0);C(this,"_sweepFlag",1);for(let u in Nc)Object.defineProperty(this,u,Nc[u]);this.command=c,this.relative=!0;const d=Re.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(Q.Types.change,d),this.controls.right.set(a,l).addEventListener(Q.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(Q.Types.change)}}static fromObject(n){return new Re().copy(n)}copy(n){return this.x=n.x,this.y=n.y,typeof n.command=="string"&&(this.command=n.command),n.controls&&(n.controls.left&&this.controls.left.copy(n.controls.left),n.controls.right&&this.controls.right.copy(n.controls.right)),typeof n.relative=="boolean"&&(this.relative=n.relative),typeof n.rx=="number"&&(this.rx=n.rx),typeof n.ry=="number"&&(this.ry=n.ry),typeof n.xAxisRotation=="number"&&(this.xAxisRotation=n.xAxisRotation),typeof n.largeArcFlag=="number"&&(this.largeArcFlag=n.largeArcFlag),typeof n.sweepFlag=="number"&&(this.sweepFlag=n.sweepFlag),this}clone(){return new Re().copy(this)}toObject(){return{x:yn(this.x),y:yn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:yn(this.rx),ry:yn(this.ry),xAxisRotation:yn(this.xAxisRotation),largeArcFlag:yn(this.largeArcFlag),sweepFlag:yn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Nc={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(Q.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(Q.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(Q.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(Q.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(Q.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(Q.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(Q.Types.change))}}};let dp=0;const ko={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return dp++}},es={RecursionLimit:16,abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function ts(t,e,n,r,s){const o=1-t;return o*o*o*e+3*o*o*t*n+3*o*t*t*r+t*t*t*s}function Ec(t,e,n,r,s,o,a,l,c){c=c||es.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Re(a,l)];const u=[];for(let h=0;h<d;h++){const m=h/d,g=ts(m,t,n,s,a),f=ts(m,e,r,o,l);u.push(new Re(g,f))}return u}function up(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-s)+3*(a-t),u=6*(t+s)-12*n,h=3*(n-t),m=9*(r-o)+3*(l-e),g=6*(e+o)-12*r,f=3*(r-e);function p(b){const y=(d*b+u)*b+h,_=(m*b+g)*b+f;return Math.sqrt(y*y+_*_)}return fp(p,0,1,c||es.RecursionLimit)}function hp(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let u,h,m,g,f,p,b,y;for(let T=0;T<2;++T){if(T===0?(h=6*t-12*n+6*s,u=-3*t+9*n-9*s+3*a,m=3*n-3*t):(h=6*e-12*r+6*o,u=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;g=-m/h,0<g&&g<1&&c.push(g);continue}b=h*h-4*m*u,y=Math.sqrt(b),!(b<0)&&(f=(-h+y)/(2*u),0<f&&f<1&&c.push(f),p=(-h-y)/(2*u),0<p&&p<1&&c.push(p))}let _=c.length,S=_,v;for(;_--;)g=c[_],v=1-g,d[0][_]=v*v*v*t+3*v*v*g*n+3*v*g*g*s+g*g*g*a,d[1][_]=v*v*v*e+3*v*v*g*r+3*v*g*g*o+g*g*g*l;return d[0][S]=t,d[1][S]=e,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function fp(t,e,n,r){let s=es.abscissas[r-2],o=es.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,u=r&1?o[c++]*t(l):0;for(;c<d;){const h=a*s[c];u+=o[c++]*(t(l+h)+t(l-h))}return a*u}function mp(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?ji(s-1,n):Math.max(s-1,0),l=e?ji(s+1,n):Math.min(s+1,r),c=t[a],d=o,u=t[l];gp(c,d,u),d.command=s===0?me.move:me.curve}}function gp(t,e,n){const r=pe.angleBetween(t,e),s=pe.angleBetween(n,e);let o=pe.distanceBetween(t,e),a=pe.distanceBetween(n,e),l=(r+s)/2;return o<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(o*=.33,a*=.33,s<r?l+=ot:l-=ot,e.controls.left.x=Math.cos(l)*o,e.controls.left.y=Math.sin(l)*o,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}let hr=(Bi=class extends Q{constructor(){super();C(this,"_flagId",!1);C(this,"_flagClassName",!1);C(this,"_renderer",{});C(this,"_id",ko.Identifier+ko.uniqueId());C(this,"_className","");C(this,"classList",[]);for(let n in Fc)Object.defineProperty(this,n,Fc[n])}static fromObject(n){const r=new Bi().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return n.renderer&&typeof n.renderer.type=="string"&&(this.renderer.type=n.renderer.type),typeof n.className=="string"&&(this.className=n.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const n=this._renderer.type;return this._renderer={type:n},typeof this.unbind=="function"&&this.unbind(),this}},C(Bi,"Properties",["renderer","id","className"]),Bi);const Fc={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}};class ns extends Error{constructor(n){super();C(this,"name","Two.js");C(this,"message");this.message=n}}class pp{constructor(){C(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}}let is;const Ac={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};pn.document&&(is=document.createElement("a"));const Ue=class Ue extends hr{constructor(n,r){super();C(this,"_flagSrc",!1);C(this,"_flagImage",!1);C(this,"_flagVideo",!1);C(this,"_flagLoaded",!1);C(this,"_flagRepeat",!1);C(this,"_flagOffset",!1);C(this,"_flagScale",!1);C(this,"_src","");C(this,"_image",null);C(this,"_loaded",!1);C(this,"_repeat","no-repeat");C(this,"_scale",1);C(this,"_offset",null);for(let s in Mc)Object.defineProperty(this,s,Mc[s]);if(this._renderer.type="texture",this._renderer.flagOffset=yp.bind(this),this._renderer.flagScale=bp.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new pe,typeof r=="function"){const s=(function(){this.unbind(Q.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(Q.Types.load,s)}if(typeof n=="string")this.src=n;else if(typeof n=="object"){const s=Object.prototype.toString.call(n);(s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]"||s==="[object HTMLVideoElement]"||s==="[object Image]")&&(this.image=n)}this._update()}fromObject(n){const r=new Ue().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return is?(is.href=n,is.href):n}static loadHeadlessBuffer(n,r){n.image.onload=r,n.image.src=n.src}static getTag(n){return n&&n.nodeName&&n.nodeName.toLowerCase()||"img"}static getImage(n){const r=Ue.getAbsoluteURL(n);if(Ue.ImageRegistry.contains(r))return Ue.ImageRegistry.get(r);let s;return pn.document?Ac.video.test(r)?s=document.createElement("video"):s=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),s.crossOrigin="anonymous",s.referrerPolicy="no-referrer",s}static load(n,r){let s=n.image,o=Ue.getTag(s);n._flagImage&&(/canvas/i.test(o)?Ue.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,Ue.Register[o](n,r))),n._flagSrc&&(s||(s=Ue.getImage(n.src),n.image=s),o=Ue.getTag(s),Ue.Register[o](n,r))}clone(){const n=new Ue(this.src);return n.repeat=this.repeat,n.offset.copy(this.offset),n.scale=this.scale,n}copy(n){return this.src=n.src,this.repeat=n.repeat,this.offset=typeof n.offset=="number"||n.offset instanceof pe?n.offset:new pe().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof pe?n.scale:new pe().copy(n.scale),this}toObject(){const n=super.toObject.call(this);return n.renderer.type="texture",n.src=this.src,n.repeat=this.repeat,n.offset=this.offset.toObject(),n.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),n}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(Q.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Ue.load(this,(function(){this.loaded=!0,this.trigger(Q.Types.change).trigger(Q.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};C(Ue,"Properties",["src","loaded","repeat","scale","offset","image"]),C(Ue,"RegularExpressions",Ac),C(Ue,"ImageRegistry",new pp),C(Ue,"Register",{canvas:function(n,r){n._src="#"+n.id,Ue.ImageRegistry.add(n.src,n.image),typeof r=="function"&&r()},img:function(n,r){const s=n.image,o=function(l){s.removeEventListener&&typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),typeof r=="function"&&r()},a=function(l){throw typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),new ns("unable to load "+n.src)};typeof s.width=="number"&&s.width>0&&typeof s.height=="number"&&s.height>0?o():typeof s.addEventListener=="function"&&(s.addEventListener("load",o,!1),s.addEventListener("error",a,!1)),n._src=Ue.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),Ue.ImageRegistry.add(n.src,s),n.image.src=n.src)},video:function(n,r){const s=function(a){n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),n.image.width=n.image.videoWidth,n.image.height=n.image.videoHeight,typeof r=="function"&&r()},o=function(a){throw n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),new ns("unable to load "+n.src)};n._src=Ue.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),Ue.ImageRegistry.add(n.src,n.image)),n.image.readyState>=4?s():(n.image.addEventListener("canplaythrough",s,!1),n.image.addEventListener("error",o,!1),n.image.src=n.src,n.image.load())}});let Ye=Ue;const Mc={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=Ye.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Ye.ImageRegistry.contains(n)?this._image=Ye.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(Q.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(Q.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof pe&&this._scale.unbind(Q.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof pe&&this._scale.bind(Q.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function yp(){this._flagOffset=!0}function bp(){this._flagScale=!0}class ui extends Array{constructor(){super();ja(this,dt,new Q);arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return Pt(this,dt)}set _events(n){Xh(this,dt,n)}get _bound(){return Pt(this,dt)._bound}set _bound(n){Pt(this,dt)._bound=n}addEventListener(){return Pt(this,dt).addEventListener.apply(this,arguments)}on(){return Pt(this,dt).on.apply(this,arguments)}bind(){return Pt(this,dt).bind.apply(this,arguments)}removeEventListener(){return Pt(this,dt).removeEventListener.apply(this,arguments)}off(){return Pt(this,dt).off.apply(this,arguments)}unbind(){return Pt(this,dt).unbind.apply(this,arguments)}dispatchEvent(){return Pt(this,dt).dispatchEvent.apply(this,arguments)}trigger(){return Pt(this,dt).trigger.apply(this,arguments)}listen(){return Pt(this,dt).listen.apply(this,arguments)}ignore(){return Pt(this,dt).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(Q.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(Q.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(Q.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(Q.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(Q.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(Q.Types.insert,r),this.trigger(Q.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(Q.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(Q.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(n,r){const s=[];for(let o=0;o<this.length;o++){const a=this[o];let l;r?l=n.call(r,a,o):l=n(a,o),s.push(l)}return s}}dt=new WeakMap;const Vc=Array.prototype.slice;function _p(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const Pe={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=Vc.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]=r[s]}return t},defaults:function(t){const e=Vc.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]===void 0&&(t[s]=r[s])}return t},each:function(t,e,n){const r=n||this,s=!_p(t)&&Object.keys(t),o=(s||t).length;for(let a=0;a<o;a++){const l=s?s[a]:a;e.call(r,t[l],l,t)}return t},performance:pn.performance&&pn.performance.now?pn.performance:Date},At=class At extends hr{constructor(n,r,s){super();C(this,"_flagOffset",!0);C(this,"_flagOpacity",!0);C(this,"_flagColor",!0);C(this,"_offset",0);C(this,"_opacity",1);C(this,"_color","#fff");for(let o in Ic)Object.defineProperty(this,o,Ic[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:At.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:At.Index<=0?"#fff":"#000",At.Index=(At.Index+1)%2}static fromObject(n){const r=new At().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<At.Properties.length;r++){const s=At.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new At;return Pe.each(At.Properties,function(s){r[s]=this[s]},this),n&&n.stops&&n.stops.push(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="stop",Pe.each(At.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};C(At,"Index",0),C(At,"Properties",["offset","opacity","color"]);let hi=At;const Ic={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},kn=class kn extends hr{constructor(n){super();C(this,"_flagStops",!1);C(this,"_flagSpread",!1);C(this,"_flagUnits",!1);C(this,"_spread","");C(this,"_units","");for(let r in Oc)Object.defineProperty(this,r,Oc[r]);this._renderer.type="gradient",this._renderer.flagStops=wp.bind(this),this._renderer.bindStops=xp.bind(this),this._renderer.unbindStops=kp.bind(this),this.spread="pad",this.units="objectBoundingBox",n&&(this.stops=n)}static fromObject(n){let r=n.stops;r&&r.length>0&&(r=r.map(o=>o instanceof hi?o:new hi().copy(o)));const s=new kn(r).copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new kn(r);return Pe.each(kn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Pe.each(kn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(Q.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};C(kn,"Stop",hi),C(kn,"Properties",["spread","stops","units"]);let nt=kn;const Oc={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(Q.Types.insert,e).unbind(Q.Types.remove,n),this._stops=new ui((t||[]).slice(0)),this._stops.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._stops)}}};function wp(){this._flagStops=!0}function xp(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function kp(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const ti=class ti extends nt{constructor(n,r,s,o,a){super(a);C(this,"_flagEndPoints",!1);C(this,"_left",null);C(this,"_right",null);for(let l in zc)Object.defineProperty(this,l,zc[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=vp.bind(this),this.left=new pe,this.right=new pe,typeof n=="number"&&(this.left.x=n),typeof r=="number"&&(this.left.y=r),typeof s=="number"&&(this.right.x=s),typeof o=="number"&&(this.right.y=o)}static fromObject(n){const r=new ti().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<ti.Properties.length;r++){const s=ti.Properties[r];s in n&&(this[s]=n[s]instanceof pe?n[s]:new pe().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new ti(this.left._x,this.left._y,this.right._x,this.right._y,r);return Pe.each(nt.Properties,function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return n.left=this.left.toObject(),n.right=this.right.toObject(),n}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(Q.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};C(ti,"Stop",hi),C(ti,"Properties",["left","right"]);let St=ti;const zc={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof pe&&this._left.unbind(Q.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(Q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof pe&&this._right.unbind(Q.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(Q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function vp(){this._flagEndPoints=!0}const vn=class vn extends nt{constructor(n,r,s,o,a,l){super(o);C(this,"_flagRadius",!1);C(this,"_flagCenter",!1);C(this,"_flagFocal",!1);C(this,"_radius",0);C(this,"_center",null);C(this,"_focal",null);for(let c in Lc)Object.defineProperty(this,c,Lc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Cp.bind(this),this._renderer.flagFocal=Sp.bind(this),this.center=new pe,this.radius=typeof s=="number"?s:1,this.focal=new pe,typeof n=="number"&&(this.center.x=n),typeof r=="number"&&(this.center.y=r),this.focal.copy(this.center),typeof a=="number"&&(this.focal.x=a),typeof l=="number"&&(this.focal.y=l)}static fromObject(n){const r=new vn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<vn.Properties.length;r++){const s=vn.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof pe?n[s]:new pe().copy(n[s]):typeof n[s]=="number"&&(this[s]=n[MediaKeySystemAccess]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new vn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Pe.each(nt.Properties.concat(vn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Pe.each(vn.Properties,function(r){n[r]=this[r]},this),n.center=this.center.toObject(),n.focal=this.focal.toObject(),n}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(Q.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};C(vn,"Stop",hi),C(vn,"Properties",["center","radius","focal"]);let Bt=vn;const Lc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(Q.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(Q.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(Q.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(Q.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Cp(){this._flagCenter=!0}function Sp(){this._flagFocal=!0}function Dc(t,e){if(e===0||e===1)return!0;const r=t._length*e;let s=0;for(let o=0;o<t._lengths.length;o++){const a=t._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function rs(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,s=0;r<t._lengths.length;r++){if(s+t._lengths[r]>=e)return e-=s,Math.max(r-1,0)+e/t._lengths[r];s+=t._lengths[r]}return-1}function Hc(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(m||t).x,d=(m||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),up(r,l,s,c,o,d,a,u,n)}function Wc(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(m||t).x,d=(m||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),Ec(r,l,s,c,o,d,a,u,n)}function fi(t){switch(t.renderer.type){case"texture":return Ye.fromObject(t);case"gradient":return nt.fromObject(t);case"linear-gradient":return St.fromObject(t);case"radial-gradient":return Bt.fromObject(t)}return t}const Bp=Math.cos,Tp=Math.sin,jc=Math.tan,vo=[],Rt=class Rt extends Q{constructor(n,r,s,o,a,l){super();C(this,"elements",new $c(9));C(this,"manual",!1);let c=n;Array.isArray(c)||(c=Array.prototype.slice.call(arguments)),this.identity(),c.length>0&&this.set(c)}static Multiply(n,r,s){if(r.length<=3){const w=n;let B,x,$;const P=r[0]||0,A=r[1]||0,V=r[2]||0;return B=w[0]*P+w[1]*A+w[2]*V,x=w[3]*P+w[4]*A+w[5]*V,$=w[6]*P+w[7]*A+w[8]*V,[B,x,$]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],u=n[5],h=n[6],m=n[7],g=n[8],f=r[0],p=r[1],b=r[2],y=r[3],_=r[4],S=r[5],v=r[6],T=r[7],R=r[8];return s=s||new $c(9),s[0]=o*f+a*y+l*v,s[1]=o*p+a*_+l*T,s[2]=o*b+a*S+l*R,s[3]=c*f+d*y+u*v,s[4]=c*p+d*_+u*T,s[5]=c*b+d*S+u*R,s[6]=h*f+m*y+g*v,s[7]=h*p+m*_+g*T,s[8]=h*b+m*S+g*R,s}static fromObject(n){return new Rt().copy(n)}set(n,r,s,o,a,l,c,d,u){if(typeof r>"u"){const h=n;n=h[0],r=h[1],s=h[2],o=h[3],a=h[4],l=h[5],c=h[6],d=h[7],u=h[8]}return this.elements[0]=n,this.elements[1]=r,this.elements[2]=s,this.elements[3]=o,this.elements[4]=a,this.elements[5]=l,this.elements[6]=c,this.elements[7]=d,this.elements[8]=u,this.trigger(Q.Types.change)}copy(n){return this.elements[0]=n.elements[0],this.elements[1]=n.elements[1],this.elements[2]=n.elements[2],this.elements[3]=n.elements[3],this.elements[4]=n.elements[4],this.elements[5]=n.elements[5],this.elements[6]=n.elements[6],this.elements[7]=n.elements[7],this.elements[8]=n.elements[8],this.manual=n.manual,this.trigger(Q.Types.change)}identity(){return this.elements[0]=Rt.Identity[0],this.elements[1]=Rt.Identity[1],this.elements[2]=Rt.Identity[2],this.elements[3]=Rt.Identity[3],this.elements[4]=Rt.Identity[4],this.elements[5]=Rt.Identity[5],this.elements[6]=Rt.Identity[6],this.elements[7]=Rt.Identity[7],this.elements[8]=Rt.Identity[8],this.trigger(Q.Types.change)}multiply(n,r,s,o,a,l,c,d,u){if(typeof r>"u")return this.elements[0]*=n,this.elements[1]*=n,this.elements[2]*=n,this.elements[3]*=n,this.elements[4]*=n,this.elements[5]*=n,this.elements[6]*=n,this.elements[7]*=n,this.elements[8]*=n,this.trigger(Q.Types.change);if(typeof s>"u"&&(s=1),typeof o>"u"){n=n||0,r=r||0,s=s||0,a=this.elements;const N=a[0]*n+a[1]*r+a[2]*s,Y=a[3]*n+a[4]*r+a[5]*s,ee=a[6]*n+a[7]*r+a[8]*s;return[N,Y,ee]}const h=this.elements,m=[n,r,s,o,a,l,c,d,u],g=h[0],f=h[1],p=h[2],b=h[3],y=h[4],_=h[5],S=h[6],v=h[7],T=h[8],R=m[0],w=m[1],B=m[2],x=m[3],$=m[4],P=m[5],A=m[6],V=m[7],F=m[8];return this.elements[0]=g*R+f*x+p*A,this.elements[1]=g*w+f*$+p*V,this.elements[2]=g*B+f*P+p*F,this.elements[3]=b*R+y*x+_*A,this.elements[4]=b*w+y*$+_*V,this.elements[5]=b*B+y*P+_*F,this.elements[6]=S*R+v*x+T*A,this.elements[7]=S*w+v*$+T*V,this.elements[8]=S*B+v*P+T*F,this.trigger(Q.Types.change)}inverse(n){const r=this.elements;n=n||new Rt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],u=r[6],h=r[7],m=r[8],g=m*c-d*h,f=-m*l+d*u,p=h*l-c*u;let b=s*g+o*f+a*p;return b?(b=1/b,n.elements[0]=g*b,n.elements[1]=(-m*o+a*h)*b,n.elements[2]=(d*o-a*c)*b,n.elements[3]=f*b,n.elements[4]=(m*s-a*u)*b,n.elements[5]=(-d*s+a*l)*b,n.elements[6]=p*b,n.elements[7]=(-h*s+o*u)*b,n.elements[8]=(c*s-o*l)*b,n):null}scale(n,r){return arguments.length<=1&&(r=n),this.multiply(n,0,0,0,r,0,0,0,1)}rotate(n){const r=Bp(n),s=Tp(n);return this.multiply(r,-s,0,s,r,0,0,0,1)}translate(n,r){return this.multiply(1,0,n,0,1,r,0,0,1)}skewX(n){const r=jc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=jc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return vo.length=0,this.toTransformArray(n,vo),vo.map(yn).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],u=s[4],h=s[5];if(n){const m=s[6],g=s[7],f=s[8];if(o){r[0]=a,r[1]=d,r[2]=m,r[3]=l,r[4]=u,r[5]=g,r[6]=c,r[7]=h,r[8]=f;return}return[a,d,m,l,u,g,c,h,f]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=u,r[4]=c,r[5]=h;return}return[a,d,l,u,c,h]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],u=s[4],h=s[5];if(n){const m=s[6],g=s[7],f=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h,r[6]=m,r[7]=g,r[8]=f;return}return[a,l,c,d,u,h,m,g,f]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h;return}return[a,l,c,d,u,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Rt().copy(this)}};C(Rt,"Identity",[1,0,0,0,1,0,0,0,1]);let fr=Rt;ap(fr);const Pr=class Pr extends hr{constructor(){super();C(this,"_flagMatrix",!0);C(this,"_flagScale",!1);C(this,"_matrix",null);C(this,"_worldMatrix",null);C(this,"_position",null);C(this,"_rotation",0);C(this,"_scale",1);C(this,"_skewX",0);C(this,"_skewY",0);for(let n in ss)Object.defineProperty(this,n,ss[n]);this._renderer.flagMatrix=qc.bind(this),this.isShape=!0,this.matrix=new fr,this.worldMatrix=new fr,this.position=new pe,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new Pr().copy(n);return"id"in n&&(r.id=n.id),r}get renderer(){return this._renderer}set renderer(n){this._renderer=n}get translation(){return ss.position.get.apply(this,arguments)}set translation(n){ss.position.set.apply(this,arguments)}addTo(n){return n.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(n){return super.copy.call(this,n),"position"in n&&(n.position instanceof pe?this.position=n.position:this.position.copy(n.position)),"rotation"in n&&(this.rotation=n.rotation),"scale"in n&&(this.scale=typeof n.scale=="number"||n.scale instanceof pe?n.scale:new pe(n.scale.x,n.scale.y)),"skewX"in n&&(this.skewX=n.skewX),"skewY"in n&&(this.skewY=n.skewY),"matrix"in n&&n.matrix.manual&&(this.matrix.copy(n.matrix),this.matrix.manual=!0),this}clone(n){const r=new Pr;return r.position.copy(this.position),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer={type:"shape"},n.isShape=!0,n.translation=this.translation.toObject(),n.rotation=this.translation.rotation,n.scale=this.scale instanceof pe?this.scale.toObject():this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.matrix=this.matrix.toObject(),n}_update(n){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof pe?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),n&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};C(Pr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Rn=Pr;const ss={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(Q.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(Q.Types.change,this._renderer.flagMatrix),qc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof pe&&this._scale.unbind(Q.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof pe&&this._scale.bind(Q.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return lp(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function qc(){this._flagMatrix=!0}const qi=Math.min,Xi=Math.max,Rp=Math.ceil,$p=Math.floor,Pp=new pe,nn=class nn extends Rn{constructor(n,r,s,o){super();C(this,"_flagVertices",!0);C(this,"_flagLength",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagCap",!0);C(this,"_flagJoin",!0);C(this,"_flagMiter",!0);C(this,"_flagStrokeAttenuation",!0);C(this,"_flagMask",!1);C(this,"_flagClip",!1);C(this,"_length",0);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_cap","round");C(this,"_join","round");C(this,"_miter",4);C(this,"_closed",!0);C(this,"_curved",!1);C(this,"_automatic",!0);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_mask",null);C(this,"_clip",!1);C(this,"_dashes",null);C(this,"_strokeAttenuation",!0);for(let a in Xc)Object.defineProperty(this,a,Xc[a]);this._renderer.type="path",this._renderer.flagVertices=Yc.bind(this),this._renderer.bindVertices=Uc.bind(this),this._renderer.unbindVertices=Kc.bind(this),this._renderer.flagFill=Gc.bind(this),this._renderer.flagStroke=Zc.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!s,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=n,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(n.stroke),o=new nn().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){if(super.copy.call(this,n),n.vertices){this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Re?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Re().copy(s))}}for(let r=0;r<nn.Properties.length;r++){const s=nn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new nn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<nn.Properties.length;s++){const o=nn.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="path",n.vertices=this.vertices.map(r=>r.toObject()),Pe.each(nn.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const n=this.getBoundingClientRect(!0),r=n.width/2,s=n.height/2,o=n.left+n.width/2,a=n.top+n.height/2;for(let l=0;l<this.vertices.length;l++){const c=this.vertices[l];c.x-=o,c.y-=a,c.x+=r,c.y+=s}return this.mask&&(this.mask.translation.x-=o,this.mask.translation.x+=r,this.mask.translation.y-=a,this.mask.translation.y+=s),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getBoundingClientRect(n){let r,s,o,a,l,c,d=1/0,u=-1/0,h=1/0,m=-1/0;if(this._update(!0),r=n?this.matrix:this.worldMatrix,s=(this.linewidth||0)/2,o=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:g,scaleY:f}=op(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof g=="number"&&typeof f=="number"&&(s=Math.max(g,f)*(this.linewidth||0)/2)}else s*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(o<=0)return{width:0,height:0};for(a=0;a<o;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+o-1)%o];const[g,f]=r.multiply(l.x,l.y),[p,b]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,_=l.controls.right.y;l.relative&&(y+=l.x,_+=l.y);let[S,v]=r.multiply(y,_),T=c.controls.left.x,R=c.controls.left.y;c.relative&&(T+=c.x,R+=c.y);let[w,B]=r.multiply(T,R);const x=hp(g,f,S,v,w,B,p,b);h=qi(x.min.y-s,h),d=qi(x.min.x-s,d),u=Xi(x.max.x+s,u),m=Xi(x.max.y+s,m)}else a<=1&&(h=qi(f-s,h),d=qi(g-s,d),u=Xi(g+s,u),m=Xi(f+s,m)),h=qi(b-s,h),d=qi(p-s,d),u=Xi(p+s,u),m=Xi(b+s,m)}return{top:h,left:d,right:u,bottom:m,width:u-d,height:m-h}}getPointAt(n,r){let s,o,a,l,c,d,u,h,m,g,f,p,b,y,_,S=this.length*Math.min(Math.max(n,0),1);const v=this.vertices.length,T=v-1;let R=null,w=null;for(let I=0,z=this._lengths.length,q=0;I<z;I++){if(q+this._lengths[I]>=S){this._closed?(s=ji(I,v),o=ji(I-1,v),I===0&&(s=o,o=I)):(s=I,o=Math.min(Math.max(I-1,0),T)),R=this.vertices[s],w=this.vertices[o],S-=q,this._lengths[I]!==0?n=S/this._lengths[I]:n=0;break}q+=this._lengths[I]}if(R===null||w===null)return null;if(R){if(!w)return R}else return w;_=w.controls&&w.controls.right,y=R.controls&&R.controls.left,c=w.x,g=w.y,d=(_||w).x,f=(_||w).y,u=(y||R).x,p=(y||R).y,h=R.x,b=R.y,_&&w.relative&&(d+=w.x,f+=w.y),y&&R.relative&&(u+=R.x,p+=R.y),l=ts(n,c,d,u,h),m=ts(n,g,f,p,b);const B=Yt(c,d,n),x=Yt(g,f,n),$=Yt(d,u,n),P=Yt(f,p,n),A=Yt(u,h,n),V=Yt(p,b,n),F=Yt(B,$,n),N=Yt(x,P,n),Y=Yt($,A,n),ee=Yt(P,V,n);return Pe.isObject(r)?(r.x=l,r.y=m,r instanceof Re&&(r.controls.left.x=F,r.controls.left.y=N,r.controls.right.x=Y,r.controls.right.y=ee,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=m,r.controls.right.x-=l,r.controls.right.y-=m)),r.t=n,r):(a=new Re(l,m,F-l,N-m,Y-l,ee-m,this._curved?me.curve:me.line),a.t=n,a)}plot(){if(this.curved)return mp(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?me.move:me.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===me.close;let o=this.vertices[r],a=[],l;return Pe.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===me.move){a.push(new Re(o.x,o.y)),d>0&&(a[a.length-1].command=me.line),o=c;return}l=Wc(c,o,n),a=a.concat(l),Pe.each(l,function(u,h){h<=0&&o.command===me.move?u.command=me.move:u.command=me.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=Wc(c,o,n),a=a.concat(l),Pe.each(l,function(u,h){h<=0&&o.command===me.move?u.command=me.move:u.command=me.line})),a.push(new Re(c.x,c.y)),a[a.length-1].command=s?me.close:me.line),o=c},this),this._automatic=!1,this._curved=!1,this.vertices=a,this}_updateLength(n,r){r||this._update();const o=this.vertices.length-1;let a=this.vertices[o],l=0;return typeof this._lengths>"u"&&(this._lengths=[]),Pe.each(this.vertices,function(c,d){if(d<=0||c.command===me.move){a=c,this._lengths[d]=0;return}this._lengths[d]=Hc(c,a,n),l+=this._lengths[d],a=c},this),this._length=l,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const n=this._collection.length,r=this._closed,s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=rs(this,s*this._length),l=rs(this,o*this._length),c=Rp(a),d=$p(l);let u,h,m,g,f,p;for(this._renderer.vertices.length=0,p=0;p<n;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Re),p>d&&!h?(f=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,f),f.command=this._renderer.collection[p].command,this._renderer.vertices.push(f),h=f,m=this._collection[p-1],m&&m.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f),m.relative?this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(pe.zero,1-f.t):this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(m,1-f.t))):p>=c&&p<=d&&(f=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(f),p===d&&Dc(this,o)?(h=f,!r&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):p===c&&Dc(this,s)&&(u=f,u.command=me.move,!r&&u.controls&&(u.relative?u.controls.left.clear():u.controls.left.copy(u))));c>0&&!u&&(p=c-1,f=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(s,f),f.command=me.move,this._renderer.vertices.unshift(f),g=this._collection[p+1],g&&g.controls&&(f.controls.left.clear(),g.relative?this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(pe.zero,f.t):(Pp.copy(g),this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(g,f.t))))}return Rn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,Rn.prototype.flagReset.call(this),this}};C(nn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),C(nn,"Utils",{getCurveLength:Hc});let Ne=nn;const Xc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ye)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ye)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ye)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ye)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";Pe.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Q.Types.insert,e).unbind(Q.Types.remove,n),t instanceof ui?this._collection=t:this._collection=new ui(t||[]),this._collection.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Pe.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Yc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Uc(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Kc(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Gc(){this._flagFill=!0}function Zc(){this._flagStroke=!0}const Np=Math.ceil,Ep=Math.floor,Cn=class Cn extends Rn{constructor(n){super();C(this,"_flagVertices",!0);C(this,"_flagLength",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagSize",!0);C(this,"_flagSizeAttenuation",!0);C(this,"_flagStrokeAttenuation",!0);C(this,"_length",0);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_size",1);C(this,"_sizeAttenuation",!1);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_dashes",null);C(this,"_strokeAttenuation",!0);C(this,"noFill",Ne.prototype.noFill);C(this,"noStroke",Ne.prototype.noStroke);C(this,"corner",Ne.prototype.corner);C(this,"center",Ne.prototype.center);C(this,"getBoundingClientRect",Ne.prototype.getBoundingClientRect);C(this,"_updateLength",Ne.prototype._updateLength);for(let r in Qc)Object.defineProperty(this,r,Qc[r]);this._renderer.type="points",this._renderer.flagVertices=Yc.bind(this),this._renderer.bindVertices=Uc.bind(this),this._renderer.unbindVertices=Kc.bind(this),this._renderer.flagFill=Gc.bind(this),this._renderer.flagStroke=Zc.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=n,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(n.stroke),o=new Cn().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Re?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Re().copy(s))}for(let r=0;r<Cn.Properties.length;r++){const s=Cn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Cn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<Cn.Properties.length;s++){const o=Cn.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="points",n.vertices=this.vertices.map(r=>r.toObject()),Pe.each(Cn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(n){this._update();let r=[];for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s],a=this.vertices[s-1];if(!a)continue;const l=o.x,c=o.y,d=a.x,u=a.y,h=Ec(l,c,l,c,d,u,d,u,n);r=r.concat(h)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=rs(this,n*this._length),o=rs(this,r*this._length),a=Np(s),l=Ep(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let u=0;u<this._collection.length;u++)u>=a&&u<=l&&(d=this._collection[u],this._renderer.collection.push(d),this._renderer.vertices[c*2+0]=d.x,this._renderer.vertices[c*2+1]=d.y,c++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};C(Cn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let os=Cn;const Qc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ye)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ye)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ye)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ye)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Q.Types.insert,e).unbind(Q.Types.remove,n),t instanceof ui?this._collection=t:this._collection=new ui(t||[]),this._collection.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};class Jc extends ui{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);ja(this,As,{});this.attach(n),this.on(Q.Types.insert,this.attach),this.on(Q.Types.remove,this.detach)}get ids(){return Pt(this,As)}attach(n){for(let r=0;r<n.length;r++){const s=n[r];s&&s.id&&(this.ids[s.id]=s)}return this}detach(n){for(let r=0;r<n.length;r++)delete this.ids[n[r].id];return this}}As=new WeakMap;const Fn=class Fn extends Ne{constructor(n,r,s,o,a,l,c){const d=c||ko.Resolution*3,u=[];for(let h=0;h<d;h++)u.push(new Re);super(u,!0,!1,!0);C(this,"_flagStartAngle",!1);C(this,"_flagEndAngle",!1);C(this,"_flagInnerRadius",!1);C(this,"_flagOuterRadius",!1);C(this,"_startAngle",0);C(this,"_endAngle",di);C(this,"_innerRadius",0);C(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let h in ed)Object.defineProperty(this,h,ed[h]);typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Fn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Fn.Properties.length;r++){const s=Fn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,s=this._innerRadius,o=this._outerRadius,a=ji(n,di)===ji(r,di),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,u,h=0,m,g,f,p,b,y,_,S,v;for(a?d--:l||(d-=2),m=0,g=d-1;m<d;m++){switch(f=m/g,p=c[h],b=f*(r-n)+n,y=(r-n)/d,_=o*Math.cos(b),S=o*Math.sin(b),m){case 0:u=me.move;break;default:u=me.curve}p.command=u,p.x=_,p.y=S,p.controls.left.clear(),p.controls.right.clear(),p.command===me.curve&&(v=o*y/Math.PI,p.controls.left.x=v*Math.cos(b-ot),p.controls.left.y=v*Math.sin(b-ot),p.controls.right.x=v*Math.cos(b+ot),p.controls.right.y=v*Math.sin(b+ot),m===1&&p.controls.left.multiplyScalar(2),m===g&&p.controls.right.multiplyScalar(2)),h++}if(l){for(a?(c[h].command=me.close,h++):(d--,g=d-1),m=0;m<d;m++)f=m/g,p=c[h],b=(1-f)*(r-n)+n,y=(r-n)/d,_=s*Math.cos(b),S=s*Math.sin(b),u=me.curve,m<=0&&(u=a?me.move:me.line),p.command=u,p.x=_,p.y=S,p.controls.left.clear(),p.controls.right.clear(),p.command===me.curve&&(v=s*y/Math.PI,p.controls.left.x=v*Math.cos(b+ot),p.controls.left.y=v*Math.sin(b+ot),p.controls.right.x=v*Math.cos(b-ot),p.controls.right.y=v*Math.sin(b-ot),m===1&&p.controls.left.multiplyScalar(2),m===g&&p.controls.right.multiplyScalar(2)),h++;c[h].copy(c[0]),c[h].command=me.line}else a||(c[h].command=me.line,c[h].x=0,c[h].y=0,h++,c[h].copy(c[0]),c[h].command=me.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.startAngle,a=this.endAngle,l=this.vertices.length,c=new Fn(0,0,r,s,o,a,l);c.translation.copy(this.translation),c.rotation=this.rotation,c.scale=this.scale,c.skewX=this.skewX,c.skewY=this.skewY,this.matrix.manual&&c.matrix.copy(this.matrix);for(let d=0;d<Ne.Properties.length;d++){const u=Ne.Properties[d];c[u]=this[u]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<Fn.Properties.length;r++){const s=Fn.Properties[r];n[s]=this[s]}return n}};C(Fn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Co=Fn;const ed={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},So=Math.cos,Bo=Math.sin,An=class An extends Ne{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new Re(0,0,0,0,0,0));super(l,!0,!0,!0);C(this,"_flagRadius",!1);C(this,"_radius",0);this._renderer.type="circle";for(let c in td)Object.defineProperty(this,c,td[c]);typeof s=="number"&&(this.radius=s),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new An().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<An.Properties.length;r++){const s=An.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagRadius){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(n*2)),s=this._radius,o=s*r;for(let a=0;a<this.vertices.length;a++){const c=a/n*di,d=s*So(c),u=s*Bo(c),h=o*So(c-ot),m=o*Bo(c-ot),g=o*So(c+ot),f=o*Bo(c+ot),p=this.vertices[a];p.command=a===0?me.move:me.curve,p.set(d,u),p.controls.left.set(h,m),p.controls.right.set(g,f)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new An(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="circle";for(let r=0;r<An.Properties.length;r++){const s=An.Properties[r];n[s]=this[s]}return n}};C(An,"Properties",["radius"]);let To=An;const td={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},Ro=Math.cos,$o=Math.sin,Mn=class Mn extends Ne{constructor(n,r,s,o,a){typeof o!="number"&&typeof s=="number"&&(o=s);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new Re);super(c,!0,!0,!0);C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_width",0);C(this,"_height",0);this._renderer.type="ellipse";for(let d in nd)Object.defineProperty(this,d,nd[d]);typeof s=="number"&&(this.width=s*2),typeof o=="number"&&(this.height=o*2),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Mn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Mn.Properties.length;r++){const s=Mn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(this.vertices.length*2)),s=this._width/2,o=this._height/2;for(let a=0;a<this.vertices.length;a++){const c=a/n*di,d=s*Ro(c),u=o*$o(c),h=s*r*Ro(c-ot),m=o*r*$o(c-ot),g=s*r*Ro(c+ot),f=o*r*$o(c+ot),p=this.vertices[a];p.command=a===0?me.move:me.curve,p.set(d,u),p.controls.left.set(h,m),p.controls.right.set(g,f)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=this.width/2,s=this.height/2,o=this.vertices.length,a=new Mn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="ellipse";for(let r=0;r<Mn.Properties.length;r++){const s=Mn.Properties[r];n[s]=this[s]}return n}};C(Mn,"Properties",["width","height"]);let Po=Mn;const nd={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},Fp=Math.cos,Ap=Math.sin,Vn=class Vn extends Ne{constructor(n,r,s,o){o=Math.max(o||0,3);super();C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_flagSides",!1);C(this,"_radius",0);C(this,"_width",0);C(this,"_height",0);C(this,"_sides",0);this._renderer.type="polygon";for(let a in id)Object.defineProperty(this,a,id[a]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.radius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Vn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Vn.Properties.length;r++){const s=Vn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const n=this._sides,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=di*a+Math.PI/2,c=this._width*Fp(l)/2,d=this._height*Ap(l)/2;o>=s?this.vertices.push(new Re(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?me.move:me.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=new Vn(0,0,0,this.sides);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,r.width=this.width,r.height=this.height,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="polygon";for(let r=0;r<Vn.Properties.length;r++){const s=Vn.Properties[r];n[s]=this[s]}return n}};C(Vn,"Properties",["width","height","sides"]);let No=Vn;const id={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},Ti=class Ti extends Ne{constructor(n,r,s,o){const a=[new Re,new Re,new Re,new Re];super(a,!0,!1,!0);C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_width",0);C(this,"_height",0);C(this,"_origin",null);this._renderer.type="rectangle";for(let l in rd)Object.defineProperty(this,l,rd[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new pe,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new Ti().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ti.Properties.length;r++){const s=Ti.Properties[r];s in n&&(typeof n[s]=="number"?this[s]=n[s]:this[s]instanceof pe&&this[s].copy(n[s]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const n=this._width/2,r=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new Re),this.vertices[0].set(-n,-r).sub(this._origin).command=me.move,this.vertices[1].set(n,-r).sub(this._origin).command=me.line,this.vertices[2].set(n,r).sub(this._origin).command=me.line,this.vertices[3].set(-n,r).sub(this._origin).command=me.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=me.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new Ti(0,0,this.width,this.height);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]instanceof pe?r[o].copy(this[o]):r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="rectangle",n.width=this.width,n.height=this.height,n.origin=this.origin.toObject(),n}};C(Ti,"Properties",["width","height","origin"]);let mr=Ti;const rd={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(Q.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(Q.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},In=class In extends Ne{constructor(n,r,s,o,a){typeof a>"u"&&typeof s=="number"&&typeof o=="number"&&(a=Math.floor(Math.min(s,o)/12));const l=[];for(let c=0;c<10;c++)l.push(new Re(0,0,0,0,0,0,c===0?me.move:me.curve));super(l);C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_flagRadius",!1);C(this,"_width",0);C(this,"_height",0);C(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in sd)Object.defineProperty(this,c,sd[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Mp.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),(typeof a=="number"||a instanceof pe)&&(this.radius=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new In().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<In.Properties.length;r++){const s=In.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof pe?o:new pe().copy(o):typeof o=="number"&&(this[s]=o)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const n=this._width,r=this._height;let s,o;this._radius instanceof pe?(s=this._radius.x,o=this._radius.y):(s=this._radius,o=this._radius);let a,l=n/2,c=r/2;a=this.vertices[0],a.x=-(l-s),a.y=-c,a=this.vertices[1],a.x=l-s,a.y=-c,a.controls.left.clear(),a.controls.right.x=s,a.controls.right.y=0,a=this.vertices[2],a.x=l,a.y=-(c-o),a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[3],a.x=l,a.y=c-o,a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=o,a=this.vertices[4],a.x=l-s,a.y=c,a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[5],a.x=-(l-s),a.y=c,a.controls.left.clear(),a.controls.right.x=-s,a.controls.right.y=0,a=this.vertices[6],a.x=-l,a.y=c-o,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[7],a.x=-l,a.y=-(c-o),a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=-o,a=this.vertices[8],a.x=-(l-s),a.y=-c,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[9],a.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=this.width,s=this.height,o=this.radius,a=new In(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="rounded-rectangle";for(let r=0;r<In.Properties.length;r++){const s=In.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};C(In,"Properties",["width","height","radius"]);let Eo=In;const sd={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof pe&&this._radius.unbind(Q.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof pe&&this._radius.bind(Q.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Mp(){this._flagRadius=!0}const Vp=Math.cos,Ip=Math.sin,On=class On extends Ne{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();C(this,"_flagInnerRadius",!1);C(this,"_flagOuterRadius",!1);C(this,"_flagSides",!1);C(this,"_innerRadius",0);C(this,"_outerRadius",0);C(this,"_sides",0);this._renderer.type="star";for(let l in od)Object.defineProperty(this,l,od[l]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.sides=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new On().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<On.Properties.length;r++){const s=On.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const n=this._sides*2,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=di*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*Vp(l),u=c*Ip(l);o>=s?this.vertices.push(new Re(d,u)):this.vertices[o].set(d,u),this.vertices[o].command=o===0?me.move:me.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.sides,a=new On(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="star";for(let r=0;r<On.Properties.length;r++){const s=On.Properties[r];n[s]=this[s]}return n}};C(On,"Properties",["innerRadius","outerRadius","sides"]);let Fo=On;const od={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}};let Ao;const ad=Math.min,ld=Math.max;pn.document&&(Ao=document.createElement("canvas"));const bt=class bt extends Rn{constructor(n,r,s,o){super();C(this,"_flagValue",!0);C(this,"_flagFamily",!0);C(this,"_flagSize",!0);C(this,"_flagLeading",!0);C(this,"_flagAlignment",!0);C(this,"_flagBaseline",!0);C(this,"_flagStyle",!0);C(this,"_flagWeight",!0);C(this,"_flagDecoration",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagMask",!1);C(this,"_flagClip",!1);C(this,"_flagDirection",!0);C(this,"_flagStrokeAttenuation",!0);C(this,"_value","");C(this,"_family","sans-serif");C(this,"_size",13);C(this,"_leading",17);C(this,"_alignment","center");C(this,"_baseline","middle");C(this,"_style","normal");C(this,"_weight",500);C(this,"_decoration","none");C(this,"_direction","ltr");C(this,"_fill","#000");C(this,"_stroke","none");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_mask",null);C(this,"_clip",!1);C(this,"_dashes",null);C(this,"_strokeAttenuation",!0);for(let a in cd)Object.defineProperty(this,a,cd[a]);if(this._renderer.type="text",this._renderer.flagFill=Op.bind(this),this._renderer.flagStroke=zp.bind(this),this.value=n,typeof r=="number"&&(this.translation.x=r),typeof s=="number"&&(this.translation.y=s),this.dashes=[],this.dashes.offset=0,!Pe.isObject(o))return this;for(let a=0;a<bt.Properties.length;a++){const l=bt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(Ao){const r=Ao.getContext("2d");r.font=[n._style,n._weight,`${n._size}px/${n._leading}px`,n._family].join(" ");const s=r.measureText(n.value,0,0),o=s.actualBoundingBoxDescent+s.actualBoundingBoxAscent;return{width:s.width,height:o}}else{const r=this.value.length*this.size*bt.Ratio,s=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:s}}}static fromObject(n){const r=typeof n.fill=="string"?n.fill:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(n.stroke),o=new bt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<bt.Properties.length;r++){const s=bt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new bt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<bt.Properties.length;s++){const o=bt.Properties[s];r[o]=this[o]}return this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);n.renderer.type="text";for(let r=0;r<bt.Properties.length;r++){const s=bt.Properties[r];n[s]=this[s]}return n}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(n){let r,s,o,a,l;this._update(!0),r=n?this.matrix:this.worldMatrix;const{width:c,height:d}=bt.Measure(this),u=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-u,o=c+u;break;case"right":s=-(c+u),o=u;break;default:s=-(c/2+u),o=c/2+u}switch(this.baseline){case"middle":a=-(d/2+u),l=d/2+u;break;default:a=-(d+u),l=u}const[h,m]=r.multiply(s,a),[g,f]=r.multiply(s,l),[p,b]=r.multiply(o,a),[y,_]=r.multiply(o,l);return a=ad(m,f,b,_),s=ad(h,g,p,y),o=ld(h,g,p,y),l=ld(m,f,b,_),{top:a,left:s,right:o,bottom:l,width:o-s,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};C(bt,"Ratio",.6),C(bt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let Yi=bt;const cd={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ye)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof St||this._fill instanceof Bt||this._fill instanceof Ye)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ye)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof St||this._stroke instanceof Bt||this._stroke instanceof Ye)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Pe.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Op(){this._flagFill=!0}function zp(){this._flagStroke=!0}const zn=class zn extends mr{constructor(n,r,s,o){super(r,s,0,0);C(this,"_flagTextures",!1);C(this,"_flagFrameRate",!1);C(this,"_flagIndex",!1);C(this,"_amount",1);C(this,"_duration",0);C(this,"_index",0);C(this,"_startTime",0);C(this,"_playing",!1);C(this,"_firstFrame",0);C(this,"_lastFrame",0);C(this,"_loop",!0);C(this,"_textures",null);C(this,"_frameRate",0);C(this,"_origin",null);this._renderer.type="image-sequence";for(let a in dd)Object.defineProperty(this,a,dd[a]);this._renderer.flagTextures=Lp.bind(this),this._renderer.bindTextures=Dp.bind(this),this._renderer.unbindTextures=Hp.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(ud.bind(this)):typeof n=="string"&&(this.textures=[ud(n)]),this.origin=new pe,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=zn.DefaultFrameRate,this.index=0}static fromObject(n){const r=new zn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<zn.Properties.length;r++){const s=zn.Properties[r];s in n&&(this[s]=n[s])}return this}play(n,r,s){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Pe.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof s=="function"?this._onLastFrame=s:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(n){const r=new zn(this.textures,this.translation.x,this.translation.y,this.frameRate);return r._loop=this._loop,this._playing&&r.play(),n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="image-sequence",n.textures=this.textures.map(function(r){return r.toObject()}),n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let n=0;n<this.textures.length;n++){const r=this.textures[n];typeof r.dispose=="function"?r.dispose():typeof r.unbind=="function"&&r.unbind()}return this}_update(){const n=this._textures;let r,s,o,a,l,c,d,u;return n&&(this._flagTextures&&(this._amount=n.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(a=this._amount,Pe.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=Pe.performance.now()-this._startTime,u=this._lastFrame+1,l=1e3*(u-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),d=Yt(this._firstFrame,u,o/l),d=Math.floor(d),d!==this._index&&(this._index=d,c=n[this._index],c.loaded&&(r=c.image.width,s=c.image.height,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s),this.fill=c,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Ye))&&(c=n[this._index],c.loaded&&(r=c.image.width,s=c.image.height,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s)),this.fill=c)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};C(zn,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),C(zn,"DefaultFrameRate",30);let Mo=zn;const dd={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(Q.Types.insert,e).unbind(Q.Types.remove,n),this._textures=new ui((t||[]).slice(0)),this._textures.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function Lp(){this._flagTextures=!0}function Dp(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Hp(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function ud(t){if(t instanceof Ye)return t;if(typeof t=="string")return new Ye(t)}const Ri=class Ri extends mr{constructor(n,r,s,o,a,l){super(r,s,0,0);C(this,"_flagTexture",!1);C(this,"_flagColumns",!1);C(this,"_flagRows",!1);C(this,"_flagFrameRate",!1);C(this,"_flagIndex",!1);C(this,"_amount",1);C(this,"_duration",0);C(this,"_startTime",0);C(this,"_playing",!1);C(this,"_firstFrame",0);C(this,"_lastFrame",0);C(this,"_loop",!0);C(this,"_texture",null);C(this,"_columns",1);C(this,"_rows",1);C(this,"_frameRate",0);C(this,"_index",0);C(this,"_origin",null);this._renderer.type="sprite";for(let c in hd)Object.defineProperty(this,c,hd[c]);this.noStroke(),this.noFill(),n instanceof Ye?this.texture=n:typeof n=="string"&&(this.texture=new Ye(n)),this.origin=new pe,this._update(),typeof o=="number"&&(this.columns=o),typeof a=="number"&&(this.rows=a),typeof l=="number"&&(this.frameRate=l),this.index=0}static fromObject(n){const r=new Ri().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ri.Properties.length;r++){const s=Ri.Properties[r];s in n&&(this[s]=n[s])}return this}play(n,r,s){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Pe.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof s=="function"?this._onLastFrame=s:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(n){const r=new Ri(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&r.play(this._firstFrame,this._lastFrame),r.loop=this.loop,r.firstFrame=this.firstFrame,r.lastFrame=this.lastFrame,n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="sprite",n.texture=this.texture.toObject(),n.columns=this.columns,n.rows=this.rows,n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const n=this._texture,r=this._columns,s=this._rows;let o,a,l,c,d,u,h,m,g;if(n&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=n),n.loaded)){h=n.image.width,m=n.image.height,o=h/r,a=m/s,c=this._amount,this.width!==o&&(this.width=o),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&(Pe.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=Pe.performance.now()-this._startTime,g=this._lastFrame+1,d=1e3*(g-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),u=Yt(this._firstFrame,g,l/d),u=Math.floor(u),u!==this._index&&(this._index=u,u>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const f=this._index%r,p=Math.floor(this._index/r),b=-o*f+(h-o)/2,y=-a*p+(m-a)/2;b!==n.offset.x&&(n.offset.x=b),y!==n.offset.y&&(n.offset.y=y)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};C(Ri,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let Vo=Ri;const hd={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},as=Math.min,ls=Math.max,rn=class rn extends Rn{constructor(n){super();C(this,"_flagAdditions",!1);C(this,"_flagSubtractions",!1);C(this,"_flagOrder",!1);C(this,"_flagOpacity",!0);C(this,"_flagBeginning",!1);C(this,"_flagEnding",!1);C(this,"_flagLength",!1);C(this,"_flagMask",!1);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_cap","round");C(this,"_join","round");C(this,"_miter",4);C(this,"_closed",!0);C(this,"_curved",!1);C(this,"_automatic",!0);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_length",0);C(this,"_mask",null);C(this,"_strokeAttenuation",!0);for(let r in fd)Object.defineProperty(this,r,fd[r]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(n)?n:Array.prototype.slice.call(arguments)}static InsertChildren(n){for(let r=0;r<n.length;r++)md.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)md.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new rn;for(let o=0;o<rn.Properties.length;o++){const a=rn.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:fi(n[a]):r[a]=n[a])}return"mask"in n&&(r.mask=s(n.mask)),"id"in n&&(r.id=n.id),r.children=n.children.map(s),r;function s(o){if(o&&o.renderer)switch(o.renderer.type){case"arc-segment":return Co.fromObject(o);case"circle":return To.fromObject(o);case"element":return hr.fromObject(o);case"ellipse":return Po.fromObject(o);case"group":return rn.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return Mo.fromObject(o);case"path":return Ne.fromObject(o);case"points":return os.fromObject(o);case"polygon":return No.fromObject(o);case"rectangle":return mr.fromObject(o);case"rounded-rectangle":return Eo.fromObject(o);case"shape":return Rn.fromObject(o);case"sprite":return Vo.fromObject(o);case"star":return Fo.fromObject(o);case"text":return Yi.fromObject(o)}return o}}copy(n){super.copy.call(this,n),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let r=0;r<rn.Properties.length;r++){const s=rn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new rn,s=this.children.map(function(o){return o.clone()});return r.add(s),r.opacity=this.opacity,this.mask&&(r.mask=this.mask),r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.className=this.className,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="group",n.children=[],n.opacity=this.opacity,n.className=this.className,n.mask=this.mask?this.mask.toObject():null,Pe.each(this.children,(r,s)=>{n.children[s]=r.toObject()},this),n}dispose(){if(super.dispose(),this.children)for(let n=0;n<this.children.length;n++){const r=this.children[n];typeof r.dispose=="function"&&r.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const n=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const s=this.children[r];s.translation.x-=n.left,s.translation.y-=n.top}return this.mask&&(this.mask.translation.x-=n.left,this.mask.translation.y-=n.top),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.children.length;o++){const a=this.children[o];a.isShape&&(a.translation.x-=r,a.translation.y-=s)}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getById(n){let r=null;function s(o){if(o.id===n)return o;if(o.children){if(o.children.ids[n])return o.children.ids[n];for(let a=0;a<o.children.length;a++)if(r=s(o.children[a]),r)return r}return null}return s(this)}getByClassName(n){const r=[];function s(o){if(Array.prototype.indexOf.call(o.classList,n)>=0&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}getByType(n){const r=[];function s(o){if(o instanceof n&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}add(n){n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let r=0;r<n.length;r++){const s=n[r];if(!(s&&s.id))continue;const o=Array.prototype.indexOf.call(this.children,s);o>=0&&this.children.splice(o,1),this.children.push(s)}return this}remove(n){const r=arguments.length,s=this.parent;if(r<=0&&s)return s.remove(this),this;n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let o=0;o<n.length;o++){const a=n[o];if(!a||!this.children.ids[a.id])continue;const l=this.children.indexOf(a);l>=0&&this.children.splice(l,1)}return this}getBoundingClientRect(n){let r,s,o,a,l,c;this._update(!0);let d=1/0,u=-1/0,h=1/0,m=-1/0;const g=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let f=0;f<this.children.length;f++){const p=this.children[f];if(!(!p.visible||g.test(p._renderer.type))&&(r=p.getBoundingClientRect(n),o=typeof r.top!="number"||Pe.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Pe.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Pe.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Pe.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[b,y]=s.multiply(r.left,r.top),[_,S]=s.multiply(r.right,r.top),[v,T]=s.multiply(r.left,r.bottom),[R,w]=s.multiply(r.right,r.bottom);h=as(y,S,T,w,h),d=as(b,_,v,R,d),u=ls(b,_,v,R,u),m=ls(y,S,T,w,m)}else h=as(r.top,h),d=as(r.left,d),u=ls(r.right,u),m=ls(r.bottom,m)}return{top:h,left:d,right:u,bottom:m,width:u-d,height:m-h}}noFill(){return this.children.forEach(function(n){n.noFill()}),this}noStroke(){return this.children.forEach(function(n){n.noStroke()}),this}subdivide(){const n=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,n)}),this}_update(){let n,r,s;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=o*l,u=a*l;for(n=0;n<this.children.length;n++)s=this.children[n],r=s.length,d>c+r?(s.beginning=1,s.ending=1):u<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):u>c&&u<c+r?(s.beginning=0,s.ending=(u-c)/r):(s.beginning=0,s.ending=1),c+=r}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};C(rn,"Children",Jc),C(rn,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let $n=rn;const fd={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=$n.InsertChildren.bind(this),n=$n.RemoveChildren.bind(this),r=$n.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Jc(t),this._children.bind(Q.Types.insert,e),this._children.bind(Q.Types.remove,n),this._children.bind(Q.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Pe.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function md(t,e){const n=t.parent;let r;if(n===e){s();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),o()),e){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function s(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}class cs extends Ne{constructor(e,n,r,s){const o=[new Re(e,n),new Re(r,s)];super(o);for(let a in gd)Object.defineProperty(this,a,gd[a]);this.vertices[0].command=me.move,this.vertices[1].command=me.line,this.automatic=!1}}C(cs,"Properties",["left","right"]);const gd={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(Pe.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=me.move;else{const e=new ns("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(Pe.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=me.line;else{const e=new ns("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class Io{constructor(e=0,n=0){this.x=e,this.y=n}}class bn{constructor(e=10,n=0,r="A"){C(this,"start",new Io);C(this,"end",new Io);this.width=e,this.angle=n,this.label=r}}const Le={line:{color:"#000",size:5},previewLine:{color:"#000",size:2},anchorPoint:{color:"#FF8000",size:12,strokeSize:20},lineLabel:{color:"#FF8000",size:22,rotation:-.5},angleLabel:{size:22,color:"#088c00",rotation:-.5},colorSideLabel:{size:20,color:"#439227"}},Wp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function jp(t,e){return i.openBlock(),i.createElementBlock("svg",Wp,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"},null,-1)])])}const ds=i.markRaw({name:"ion-close",render:jp}),qp={class:"mr-3 flex flex-col gap-2"},Xp=["onClick"],Yp={class:"h-full p-2"},Up={},Kp=i.defineComponent({...Up,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(t,{emit:e}){const n=t,r=i.ref(!1),s=i.useTemplateRef("drawing-template-containers"),o=i.useTemplateRef("drawing-custom-template-containers"),a=e,l=c=>{r.value=!0,a("remove-custom-template",c,()=>{r.value=!1})};return i.onMounted(()=>{var c,d;(c=n.settings.templates)==null||c.forEach((u,h)=>{var g;const m=(g=s.value)==null?void 0:g.at(h);m&&a("init-draw-template",m,u)}),(d=n.settings.customTemplates)==null||d.forEach((u,h)=>{var g;const m=(g=o.value)==null?void 0:g.at(h);m&&a("init-draw-template",m,u)})}),i.watch(()=>[...n.settings.customTemplates],(c,d)=>{i.nextTick(()=>{c.forEach((u,h)=>{var m;if(!(d!=null&&d.includes(u))){const g=(m=o.value)==null?void 0:m.at(h);g&&a("init-draw-template",g,u)}}),d.length>c.length&&d.forEach((u,h)=>{var g;const m=(g=o.value)==null?void 0:g.at(h);m&&(m.innerHTML="",a("init-draw-template",m,u))})})},{deep:!0}),(c,d)=>{const u=ds;return i.openBlock(),i.createBlock(i.unref(L.NScrollbar),{style:{width:"auto"},trigger:"none",class:"max-h-[19rem] md:max-h-[40rem] w-auto"},{default:i.withCtx(()=>[i.createElementVNode("div",qp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.settings.allTemplates,(h,m)=>(i.openBlock(),i.createElementBlock("div",{key:`${h.id}-${m}`,class:"group relative"},[i.createVNode(i.unref(L.NPopover),{trigger:"hover",placement:"right"},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":m===t.selectTemplateIndex}]),onClick:g=>a("template:select",m)},[i.createElementVNode("div",Yp,[i.createElementVNode("div",{ref_for:!0,ref:h.isCustom&&h.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Xp)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.label),1)]),_:2},1024),h.isCustom&&!h.isNewRec()?(i.openBlock(),i.createBlock(i.unref(L.NButton),{key:0,size:"tiny",quaternary:"",loading:r.value,disabled:r.value,circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:g=>l(m)},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["loading","disabled","onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),pd=Wn(Kp,[["__scopeId","data-v-afccb364"]]),Gp={class:"flex gap-3 min-w-[20rem] relative"},Zp={class:"kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},Qp={ref:"drawing-container",class:"size-full"},Jp={},yd=i.defineComponent({...Jp,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select","remove-custom-template"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,u=i.computed(()=>n.value.configuratorParams.linesAngles.map((I,z)=>new bn(n.value.configuratorParams.linesWidths[z],I,`A-${z+1}`))),h=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),m=i.computed(()=>{var I,z;return n.value.configuratorParams.startTailType&&((I=n.settings.startTailConfigs)!=null&&I[n.value.configuratorParams.startTailType])?(z=n.settings.startTailConfigs)==null?void 0:z[n.value.configuratorParams.startTailType].points:[]}),g=i.computed(()=>{var z;const I=n.value.configuratorParams.endTailType!==void 0&&((z=n.settings.endTailConfigs)==null?void 0:z[n.value.configuratorParams.endTailType]);return!I||!I.points?[]:I.points.map((q,W)=>Array.isArray(q)?new bn(q[0],q[1],`A-${W+1}`):new bn(q.width,q.angle,`A-${W+1}`))}),f=(I,z=!1)=>{I[0].start.x=0,I[0].start.y=0;let q=0;for(let W=0;W<I.length;W++){const O=I[W],D=I[W-1]??new bn(0,q);q+=!z||W>1?D.angle:0;const j=(!z||W>0?O.angle:0)+q;if(I[W].end.x=O.width*Math.cos(j*Math.PI/180)+I[W].start.x,I[W].end.y=O.width*Math.sin(j*Math.PI/180)+I[W].start.y,W<I.length-1){const G=W+1;I[G].start.x=I[W].end.x,I[G].start.y=I[W].end.y}}return I},p=(I,z,q,W,O=!1)=>{let D=f([...q,...W]);z.length>0&&(D=[...f(z),...D]);let j=0,G=0,ue=0,oe=0;D.forEach(Fe=>{j=Math.min(j,Fe.start.x,Fe.end.x),G=Math.min(G,Fe.start.y,Fe.end.y),ue=Math.max(ue,Fe.start.x,Fe.end.x),oe=Math.max(oe,Fe.start.y,Fe.end.y)});let re,Ee;j===0&&G===0&&ue===0&&oe===0?(re=1,Ee=1):(re=I.width/Math.abs(ue-j),Ee=(O?I.height:I.height-Le.colorSideLabel.size)/Math.abs(oe-G));const We=Math.min(re,Ee);return j=j<0?-j*We:0,G=G<0?-G*We:0,[We,j,G]},b=I=>{const z=new os([I]);return z._size=Le.anchorPoint.size,z.fill=Le.anchorPoint.color,z.stroke="transparent",z._linewidth=Le.anchorPoint.strokeSize,l.push(z),z},y=(I,z)=>{if(l=[],n.settings.allowChangeFirstPoint){const q=I[0],W=new pe(q.vertices[0].x,q.vertices[0].y);W.bind(Q.Types.change,()=>{q.vertices[0].copy(W)});const O=b(W);z.add(O)}I.forEach((q,W)=>{const O=I[W+1],D=new pe(q.vertices[1].x,q.vertices[1].y);D.bind(Q.Types.change,()=>{q.vertices[1].copy(D),O!==void 0&&O.vertices[0].copy(D)});const j=b(D);z.add(j)})},_=I=>I*(Math.PI/180),S=(I,z,q)=>{const W=z.vertices.length-1;I.position.x=z.vertices[W].x,I.position.y=z.vertices[W].y;const O=Math.atan2(z.vertices[W].y-z.vertices[0].y,z.vertices[W].x-z.vertices[0].x);I.rotation=_(q)+O},v=(I,z,q)=>{if(z.vertices[0]===void 0)return;I.position.x=z.vertices[0].x,I.position.y=z.vertices[0].y;const W=z.vertices.length-1,O=Math.atan2(z.vertices[W].y-z.vertices[0].y,z.vertices[W].x-z.vertices[0].x);I.rotation=_(q)+O},T=(I,z,q)=>{const W=new $n;if(I.length===0)return W;const O=[];return[...I].reverse().forEach((D,j)=>{j!==0&&D.angle>0&&(D.angle*=-1),O.push(D)}),I=f(O,!0),v(W,z,I[0].angle),[z.vertices[0],z.vertices[1]].forEach(D=>{D.bind(Q.Types.change,()=>{v(W,z,I[0].angle)})}),I.forEach(D=>{const j=D.start.x*q,G=D.end.x*q,ue=D.start.y*q,oe=D.end.y*q,re=new cs(j,ue,G,oe);re.linewidth=Le.line.size,re.stroke=Le.line.color,W.add(re)}),W},R=(I,z,q)=>{const W=new $n;return I.length===0||(I=f(I,!0),S(W,z,I[0].angle),[z.vertices[0],z.vertices[1]].forEach(O=>{O.bind(Q.Types.change,()=>{S(W,z,I[0].angle)})}),I.forEach(O=>{const D=O.start.x*q,j=O.end.x*q,G=O.start.y*q,ue=O.end.y*q,oe=new cs(D,G,j,ue);oe.linewidth=Le.line.size,oe.stroke=Le.line.color,W.add(oe)})),W},w=(I,z,q,W)=>{const O=z.vertices[0].x+(z.vertices[1].x-z.vertices[0].x)/2-8*Math.sin(I.angle*Math.PI/180),D=z.vertices[0].y+(z.vertices[1].y-z.vertices[0].y)/2-8*Math.cos(I.angle*Math.PI/180),j=new Yi(I.label,O+10,D-10);let G;j.size=Le.lineLabel.size,j.weight=600,j.fill=Le.lineLabel.color,j.id+=1,j.rotation=Le.lineLabel.rotation,W>0&&(G=new Yi(`${I.angle}°`,z.vertices[0].x+25,z.vertices[0].y-25),G.size=Le.angleLabel.size,G.weight=600,G.fill=Le.angleLabel.color,G.rotation=Le.angleLabel.rotation,G.id+=W,o.push(G),q.add(G)),q.add(j),x(j,z,0,G),x(j,z,1)},B=()=>{const{size:I}=Le.colorSideLabel,z=0,q=0,W=h.value?I/2:I/2-I,O=h.value?I/2-I:I/2,D=new $n;if(!c)return D;const j=5,G=Math.atan2(O-W,q-z),ue=[new Re(z,W,0,0,0,0,gn.Commands.move),new Re(q,O,0,0,0,0,gn.Commands.line),new Re(q-j*Math.cos(G-Math.PI/4),O-j*Math.sin(G-Math.PI/4),0,0,0,0,gn.Commands.line),new Re(q,O,0,0,0,0,gn.Commands.move),new Re(q-j*Math.cos(G+Math.PI/4),O-j*Math.sin(G+Math.PI/4),0,0,0,0,gn.Commands.line)],oe=new Ne(ue,!1,!1,!0);oe.noFill(),oe.cap="round",oe.join="round",oe.linewidth=I/7,oe.stroke=Le.colorSideLabel.color,D.add(oe);const re=new Yi(h.value?"Цвет снизу":"Цвет сверху",10,0);re.size=I,re.weight=600,re.fill=Le.colorSideLabel.color,re.alignment="left",D.add(re);const Ee=D.getBoundingClientRect();return D.position.x=(c.width-Ee.width)*d+10,D.position.y=h.value?c.height+Ee.height*2:Ee.height/2,D},x=(I,z,q,W)=>{z.vertices[q].bind(Q.Types.change,()=>{const O=z.vertices.length-1,D=Math.atan2(z.vertices[0].y-z.vertices[O].y,z.vertices[0].x-z.vertices[O].x)*180/Math.PI,j=z.vertices[0].x+(z.vertices[O].x-z.vertices[0].x)/2-8*Math.sin(D*Math.PI/180),G=z.vertices[0].y+(z.vertices[O].y-z.vertices[0].y)/2-8*Math.cos(D*Math.PI/180);I.position.x=j+10,I.position.y=G-10,I.rotation=-.5,W&&(W.position.x=z.vertices[0].x+25,W.position.y=z.vertices[0].y-25)})},$=(I,z,q,W,O=!1)=>{var Gt;if(I.clear(),q.length===0){I.update();return}const D=f(q),[j,G,ue]=p(I,z,D,W,O),oe=new $n,re=new Array,Ee=new Array;O||(o=[],a=[]),D.forEach((Te,sn)=>{const on=Te.start.x*j+G,$t=Te.end.x*j+G,Lt=Te.start.y*j+ue,an=Te.end.y*j+ue,wt=new cs(on,Lt,$t,an);wt.linewidth=O?Le.previewLine.size:Le.line.size,wt.stroke=O?Le.previewLine.color:Le.line.color,a.push(wt),re.push(wt),oe.add(wt),!O&&Te.label!==""&&w(Te,wt,oe,sn)});const We=re.at(-1);let Fe=oe.getBoundingClientRect();if(!O){const Te=B();Ee.push(Te)}if(z.length>0){const Te=T(z,re[0],j);oe.add(Te)}if(W.length>0&&We){const Te=R(W,We,j);oe.add(Te)}if(Ee.push(oe),I.makeGroup(Ee),Fe=oe.getBoundingClientRect(),oe.position.x=0-Fe.left+(I.width-Fe.width)/(2*(O?1:d)),oe.position.y=0-Fe.top+(I.height-Fe.height)/(2*(O?1:d)),I.update(),!O){const Te=((Gt=n.value.configuratorParams)==null?void 0:Gt.colorSide)==="top";oe.position.y=oe.position.y+Le.colorSideLabel.size*Number(Te),y(re,oe),I.update()}},P=(I,z)=>{if(I&&!z.isNewRec()){const q=new gn({width:I.scrollWidth,height:I.scrollHeight});q.appendTo(I),$(q,[],z.points,[],!0)}},A=()=>{c&&$(c,m.value,u.value,g.value,!1)},V=I=>I*(180/Math.PI),F=(I,z)=>{const q=I[1].x-I[0].x,W=I[1].y-I[0].y,O=z[1].x-z[0].x,D=z[1].y-z[0].y;let j=Math.atan2(q*D-W*O,q*O+W*D);return j=V(j),Math.round(j)*-1},N=I=>{const z=a.map((q,W,O)=>{const D=O[W-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let j=Math.ceil(q._length/I/n.settings.lineWidthStep)*n.settings.lineWidthStep;const G=o[W-1];j<(O.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(j=O.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),j>n.settings.maxLineWidth&&(j=n.settings.maxLineWidth);const ue=F(q.vertices,D.vertices);return G&&(G.value=`${ue}°`),new bn(j,ue,`A-${W+1}`)});r("pointer:move",z)},Y=I=>{let z=null,q;const W=G=>{z=l.find(ue=>{const oe=ue.renderer;return(oe==null?void 0:oe.elem)===G.target}),[q]=p(I,m.value,u.value.map(ue=>ue),g.value)},O=G=>{if(z){const ue=z.renderer,oe=ue==null?void 0:ue.elem;if(!oe)return;const re=oe.getBoundingClientRect();z.vertices[0].x-=re.x-(G instanceof MouseEvent?G.clientX:G.targetTouches[0].clientX)+Le.anchorPoint.size/2,z.vertices[0].y-=re.y-(G instanceof MouseEvent?G.clientY:G.targetTouches[0].clientY)+Le.anchorPoint.size/2,N(q),I.update()}},D=()=>{z&&r("pointer:up",u.value),z=null},j=s.value;j&&(j.addEventListener("touchstart",W,{passive:!0}),j.addEventListener("touchend",D,{passive:!0}),j.addEventListener("mousedown",W),j.addEventListener("mouseup",D),j.addEventListener("mousemove",O),j.addEventListener("touchmove",O,{passive:!0}))},ee=(I,z)=>{r("remove-custom-template",I,z)};return i.onMounted(()=>{s.value&&(c=new gn({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{A()},{deep:!0,immediate:!0}),Y(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(I,z)=>(i.openBlock(),i.createElementBlock("div",Gp,[i.createVNode(pd,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":z[0]||(z[0]=q=>r("template:select",q)),onInitDrawTemplate:P,onRemoveCustomTemplate:ee},null,8,["select-template-index","settings"]),i.createElementVNode("div",Zp,[i.createElementVNode("div",Qp,null,512)])]))}});class Ui extends Z.Identity{constructor(n,r){super();C(this,"label","");C(this,"points",[]);C(this,"isCustom",!1);C(this,"id",-1);C(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>M.isArray(s)?new bn(s[0],s[1],`A-${o+1}`):new bn(s.width,s.angle,`A-${o+1}`)),this.isCustom=n.isCustom):(this.label="-- Новая конфигурация --",this.points=[new bn(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class Oo extends Ui{constructor(n){super(n);C(this,"isDefault");this.isDefault=n.isDefault??!1}}class bd{constructor(e){C(this,"minLineWidth");C(this,"maxLineWidth");C(this,"lineWidthStep");C(this,"minLineAngle");C(this,"maxLineAngle");C(this,"lineAngleStep");C(this,"stripMinWidth");C(this,"stripMaxWidth");C(this,"stripMinLength");C(this,"stripMaxLength");C(this,"allowShowTable");C(this,"showOnlyTemplates");C(this,"templates");C(this,"customTemplates",[]);C(this,"startTailConfigs");C(this,"endTailConfigs");C(this,"bendCountForExtended");C(this,"extendedProductCatalog");C(this,"allowChangeFirstPoint");C(this,"allowSaveTemplates");C(this,"userTemplatesPrefix");C(this,"lengthStep");C(this,"canSetDopProdaga");var n,r;this.minLineWidth=e.minLineWidth,this.maxLineWidth=e.maxLineWidth,this.lineWidthStep=e.lineWidthStep,this.minLineAngle=e.minLineAngle,this.maxLineAngle=e.maxLineAngle,this.lineAngleStep=e.lineAngleStep,this.stripMinWidth=e.stripMinWidth,this.stripMaxWidth=e.stripMaxWidth,this.stripMinLength=e.stripMinLength,this.stripMaxLength=e.stripMaxLength,this.allowShowTable=e.allowShowTable,this.showOnlyTemplates=e.showOnlyTemplates,this.templates=e.templates.map(s=>new Ui(s)),this.templates.forEach((s,o)=>{s.id=o}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(s=>new Oo(s)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(s=>new Oo(s)))??[],this.bendCountForExtended=e.bendCountForExtended,this.extendedProductCatalog=e.extendedProductCatalog,this.allowChangeFirstPoint=e.allowChangeFirstPoint,this.allowSaveTemplates=e.allowSaveTemplates,this.userTemplatesPrefix=e.userTemplatesPrefix,this.lengthStep=e.lengthStep,this.canSetDopProdaga=e.canSetDopProdaga,this.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).filter(([,s])=>s.id!==-1).map(([s,o])=>{const a=new Ui(o);return a.isCustom=!0,a.id=+s,a}):[],this.customTemplates.some(s=>s.isCustom&&s.isNewRec())||this.customTemplates.push(new Ui({label:"-- Новая конфигурация --",points:[new bn(this.stripMinWidth,0,"A-1")],isCustom:!0,id:-1,guid:""})))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findLast(s=>!s.isNewRec()),r=new Ui(e);r.isCustom=!0,r.id=n?n.id+1:0,this.customTemplates.splice(-1,0,r)}removeCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===e);n!==-1&&this.customTemplates.splice(n,1)}}const ey={class:"flex flex-col gap-3"},ty={class:"grid gap-5 md:grid-cols-5"},ny={},_d=i.defineComponent({...ny,__name:"kozyrek-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref(new bd(n.settings)),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),u=i.ref({quantity:{},marker:{},length:{}}),h=i.ref(0),m=i.useTemplateRef("kozyrek-configurator-params-form"),g=(x=0)=>{var P;const $=(P=c.value.allTemplates)==null?void 0:P.at(x);$!==void 0&&(h.value=x,l.value.configuratorParams.linesWidths=$.points.map(A=>M.isArray(A)?A[0]:A.width),l.value.configuratorParams.linesAngles=$.points.map(A=>M.isArray(A)?A[1]:A.angle),S()),y(l.value.configuratorParams)},f=async()=>{const x=prompt("Введите название шаблона:");if(!x)return;a.value=!0;const $={label:x,points:l.value.configuratorParams.linesWidths.map((A,V)=>[A,l.value.configuratorParams.linesAngles[V]])},P=A=>{A&&(c.value.addCustomTemplate($),h.value=c.value.allTemplates.length-2),a.value=!1};n.eventEmitter.emit("configurator:create-template",{category:n.cartItem.category,template:$,callback:P})},p=async(x,$)=>{var V;const P=(V=c.value.allTemplates)==null?void 0:V.at(x);if(!P||!P.isCustom)return;const A=F=>{F&&(c.value.removeCustomTemplate(P.id),g()),$==null||$()};n.eventEmitter.emit("configurator:remove-template",{category:n.cartItem.category,templateId:P.id,callback:A})},b=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(h.value=c.value.allTemplates.length-1)},y=async x=>{var $,P;l.value.product=new Z.ClientProduct,(P=($=m.value)==null?void 0:$.formReference)==null||P.validate(A=>{A||(S(),s.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:x,validationFieldResultData:u.value,callback:V=>{V?l.value.product=V:u.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},s.value=!1}}))}).catch(M.noop)},_=async()=>{var x,$;($=(x=m.value)==null?void 0:x.formReference)==null||$.validate(P=>{P||(o.value=!0,r("submit",l.value,u.value,()=>{o.value=!1,i.nextTick(()=>{var A,V;(V=(A=m.value)==null?void 0:A.formReference)==null||V.restoreValidation()})}))}).catch(M.noop)},S=()=>{const x={quantity:u.value.quantity,marker:u.value.marker};l.value.configuratorParams.linesWidths.forEach(($,P)=>{x[`lines_widths[${P+1}]`]={},x[`lines_angles[${P+1}]`]={}}),u.value=x},v=x=>{d.value.linesWidths=x.map($=>$.width),d.value.linesAngles=x.map($=>$.angle)},T=x=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,S(),b(),y(l.value.configuratorParams)},R=(x,$)=>{d.value.linesWidths=x,d.value.linesAngles=$},w=x=>{const $=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,P=0;l.value.configuratorParams.linesWidths.splice(x+1,0,$),l.value.configuratorParams.linesAngles.splice(x+1,0,P),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],S(),b(),y(l.value.configuratorParams)},B=x=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(x,1),l.value.configuratorParams.linesAngles.splice(x,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],S(),b(),y(l.value.configuratorParams))};return i.onBeforeMount(()=>{g()}),i.watch(()=>n.cartItem,x=>{l.value=new Z.OrderItemBase(x),g()}),(x,$)=>{const P=L.NButton;return i.openBlock(),i.createElementBlock("div",ey,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(P,{key:0,type:"tertiary",class:"self-end",onClick:$[0]||($[0]=A=>r("click:view-switch"))},{default:i.withCtx(()=>[...$[3]||($[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",ty,[i.createVNode(yd,{value:l.value,"select-template-index":h.value,settings:c.value,class:"h-fit col-span-3","onPointer:up":T,"onPointer:move":v,"onTemplate:select":g,onRemoveCustomTemplate:p},null,8,["value","select-template-index","settings"]),i.createVNode(il,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":$[1]||($[1]=A=>l.value=A),"preview-params":d.value,validation:u.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":h.value,class:"col-span-2","onUpdate:params":$[2]||($[2]=A=>y(A)),"onUpdate:preview":R,onSubmit:_,"onClick:saveTemplate":f,"onClick:addLine":w,"onClick:removeLine":B},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])])}}}),iy={class:"flex flex-col items-center justify-between rounded-xl"},ry={class:"img-preview relative flex justify-center"},sy={},oy=i.defineComponent({...sy,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(t,{emit:e}){const n=t,r=i.computed(()=>{const{height:o}=n.configuratorParams,a=M.keys(n.settings.crossbarCount).reverse().find(l=>{const c=n.settings.crossbarCount[Number(l)];return o>=c});if(a!==void 0)return String(Number(a)+1)}),s=e;return(o,a)=>{const l=L.NButton;return i.openBlock(),i.createElementBlock("div",iy,[i.createElementVNode("div",ry,[a[1]||(a[1]=i.createElementVNode("div",{class:"window"},null,-1)),i.createElementVNode("div",{class:i.normalizeClass(["net",`net-${t.configuratorParams.netType}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["frame",`frame-${t.configuratorParams.color}`])},null,2),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${t.configuratorParams.color}`])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["mount",`mount-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["cut-preview",`cut-preview-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2)]),i.createVNode(l,{type:"primary",class:"block justify-self-center",onClick:a[0]||(a[0]=c=>s("open-instructions"))},{default:i.withCtx(()=>[...a[2]||(a[2]=[i.createTextVNode(" Руководство по замеру ",-1)])]),_:1})])}}}),zo=Wn(oy,[["__scopeId","data-v-a67fd61e"]]),ay={key:0,class:"flex items-baseline gap-1"},ly={key:0,class:"flex items-baseline gap-1"},cy={key:1},dy={class:"text-lg font-semibold"},uy={key:2,class:"text-red-500 text-sm mb-2"},hy={class:"flex gap-3"},fy={},wd=i.defineComponent({...fy,__name:"mosquito-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:instructions-toggle","click:show-preview-drawer"],setup(t,{expose:e,emit:n}){var w;const r=t,s=n,o=i.computed(()=>kt.isPhoneDevice()),a=i.useTemplateRef("form-reference"),l=i.useTemplateRef("width-form-item-reference"),c=i.useTemplateRef("height-form-item-reference"),d=i.useTemplateRef("width-input-reference"),u=i.ref(M.cloneDeep(r.value)),h=i.computed(()=>r.settings.widthOverlaps[u.value.configuratorParams.mountType]??0),m=i.computed(()=>r.settings.heightOverlaps[u.value.configuratorParams.mountType]??0),g=i.computed(()=>r.settings.maxWidths[u.value.configuratorParams.netType]),f=i.computed(()=>r.settings.maxHeights[u.value.configuratorParams.netType]),p=i.computed(()=>u.value.configuratorParams.width?u.value.configuratorParams.width+h.value:0),b=i.computed(()=>u.value.configuratorParams.height?u.value.configuratorParams.height+m.value:0),y=i.ref(r.settings.canSetDopProdaga??!1),_=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth-h.value),ae.max(g.value-h.value),ae.step(1),De.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[ae.required,ae.min(r.settings.minHeight-m.value),ae.max(f.value-m.value),ae.step(1),De.serverValidation(r.validation.height.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),De.serverValidation(r.validation.quantity.feedback)],marker:[De.serverValidation(r.validation.marker.feedback)]})),S=i.computed(()=>{var V;const B=p.value,x=b.value,{quantity:$}=r.value,P=((V=r.value.product)==null?void 0:V.costRub)||0;if(!B||!x||!$||P===0)return null;const A=B*x/1e6;return(P*$*A).toLocaleString("ru-ru",{minimumFractionDigits:2})}),v=i.computed(()=>{const B=p.value,x=b.value,$=!!(B&&B>=r.settings.minWidth&&B<=r.settings.maxWidths[u.value.configuratorParams.netType]),P=!!(x&&x>=r.settings.minHeight&&x<=r.settings.maxHeights[u.value.configuratorParams.netType]),A=!!(r.value.quantity&&r.value.quantity>0);return $&&P&&A}),T=(B,x)=>{var A,V;const $=u.value.configuratorParams;B&&B in $&&($[B]=x);const P={...$,width:p.value??0,height:b.value??0};B==="width"&&((A=l.value)==null||A.validate().catch(M.noop)),B==="height"&&((V=c.value)==null||V.validate().catch(M.noop)),i.nextTick(()=>{var N,Y;!((N=l.value)!=null&&N.validationErrored)&&!((Y=c.value)!=null&&Y.validationErrored)&&P.height&&P.width&&s("update:params",P),R("configuratorParams",P)})},R=(B,x)=>{const $=new Z.OrderItemBase(r.value);$[B]=x,B==="configuratorParams"&&($.product=new Z.ClientProduct),s("update:value",$)};return i.watch(()=>r.value,B=>{const x=M.cloneDeep(i.toRaw(B)),$=x.configuratorParams.mountType,P=r.settings.widthOverlaps[$]??0,A=r.settings.heightOverlaps[$]??0;x.configuratorParams.width&&x.configuratorParams.width>0&&(x.configuratorParams.width-=P),x.configuratorParams.height&&x.configuratorParams.height>0&&(x.configuratorParams.height-=A),u.value=x},{deep:!0}),i.onMounted(()=>{var B;(B=d.value)==null||B.select()}),e({validate:(w=a.value)==null?void 0:w.validate,formReference:a}),(B,x)=>{const $=L.NCheckbox;return i.openBlock(),i.createBlock(i.unref(L.NForm),{ref:"form-reference",model:u.value,rules:_.value,class:"flex flex-col gap-2 px-4 md:max-w-96 sc-hide-empty-feedback-message",onKeydown:x[25]||(x[25]=i.withKeys(i.withModifiers(P=>s("submit",u.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NSelect),{value:u.value.configuratorParams.netType,"onUpdate:value":[x[0]||(x[0]=P=>u.value.configuratorParams.netType=P),x[1]||(x[1]=P=>T("netType",P))],options:t.settings.netType.map(P=>({label:t.settings.descriptions.net_type[P],value:P}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(L.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NSelect),{value:u.value.configuratorParams.color,"onUpdate:value":[x[2]||(x[2]=P=>u.value.configuratorParams.color=P),x[3]||(x[3]=P=>T("color",P))],options:t.settings.color.map(P=>({label:t.settings.descriptions.color[P],value:P}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(L.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NSelect),{value:u.value.configuratorParams.mountType,"onUpdate:value":[x[4]||(x[4]=P=>u.value.configuratorParams.mountType=P),x[5]||(x[5]=P=>T("mountType",P))],options:t.settings.mountType.map(P=>({label:t.settings.descriptions.mount_type[P],value:P}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(L.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-h.value} ${g.value?" до "+(g.value-h.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&p.value>=t.settings.minWidth&&p.value<=t.settings.maxWidths[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",ay,[i.createVNode(i.unref(L.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(p.value),1)]),_:1}),i.createVNode(i.unref(L.NButton),{quaternary:"",type:"info",size:"tiny",onClick:x[10]||(x[10]=P=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...x[26]||(x[26]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{ref:"width-input-reference",value:u.value.configuratorParams.width,"onUpdate:value":[x[6]||(x[6]=P=>u.value.configuratorParams.width=P),x[9]||(x[9]=P=>T("width",P))],parse:i.unref(xt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:x[7]||(x[7]=P=>i.unref(lt)(P)),onInput:x[8]||(x[8]=P=>i.unref(Oe)(t.validation,"width")),onFocus:i.unref(ze)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(L.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-m.value} ${f.value?" до "+(f.value-m.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&b.value>=t.settings.minHeight&&b.value<=t.settings.maxHeights[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",ly,[i.createVNode(i.unref(L.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(b.value),1)]),_:1}),i.createVNode(i.unref(L.NButton),{quaternary:"",type:"info",size:"tiny",onClick:x[15]||(x[15]=P=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...x[27]||(x[27]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:u.value.configuratorParams.height,"onUpdate:value":[x[11]||(x[11]=P=>u.value.configuratorParams.height=P),x[14]||(x[14]=P=>T("height",P))],parse:i.unref(xt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:x[12]||(x[12]=P=>i.unref(lt)(P)),onInput:x[13]||(x[13]=P=>i.unref(Oe)(t.validation,"height")),onFocus:i.unref(ze)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(L.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:u.value.quantity,"onUpdate:value":[x[16]||(x[16]=P=>u.value.quantity=P),x[19]||(x[19]=P=>R("quantity",P??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:x[17]||(x[17]=P=>i.unref(lt)(P,!1)),onInput:x[18]||(x[18]=P=>i.unref(Oe)(t.validation,"quantity")),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(L.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:x[20]||(x[20]=P=>i.unref(Oe)(t.validation,"marker")),"onUpdate:value":x[21]||(x[21]=P=>{u.value.marker=P??null,R("marker",P??null)}),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),y.value?(i.openBlock(),i.createBlock($,{key:0,checked:u.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":x[22]||(x[22]=P=>{u.value.isAdditionalSale=P??!1,R("isAdditionalSale",P??!1)})},{default:i.withCtx(()=>[...x[28]||(x[28]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(lr,{"is-product-searching":t.isProductSearching,product:u.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),S.value?(i.openBlock(),i.createElementBlock("div",cy,[x[29]||(x[29]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",dy,i.toDisplayString(S.value)+" ₽",1)])):i.createCommentVNode("",!0),v.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",uy," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",hy,[i.createVNode(i.unref(L.NButton),{loading:t.isSubmitProcessing,disabled:!v.value||u.value.product.isNewRec(),type:"primary",class:"self-start",onClick:x[23]||(x[23]=P=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),o.value?(i.openBlock(),i.createBlock(i.unref(L.NButton),{key:0,type:"default",onClick:x[24]||(x[24]=P=>s("click:show-preview-drawer"))},{default:i.withCtx(()=>[...x[30]||(x[30]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["model","rules"])}}}),my="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",gy="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",py="/img/configurators/mosquitto/measurement-instructions/mount.png",yy="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",by="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",_y={class:"flex flex-col gap-6"},wy={class:"flex gap-4"},xy={class:"flex flex-col gap-2"},ky={class:"flex gap-4"},vy={class:"flex flex-col gap-2"},Cy={class:"flex gap-4"},Sy={class:"flex flex-col gap-2"},By={},xd=i.defineComponent({...By,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=kt.initRefDependingOnDeviceResolution("small","small","medium"),r=kt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=e;return(a,l)=>{const c=L.NText;return i.openBlock(),i.createBlock(i.unref(L.NModal),{show:t.show,"show-icon":!1,size:i.unref(n),style:i.normalizeStyle(`width: ${s.value}px`),title:"Руководство по замеру","action-class":"grid grid-cols-2 !justify-between",preset:"dialog",onClose:l[0]||(l[0]=d=>o("update:show",!1)),onEsc:l[1]||(l[1]=d=>o("update:show",!1)),onMaskClick:l[2]||(l[2]=d=>o("update:show",!1))},{default:i.withCtx(()=>[i.createElementVNode("div",_y,[i.createVNode(c,{type:"error",class:"text-base font-medium"},{default:i.withCtx(()=>[...l[3]||(l[3]=[i.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ",-1)])]),_:1}),l[22]||(l[22]=i.createElementVNode("div",{class:"grid gap-6 md:grid-cols-2"},[i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:my,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер ширины"),i.createElementVNode("span",null,"Замерить по ширине световой проем оконной рамы. Размер учитывать c точностью до 1 мм")])]),i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:gy,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер высоты"),i.createElementVNode("span",null,"Замерить по высоте световой проем оконной рамы. Размер учитывать с точностью до 1 мм")])])],-1)),i.createElementVNode("div",wy,[l[9]||(l[9]=i.createElementVNode("img",{src:py,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",xy,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.frame)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=i.createElementVNode("br",null,null,-1)),l[7]||(l[7]=i.createTextVNode(" Крепления находятся на раме сетки. ",-1))])])]),i.createElementVNode("div",ky,[l[15]||(l[15]=i.createElementVNode("img",{src:yy,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",vy,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:",-1)),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=i.createElementVNode("br",null,null,-1)),l[13]||(l[13]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])]),i.createElementVNode("div",Cy,[l[21]||(l[21]=i.createElementVNode("img",{src:by,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Sy,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_metal)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=i.createElementVNode("br",null,null,-1)),l[19]||(l[19]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])])])]),_:1},8,["show","size","style"])}}}),Ty={class:"grid md:grid-cols-2"},Ry={},kd=i.defineComponent({...Ry,__name:"mosquito-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>kt.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.useTemplateRef("mosquito-configurator-form"),d=i.ref({width:{},height:{},quantity:{},marker:{}}),u=i.ref(!1),h=i.ref(!1),m=i.computed(()=>i.inject("debounce-input-time",300)),g=M.debounce(async p=>{var b,y;l.value.product=new Z.ClientProduct,(y=(b=c.value)==null?void 0:b.formReference)==null||y.validate(_=>{_||(u.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:p,validationFieldResultData:d.value,callback:S=>{S?l.value.product=S:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},u.value=!1}}))}).catch(M.noop)},m.value),f=()=>{h.value=!0,r("submit",l.value,d.value,()=>{h.value=!1})};return i.watch(()=>n.cartItem,p=>{l.value=p},{deep:!0}),(p,b)=>{const y=ds;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(xd,{show:a.value,"onUpdate:show":b[0]||(b[0]=_=>a.value=_),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",Ty,[s.value?(i.openBlock(),i.createBlock(i.unref(L.NDrawer),{key:1,show:o.value,"onUpdate:show":b[4]||(b[4]=_=>o.value=_),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(L.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:b[2]||(b[2]=_=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(y)]),_:1})]),default:i.withCtx(()=>[i.createVNode(zo,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:b[3]||(b[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(zo,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:b[1]||(b[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(wd,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":b[5]||(b[5]=_=>l.value=_),validation:d.value,settings:t.settings,"is-product-searching":u.value,"is-submit-processing":h.value,"onUpdate:params":b[6]||(b[6]=_=>i.unref(g)(_)),onSubmit:b[7]||(b[7]=_=>f()),"onClick:instructionsToggle":b[8]||(b[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":b[9]||(b[9]=_=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),$y={},vd=i.defineComponent({...$y,__name:"strip-configurator-line-item",props:{value:{},index:{},path:{},settings:{},product:{default:void 0},addLineButtonDisabled:{type:Boolean,default:!1},removeLineButtonDisabled:{type:Boolean,default:!1},suggestionOption:{default:void 0},autoFocus:{type:Boolean,default:!1},validation:{}},emits:["update:value","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.useTemplateRef("width-input-element"),a=i.ref(!1),l=i.ref(r.value),c=i.useTemplateRef("form-item-reference"),d=i.computed(()=>{var m;return!((m=c.value)!=null&&m.validationErrored)}),u=m=>{l.value=m,s("update:value",m,r.index,a)},h=()=>{var m;(m=o.value)==null||m.select()};return i.watch(()=>r.value,m=>{l.value=m}),i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{h()})}),e({isValid:d,formItemReference:c}),(m,g)=>{const f=nl,p=Hs;return i.openBlock(),i.createBlock(i.unref(L.NFormItem),{ref:"form-item-reference",path:t.path,label:`Полоса №${t.index+1}, мм`,class:"sc-hide-empty-feedback-message"},{feedback:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(lr,{key:0,"is-product-searching":a.value,product:t.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(L.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:u},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:i.unref(xt),placeholder:"Введите ширину",onKeydown:g[0]||(g[0]=b=>i.unref(lt)(b)),onInput:g[1]||(g[1]=b=>i.unref(Oe)(t.validation,`linesWidths.${t.index}`)),onFocus:i.unref(ze),"onUpdate:value":u},null,8,["value","parse","onFocus"])]),_:1},8,["options"]),i.createVNode(i.unref(L.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:g[2]||(g[2]=b=>s("click:add-line",t.index))},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"]),i.createVNode(i.unref(L.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:g[3]||(g[3]=b=>s("click:remove-line",t.index))},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),_:1},8,["path","label"])}}}),Py={class:"my-2 flex w-full flex-col"},Ny={key:1},Ey={class:"text-lg font-semibold"},Fy={class:"flex gap-3"},Ay={},Cd=i.defineComponent({...Ay,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){var _;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("line-items-reference"),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>{const S={length:[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(r.settings.lengthStep),De.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),De.serverValidation(r.validation.quantity.feedback)],marker:[De.serverValidation(r.validation.marker.feedback)]};return M.forEach(l.value,(v,T)=>{var R;S[`configuratorParams.linesWidths.${T}`]=[ae.required,ae.min(r.settings.minLineWidth),ae.step(r.settings.lineWidthStep),De.serverValidation((R=r.validation[`linesWidths.${T}`])==null?void 0:R.feedback)]}),S}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((S,v)=>(S??0)+(v??0),0)),h=i.computed(()=>r.settings.width-u.value),m=i.computed(()=>!r.value.some(({product:S})=>!S||S.isNewRec())),g=i.computed(()=>r.isSubmitProcessing||!m.value||h.value<=0||l.value.length>=r.settings.maxLinesCount||r.value.some(S=>S.product.isNewRec())),f=i.computed(()=>S=>h.value===0?void 0:[{label:`${(h.value>0?"Остаток +":"Излишек ")+h.value} мм.`,key:h.value+S}]),p=i.computed(()=>{const{length:S}=r.value[0];return!S||u.value!==r.settings.width?null:(M.reduce(r.value,(T,R)=>{var B;const w=((B=R.product)==null?void 0:B.costRub)||0;return T+w},0)*r.value[0].quantity*S).toLocaleString("ru-ru",{minimumFractionDigits:2})}),b=(S,v,T)=>{var w,B,x;l.value[v].product.id=-1;const{configuratorParams:R}=l.value[v];R.linesWidths[v]=S,y("configuratorParams",R),(x=(B=(w=a.value)==null?void 0:w.at(v))==null?void 0:B.formItemReference)==null||x.validate().catch(M.noop),i.nextTick(()=>{var $,P;(P=($=a.value)==null?void 0:$.at(v))!=null&&P.isValid&&s("update:params",R,v,T)})},y=(S,v)=>{l.value.forEach(T=>{T[S]=v}),s("update:value",l.value)};return i.watch(()=>r.value,S=>{l.value=M.cloneDeep(S)},{deep:!0}),e({validate:(_=o.value)==null?void 0:_.validate,formReference:o}),(S,v)=>{const T=L.NCheckbox;return i.openBlock(),i.createBlock(i.unref(L.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:v[15]||(v[15]=i.withKeys(i.withModifiers(R=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var R;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(w,B)=>{var x,$;return i.openBlock(),i.createBlock(vd,{key:B,ref_for:!0,ref:"line-items-reference",value:((x=w.configuratorParams)==null?void 0:x.linesWidths.at(B))??null,"auto-focus":!0,index:B,path:`configuratorParams.linesWidths.${B}`,product:w.product,settings:t.settings,validation:t.validation,"suggestion-option":f.value((($=w.configuratorParams)==null?void 0:$.linesWidths.at(B))??0),"add-line-button-disabled":h.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some(P=>P.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"onUpdate:value":b,"onClick:addLine":v[0]||(v[0]=P=>s("click:add-line",P)),"onClick:removeLine":v[1]||(v[1]=P=>s("click:remove-line",P))},null,8,["value","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled"])}),128)),i.createElementVNode("div",Py,[h.value<0?(i.openBlock(),i.createBlock(i.unref(L.NText),{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(t.settings.width),1)]),_:1})):i.createCommentVNode("",!0),m.value&&l.value.length===t.settings.maxLinesCount&&h.value>0?(i.openBlock(),i.createBlock(i.unref(L.NText),{key:1,type:"error"},{default:i.withCtx(()=>[...v[16]||(v[16]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[v[17]||(v[17]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(L.NText),{type:h.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(t.settings.width)+" мм ",1)])]),i.createVNode(i.unref(L.NButton),{disabled:g.value,type:"primary",class:"self-center",onClick:v[2]||(v[2]=w=>s("click:add-line",l.value.length))},{default:i.withCtx(()=>[...v[18]||(v[18]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),i.createVNode(i.unref(L.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:l.value[0].length,"onUpdate:value":[v[3]||(v[3]=w=>l.value[0].length=w),v[6]||(v[6]=w=>y("length",w))],parse:i.unref(xt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:v[4]||(v[4]=w=>i.unref(lt)(w,!1)),onInput:v[5]||(v[5]=w=>i.unref(Oe)(t.validation,"length")),onFocus:i.unref(ze)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(L.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[v[7]||(v[7]=w=>l.value[0].quantity=w),v[10]||(v[10]=w=>y("quantity",w))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:v[8]||(v[8]=w=>i.unref(lt)(w,!1)),onInput:v[9]||(v[9]=w=>i.unref(Oe)(t.validation,"quantity")),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(L.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:v[11]||(v[11]=w=>i.unref(Oe)(t.validation,"marker")),"onUpdate:value":v[12]||(v[12]=w=>{l.value[0].marker=w??null,y("marker",w??null)}),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(T,{key:0,checked:l.value[0].isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":v[13]||(v[13]=w=>{l.value[0].isAdditionalSale=w??!1,y("isAdditionalSale",w??!1)})},{default:i.withCtx(()=>[...v[19]||(v[19]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("div",Ny,[v[20]||(v[20]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Ey,i.toDisplayString(p.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",Fy,[i.createVNode(i.unref(L.NButton),{loading:t.isSubmitProcessing,disabled:!m.value||h.value!=0||!((R=l.value[0])!=null&&R.length)||l.value[0].length>t.settings.maxLength||l.value[0].length<t.settings.minLength||l.value[0].quantity===0,type:"primary",class:"self-start",onClick:v[14]||(v[14]=w=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])}}}),My={class:"flex grow flex-col"},Vy=["src"],Iy={class:"w-full"},Oy={},Sd=i.defineComponent({...Oy,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",My,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center py-5",alt:"Штрипс"},null,8,Vy),i.createElementVNode("div",Iy,[i.createTextVNode(" Число полос можно указать от "+i.toDisplayString(t.settings.minLinesCount)+" до "+i.toDisplayString(t.settings.maxLinesCount)+". ",1),n[0]||(n[0]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Минимальная ширина полосы "+i.toDisplayString(t.settings.minLineWidth)+" мм. ",1),n[1]||(n[1]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина всех полос "+i.toDisplayString(t.settings.width)+" мм. ",1),n[2]||(n[2]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Шаг ширины полосы - "+i.toDisplayString(t.settings.lineWidthStep)+" мм. ",1)])]))}}),zy={class:"flex flex-col gap-2"},Ly={class:"w-104 flex grow flex-col px-5"},Dy={},Bd=i.defineComponent({...Dy,__name:"strip-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("strip-configurator-form"),o=i.ref(n.cartItems),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.computed(()=>i.inject("debounce-input-time",300)),d=i.computed(()=>{var f;return(f=o.value[0].configuratorParams)==null?void 0:f.linesWidths.reduce((p,b)=>(p??0)+(b??0),0)}),u=f=>{f===void 0&&(f=o.value.length-1);const p=o.value.at(0);if(!p)return;p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(f+1,0,null),o.value.forEach(y=>{y.configuratorParams.linesWidths=p.configuratorParams.linesWidths});const b=new Z.OrderItemBase({quantity:(p==null?void 0:p.quantity)??1,category:p==null?void 0:p.category,length:(p==null?void 0:p.length)??n.settings.minLength,marker:p==null?void 0:p.marker,configuratorParams:{linesWidths:p==null?void 0:p.configuratorParams.linesWidths}});o.value=o.value.toSpliced(f+1,0,b)},h=f=>{const p=o.value.at(0);p&&(p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(f,1),o.value.forEach(b=>{b.configuratorParams.linesWidths=p.configuratorParams.linesWidths}),o.value=o.value.toSpliced(f,1),delete a[`linesWidths.${f}`],delete a[`linesWidths.${f}`])},m=M.debounce(async(f,p,b)=>{const y={linesWidths:f.linesWidths.at(p)};b.value=!0,a.value[`linesWidths.${p}`]={},o.value[p].product=new Z.ClientProduct,n.eventEmitter.emit("configurator:search-product",{category:o.value[p].category,params:y,validationFieldResultData:a.value,callback:_=>{_?(o.value[p].product=_,p===o.value.length-1&&o.value.length<n.settings.maxLinesCount&&d.value&&d.value<n.settings.width&&u()):(o.value[p].product=new Z.ClientProduct,a.value[`linesWidths.${p}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},b.value=!1),b.value=!1}})},c.value),g=async()=>{var f,p;(p=(f=s.value)==null?void 0:f.formReference)==null||p.validate(b=>{if(!b){l.value=!0;const y=o.value.at(0);if(!y)return;r("submit",y,a.value,()=>{l.value=!1,i.nextTick(()=>{var _,S;(S=(_=s.value)==null?void 0:_.formReference)==null||S.restoreValidation()})})}}).catch(M.noop)};return i.watch(()=>n.cartItems,f=>{o.value=f.map(p=>new Z.OrderItemBase(p))}),(f,p)=>{const b=L.NButton;return i.openBlock(),i.createElementBlock("div",zy,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(b,{key:0,type:"tertiary",class:"self-center",onClick:p[0]||(p[0]=y=>r("click:view-switch"))},{default:i.withCtx(()=>[...p[3]||(p[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Ly,[i.createVNode(Sd,{value:o.value,"onUpdate:value":p[1]||(p[1]=y=>o.value=y),settings:t.settings},null,8,["value","settings"]),i.createVNode(Cd,{ref:"strip-configurator-form",value:o.value,"onUpdate:value":p[2]||(p[2]=y=>o.value=y),validation:a.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":i.unref(m),onSubmit:g,"onClick:addLine":u,"onClick:removeLine":h},null,8,["value","validation","settings","is-submit-processing","onUpdate:params"])])])}}}),Hy={class:"flex flex-col gap-3"},Wy={},Td=i.defineComponent({...Wy,__name:"metal-for-doors-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit"],setup(t,{expose:e,emit:n}){var g;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("first-input-element"),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth),...r.settings.maxWidth?[ae.max(r.settings.maxWidth)]:[],ae.step(1),De.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(1),De.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),De.serverValidation(r.validation.quantity.feedback)],marker:[De.serverValidation(r.validation.marker.feedback)]})),d=i.ref(r.settings.canSetDopProdaga??!1),u=()=>{s("update:params",l.value.configuratorParams),h("configuratorParams",l.value.configuratorParams)},h=(f,p)=>{const b=new Z.OrderItemBase(r.value);b[f]=p,f==="configuratorParams"&&(b.product=new Z.ClientProduct),s("update:value",b)},m=()=>{var f;(f=a.value)==null||f.select()};return i.watch(()=>r.value,f=>{l.value=M.cloneDeep(f)},{deep:!0}),i.onMounted(()=>{r.value.isNewRec()&&i.nextTick(()=>{m()})}),e({validate:(g=o.value)==null?void 0:g.validate,formReference:o}),(f,p)=>{const b=L.NCheckbox;return i.openBlock(),i.createBlock(i.unref(L.NForm),{ref:"form-reference",model:l.value,rules:c.value,disabled:t.isSubmitProcessing,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:p[13]||(p[13]=i.withKeys(i.withModifiers(y=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[p[0]||(p[0]=y=>l.value.configuratorParams.width=y),u],class:"w-full",parse:i.unref(xt),"show-button":!1,placeholder:"Введите ширину",onKeydown:p[1]||(p[1]=y=>i.unref(lt)(y)),onInput:p[2]||(p[2]=y=>i.unref(Oe)(t.validation,"width")),onFocus:i.unref(ze)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(L.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[p[3]||(p[3]=y=>l.value.configuratorParams.length=y),u],placeholder:"Введите длину",parse:i.unref(xt),"show-button":!1,class:"w-full",onKeydown:p[4]||(p[4]=y=>i.unref(lt)(y)),onInput:p[5]||(p[5]=y=>i.unref(Oe)(t.validation,"length")),onFocus:i.unref(ze)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(L.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:p[6]||(p[6]=y=>i.unref(lt)(y,!1)),onInput:p[7]||(p[7]=y=>i.unref(Oe)(t.validation,"quantity")),"onUpdate:value":p[8]||(p[8]=y=>h("quantity",y??0)),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(L.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInput),{value:t.value.marker??null,placeholder:"Введите маркировку",onInput:p[9]||(p[9]=y=>i.unref(Oe)(t.validation,"marker")),"onUpdate:value":p[10]||(p[10]=y=>h("marker",y??null)),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(b,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":p[11]||(p[11]=y=>{l.value.isAdditionalSale=y??!1,h("isAdditionalSale",y??!1)})},{default:i.withCtx(()=>[...p[14]||(p[14]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(lr,{"is-product-searching":t.isProductSearching,product:t.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),i.createElementVNode("div",Hy,[i.createVNode(i.unref(L.NButton),{disabled:t.value.product.isNewRec()||t.isProductSearching||t.isSubmitProcessing||t.value.length===0||t.value.width===0||t.value.quantity===0,type:"primary",class:"self-start",onClick:p[12]||(p[12]=y=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"])}}}),jy={class:"flex flex-col gap-2 w-72"},qy={},Rd=i.defineComponent({...qy,__name:"metal-for-doors-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("metal-for-doors-configurator-form"),o=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.ref(!1),d=i.computed(()=>i.inject("debounce-input-time",300)),u=M.debounce(async m=>{var g,f;o.value.product=new Z.ClientProduct,(f=(g=s.value)==null?void 0:g.formReference)==null||f.validate(p=>{p||(l.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:m,validationFieldResultData:a.value,callback:b=>{b?o.value.product=b:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(M.noop)},d.value),h=async()=>{var m,g;(g=(m=s.value)==null?void 0:m.formReference)==null||g.validate(f=>{f||(c.value=!0,r("submit",o.value,a.value,()=>{c.value=!1,i.nextTick(()=>{var p,b;(b=(p=s.value)==null?void 0:p.formReference)==null||b.restoreValidation()})}))}).catch(M.noop)};return i.watch(()=>n.cartItem,m=>{o.value=new Z.OrderItemBase(m)},{deep:!0}),(m,g)=>{const f=L.NButton;return i.openBlock(),i.createElementBlock("div",jy,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(f,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=p=>r("click:view-switch"))},{default:i.withCtx(()=>[...g[4]||(g[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Td,{ref:"metal-for-doors-configurator-form",value:o.value,"onUpdate:value":g[1]||(g[1]=p=>o.value=p),validation:a.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":g[2]||(g[2]=p=>i.unref(u)(p)),onSubmit:g[3]||(g[3]=p=>h())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),Xy={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Yy(t,e){return i.openBlock(),i.createElementBlock("svg",Xy,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 112v288m144-144H112"},null,-1)])])}const Uy=i.markRaw({name:"ion-add",render:Yy}),Ky={key:0,class:"ml-2 text-gray-500 text-sm"},Gy={class:"font-bold"},Zy={key:1,class:"flex flex-col gap-3"},Qy={class:"w-full text-sm"},Jy={"form-array-name":"items",class:"flex flex-col gap-3"},e0={class:"grid grow grid-cols-3 gap-2 items-start"},t0={key:0,class:"flex flex-wrap items-end gap-2"},n0={class:"whitespace-nowrap text-xl font-bold"},i0={key:0,class:"whitespace-nowrap text-lg text-gray-500"},r0={class:"font-bold"},s0={class:"font-bold"},o0={class:"flex gap-3"},a0={},$d=i.defineComponent({...a0,__name:"sandwich-configurator-form",props:{value:{},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","add-item","remove-item"],setup(t,{expose:e,emit:n}){var V;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.ref(M.cloneDeep(r.value)),l=i.computed(()=>r.value.category),c=i.ref(null),d=i.ref(null),u=i.computed(()=>l.value.products??[]),h=i.computed(()=>u.value.map(F=>({label:F.name,value:F.id}))),m=i.ref(null),g=i.ref(!1),f=i.computed(()=>i.inject("debounce-default-time",300)),p=i.computed(()=>{var F,N;return(N=(F=c.value)==null?void 0:F.properties)!=null&&N.width?ae.max(c.value.properties.width):null}),b=i.computed(()=>{var F,N;return(N=(F=c.value)==null?void 0:F.properties)!=null&&N.length?ae.max(c.value.properties.length):null}),y=i.computed(()=>{const F={marker:[De.serverValidation(r.validation.marker.feedback)]};return a.value.configuratorParams.items.forEach((N,Y)=>{var ee,I,z,q,W,O,D;F[`configuratorParams.items.${Y}.width`]=[ae.required,ae.min(r.settings.minWidth),...(I=(ee=c.value)==null?void 0:ee.properties)!=null&&I.width?[ae.max(c.value.properties.width)]:[],ae.step(1),De.serverValidation((z=r.validation[`items.${Y}.width`])==null?void 0:z.feedback)],F[`configuratorParams.items.${Y}.length`]=[ae.required,ae.min(r.settings.minLength),...(W=(q=c.value)==null?void 0:q.properties)!=null&&W.length?[ae.max(c.value.properties.length)]:[],ae.step(1),De.serverValidation((O=r.validation[`items.${Y}.length`])==null?void 0:O.feedback)],F[`configuratorParams.items.${Y}.count`]=[ae.required,ae.min(1),ae.step(1),De.serverValidation((D=r.validation[`items.${Y}.count`])==null?void 0:D.feedback)]}),F}),_=i.ref(r.settings.canSetDopProdaga??!1),S=i.computed(()=>a.value.configuratorParams.items.some(F=>{var N,Y;return!c.value||!F.width||F.width<r.settings.minWidth||F.width>(((N=c.value.properties)==null?void 0:N.width)??0)||F.length===0||F.length<r.settings.minLength||F.length>(((Y=c.value.properties)==null?void 0:Y.length)??0)||!F.count||F.count<1})),v=i.computed(()=>!c.value||S.value||a.value.configuratorParams.items.length===0),T=i.ref(null),R=F=>{if(!F){c.value=null,d.value=null,a.value.product=new Z.ClientProduct,m.value=null;return}const N=u.value.find(Y=>Y.id===F);N&&(c.value=N,d.value=F,a.value.product=N,A("product",a.value.product),a.value.configuratorParams.items.forEach(Y=>{var ee,I;(ee=N.properties)!=null&&ee.width&&Y.width>N.properties.width&&(Y.width=N.properties.width),(I=N.properties)!=null&&I.length&&Y.length>N.properties.length&&(Y.length=N.properties.length)}),w())},w=M.debounce(async()=>{var F;if(!c.value||a.value.configuratorParams.items.length===0||S.value){m.value=null;return}(F=o.value)==null||F.validate(N=>{if(N){m.value=null;return}if(g.value=!0,!c.value||!l.value){m.value=null,g.value=!1;return}r.eventEmitter.emit("configurator:calculate",{category:l.value,params:{productId:c.value.id,items:a.value.configuratorParams.items},callback:Y=>{Y?(m.value=Y,a.value.configuratorParams.calculationId=Y.id,a.value.quantity=Y.quantity,i.nextTick(()=>{A("quantity",Y.quantity)})):(a.value.configuratorParams.calculationId="",a.value.quantity=0,m.value=null),A("configuratorParams",a.value.configuratorParams),B(),g.value=!1}})}).catch(()=>{m.value=null,g.value=!1})},f.value),B=()=>{var N;if(!((N=c.value)!=null&&N.costRub)||!m.value){T.value=null;return}const F=m.value.quantity*c.value.costRub;T.value=Math.round(F*100)/100},x=F=>{var Y,ee;const N=a.value.configuratorParams.items[F];c.value&&((Y=c.value.properties)!=null&&Y.width&&N.width>c.value.properties.width&&(N.width=c.value.properties.width),(ee=c.value.properties)!=null&&ee.length&&N.length>c.value.properties.length&&(N.length=c.value.properties.length)),A("configuratorParams",a.value.configuratorParams),w()},$=()=>{a.value.configuratorParams.calculationId="",a.value.configuratorParams.items.push({width:0,length:0,count:1}),A("configuratorParams",a.value.configuratorParams),w(),s("add-item",a.value.configuratorParams.items.length)},P=F=>{a.value.configuratorParams.items.splice(F,1),A("configuratorParams",a.value.configuratorParams),w(),s("remove-item",F)},A=(F,N)=>{const Y=new Z.OrderItemBase(r.value);Y[F]=N,s("update:value",Y)};return i.watch(()=>r.value,F=>{const N=M.cloneDeep(i.toRaw(F));(!N.configuratorParams.items||N.configuratorParams.items.length===0)&&(N.configuratorParams.items=[{width:0,length:0,count:1}]),a.value=N,r.value.product&&!r.value.product.isNewRec()&&(c.value=r.value.product,d.value=r.value.product.id),r.value.product.isNewRec()&&(c.value=null,d.value=null)},{deep:!0}),i.onMounted(()=>{r.value.product&&!r.value.product.isNewRec()&&(c.value=r.value.product,d.value=r.value.product.id),a.value.configuratorParams.items.length>0&&c.value&&w()}),e({validate:(V=o.value)==null?void 0:V.validate,formReference:o}),(F,N)=>{const Y=Hs,ee=Uy;return i.openBlock(),i.createBlock(i.unref(L.NForm),{ref:"form-reference",model:a.value,rules:y.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:N[8]||(N[8]=i.withKeys(i.withModifiers(I=>s("submit",a.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var I,z,q;return[i.createVNode(i.unref(L.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NSelect),{value:d.value,"onUpdate:value":[N[0]||(N[0]=W=>d.value=W),R],options:h.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),c.value?(i.openBlock(),i.createElementBlock("div",Ky,[N[9]||(N[9]=i.createTextVNode(" Стоимость: ",-1)),i.createElementVNode("span",Gy,i.toDisplayString((I=c.value.costRub)==null?void 0:I.toLocaleString())+" "+i.toDisplayString(c.value.currency.symbol)+"/шт.",1)])):i.createCommentVNode("",!0),c.value&&p.value&&b.value?(i.openBlock(),i.createElementBlock("div",Zy,[N[14]||(N[14]=i.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),i.createElementVNode("div",Qy,[i.createTextVNode(" Минимальная ширина: "+i.toDisplayString(t.settings.minWidth)+" мм. ",1),N[10]||(N[10]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Максимальная ширина: "+i.toDisplayString((z=c.value.properties)==null?void 0:z.width)+" мм. ",1),N[11]||(N[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Минимальная длина: "+i.toDisplayString(t.settings.minLength)+" мм. ",1),N[12]||(N[12]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Максимальная длина: "+i.toDisplayString((q=c.value.properties)==null?void 0:q.length)+" мм. ",1)]),i.createElementVNode("div",Jy,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value.configuratorParams.items,(W,O)=>(i.openBlock(),i.createElementBlock("div",{key:O,class:"flex grow gap-2"},[i.createElementVNode("div",e0,[i.createVNode(i.unref(L.NFormItem),{path:`configuratorParams.items.${O}.width`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:a.value.configuratorParams.items[O].width,"onUpdate:value":[D=>a.value.configuratorParams.items[O].width=D,D=>x(O)],parse:i.unref(xt),"show-button":!1,placeholder:"Ширина",class:"w-full",onKeydown:N[1]||(N[1]=D=>i.unref(lt)(D)),onInput:D=>i.unref(Oe)(t.validation,`items.${O}.width`),onFocus:i.unref(ze)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(L.NFormItem),{path:`configuratorParams.items.${O}.length`,label:"Длина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:a.value.configuratorParams.items[O].length,"onUpdate:value":[D=>a.value.configuratorParams.items[O].length=D,D=>x(O)],parse:i.unref(xt),"show-button":!1,placeholder:"Длина",class:"w-full",onKeydown:N[2]||(N[2]=D=>i.unref(lt)(D)),onInput:D=>i.unref(Oe)(t.validation,`items.${O}.length`),onFocus:i.unref(ze)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(L.NFormItem),{path:`configuratorParams.items.${O}.count`,label:"Количество, шт"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:a.value.configuratorParams.items[O].count,"onUpdate:value":[D=>a.value.configuratorParams.items[O].count=D,D=>x(O)],parse:i.unref(xt),"show-button":!1,placeholder:"Количество",class:"w-full",onKeydown:N[3]||(N[3]=D=>i.unref(lt)(D,!1)),onInput:D=>i.unref(Oe)(t.validation,`items.${O}.count`),onFocus:i.unref(ze)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"])]),i.createVNode(i.unref(L.NButton),{disabled:a.value.configuratorParams.items.length<=1,type:"error",size:"medium",class:"mt-5",onClick:D=>P(O)},{default:i.withCtx(()=>[i.createVNode(Y)]),_:1},8,["disabled","onClick"])]))),128))]),i.createVNode(i.unref(L.NButton),{disabled:S.value,type:"default",class:"self-center",onClick:$},{default:i.withCtx(()=>[i.createVNode(ee),N[13]||(N[13]=i.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])])):c.value?(i.openBlock(),i.createBlock(i.unref(L.NText),{key:2,type:"error"},{default:i.withCtx(()=>[...N[15]||(N[15]=[i.createTextVNode(" Расчет по продукту невозможен. Обратитесь к менеджеру. ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(i.unref(L.NFormItem),{path:"marker",label:"Маркировка распила"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInput),{value:a.value.marker??null,placeholder:"Введите маркировку распила",onInput:N[4]||(N[4]=W=>i.unref(Oe)(t.validation,"marker")),"onUpdate:value":N[5]||(N[5]=W=>A("marker",W??null)),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1}),_.value?(i.openBlock(),i.createBlock(i.unref(L.NCheckbox),{key:3,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":N[6]||(N[6]=W=>{a.value.isAdditionalSale=W??!1,A("isAdditionalSale",W??!1)})},{default:i.withCtx(()=>[...N[16]||(N[16]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(i.unref(L.NSpin),{show:g.value,size:"small",class:"grow"},{default:i.withCtx(()=>{var W;return[m.value&&c.value&&T.value?(i.openBlock(),i.createElementBlock("div",t0,[i.createElementVNode("div",null,[N[17]||(N[17]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",n0,i.toDisplayString(T.value.toLocaleString())+" "+i.toDisplayString(c.value.currency.symbol),1)]),m.value.quantity&&c.value?(i.openBlock(),i.createElementBlock("div",i0,[i.createElementVNode("span",r0,"("+i.toDisplayString(m.value.quantity)+" шт.",1),N[18]||(N[18]=i.createTextVNode(" x ",-1)),i.createElementVNode("span",s0,i.toDisplayString((W=c.value.costRub)==null?void 0:W.toLocaleString())+" "+i.toDisplayString(c.value.currency.symbol)+"/шт.)",1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]}),_:1},8,["show"]),i.createElementVNode("div",o0,[i.createVNode(i.unref(L.NButton),{loading:t.isSubmitProcessing,disabled:v.value||!m.value||g.value,type:"primary",class:"self-start",onClick:N[7]||(N[7]=W=>s("submit",a.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])}}}),l0={class:"flex flex-col gap-2"},c0={class:"w-104 flex grow flex-col px-5"},d0={},Pd=i.defineComponent({...d0,__name:"sandwich-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("sandwich-configurator-form"),o=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{},product:{}}),l=i.ref(!1),c=async()=>{var h,m;(m=(h=s.value)==null?void 0:h.formReference)==null||m.validate(g=>{if(!g){l.value=!0;const f=M.cloneDeep(o.value);"items"in f.configuratorParams&&delete f.configuratorParams.items,r("submit",f,a.value,()=>{l.value=!1,i.nextTick(()=>{var p,b;(b=(p=s.value)==null?void 0:p.formReference)==null||b.restoreValidation()})})}}).catch(M.noop)},d=h=>{a.value[`items.${h}.width`]={},a.value[`items.${h}.length`]={},a.value[`items.${h}.count`]={}},u=h=>{delete a.value[`items.${h}.width`],delete a.value[`items.${h}.length`],delete a.value[`items.${h}.count`]};return i.onMounted(()=>{n.cartItem.configuratorParams.items.forEach((h,m)=>{a.value[`items.${m}.width`]={},a.value[`items.${m}.length`]={},a.value[`items.${m}.count`]={}})}),i.watch(()=>n.cartItem,h=>{o.value=new Z.OrderItemBase(h)},{deep:!0}),(h,m)=>{const g=L.NButton;return i.openBlock(),i.createElementBlock("div",l0,[t.settings.allowShowTable&&o.value.isNewRec()?(i.openBlock(),i.createBlock(g,{key:0,type:"tertiary",class:"self-center",onClick:m[0]||(m[0]=f=>r("click:view-switch"))},{default:i.withCtx(()=>[...m[2]||(m[2]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",c0,[i.createVNode($d,{ref:"sandwich-configurator-form",value:o.value,"onUpdate:value":m[1]||(m[1]=f=>o.value=f),validation:a.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":l.value,onSubmit:c,onAddItem:d,onRemoveItem:u},null,8,["value","validation","settings","event-emitter","is-submit-processing"])])])}}}),u0={key:0,class:"flex justify-center p-4"},h0={key:1,class:"p-4 text-center text-red-500"},f0={key:2,class:"flex justify-center"},m0={class:"!bg-white p-4 m-2 rounded-md w-max"},g0={key:3,class:"p-4 text-center text-gray-500"},p0={},Nd=i.defineComponent({...p0,__name:"dynamic-configurator",props:{eventEmitter:{},settings:{},editor:{},cartItem:{},category:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(null),s=i.ref(e.cartItem??null),o=i.ref(null),a=()=>{var u,h,m;if(!e.settings){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const d={category:((u=e.cartItem)==null?void 0:u.category)??e.category,configurator:e.editor,quantity:1};switch(e.editor){case"kozyrek":{const g=e.settings;s.value=new Z.OrderItemBase({...d,configuratorParams:{length:g.stripMinLength,linesAngles:[],linesWidths:[],startTailType:M.some(g.startTailConfigs,f=>f.isDefault)?(h=g.startTailConfigs)==null?void 0:h.findIndex(f=>f.isDefault):void 0,endTailType:M.some(g.endTailConfigs,f=>f.isDefault)?(m=g.endTailConfigs)==null?void 0:m.findIndex(f=>f.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const g=e.settings;s.value=new Z.OrderItemBase({...d,configuratorParams:{width:0,height:0,netType:g.netType[0]||"",color:g.color[0]||"",mountType:g.mountType[0]||""}});break}case"strip":{const g=e.settings;o.value=[new Z.OrderItemBase({...d,length:g.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const g=e.settings;s.value=new Z.OrderItemBase({...d,configuratorParams:{width:g.minWidth,length:g.minLength}});break}case"sandwich":{s.value=new Z.OrderItemBase({...d,configuratorParams:{calculationId:"",items:[{width:0,length:0,count:1}]}});break}default:r.value=`Неподдерживаемый тип конфигуратора: ${e.editor}.`}s.value&&(s.value.marker=void 0)},l=(d,u,h)=>{const m=g=>{h==null||h(),g&&a()};e.eventEmitter.emit("configurator:submit",{cartItem:d,callback:m,validation:u})},c=()=>{e.category&&e.eventEmitter.emit("configurator:click-view-switch",{category:e.category})};return i.onMounted(()=>{e.cartItem||a()}),(d,u)=>{const h=L.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[n.value?(i.openBlock(),i.createElementBlock("div",u0,[i.createVNode(h,{size:"large"})])):r.value?(i.openBlock(),i.createElementBlock("div",h0,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0),t.settings!==null&&(s.value!==null||o.value!==null)?(i.openBlock(),i.createElementBlock("div",f0,[i.createElementVNode("div",m0,[t.editor==="kozyrek"?(i.openBlock(),i.createBlock(_d,{key:0,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":c,onSubmit:l},null,8,["event-emitter","settings","cart-item"])):t.editor==="mosquitto"?(i.openBlock(),i.createBlock(kd,{key:1,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,onSubmit:l},null,8,["event-emitter","settings","cart-item"])):t.editor==="strip"?(i.openBlock(),i.createBlock(Bd,{key:2,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":o.value,"onClick:viewSwitch":c,onSubmit:l},null,8,["event-emitter","settings","cart-items"])):t.editor==="metal_for_doors"?(i.openBlock(),i.createBlock(Rd,{key:3,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":c,onSubmit:l},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich"?(i.openBlock(),i.createBlock(Pd,{key:4,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":c,onSubmit:l},null,8,["event-emitter","settings","cart-item"])):i.createCommentVNode("",!0)])])):(i.openBlock(),i.createElementBlock("div",g0,' Конфигуратор "'+i.toDisplayString(t.editor)+'" не поддерживается. ',1))],64)}}});var us=(t=>(t.Kozyrek="kozyrek",t.Mosquitto="mosquitto",t.Strip="strip",t.MetalForDoors="metal_for_doors",t.Sandwich="sandwich",t))(us||{});function Ed(t){return Object.values(us).includes(t)}function Fd(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==us.Sandwich?!0:t.properties.configuratorSettings!==void 0&&M.isArray(t.products)&&t.products.length>0}const y0={key:0,class:"pt-0.5"},b0={key:0},_0={class:"line-through"},w0={key:0},x0={key:1},k0={class:"flex flex-row gap-1"},v0={key:0},C0={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},S0={class:"flex flex-col gap-2.5 sm:flex-row"},B0={class:"mt-2"},T0={key:1,class:"flex flex-col"},R0={},$0=i.defineComponent({...R0,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function],default:!1},showCategoryRequiredButton:{type:[Boolean,String,Function],default:!1},showCategoryPinButton:{type:[Boolean,String,Function],default:!1},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function],default:!1},canShowConfigurator:{type:[Boolean,Function],default:!1},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(Mr,"medium"),r=i.computed(()=>{var j;return(j=e==null?void 0:e.filteredItems)==null?void 0:j[e.categoryItem.id]}),s=i.computed(()=>{var j,G;return M.isArray((j=e.categoryItem)==null?void 0:j.categories)&&((G=e.categoryItem.categories)==null?void 0:G.length)>0}),o=i.computed(()=>{var j;return M.isArray((j=e.categoryItem)==null?void 0:j.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([j,G])=>`${G} руб./${P(j)}`).join(", ")),l=i.computed(()=>M.isUndefined(e.filteredItems)||r.value==="*"?o.value:o.value.filter(j=>{var ue;const G=(ue=r.value)==null?void 0:ue.products;return M.isArray(G)&&G.includes(j.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>M.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),u=i.computed(()=>M.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),h=i.computed(()=>M.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),m=i.computed(()=>M.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),g=i.computed(()=>{var j,G,ue;return((j=e.categoryItem.properties)==null?void 0:j.configurator)!==void 0&&Ed((G=e.categoryItem.properties)==null?void 0:G.configurator)&&Fd(e.categoryItem)&&((ue=e.categoryItem.properties)==null?void 0:ue.configuratorSettings)!==void 0&&(M.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),f=i.computed(()=>g.value&&(M.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)),p=i.computed(()=>M.isNil(e.categoryContextButtonsConfig)?[]:M.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),b=i.computed(()=>new Z.ClientCategory(e.categoryItem)),y=i.ref(!1),_=i.ref(!1),S=i.computed(()=>!M.isUndefined(e.isCategoryItemSelected)),v=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),T=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),R=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),w=i.computed(()=>W.value&&kt.getDeviceTypeByResolution()===Ge.laptop?"auto":"fixed"),B=i.useTemplateRef("collapse-item-reference"),x=i.computed(()=>{var j,G;return(G=(j=e.categoryItem.properties)==null?void 0:j.templateCost)==null?void 0:G.priceCoefficient}),$=i.computed(()=>{var j,G;return(G=(j=e.categoryItem.properties)==null?void 0:j.templateCost)==null?void 0:G.increasePercent}),P=(j,G="ru-RU")=>0 .toLocaleString(G,{style:"currency",currency:j,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),A=j=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:j,target:B.value})},V=(j,G)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:G,isLoadingState:y,target:B.value})},F=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:B.value})},N=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:B.value})},Y=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:B.value})},ee=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:B.value})},I=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:B.value})},z=j=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:j,target:B.value})},q=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},W=i.ref(0),O=i.computed(()=>W.value&&o.value.length>0?Im(o.value,{eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,isProductItemSelected:e.isProductItemSelected,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.categoryItem.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig}):[]),D=M.debounce(()=>{W.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",D)}),window.addEventListener("resize",D),D(),(j,G)=>{const ue=L.NCheckbox,oe=bf,re=L.NTooltip,Ee=gf,We=L.NTag,Fe=hf,Gt=cf,Te=L.NButton,sn=of,on=Ka,$t=Ua,Lt=Ya,an=Xa,wt=L.NDropdown,Ln=L.NDataTable,ln=L.NAlert,Zt=L.NSpin;return i.openBlock(),i.createBlock(Ga,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":V},{"pre-arrow":i.withCtx(()=>{var $e,K;return[S.value?(i.openBlock(),i.createElementBlock("div",y0,[i.createVNode(ue,{checked:v.value,indeterminate:R.value,disabled:T.value,"onUpdate:checked":A},null,8,["checked","indeterminate","disabled"])])):i.createCommentVNode("",!0),!d.value&&(($e=b.value)!=null&&$e.isDisabled)?(i.openBlock(),i.createBlock(re,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(oe,{class:"pt-1.5"})]),default:i.withCtx(()=>[G[1]||(G[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((K=b.value)==null?void 0:K.isFavorite)??!1?(i.openBlock(),i.createBlock(re,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Ee,{class:"pt-1.5"})]),default:i.withCtx(()=>[G[2]||(G[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var $e,K,se,Ie,ni;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":($e=b.value)==null?void 0:$e.isDisabled})},[i.createVNode(re,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[G[3]||(G[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:G[0]||(G[0]=i.withModifiers((...Je)=>i.unref(M.noop)&&i.unref(M.noop)(...Je),["prevent","stop"]))},[(K=t.categoryItem.properties)!=null&&K.m2Price?(i.openBlock(),i.createBlock(We,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((se=t.categoryItem.properties)==null?void 0:se.templateCost)&&t.categoryItem.properties.m2PriceRetail&&$.value}),round:""},{default:i.withCtx(()=>{var Je;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(Je=t.categoryItem.properties)!=null&&Je.templateCost&&t.categoryItem.properties.m2PriceRetail&&$.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[$.value?(i.openBlock(),i.createBlock(We,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[$.value?(i.openBlock(),i.createElementBlock("span",b0,i.toDisplayString($.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(We,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",_0,i.toDisplayString(t.categoryItem.properties.m2PriceRetail)+" руб./м2",1)]),_:1},8,["size"])]),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0)]}),_:1},8,["size","class"])):(Ie=t.categoryItem.properties)!=null&&Ie.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[x.value||$.value?(i.openBlock(),i.createBlock(We,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var Je;return[x.value?(i.openBlock(),i.createElementBlock("span",w0,i.toDisplayString((Je=x.value)==null?void 0:Je.name),1)):i.createCommentVNode("",!0),$.value?(i.openBlock(),i.createElementBlock("span",x0,i.toDisplayString($.value>0?"+":"")+i.toDisplayString($.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(We,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),u.value&&((ni=b.value)!=null&&ni.manager)?(i.openBlock(),i.createBlock(We,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:ee},{default:i.withCtx(()=>[i.createVNode(re,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Je,Dt;return[i.createElementVNode("span",k0,[i.createVNode(Fe),i.createTextVNode(" "+i.toDisplayString((Dt=(Je=b.value)==null?void 0:Je.manager)==null?void 0:Dt.name),1)])]}),default:i.withCtx(()=>{var Je,Dt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((Dt=(Je=b.value)==null?void 0:Je.manager)==null?void 0:Dt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",v0,[i.createElementVNode("ul",C0,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},($e,K)=>(i.openBlock(),i.createElementBlock("li",{key:K}," ("+i.toDisplayString(K)+"): "+i.toDisplayString($e),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.categoryItem.properties,($e,K)=>(i.openBlock(),i.createElementBlock("li",{key:K}," ("+i.toDisplayString(K)+"): "+i.toDisplayString($e),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var $e;return[i.createElementVNode("div",S0,[d.value?(i.openBlock(),i.createBlock(re,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),onClick:F},{default:i.withCtx(()=>{var K;return[(K=b.value)!=null&&K.isDisabled?(i.openBlock(),i.createBlock(oe,{key:1})):(i.openBlock(),i.createBlock(Gt,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var K;return[(K=b.value)!=null&&K.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(b.value.hidingComment?`. Причина: '${b.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),u.value&&!(($e=b.value)!=null&&$e.manager)?(i.openBlock(),i.createBlock(re,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),onClick:Y},{default:i.withCtx(()=>[i.createVNode(sn)]),_:1},8,["size"])]),default:i.withCtx(()=>{var K,se,Ie;return[(K=b.value)!=null&&K.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((Ie=(se=b.value)==null?void 0:se.manager)==null?void 0:Ie.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),h.value?(i.openBlock(),i.createBlock(re,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,disabled:h.value==="disabled",size:i.unref(n),onClick:N},{default:i.withCtx(()=>{var K;return[(K=b.value)!=null&&K.isRequired?(i.openBlock(),i.createBlock($t,{key:1})):(i.openBlock(),i.createBlock(on,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[G[4]||(G[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(re,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),type:"primary",onClick:I},{default:i.withCtx(()=>[i.createVNode(Lt)]),_:1},8,["size"])]),default:i.withCtx(()=>[G[5]||(G[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(wt,{key:4,options:p.value,size:i.unref(n),trigger:"click",onSelect:z},{default:i.withCtx(()=>[i.createVNode(Te,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(an)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(j.$slots,"default",{},()=>{var $e,K,se;return[i.createElementVNode("div",B0,[s.value?(i.openBlock(),i.createBlock(Md,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?(($e=r.value)==null?void 0:$e.categories)??{}:void 0,"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator,"can-show-configurator":t.canShowConfigurator},null,8,["categories-items","has-products","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator","can-show-configurator"])):i.createCommentVNode("",!0)]),g.value&&f.value?(i.openBlock(),i.createBlock(Nd,{key:0,"event-emitter":t.eventEmitter,settings:(K=t.categoryItem.properties)==null?void 0:K.configuratorSettings,editor:(se=t.categoryItem.properties)==null?void 0:se.configurator,category:t.categoryItem},null,8,["event-emitter","settings","editor","category"])):c.value?(i.openBlock(),i.createElementBlock("div",T0,[g.value?(i.openBlock(),i.createBlock(Te,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:q},{default:i.withCtx(()=>[...G[6]||(G[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Ln,{columns:O.value,data:l.value,bordered:!0,loading:y.value,remote:!0,"row-key":Ie=>Ie.id,"table-layout":w.value,class:"mt-2"},null,8,["columns","data","loading","row-key","table-layout"])])):i.createCommentVNode("",!0),!y.value&&!_.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(ln,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createBlock(ln,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createBlock(Zt,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...G[7]||(G[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),P0=Wn($0,[["__scopeId","data-v-3560e7d3"]]),N0={class:"sc-collapse flex w-full flex-col"},E0={},Ad=i.defineComponent({...E0,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(t,{emit:e}){const n=t,r=e,s=(o,a)=>{r("on-item-header-click",o,a)};return i.provide("itemHeaderClickHandler",s),i.provide("defaultExpandedNames",n.defaultExpandedNames),i.provide("expandedNames",n.expandedNames),(o,a)=>(i.openBlock(),i.createElementBlock("div",N0,[i.renderSlot(o.$slots,"default")]))}}),F0={},Md=i.defineComponent({...F0,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function]},canShowConfigurator:{type:[Boolean,Function]},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(Mr,"medium"),r=i.computed(()=>M.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(o=>{var a;return!!((a=e.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(M.isUndefined(a))return;const l=a[o.id];if(l==="*")return;const c={};return c[o.id]=structuredClone(i.toRaw(l)),c};return(o,a)=>{const l=L.NSpin,c=L.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(Ad,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(P0,{key:d.id,"category-item":d,"event-emitter":t.eventEmitter,"filtered-items":s(d,t.filteredItems),"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator,"can-show-configurator":t.canShowConfigurator},null,8,["category-item","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator","can-show-configurator"]))),128))]),_:1})):t.loading?(i.openBlock(),i.createBlock(l,{key:1,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...a[0]||(a[0]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0),!t.hasProducts&&!t.loading&&t.categoriesItems.length>0&&r.value.length===0?(i.openBlock(),i.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):i.createCommentVNode("",!0)],64)}}}),A0={},Vd=i.defineComponent({...A0,__name:"reference-select",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean},referenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1},sortOptionsByLabel:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=new Z.Reference,l=i.computed(()=>{const g=o.value?[]:a,f=M.isUndefined(r.value)?g:r.value;return M.isArray(f)?f.map(p=>p.id):f==null?void 0:f.id}),c=i.computed(()=>Mt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue)),d=g=>{var f;if(M.isArray(g)){const p=g.length>0?g.map(b=>{var y;return(y=c.value.find(_=>_.value===b))==null?void 0:y.item}):[];s("update:value",p)}else{const p=g===a.id||(f=c.value.find(b=>b.value===g))==null?void 0:f.item;s("update:value",p)}},u=i.useTemplateRef("select-component");return e({focus:()=>{var g;return(g=u.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=u.value)==null?void 0:g.blur()}}),(g,f)=>(i.openBlock(),i.createBlock(i.unref(L.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:o.value,options:c.value,placeholder:"",class:"w-full","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),M0={},V0=i.defineComponent({...M0,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(t,{emit:e}){var S,v;const n=t,r=e,s=()=>{const T=Z.PriceCoefficient.getRetailPriceCoefficient();return M.unset(T,"isNewRec"),T},o=T=>!T||T.id===s().id,a=i.computed(()=>{var T;return((T=n.catalogItem)==null?void 0:T.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=T=>{var R,w,B,x;return T.id===s().id?(R=l.value)==null?void 0:R.getRetailCost():(x=(B=(w=l.value)==null?void 0:w.priceCoefficients)==null?void 0:B.find($=>$.coefficient.id===T.id))==null?void 0:x.cost},d=i.computed(()=>{var R;const T=[...((R=Z.useReferencesStore().priceCoefficientsReference)==null?void 0:R.map(w=>structuredClone(i.toRaw(w))))??[],s()];return a.value&&T.forEach(w=>{var x;const B=c(w);B?w.name+=` (${B} ${(x=l.value)==null?void 0:x.currency.symbol})`:w.name=""}),T.filter(w=>w.name!=="")}),u=i.ref(n.value.coefficient),h=i.ref(((v=(S=n.value)==null?void 0:S.value)==null?void 0:v.toString())??null),m=i.ref(null),g=i.computed(()=>{var T,R;return(R=(T=l.value)==null?void 0:T.priceCoefficients)==null?void 0:R.find(w=>w.coefficient.slug===Z.PriceCoefficientEnum.K0)}),f=i.ref(void 0),p=()=>{var R,w,B;f.value=void 0;let T=Number.parseFloat(((R=h.value)==null?void 0:R.replace(",","."))??"");if(T=Number.isNaN(T)?void 0:T,a.value)if(u.value||h.value){const x=s(),$=c(u.value??x)??0,P=$+$*((T??0)/100);m.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(P),P>(((w=l.value)==null?void 0:w.getRetailCost())??P)&&(f.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),g.value&&P<(((B=g.value)==null?void 0:B.cost)??0)&&(f.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else m.value=null;r("update:value",{value:Number.isNaN(T)?void 0:T,coefficient:o(u.value)?void 0:structuredClone(i.toRaw(u.value))})},b=T=>{M.isArray(T)||(u.value=T,h.value=null,!u.value&&h.value&&(u.value=s()),p())},y=()=>{u.value||(u.value=s()),p()},_=T=>{var w,B,x,$,P,A;const R=Number.parseFloat((T==null?void 0:T.replace(",","."))??"");if(a.value){let V=0;if(R<=0)u.value=void 0,h.value=null;else if(g.value&&R<(((w=g.value)==null?void 0:w.cost)??0))u.value=(B=g.value)==null?void 0:B.coefficient,V=(R-g.value.cost)*100/g.value.cost,f.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(R>(((x=l.value)==null?void 0:x.getRetailCost())??R)){u.value=s();const F=(($=l.value)==null?void 0:$.getRetailCost())??0;V=(R-F)*100/F,f.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const F=(A=(P=l.value)==null?void 0:P.priceCoefficients)==null?void 0:A.filter(N=>N.cost<R);if(F&&F.length>0){const N=F.at(-1);u.value=N==null?void 0:N.coefficient,V=(R-((N==null?void 0:N.cost)??0))*100/((N==null?void 0:N.cost)??1)}f.value={validationStatus:void 0,feedback:void 0}}h.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(V),r("update:value",{value:Number.isNaN(V)?void 0:V,coefficient:o(u.value)?void 0:structuredClone(i.toRaw(u.value))})}else r("update:value",{value:Number.isNaN(R)?void 0:R,coefficient:void 0})};return i.onMounted(()=>{var T,R,w,B;n.calculationType===Z.CalculationTypeEnum.m2Cost?m.value=((R=(T=n.value)==null?void 0:T.value)==null?void 0:R.toString())??null:!((w=n.value)!=null&&w.coefficient)&&((B=n.value)!=null&&B.value)&&(u.value=s()),p()}),(T,R)=>{var x,$,P;const w=L.NInput,B=L.NInputGroup;return i.openBlock(),i.createBlock(i.unref(L.NFormItem),{"show-label":!i.unref(M.isNil)(t.label),label:t.label,"show-feedback":!i.unref(M.isNil)(((x=f.value)==null?void 0:x.feedback)??t.feedback),feedback:(($=f.value)==null?void 0:$.feedback)??t.feedback,"validation-status":((P=f.value)==null?void 0:P.validationStatus)??t.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==i.unref(Z.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==i.unref(Z.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(B,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(Vd,{class:"w-full min-w-0 flex-1",value:u.value,"reference-list":d.value,clearable:t.clearable,disabled:t.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":b},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(w,{value:h.value,"onUpdate:value":[R[0]||(R[0]=A=>h.value=A),y],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[R[3]||(R[3]=i.createTextVNode("%",-1))]),_:2},[h.value&&!h.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[R[2]||(R[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||t.calculationType===i.unref(Z.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(w,{key:1,value:m.value,"onUpdate:value":[R[1]||(R[1]=A=>m.value=A),_],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var A;return[i.createTextVNode(i.toDisplayString((A=l.value)==null?void 0:A.currency.symbol),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),I0={key:0,class:"flex flex-row gap-2.5"},O0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},z0={},Id=i.defineComponent({...z0,__name:"base-dialog",props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:"small",scale:.98},tablet:{size:"small",scale:.9},default:{size:"medium",scale:.7}})},modalWidth:{default:void 0},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})},trapFocus:{type:Boolean,default:!0}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=kt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=kt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>r.modalWidth??window.innerWidth*c.value),u=()=>{s("opening"),o.value=!0,s("update:show",o.value)},h=(g="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let f=!1;s("closing",g,()=>{f=!0}),f||(o.value=!1,s("update:show",o.value))},m=()=>{s("accept",f=>{a.value=f})};return i.watch(()=>r.show,g=>{g?u():h("other")}),i.watch(()=>r.processing,g=>{a.value=g}),e({open:u,close:h,acceptHandler:m}),(g,f)=>{const p=L.NButton,b=L.NModal;return i.openBlock(),i.createBlock(b,{loading:a.value,show:o.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:t.title,"trap-focus":t.trapFocus??!0,"action-class":g.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:f[1]||(f[1]=y=>h("header")),onEsc:f[2]||(f[2]=y=>h("esc")),onMaskClick:f[3]||(f[3]=y=>h("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(g.$slots,"default")]),_:2},[g.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(g.$slots,"header")]),key:"0"}:void 0,g.$slots.action||g.$slots["extra-action"]||t.acceptButton.show||t.cancelButton.show?{name:"action",fn:i.withCtx(()=>[g.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",I0,[i.renderSlot(g.$slots,"extra-action")])):i.createCommentVNode("",!0),g.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",O0,[i.renderSlot(g.$slots,"action",{disabled:a.value}),t.acceptButton.show??!0?(i.openBlock(),i.createBlock(p,{key:0,disabled:a.value||!t.valid,size:i.unref(l),type:"primary",onClick:m},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),t.cancelButton.show??!0?(i.openBlock(),i.createBlock(p,{key:1,size:i.unref(l),type:"default",onClick:f[0]||(f[0]=y=>h("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","trap-focus","action-class"])}}}),L0={class:"text-sm"},D0={},H0=i.defineComponent({...D0,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:n}){const r=i.useTemplateRef("form-reference"),s=i.useTemplateRef("base-dialog-reference"),o=i.ref(null),a=i.computed(()=>{var w,B,x;return((w=o.value)==null?void 0:w.unit.isLinear)&&((x=(B=o.value)==null?void 0:B.properties)==null?void 0:x.isLengthConfigurator)}),l=i.ref(void 0),c=i.ref(void 0),d=i.ref(!0),u=i.ref(null),h=n,m=()=>({length:{},quantity:{},marker:{}}),g=i.ref(m()),f=i.ref(!1),p=i.computed(()=>{var P,A,V,F;if(!o.value)return{};const w=Z.UnitsHelper.getProductLengthMultiplicity(o.value),B=Z.UnitsHelper.getProductMultiplicity(o.value),x=((A=(P=o.value)==null?void 0:P.properties)==null?void 0:A.minLength)||w,$=(F=(V=o.value)==null?void 0:V.properties)==null?void 0:F.maxLength;return{length:[ae.required,ae.min(x??.1),ae.max($),ae.step(w),De.serverValidation(g.value.length.feedback)],quantity:[ae.required,ae.min(B),ae.step(B),De.serverValidation(g.value.quantity.feedback)],marker:[De.serverValidation(g.value.marker.feedback)]}}),b=i.computed(()=>{var w,B,x;return o.value?((w=o.value.properties)==null?void 0:w.lengthStep)??((B=o.value.properties)!=null&&B.ignoreMinCountCheck?0:((x=o.value.properties)==null?void 0:x.minCount)??0):0}),y=i.computed(()=>{var x,$,P,A,V,F,N,Y,ee;if(!o.value)return"";const w=(($=(x=o.value)==null?void 0:x.properties)==null?void 0:$.minLength)??((A=(P=o.value)==null?void 0:P.properties)!=null&&A.ignoreMinCountCheck?0:(F=(V=o.value)==null?void 0:V.properties)==null?void 0:F.minCount),B=(Y=(N=o.value)==null?void 0:N.properties)==null?void 0:Y.maxLength;return w||B?`(${w?`от ${w}`:""}${w&&B?" ":""}${B?`до ${B}`:""} ${(ee=o.value)==null?void 0:ee.unit.name})`:""}),_=w=>{var A,V;if(!((V=(A=o.value)==null?void 0:A.properties)!=null&&V.isLengthConfigurator)||!u.value||M.isNil(w)||b.value===0)return;const B=w/b.value,x=Math.round(B),$=Z.UnitsHelper.getProductMultiplicity(o.value),P=Math.max(x,$);u.value.quantity=P},S=w=>{var P,A,V,F;if(!((A=(P=o.value)==null?void 0:P.properties)!=null&&A.isLengthConfigurator)||!u.value||M.isNil(w)||b.value===0)return;const B=w*b.value,x=((V=o.value.properties)==null?void 0:V.minLength)||Z.UnitsHelper.getProductLengthMultiplicity(o.value),$=(F=o.value.properties)==null?void 0:F.maxLength;x!==void 0&&B<x?u.value.length=x:$!==void 0&&B>$?u.value.length=$:u.value.length=B},v=async w=>{var x;const B=M.cloneDeep(u.value);try{await((x=r.value)==null?void 0:x.validate($=>{if(!$){if(!o.value||!B)return;Z.UnitsHelper.productIsMeasurable(o.value)||delete B.length,a.value&&b.value&&(B.length=b.value),f.value=!0,h("submit",B,g.value,()=>{f.value=!1,w(!1),i.nextTick(()=>{var P;(P=r.value)==null||P.validate(M.noop).catch(M.noop)})})}}))}catch{}},T=()=>{o.value=null,l.value=void 0,u.value=null,g.value=m()};return e({show:(w,B)=>{var x,$,P,A,V;if(o.value=w,l.value=B==null?void 0:B.cartItemData,c.value=B==null?void 0:B.orderId,d.value=(B==null?void 0:B.canSetDopProdaga)??!1,u.value=new Z.OrderItemBase((B==null?void 0:B.cartItemData)??new Z.OrderItemBase({product:w,quantity:Z.UnitsHelper.productIsMeasurable(o.value)?1:((x=w==null?void 0:w.properties)==null?void 0:x.minCount)??1,length:(($=w==null?void 0:w.properties)==null?void 0:$.minLength)||((P=w==null?void 0:w.properties)!=null&&P.ignoreMinCountCheck?0:(A=w==null?void 0:w.properties)==null?void 0:A.minCount)||0})),(V=w==null?void 0:w.properties)!=null&&V.isLengthConfigurator&&u.value&&b.value>0){const F=b.value,N=u.value.quantity||1;u.value.length=N*F}},closeDialog:T}),(w,B)=>{var V;const x=L.NFormItem,$=L.NInputGroupLabel,P=L.NInputGroup,A=L.NCheckbox;return i.openBlock(),i.createBlock(Id,{ref:"base-dialog-reference",show:!i.unref(M.isNil)(o.value)&&!i.unref(M.isNil)(u.value),title:`${l.value?"Изменение":"Добавление"} товара ${(V=o.value)==null?void 0:V.name} в ${c.value?` заказ №${c.value}`:"корзину"}`,"accept-button":{show:!0,text:l.value?"Изменить":"Добавить"},processing:f.value,"modal-width":500,onAccept:v,onClosing:T},{default:i.withCtx(()=>{var F;return[o.value&&u.value?(i.openBlock(),i.createBlock(i.unref(L.NForm),{key:0,ref:"form-reference",model:u.value,rules:p.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:i.withKeys(i.withModifiers((F=s.value)==null?void 0:F.acceptHandler,["prevent"]),["enter"])},{default:i.withCtx(()=>[i.unref(Z.UnitsHelper).productIsMeasurable(o.value)?(i.openBlock(),i.createBlock(x,{key:0,path:"length",label:`Метраж, ${y.value+o.value.unit.name}`},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:u.value.length,"onUpdate:value":[B[0]||(B[0]=N=>u.value.length=N),_],parse:i.unref(xt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:B[1]||(B[1]=N=>i.unref(zs)(N,".",!1)),onInput:B[2]||(B[2]=N=>i.unref(Oe)(g.value,"length")),onFocus:i.unref(ze)},null,8,["value","parse","onFocus"])]),_:1},8,["label"])):i.createCommentVNode("",!0),i.createVNode(x,{path:"quantity",label:"Количество, шт."},{default:i.withCtx(()=>[i.createVNode(P,null,i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(L.NInputNumber),{value:u.value.quantity,"onUpdate:value":[B[3]||(B[3]=N=>u.value.quantity=N),S],parse:i.unref(xt),step:i.unref(Z.UnitsHelper).getProductMultiplicity(o.value),"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:B[4]||(B[4]=N=>i.unref(zs)(N,".",!1)),onInput:B[5]||(B[5]=N=>i.unref(Oe)(g.value,"quantity")),onFocus:i.unref(ze)},null,8,["value","parse","step","onFocus"]),a.value?(i.openBlock(),i.createBlock($,{key:0,class:"bg-orange-100 font-bold"},{default:i.withCtx(()=>[i.createTextVNode(" x "+i.toDisplayString(b.value)+" "+i.toDisplayString(o.value.unit.name),1)]),_:1})):i.createCommentVNode("",!0)]),_:2},[!g.value.quantity.feedback&&i.unref(Z.UnitsHelper).getProductMultiplicity(o.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",L0,"Количество должно быть кратно "+i.toDisplayString(i.unref(Z.UnitsHelper).getProductMultiplicity(o.value)),1)]),key:"0"}:void 0]),1024)]),_:1}),i.unref(Z.UnitsHelper).productIsMeasurable(o.value)?(i.openBlock(),i.createBlock(x,{key:1,path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:B[6]||(B[6]=N=>i.unref(Oe)(g.value,"marker")),"onUpdate:value":B[7]||(B[7]=N=>u.value.marker=N??null),onFocus:i.unref(ze)},null,8,["value","onFocus"])]),_:1})):i.createCommentVNode("",!0),d.value?(i.openBlock(),i.createBlock(A,{key:2,checked:u.value.isAdditionalSale,"onUpdate:checked":B[8]||(B[8]=N=>u.value.isAdditionalSale=N),"true-value":!0,"false-value":!1},{default:i.withCtx(()=>[...B[9]||(B[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0)]),_:1},8,["model","rules","onKeydown"])):i.createCommentVNode("",!0)]}),_:1},8,["show","title","accept-button","processing"])}}}),W0={class:"flex flex-row gap-1"},j0={class:"sc-client-name flex flex-col gap-1 text-base"},q0=["href"],X0={key:1,class:"text-sc-grey"},Y0={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},U0={key:0},K0={key:1,class:"text-sm"},G0={},hs=i.defineComponent({...G0,__name:"client-name-with-short-info",props:{client:{},nameLink:{default:void 0},popoverPosition:{default:void 0},showCityAndRegion:{type:Boolean,default:!0},showSalesDirection:{type:Boolean,default:!1},showClientInfoIcon:{type:Boolean,default:!1}},emits:["click:client-name","click:client-info"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>n.client.lastLoginAt?Hn.format(n.client.lastLoginAt,Z.useBaseConfigStateStore().config.dateFormats.uiDateWithTime):""),o=a=>{M.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Ls,d=L.NButton,u=L.NPopover;return i.openBlock(),i.createElementBlock("div",W0,[t.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=h=>a.$emit("click:client-info",t.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(u,{disabled:i.unref(M.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",j0,[i.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=h=>o(h))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!t.client.isActive})},i.toDisplayString(t.client.name),3),t.showSalesDirection&&t.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!t.client.isActive})}," ("+i.toDisplayString(t.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),t.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",X0," [ Деактивирован ] "))],8,q0),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",Y0," г. "+i.toDisplayString(t.client.city.name)+", "+i.toDisplayString(t.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[t.client.alternativeName?(i.openBlock(),i.createElementBlock("div",U0,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",K0," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),Z0={class:"text-base"},Q0={},Od=i.defineComponent({...Q0,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",Z0,i.toDisplayString(t.contragent.name),1))}}),J0={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eb(t,e){return i.openBlock(),i.createElementBlock("svg",J0,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),i.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)])])}const tb=i.markRaw({name:"tabler-mail",render:eb}),nb=["href"],ib={},rb=i.defineComponent({...ib,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=tb;return i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showEmailIcon})},[t.showEmailIcon?(i.openBlock(),i.createBlock(r,{key:0})):i.createCommentVNode("",!0),i.createElementVNode("a",{href:`mailto:${t.email}`,class:"no-underline"},i.toDisplayString(t.email),9,nb)],2)}}}),sb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ob(t,e){return i.openBlock(),i.createElementBlock("svg",sb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M444 49.9C431.3 38.2 379.9.9 265.3.4c0 0-135.1-8.1-200.9 52.3C27.8 89.3 14.9 143 13.5 209.5s-3.1 191.1 117 224.9h.1l-.1 51.6s-.8 20.9 13 25.1c16.6 5.2 26.4-10.7 42.3-27.8c8.7-9.4 20.7-23.2 29.8-33.7c82.2 6.9 145.3-8.9 152.5-11.2c16.6-5.4 110.5-17.4 125.7-142c15.8-128.6-7.6-209.8-49.8-246.5M457.9 287c-12.9 104-89 110.6-103 115.1c-6 1.9-61.5 15.7-131.2 11.2c0 0-52 62.7-68.2 79c-5.3 5.3-11.1 4.8-11-5.7c0-6.9.4-85.7.4-85.7q-.15 0 0 0C43.1 372.7 49.1 266.6 50.2 211.1s11.6-101 42.6-131.6c55.7-50.5 170.4-43 170.4-43c96.9.4 143.3 29.6 154.1 39.4c35.7 30.6 53.9 103.8 40.6 211.1m-139-80.8c.4 8.6-12.5 9.2-12.9.6c-1.1-22-11.4-32.7-32.6-33.9c-8.6-.5-7.8-13.4.7-12.9c27.9 1.5 43.4 17.5 44.8 46.2m20.3 11.3c1-42.4-25.5-75.6-75.8-79.3c-8.5-.6-7.6-13.5.9-12.9c58 4.2 88.9 44.1 87.8 92.5c-.1 8.6-13.1 8.2-12.9-.3m47 13.4c.1 8.6-12.9 8.7-12.9.1c-.6-81.5-54.9-125.9-120.8-126.4c-8.5-.1-8.5-12.9 0-12.9c73.7.5 133 51.4 133.7 139.2M374.9 329v.2c-10.8 19-31 40-51.8 33.3l-.2-.3c-21.1-5.9-70.8-31.5-102.2-56.5c-16.2-12.8-31-27.9-42.4-42.4c-10.3-12.9-20.7-28.2-30.8-46.6c-21.3-38.5-26-55.7-26-55.7c-6.7-20.8 14.2-41 33.3-51.8h.2c9.2-4.8 18-3.2 23.9 3.9c0 0 12.4 14.8 17.7 22.1c5 6.8 11.7 17.7 15.2 23.8c6.1 10.9 2.3 22-3.7 26.6l-12 9.6c-6.1 4.9-5.3 14-5.3 14s17.8 67.3 84.3 84.3c0 0 9.1.8 14-5.3l9.6-12c4.6-6 15.7-9.8 26.6-3.7c14.7 8.3 33.4 21.2 45.8 32.9c7 5.7 8.6 14.4 3.8 23.6"},null,-1)])])}const zd=i.markRaw({name:"fa6-brands-viber",render:ob}),ab={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},lb=["id"],cb=["id"],db=["fill"],ub=["fill"];function hb(t,e){return i.openBlock(),i.createElementBlock("svg",ab,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGBRLHCcSy,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)])],8,lb),i.createElementVNode("linearGradient",{id:t.idMap.SVGHW6lecxh,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[1]||(e[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)])],8,cb)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGBRLHCcSy+")",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"},null,8,db),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGHW6lecxh+")",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"},null,8,ub),e[2]||(e[2]=i.createElementVNode("path",{fill:"#FFF",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"},null,-1))])}const Ld=i.markRaw({name:"logos-whatsapp-icon",render:hb,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),fb={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},mb=["id"],gb=["fill"];function pb(t,e){return i.openBlock(),i.createElementBlock("svg",fb,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGuySfwdaH,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)])],8,mb)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGuySfwdaH+")",d:"M128 0C94.06 0 61.48 13.494 37.5 37.49A128.04 128.04 0 0 0 0 128c0 33.934 13.5 66.514 37.5 90.51C61.48 242.506 94.06 256 128 256s66.52-13.494 90.5-37.49c24-23.996 37.5-56.576 37.5-90.51s-13.5-66.514-37.5-90.51C194.52 13.494 161.94 0 128 0"},null,8,gb),e[1]||(e[1]=i.createElementVNode("path",{fill:"#FFF",d:"M57.94 126.648q55.98-24.384 74.64-32.152c35.56-14.786 42.94-17.354 47.76-17.441c1.06-.017 3.42.245 4.96 1.49c1.28 1.05 1.64 2.47 1.82 3.467c.16.996.38 3.266.2 5.038c-1.92 20.24-10.26 69.356-14.5 92.026c-1.78 9.592-5.32 12.808-8.74 13.122c-7.44.684-13.08-4.912-20.28-9.63c-11.26-7.386-17.62-11.982-28.56-19.188c-12.64-8.328-4.44-12.906 2.76-20.386c1.88-1.958 34.64-31.748 35.26-34.45c.08-.338.16-1.598-.6-2.262c-.74-.666-1.84-.438-2.64-.258c-1.14.256-19.12 12.152-54 35.686c-5.1 3.508-9.72 5.218-13.88 5.128c-4.56-.098-13.36-2.584-19.9-4.708c-8-2.606-14.38-3.984-13.82-8.41c.28-2.304 3.46-4.662 9.52-7.072"},null,-1))])}const Dd=i.markRaw({name:"logos-telegram",render:pb,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),yb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function bb(t,e){return i.openBlock(),i.createElementBlock("svg",yb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M391 480c-19.52 0-46.94-7.06-88-30c-49.93-28-88.55-53.85-138.21-103.38C116.91 298.77 93.61 267.79 61 208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82 73.38 58.16 62.65 74.11 52a176.3 176.3 0 0 1 28.64-15.2c1-.43 1.93-.84 2.76-1.21c4.95-2.23 12.45-5.6 21.95-2c6.34 2.38 12 7.25 20.86 16c18.17 17.92 43 57.83 52.16 77.43c6.15 13.21 10.22 21.93 10.23 31.71c0 11.45-5.76 20.28-12.75 29.81c-1.31 1.79-2.61 3.5-3.87 5.16c-7.61 10-9.28 12.89-8.18 18.05c2.23 10.37 18.86 41.24 46.19 68.51s57.31 42.85 67.72 45.07c5.38 1.15 8.33-.59 18.65-8.47c1.48-1.13 3-2.3 4.59-3.47c10.66-7.93 19.08-13.54 30.26-13.54h.06c9.73 0 18.06 4.22 31.86 11.18c18 9.08 59.11 33.59 77.14 51.78c8.77 8.84 13.66 14.48 16.05 20.81c3.6 9.53.21 17-2 22c-.37.83-.78 1.74-1.21 2.75a176.5 176.5 0 0 1-15.29 28.58c-10.63 15.9-21.4 28.21-39.38 36.58A67.4 67.4 0 0 1 391 480"},null,-1)])])}const Hd=i.markRaw({name:"ion-call",render:bb}),_b={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wb(t,e){return i.openBlock(),i.createElementBlock("svg",_b,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2m10 3a2 2 0 0 1 2 2m-2-6a6 6 0 0 1 6 6"},null,-1)])])}const xb=i.markRaw({name:"tabler-phone-call",render:wb}),kb={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},vb=["href"],Cb=["href"],Sb=["href"],Bb=["href"],Tb={},Rb=i.defineComponent({...Tb,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{try{return e.phone?sr.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=i.computed(()=>{var l;return M.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return M.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return M.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=xb,u=Hd,h=Dd,m=Ld,g=zd;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",{class:i.normalizeClass({"border-xl relative inline-flex items-center rounded px-2":r.value&&a.value,"min-w-10":!0}),onClick:c[0]||(c[0]=f=>a.value=!a.value),onFocusout:c[1]||(c[1]=f=>a.value=!1),onMouseleave:c[2]||(c[2]=f=>a.value=!1)},[i.createElementVNode("div",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showPhoneIcon})},[t.showPhoneIcon?(i.openBlock(),i.createBlock(d,{key:0})):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(s.value),1)],2),r.value&&a.value?(i.openBlock(),i.createElementBlock("div",kb,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${o.value}`,class:"text-blue-600 hover:animate-pulse hover:text-blue-600"},[i.createVNode(u)],8,vb)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(h)],8,Cb)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(m)],8,Sb)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:animate-pulse hover:text-purple-600"},[i.createVNode(g)],8,Bb)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),$b={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Pb(t,e){return i.openBlock(),i.createElementBlock("svg",$b,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m20 8l-8 5l-8-5V6l8 5l8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2"},null,-1)])])}const Nb=i.markRaw({name:"mdi-envelope",render:Pb}),Eb={class:"flex flex-col gap-1"},Fb={key:0,class:"mb-2 flex flex-col text-base"},Ab={key:0,class:"text-sc-dark-grey text-sm"},Mb={key:1,class:"whitespace-nowrap text-sm"},Vb={key:2,class:"whitespace-nowrap text-sm"},Ib={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Ob=["href"],zb=["href"],Lb=["href"],Db=["href"],Hb=["href"],Wb={key:0,class:"flex flex-col text-base"},jb={key:0,class:"text-sc-dark-grey text-sm"},qb={key:1,class:"mt-2 text-sm"},Xb={key:0,class:"-mt-1"},Yb={},Ub=i.defineComponent({...Yb,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{try{return e.contact.phone?sr.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),r=i.computed(()=>{var c;return M.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return M.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return M.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||e.contact.email),l=i.ref(!1);return(c,d)=>{var b,y;const u=Hd,h=Dd,m=Ld,g=zd,f=Nb,p=L.NPopover;return i.openBlock(),i.createElementBlock("div",Eb,[i.createVNode(p,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var _,S,v,T;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(_=t.contact)!=null&&_.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${t.classes}`),style:i.normalizeStyle(t.styles),onMouseenter:d[0]||(d[0]=R=>l.value=!0),onFocusin:d[1]||(d[1]=R=>l.value=!0),onMouseleave:d[2]||(d[2]=R=>l.value=!1),onFocusout:d[3]||(d[3]=R=>l.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(S=t.contact)!=null&&S.position)?(i.openBlock(),i.createElementBlock("div",Fb,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(v=t.contact)!=null&&v.position?(i.openBlock(),i.createElementBlock("span",Ab,i.toDisplayString((T=t.contact)==null?void 0:T.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.contact.phone?(i.openBlock(),i.createElementBlock("div",Mb,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",Vb,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",Ib,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${o.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[i.createVNode(u)],8,Ob)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(h)],8,zb)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(m)],8,Lb)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[i.createVNode(g)],8,Db)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(f)],8,Hb)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var _,S,v,T;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",Wb,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(_=t.contact)!=null&&_.position?(i.openBlock(),i.createElementBlock("span",jb,i.toDisplayString((S=t.contact)==null?void 0:S.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(v=t.contact)!=null&&v.comment?(i.openBlock(),i.createElementBlock("div",qb,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((T=t.contact)==null?void 0:T.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((b=t.contact)!=null&&b.comment)?(i.openBlock(),i.createElementBlock("div",Xb,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((y=t.contact)==null?void 0:y.comment),1)])):i.createCommentVNode("",!0)])}}});class Kb{constructor(e){C(this,"minHeight");C(this,"maxHeights");C(this,"minWidth");C(this,"maxWidths");C(this,"netType");C(this,"color");C(this,"mountType");C(this,"descriptions");C(this,"crossbarCount");C(this,"heightOverlaps");C(this,"widthOverlaps");C(this,"canSetDopProdaga");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=Os.objectToSnake(e.descriptions),this.maxHeights=e.maxHeights,this.maxWidths=e.maxWidths,this.minHeight=e.minHeight,this.minWidth=e.minWidth,this.mountType=e.mountType,this.netType=e.netType,this.heightOverlaps=Os.objectToSnake(e.heightOverlaps),this.widthOverlaps=Os.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}const Gb={class:"flex flex-wrap gap-2"},Zb={class:"flex flex-col"},Qb={class:"flex flex-col"},Jb={},e_=i.defineComponent({...Jb,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>Z.useBaseConfigStateStore().config.dateFormats.uiDate},disabled:{default:()=>({from:!1,to:!1})},predefinedDateRanges:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1}},emits:["update:date-range"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>{if(n.predefinedDateRanges)return n.predefinedDateRanges;if(n.useDefaultPredefinedDateRanges){const a={};return M.forOwn(Z.DateTimeProvider.defaultDateRanges(),(l,c)=>{a[c]={label:l.label,from:l.from??void 0,to:l.to??void 0}}),a}}),o=(a,l)=>{r("update:date-range",{from:a?Hn.startOfDay(new Date(a)):void 0,to:l?Hn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var u,h,m,g,f,p;const c=L.NButton,d=L.NDatePicker;return i.openBlock(),i.createElementBlock("div",Gb,[i.createVNode(d,{value:((h=(u=t.dateRange)==null?void 0:u.from)==null?void 0:h.getTime())??null,clearable:t.clearable,"is-date-disabled":b=>{var y,_;return((y=t.dateRange)==null?void 0:y.to)&&b>((_=t.dateRange)==null?void 0:_.to)},disabled:(m=t.disabled)==null?void 0:m.from,format:t.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[0]||(l[0]=b=>{var y,_;return o(b,(_=(y=t.dateRange)==null?void 0:y.to)==null?void 0:_.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",Zb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(b,y)=>(i.openBlock(),i.createBlock(c,{key:y,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var S,v;return o((S=b==null?void 0:b.from)==null?void 0:S.getTime(),(v=b==null?void 0:b.to)==null?void 0:v.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"]),i.createVNode(d,{value:((f=(g=t.dateRange)==null?void 0:g.to)==null?void 0:f.getTime())??null,clearable:t.clearable,"is-date-disabled":b=>{var y,_;return((y=t.dateRange)==null?void 0:y.from)&&b<((_=t.dateRange)==null?void 0:_.from)},disabled:(p=t.disabled)==null?void 0:p.to,format:t.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[1]||(l[1]=b=>{var y,_;return o((_=(y=t.dateRange)==null?void 0:y.from)==null?void 0:_.getTime(),b)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",Qb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(b,y)=>(i.openBlock(),i.createBlock(c,{key:y,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var S,v;return o((S=b==null?void 0:b.from)==null?void 0:S.getTime(),(v=b==null?void 0:b.to)==null?void 0:v.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"])])}}}),t_={class:"sc-lbl-date text-nowrap"},n_={},Lo=i.defineComponent({...n_,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>Hn.format(e.date,Z.useBaseConfigStateStore().config.dateFormats.uiDate)),r=i.computed(()=>Hn.format(e.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",t_,i.toDisplayString(n.value),1),i.createElementVNode("span",{class:i.normalizeClass([{"text-sc-grey":t.isTimeSecondary,"ml-1":!t.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)],2))}}),i_={class:"flex flex-row gap-2.5"},r_={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},s_={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},o_={class:"mb-0.5 sm:mb-0 sm:ml-3"},a_={},l_=i.defineComponent({...a_,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=ds,s=L.NButton,o=L.NPopover;return i.openBlock(),i.createElementBlock("div",i_,[i.createElementVNode("div",r_,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",s_,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",o_,[t.showCloseButton?(i.openBlock(),i.createBlock(o,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(s,{size:"small",type:"error",onClick:n[0]||(n[0]=a=>e.$emit("close"))},{default:i.withCtx(()=>[i.createVNode(r)]),_:1})]),default:i.withCtx(()=>[n[1]||(n[1]=i.createTextVNode(" Закрыть ",-1))]),_:1})):i.createCommentVNode("",!0)])])])])}}}),c_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function d_(t,e){return i.openBlock(),i.createElementBlock("svg",c_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m176 272l80 80l80-80M256 48v288"},null,-1)])])}const u_=i.markRaw({name:"ion-download-outline",render:d_}),h_={},f_=i.defineComponent({...h_,__name:"single-file-upload-selector",props:{draggedAreaText:{},accept:{},isError:{type:Boolean}},emits:["update:file"],setup(t,{emit:e}){const n=t,r=e,s=i.ref([]),o=i.computed(()=>s.value.map(l=>(l.status=n.isError?"error":"finished",l))),a=l=>{s.value=l;const c={name:"",content:""};if(l.length===0){r("update:file",null);return}const d=l[0];c.name=d.name;const u=new FileReader;u.addEventListener("load",()=>{c.content=u.result??"",r("update:file",c)}),u.readAsDataURL(d.file)};return(l,c)=>{const d=u_;return i.openBlock(),i.createBlock(i.unref(L.NUpload),{"file-list":o.value,"default-upload":!1,max:1,"show-retry-button":!1,action:"",accept:t.accept,"directory-dnd":"",class:"content-center","onUpdate:fileList":a},{default:i.withCtx(()=>[i.createVNode(i.unref(L.NUploadDragger),null,{default:i.withCtx(()=>[i.renderSlot(l.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(d,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(t.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3},8,["file-list","accept"])}}}),m_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function g_(t,e){return i.openBlock(),i.createElementBlock("svg",m_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"square","stroke-miterlimit":"10","stroke-width":"44",d:"M465 127L241 384l-92-92m-9 93l-93-93m316-165L236 273"},null,-1)])])}const p_=i.markRaw({name:"ion-checkmark-done-sharp",render:g_}),y_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function b_(t,e){return i.openBlock(),i.createElementBlock("svg",y_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 128h80m-384 0h240m64 256h80m-384 0h240m-96-128h240m-384 0h80"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"128",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"176",cy:"256",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"384",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)])])}const __=i.markRaw({name:"ion-options-outline",render:b_}),w_={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},x_={class:"flex-auto"},k_={class:"sticky top-0 flex flex-none flex-col justify-start gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},v_={class:"flex flex-none flex-col-reverse justify-end gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},C_={},Do=i.defineComponent({...C_,__name:"inline-view",props:{disabled:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!1},showApplyButton:{type:Boolean,default:!1},showCancelButton:{type:Boolean,default:!1}},emits:["edit","apply","cancel"],setup(t,{emit:e}){const n=e,r=i.ref(!1),s=()=>{n("edit")},o=()=>{r.value=!1},a=()=>{r.value=!0,n("apply",o)},l=()=>{n("cancel",o)};return(c,d)=>{const u=__,h=L.NButton,m=L.NPopover,g=p_,f=ds;return i.openBlock(),i.createElementBlock("div",w_,[i.createElementVNode("div",x_,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",k_,[i.createElementVNode("div",v_,[t.showEditButton?(i.openBlock(),i.createBlock(m,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[0]||(d[0]=i.createTextVNode(" Редактировать данные ",-1))]),_:1})):i.createCommentVNode("",!0),t.showApplyButton?(i.openBlock(),i.createBlock(m,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),t.showCancelButton?(i.openBlock(),i.createBlock(m,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),S_={},Wd=i.defineComponent({...S_,__name:"inline-editable-item",props:{disabled:{type:Boolean,default:!1},showEditor:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!0}},emits:["editor:apply","editor:cancel"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.showEditor),o=l=>{r("editor:apply",d=>{s.value=!d,l()})},a=l=>{s.value=!1,l(),r("editor:cancel")};return i.onMounted(()=>{i.watch(()=>n.showEditor,l=>{s.value=l})}),(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[s.value?(i.openBlock(),i.createBlock(Do,{key:1,disabled:t.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:o,onCancel:a},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-editor-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"editor")]),_:3},8,["disabled"])):(i.openBlock(),i.createBlock(Do,{key:0,disabled:t.disabled,"show-edit-button":t.showEditButton,onEdit:c[0]||(c[0]=d=>s.value=!0)},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-viewer-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"viewer")]),_:3},8,["disabled","show-edit-button"]))]))}}),B_={},T_=i.defineComponent({...B_,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.value),o=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=M.debounce(()=>r("update:value",s.value),o.value),l=c=>{s.value=c,a()};return i.watch(()=>n.value,c=>{s.value=c}),(c,d)=>(i.openBlock(),i.createBlock(i.unref(L.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=u=>s.value=u),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),R_={},$_=i.defineComponent({...R_,__name:"debounced-input-number",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:500},placeholder:{default:""},min:{default:void 0},max:{default:void 0},step:{default:1},validator:{type:Function,default:void 0},parse:{type:Function,default:void 0},showButton:{type:Boolean,default:!0}},emits:["update:value","keydown","input","focus"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=M.debounce(()=>s("update:value",o.value),a.value),c=g=>{o.value=g,l()};i.watch(()=>r.value,g=>{o.value=g});const d=i.ref(null);return e({focus:()=>{var g;return(g=d.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=d.value)==null?void 0:g.blur()},select:()=>{var g;return(g=d.value)==null?void 0:g.select()}}),(g,f)=>(i.openBlock(),i.createBlock(i.unref(L.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value??null,clearable:t.clearable,parse:t.parse,"show-button":t.showButton,placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,validator:t.validator,"onUpdate:value":c,onKeydown:f[0]||(f[0]=p=>s("keydown",p)),onInput:f[1]||(f[1]=p=>s("input",p)),onFocus:f[2]||(f[2]=p=>s("focus",p))},{prefix:i.withCtx(()=>[i.renderSlot(g.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),P_={},N_=i.defineComponent({...P_,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref((n.value??"").replaceAll(/\D*/g,"")),o=M.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(M.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(M.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof sr.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}n.debounceTime?o(d):r("update:value",d)},l=c=>{const d=c.replaceAll(/\D*/g,"");try{const u=sr.parsePhoneNumberWithError(`+${d}`);u.isValid()?s.value=u.format("E.164"):u.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(u){if(u instanceof sr.ParseError)s.value=d;else throw u}};return i.watch(()=>n.value,c=>{var d;(c==null?void 0:c.replaceAll(/\D*/g,""))!==((d=s.value)==null?void 0:d.replaceAll(/\D*/g,""))&&l(c)},{immediate:!0}),i.onBeforeMount(()=>l(s.value??"")),(c,d)=>(i.openBlock(),i.createBlock(i.unref(Uh.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=u=>s.value=u),a],"auto-default-country":!1,"auto-format":!0,"default-country":t.defaultCountry,disabled:t.disabled,"input-options":{placeholder:t.placeholder},"preferred-countries":t.preferredCountries,"only-countries":t.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),E_=Wn(N_,[["__scopeId","data-v-751dbb0e"]]),F_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function A_(t,e){return i.openBlock(),i.createElementBlock("svg",F_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"},null,-1)])])}const M_=i.markRaw({name:"tabler-external-link",render:A_}),V_={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},I_=["href"],O_={},z_=i.defineComponent({...O_,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=M_,s=L.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(M.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",V_,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,I_),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),L_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function D_(t,e){return i.openBlock(),i.createElementBlock("svg",L_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 256H176"},null,-1)])])}const H_=i.markRaw({name:"ion-remove-circle-outline",render:D_});let fs=[];const jd=new WeakMap;function W_(){fs.forEach(t=>t(...jd.get(t))),fs=[]}function qd(t,...e){jd.set(t,e),!fs.includes(t)&&fs.push(t)===1&&requestAnimationFrame(W_)}function gr(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function pr(t){return t.composedPath()[0]||null}function yr(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function br(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function en(t,e){const n=t.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw new Error("[seemly/getMargin]:"+t+" is not a valid value.")}return e===void 0?r:r[e]}const Xd={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",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:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",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:"#F00",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:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function j_(t,e,n){e/=100,n/=100;let r=(s,o=(s+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function q_(t,e,n){e/=100,n/=100;let r=e*Math.min(n,1-n),s=(o,a=(o+t/30)%12)=>n-r*Math.max(Math.min(a-3,9-a,1),-1);return[s(0)*255,s(8)*255,s(4)*255]}const _n="^\\s*",wn="\\s*$",Gn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",zt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",mi="([0-9A-Fa-f])",gi="([0-9A-Fa-f]{2})",Yd=new RegExp(`${_n}hsl\\s*\\(${zt},${Gn},${Gn}\\)${wn}`),Ud=new RegExp(`${_n}hsv\\s*\\(${zt},${Gn},${Gn}\\)${wn}`),Kd=new RegExp(`${_n}hsla\\s*\\(${zt},${Gn},${Gn},${zt}\\)${wn}`),Gd=new RegExp(`${_n}hsva\\s*\\(${zt},${Gn},${Gn},${zt}\\)${wn}`),X_=new RegExp(`${_n}rgb\\s*\\(${zt},${zt},${zt}\\)${wn}`),Y_=new RegExp(`${_n}rgba\\s*\\(${zt},${zt},${zt},${zt}\\)${wn}`),U_=new RegExp(`${_n}#${mi}${mi}${mi}${wn}`),K_=new RegExp(`${_n}#${gi}${gi}${gi}${wn}`),G_=new RegExp(`${_n}#${mi}${mi}${mi}${mi}${wn}`),Z_=new RegExp(`${_n}#${gi}${gi}${gi}${gi}${wn}`);function Ft(t){return parseInt(t,16)}function Q_(t){try{let e;if(e=Kd.exec(t))return[gs(e[1]),Zn(e[5]),Zn(e[9]),yi(e[13])];if(e=Yd.exec(t))return[gs(e[1]),Zn(e[5]),Zn(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function J_(t){try{let e;if(e=Gd.exec(t))return[gs(e[1]),Zn(e[5]),Zn(e[9]),yi(e[13])];if(e=Ud.exec(t))return[gs(e[1]),Zn(e[5]),Zn(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function pi(t){try{let e;if(e=K_.exec(t))return[Ft(e[1]),Ft(e[2]),Ft(e[3]),1];if(e=X_.exec(t))return[mt(e[1]),mt(e[5]),mt(e[9]),1];if(e=Y_.exec(t))return[mt(e[1]),mt(e[5]),mt(e[9]),yi(e[13])];if(e=U_.exec(t))return[Ft(e[1]+e[1]),Ft(e[2]+e[2]),Ft(e[3]+e[3]),1];if(e=Z_.exec(t))return[Ft(e[1]),Ft(e[2]),Ft(e[3]),yi(Ft(e[4])/255)];if(e=G_.exec(t))return[Ft(e[1]+e[1]),Ft(e[2]+e[2]),Ft(e[3]+e[3]),yi(Ft(e[4]+e[4])/255)];if(t in Xd)return pi(Xd[t]);if(Yd.test(t)||Kd.test(t)){const[n,r,s,o]=Q_(t);return[...q_(n,r,s),o]}else if(Ud.test(t)||Gd.test(t)){const[n,r,s,o]=J_(t);return[...j_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function e1(t){return t>1?1:t<0?0:t}function Ho(t,e,n,r){return`rgba(${mt(t)}, ${mt(e)}, ${mt(n)}, ${e1(r)})`}function Wo(t,e,n,r,s){return mt((t*e*(1-r)+n*r)/s)}function t1(t,e){Array.isArray(t)||(t=pi(t)),Array.isArray(e)||(e=pi(e));const n=t[3],r=e[3],s=yi(n+r-n*r);return Ho(Wo(t[0],n,e[0],r,s),Wo(t[1],n,e[1],r,s),Wo(t[2],n,e[2],r,s),s)}function Ve(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:pi(t);return typeof e.alpha=="number"?Ho(n,r,s,e.alpha):Ho(n,r,s,o)}function ms(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:pi(t),{lightness:a=1,alpha:l=1}=e;return n1([n*a,r*a,s*a,o*l])}function yi(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function gs(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function mt(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Zn(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function n1(t){const[e,n,r]=t;return 3 in t?`rgba(${mt(e)}, ${mt(n)}, ${mt(r)}, ${yi(t[3])})`:`rgba(${mt(e)}, ${mt(n)}, ${mt(r)}, 1)`}function i1(t=8){return Math.random().toString(16).slice(2,2+t)}function Zd(t){return Array.isArray(t)?t:[t]}const jo={STOP:"STOP"};function Qd(t,e){const n=e(t);t.children!==void 0&&n!==jo.STOP&&t.children.forEach(r=>Qd(r,e))}function r1(t,e={}){const{preserveGroup:n=!1}=e,r=[],s=n?a=>{a.isLeaf||(r.push(a.key),o(a.children))}:a=>{a.isLeaf||(a.isGroup||r.push(a.key),o(a.children))};function o(a){a.forEach(s)}return o(t),r}function s1(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function o1(t){return t.children}function a1(t){return t.key}function l1(){return!1}function c1(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function d1(t){return t.disabled===!0}function u1(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function h1(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function qo(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Xo(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function f1(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function m1(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function g1(t){return(t==null?void 0:t.type)==="group"}function p1(t){const e=new Map;return t.forEach((n,r)=>{e.set(n.key,r)}),n=>{var r;return(r=e.get(n))!==null&&r!==void 0?r:null}}class y1 extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function b1(t,e,n,r){return ps(e.concat(t),n,r,!1)}function _1(t,e){const n=new Set;return t.forEach(r=>{const s=e.treeNodeMap.get(r);if(s!==void 0){let o=s.parent;for(;o!==null&&!(o.disabled||n.has(o.key));)n.add(o.key),o=o.parent}}),n}function w1(t,e,n,r){const s=ps(e,n,r,!1),o=ps(t,n,r,!0),a=_1(t,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function Yo(t,e){const{checkedKeys:n,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=t;if(!a)return r!==void 0?{checkedKeys:f1(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:m1(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:u}=e;let h;s!==void 0?h=w1(s,n,e,d):r!==void 0?h=b1(r,n,e,d):h=ps(n,e,d,!1);const m=c==="parent",g=c==="child"||l,f=h,p=new Set,b=Math.max.apply(null,Array.from(u.keys()));for(let y=b;y>=0;y-=1){const _=y===0,S=u.get(y);for(const v of S){if(v.isLeaf)continue;const{key:T,shallowLoaded:R}=v;if(g&&R&&v.children.forEach($=>{!$.disabled&&!$.isLeaf&&$.shallowLoaded&&f.has($.key)&&f.delete($.key)}),v.disabled||!R)continue;let w=!0,B=!1,x=!0;for(const $ of v.children){const P=$.key;if(!$.disabled){if(x&&(x=!1),f.has(P))B=!0;else if(p.has(P)){B=!0,w=!1;break}else if(w=!1,B)break}}w&&!x?(m&&v.children.forEach($=>{!$.disabled&&f.has($.key)&&f.delete($.key)}),f.add(T)):B&&p.add(T),_&&g&&f.has(T)&&f.delete(T)}}return{checkedKeys:Array.from(f),indeterminateKeys:Array.from(p)}}function ps(t,e,n,r){const{treeNodeMap:s,getChildren:o}=e,a=new Set,l=new Set(t);return t.forEach(c=>{const d=s.get(c);d!==void 0&&Qd(d,u=>{if(u.disabled)return jo.STOP;const{key:h}=u;if(!a.has(h)&&(a.add(h),l.add(h),u1(u.rawNode,o))){if(r)return jo.STOP;if(!n)throw new y1}})}),l}function x1(t,{includeGroup:e=!1,includeSelf:n=!0},r){var s;const o=r.treeNodeMap;let a=t==null?null:(s=o.get(t))!==null&&s!==void 0?s:null;const l={keyPath:[],treeNodePath:[],treeNode:a};if(a!=null&&a.ignored)return l.treeNode=null,l;for(;a;)!a.ignored&&(e||!a.isGroup)&&l.treeNodePath.push(a),a=a.parent;return l.treeNodePath.reverse(),n||l.treeNodePath.pop(),l.keyPath=l.treeNodePath.map(c=>c.key),l}function k1(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function v1(t,e){const n=t.siblings,r=n.length,{index:s}=t;return e?n[(s+1)%r]:s===n.length-1?null:n[s+1]}function Jd(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const s=e==="prev"?C1:v1,o={reverse:e==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===t){if(!a)a=!0;else if(!t.disabled&&!t.isGroup){l=t;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const u=Uo(d,o);u!==null?l=u:c(s(d,n))}else{const u=s(d,!1);if(u!==null)c(u);else{const h=S1(d);h!=null&&h.isGroup?c(s(h,n)):n&&c(s(d,!0))}}}}return c(t),l}function C1(t,e){const n=t.siblings,r=n.length,{index:s}=t;return e?n[(s-1+r)%r]:s===0?null:n[s-1]}function S1(t){return t.parent}function Uo(t,e={}){const{reverse:n=!1}=e,{children:r}=t;if(r){const{length:s}=r,o=n?s-1:0,a=n?-1:s,l=n?-1:1;for(let c=o;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const u=Uo(d,e);if(u!==null)return u}else return d}}return null}const B1={getChild(){return this.ignored?null:Uo(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return Jd(this,"next",t)},getPrev(t={}){return Jd(this,"prev",t)}};function T1(t,e){const n=e?new Set(e):void 0,r=[];function s(o){o.forEach(a=>{r.push(a),!(a.isLeaf||!a.children||a.ignored)&&(a.isGroup||n===void 0||n.has(a.key))&&s(a.children)})}return s(t),r}function R1(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var $1={};function eu(t,e,n,r,s,o=null,a=0){const l=[];return t.forEach((c,d)=>{var u;$1.NODE_ENV!=="production"&&h1(c,s)&&console.error("[treemate]: node",c,"is invalid");const h=Object.create(r);if(h.rawNode=c,h.siblings=l,h.level=a,h.index=d,h.isFirstChild=d===0,h.isLastChild=d+1===t.length,h.parent=o,!h.ignored){const m=s(c);Array.isArray(m)&&(h.children=eu(m,e,n,r,s,h,a+1))}l.push(h),e.set(h.key,h),n.has(a)||n.set(a,[]),(u=n.get(a))===null||u===void 0||u.push(h)}),l}function P1(t,e={}){var n;const r=new Map,s=new Map,{getDisabled:o=d1,getIgnored:a=l1,getIsGroup:l=g1,getKey:c=a1}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:o1,u=e.ignoreEmptyChildren?v=>{const T=d(v);return Array.isArray(T)?T.length?T:null:T}:d,h=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return s1(this.rawNode,u)},get shallowLoaded(){return c1(this.rawNode,u)},get ignored(){return a(this.rawNode)},contains(v){return R1(this,v)}},B1),m=eu(t,r,s,h,u);function g(v){if(v==null)return null;const T=r.get(v);return T&&!T.isGroup&&!T.ignored?T:null}function f(v){if(v==null)return null;const T=r.get(v);return T&&!T.ignored?T:null}function p(v,T){const R=f(v);return R?R.getPrev(T):null}function b(v,T){const R=f(v);return R?R.getNext(T):null}function y(v){const T=f(v);return T?T.getParent():null}function _(v){const T=f(v);return T?T.getChild():null}const S={treeNodes:m,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:u,getFlattenedNodes(v){return T1(m,v)},getNode:g,getPrev:p,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return k1(m)},getPath(v,T={}){return x1(v,T,S)},getCheckedKeys(v,T={}){const{cascade:R=!0,leafOnly:w=!1,checkStrategy:B="all",allowNotLoaded:x=!1}=T;return Yo({checkedKeys:qo(v),indeterminateKeys:Xo(v),cascade:R,leafOnly:w,checkStrategy:B,allowNotLoaded:x},S)},check(v,T,R={}){const{cascade:w=!0,leafOnly:B=!1,checkStrategy:x="all",allowNotLoaded:$=!1}=R;return Yo({checkedKeys:qo(T),indeterminateKeys:Xo(T),keysToCheck:v==null?[]:Zd(v),cascade:w,leafOnly:B,checkStrategy:x,allowNotLoaded:$},S)},uncheck(v,T,R={}){const{cascade:w=!0,leafOnly:B=!1,checkStrategy:x="all",allowNotLoaded:$=!1}=R;return Yo({checkedKeys:qo(T),indeterminateKeys:Xo(T),keysToUncheck:v==null?[]:Zd(v),cascade:w,leafOnly:B,checkStrategy:x,allowNotLoaded:$},S)},getNonLeafKeys(v={}){return r1(m,v)}};return S}function ys(t){return t.composedPath()[0]}const N1={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function E1(t,e,n){if(t==="mousemoveoutside"){const r=s=>{e.contains(ys(s))||n(s)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const s=a=>{r=!e.contains(ys(a))},o=a=>{r&&(e.contains(ys(a))||n(a))};return{mousedown:s,mouseup:o,touchstart:s,touchend:o}}return console.error(`[evtd/create-trap-handler]: name \`${t}\` is invalid. This could be a bug of evtd.`),{}}function tu(t,e,n){const r=N1[t];let s=r.get(e);s===void 0&&r.set(e,s=new WeakMap);let o=s.get(n);return o===void 0&&s.set(n,o=E1(t,e,n)),o}function F1(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=tu(t,e,n);return Object.keys(s).forEach(o=>{Tt(o,document,s[o],r)}),!0}return!1}function A1(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=tu(t,e,n);return Object.keys(s).forEach(o=>{it(o,document,s[o],r)}),!0}return!1}function M1(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const t=new WeakMap,e=new WeakMap;function n(){t.set(this,!0)}function r(){t.set(this,!0),e.set(this,!0)}function s(w,B,x){const $=w[B];return w[B]=function(){return x.apply(w,arguments),$.apply(w,arguments)},w}function o(w,B){w[B]=Event.prototype[B]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var w;return(w=a.get(this))!==null&&w!==void 0?w:null}function d(w,B){l!==void 0&&Object.defineProperty(w,"currentTarget",{configurable:!0,enumerable:!0,get:B??l.get})}const u={bubble:{},capture:{}},h={};function m(){const w=function(B){const{type:x,eventPhase:$,bubbles:P}=B,A=ys(B);if($===2)return;const V=$===1?"capture":"bubble";let F=A;const N=[];for(;F===null&&(F=window),N.push(F),F!==window;)F=F.parentNode||null;const Y=u.capture[x],ee=u.bubble[x];if(s(B,"stopPropagation",n),s(B,"stopImmediatePropagation",r),d(B,c),V==="capture"){if(Y===void 0)return;for(let I=N.length-1;I>=0&&!t.has(B);--I){const z=N[I],q=Y.get(z);if(q!==void 0){a.set(B,z);for(const W of q){if(e.has(B))break;W(B)}}if(I===0&&!P&&ee!==void 0){const W=ee.get(z);if(W!==void 0)for(const O of W){if(e.has(B))break;O(B)}}}}else if(V==="bubble"){if(ee===void 0)return;for(let I=0;I<N.length&&!t.has(B);++I){const z=N[I],q=ee.get(z);if(q!==void 0){a.set(B,z);for(const W of q){if(e.has(B))break;W(B)}}}}o(B,"stopPropagation"),o(B,"stopImmediatePropagation"),d(B)};return w.displayName="evtdUnifiedHandler",w}function g(){const w=function(B){const{type:x,eventPhase:$}=B;if($!==2)return;const P=h[x];P!==void 0&&P.forEach(A=>A(B))};return w.displayName="evtdUnifiedWindowEventHandler",w}const f=m(),p=g();function b(w,B){const x=u[w];return x[B]===void 0&&(x[B]=new Map,window.addEventListener(B,f,w==="capture")),x[B]}function y(w){return h[w]===void 0&&(h[w]=new Set,window.addEventListener(w,p)),h[w]}function _(w,B){let x=w.get(B);return x===void 0&&w.set(B,x=new Set),x}function S(w,B,x,$){const P=u[B][x];if(P!==void 0){const A=P.get(w);if(A!==void 0&&A.has($))return!0}return!1}function v(w,B){const x=h[w];return!!(x!==void 0&&x.has(B))}function T(w,B,x,$){let P;if(typeof $=="object"&&$.once===!0?P=Y=>{R(w,B,P,$),x(Y)}:P=x,F1(w,B,P,$))return;const V=$===!0||typeof $=="object"&&$.capture===!0?"capture":"bubble",F=b(V,w),N=_(F,B);if(N.has(P)||N.add(P),B===window){const Y=y(w);Y.has(P)||Y.add(P)}}function R(w,B,x,$){if(A1(w,B,x,$))return;const A=$===!0||typeof $=="object"&&$.capture===!0,V=A?"capture":"bubble",F=b(V,w),N=_(F,B);if(B===window&&!S(B,A?"bubble":"capture",w,x)&&v(w,x)){const ee=h[w];ee.delete(x),ee.size===0&&(window.removeEventListener(w,p),h[w]=void 0)}N.has(x)&&N.delete(x),N.size===0&&F.delete(B),F.size===0&&(window.removeEventListener(w,f,V==="capture"),u[V][w]=void 0)}return{on:T,off:R}}const{on:Tt,off:it}=M1(),Ki="@@mmoContext",V1={mounted(t,{value:e}){t[Ki]={handler:void 0},typeof e=="function"&&(t[Ki].handler=e,Tt("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Ki];typeof e=="function"?n.handler?n.handler!==e&&(it("mousemoveoutside",t,n.handler),n.handler=e,Tt("mousemoveoutside",t,e)):(t[Ki].handler=e,Tt("mousemoveoutside",t,e)):n.handler&&(it("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Ki];e&&it("mousemoveoutside",t,e),t[Ki].handler=void 0}},Gi="@@coContext",bs={mounted(t,{value:e,modifiers:n}){t[Gi]={handler:void 0},typeof e=="function"&&(t[Gi].handler=e,Tt("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Gi];typeof e=="function"?r.handler?r.handler!==e&&(it("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,Tt("clickoutside",t,e,{capture:n.capture})):(t[Gi].handler=e,Tt("clickoutside",t,e,{capture:n.capture})):r.handler&&(it("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Gi];n&&it("clickoutside",t,n,{capture:e.capture}),t[Gi].handler=void 0}};function I1(t,e){console.error(`[vdirs/${t}]: ${e}`)}class O1{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,n){const{elementZIndex:r}=this;if(n!==void 0){e.style.zIndex=`${n}`,r.delete(e);return}const{nextZIndex:s}=this;r.has(e)&&r.get(e)+1===this.nextZIndex||(e.style.zIndex=`${s}`,r.set(e,s),this.nextZIndex=s+1,this.squashState())}unregister(e,n){const{elementZIndex:r}=this;r.has(e)?r.delete(e):n===void 0&&I1("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){const e=Array.from(this.elementZIndex.entries());e.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,e.forEach(n=>{const r=n[0],s=this.nextZIndex++;`${s}`!==r.style.zIndex&&(r.style.zIndex=`${s}`)})}}const Ko=new O1,Zi="@@ziContext",nu={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n;t[Zi]={enabled:!!s,initialized:!1},s&&(Ko.ensureZIndex(t,r),t[Zi].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n,o=t[Zi].enabled;s&&!o&&(Ko.ensureZIndex(t,r),t[Zi].initialized=!0),t[Zi].enabled=!!s},unmounted(t,e){if(!t[Zi].initialized)return;const{value:n={}}=e,{zIndex:r}=n;Ko.unregister(t,r)}};function z1(t){const e=i.ref(!!t.value);if(e.value)return i.readonly(e);const n=i.watch(t,r=>{r&&(e.value=!0,n())});return i.readonly(e)}function Ut(t){const e=i.computed(t),n=i.ref(e.value);return i.watch(e,r=>{n.value=r}),typeof t=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){t.set(r)}}}const L1=typeof window<"u";let Qi,_r;(()=>{var t,e;Qi=L1?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,_r=!1,Qi!==void 0?Qi.then(()=>{_r=!0}):_r=!0})();function D1(t){if(_r)return;let e=!1;i.onMounted(()=>{_r||Qi==null||Qi.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Go(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function _s(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function iu(t,e){return i.computed(()=>{for(const n of e)if(t[n]!==void 0)return t[n];return t[e[e.length-1]]})}const H1=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function W1(){return H1}function Zo(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function Qo(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){Qo(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Qo(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function ru(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const s=Qo(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let Qn=null;function su(){if(Qn===null&&(Qn=document.getElementById("v-binder-view-measurer"),Qn===null)){Qn=document.createElement("div"),Qn.id="v-binder-view-measurer";const{style:t}=Qn;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(Qn)}return Qn.getBoundingClientRect()}function j1(t,e){const n=su();return{top:e,left:t,height:0,width:0,right:n.width-t,bottom:n.height-e}}function Jo(t){const e=t.getBoundingClientRect(),n=su();return{left:e.left-n.left,top:e.top-n.top,bottom:n.height+n.top-e.bottom,right:n.width+n.left-e.right,width:e.width,height:e.height}}function q1(t){return t.nodeType===9?null:t.parentNode}function ou(t){if(t===null)return null;const e=q1(t);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(n+s+r))return e}return ou(e)}const au=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(t){var e;i.provide("VBinder",(e=i.getCurrentInstance())===null||e===void 0?void 0:e.proxy);const n=i.inject("VBinder",null),r=i.ref(null),s=y=>{r.value=y,n&&t.syncTargetWithParent&&n.setTargetRef(y)};let o=[];const a=()=>{let y=r.value;for(;y=ou(y),y!==null;)o.push(y);for(const _ of o)Tt("scroll",_,h,!0)},l=()=>{for(const y of o)it("scroll",y,h,!0);o=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},u=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},h=()=>{qd(m)},m=()=>{c.forEach(y=>y())},g=new Set,f=y=>{g.size===0&&Tt("resize",window,b),g.has(y)||g.add(y)},p=y=>{g.has(y)&&g.delete(y),g.size===0&&it("resize",window,b)},b=()=>{g.forEach(y=>y())};return i.onBeforeUnmount(()=>{it("resize",window,b),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:u,addResizeListener:f,removeResizeListener:p}},render(){return Zo("binder",this.$slots)}}),lu=i.defineComponent({name:"Target",setup(){const{setTargetRef:t,syncTarget:e}=i.inject("VBinder");return{syncTarget:e,setTargetDirective:{mounted:t,updated:t}}},render(){const{syncTarget:t,setTargetDirective:e}=this;return t?i.withDirectives(ru("follower",this.$slots),[[e]]):ru("follower",this.$slots)}}),X1="@css-render/vue3-ssr";function Y1(t,e){return`<style cssr-id="${t}">
104
104
  ${e}
105
105
  </style>`}function U1(t,e,n){const{styles:r,ids:s}=n;s.has(t)||r!==null&&(s.add(t),r.push(Y1(t,e)))}const K1=typeof document<"u";function bi(){if(K1)return;const t=i.inject(X1,null);if(t!==null)return{adapter:(e,n)=>U1(e,n,t),context:t}}function cu(t,e){console.error(`[vueuc/${t}]: ${e}`)}function G1(t){let e=0;for(let n=0;n<t.length;++n)t[n]==="&"&&++e;return e}const du=/\s*,(?![^(]*\))\s*/g,Z1=/\s+/g;function Q1(t,e){const n=[];return e.split(du).forEach(r=>{let s=G1(r);if(s){if(s===1){t.forEach(a=>{n.push(r.replace("&",a))});return}}else{t.forEach(a=>{n.push((a&&a+" ")+r)});return}let o=[r];for(;s--;){const a=[];o.forEach(l=>{t.forEach(c=>{a.push(l.replace("&",c))})}),o=a}o.forEach(a=>n.push(a))}),n}function J1(t,e){const n=[];return e.split(du).forEach(r=>{t.forEach(s=>{n.push((s&&s+" ")+r)})}),n}function ew(t){let e=[""];return t.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?e=Q1(e,n):e=J1(e,n))}),e.join(", ").replace(Z1," ")}function uu(t){if(!t)return;const e=t.parentElement;e&&e.removeChild(t)}function ws(t,e){return(e??document.head).querySelector(`style[cssr-id="${t}"]`)}function tw(t){const e=document.createElement("style");return e.setAttribute("cssr-id",t),e}function xs(t){return t?/^\s*@(s|m)/.test(t):!1}const nw=/[A-Z]/g;function hu(t){return t.replace(nw,e=>"-"+e.toLowerCase())}function iw(t,e=" "){return typeof t=="object"&&t!==null?` {
106
106
  `+Object.entries(t).map(n=>e+` ${hu(n[0])}: ${n[1]};`).join(`
@@ -111,9 +111,9 @@ ${s}
111
111
  }`:"";const a=t?[t+" {"]:[];return o.forEach(l=>{const c=s[l];if(l==="raw"){a.push(`
112
112
  `+c+`
113
113
  `);return}l=hu(l),c!=null&&a.push(` ${l}${iw(c)}`)}),t&&a.push("}"),a.join(`
114
- `)}function Jo(t,e,n){t&&t.forEach(r=>{if(Array.isArray(r))Jo(r,e,n);else if(typeof r=="function"){const s=r(e);Array.isArray(s)?Jo(s,e,n):s&&n(s)}else r&&n(r)})}function mu(t,e,n,r,s){const o=t.$;let a="";if(!o||typeof o=="string")xs(o)?a=o:e.push(o);else if(typeof o=="function"){const d=o({context:r.context,props:s});xs(d)?a=d:e.push(d)}else if(o.before&&o.before(r.context),!o.$||typeof o.$=="string")xs(o.$)?a=o.$:e.push(o.$);else if(o.$){const d=o.$({context:r.context,props:s});xs(d)?a=d:e.push(d)}const l=ew(e),c=fu(l,t.props,r,s);a?n.push(`${a} {`):c.length&&n.push(c),t.children&&Jo(t.children,{context:r.context,props:s},d=>{if(typeof d=="string"){const u=fu(l,{raw:d},r,s);n.push(u)}else mu(d,e,n,r,s)}),e.pop(),a&&n.push("}"),o&&o.after&&o.after(r.context)}function sw(t,e,n){const r=[];return mu(t,[],r,e,n),r.join(`
114
+ `)}function ea(t,e,n){t&&t.forEach(r=>{if(Array.isArray(r))ea(r,e,n);else if(typeof r=="function"){const s=r(e);Array.isArray(s)?ea(s,e,n):s&&n(s)}else r&&n(r)})}function mu(t,e,n,r,s){const o=t.$;let a="";if(!o||typeof o=="string")xs(o)?a=o:e.push(o);else if(typeof o=="function"){const d=o({context:r.context,props:s});xs(d)?a=d:e.push(d)}else if(o.before&&o.before(r.context),!o.$||typeof o.$=="string")xs(o.$)?a=o.$:e.push(o.$);else if(o.$){const d=o.$({context:r.context,props:s});xs(d)?a=d:e.push(d)}const l=ew(e),c=fu(l,t.props,r,s);a?n.push(`${a} {`):c.length&&n.push(c),t.children&&ea(t.children,{context:r.context,props:s},d=>{if(typeof d=="string"){const u=fu(l,{raw:d},r,s);n.push(u)}else mu(d,e,n,r,s)}),e.pop(),a&&n.push("}"),o&&o.after&&o.after(r.context)}function sw(t,e,n){const r=[];return mu(t,[],r,e,n),r.join(`
115
115
 
116
- `)}function ea(t){for(var e=0,n,r=0,s=t.length;s>=4;++r,s-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(s){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function ow(t,e,n,r){const{els:s}=e;if(n===void 0)s.forEach(uu),e.els=[];else{const o=ws(n,r);o&&s.includes(o)&&(uu(o),e.els=s.filter(a=>a!==o))}}function gu(t,e){t.push(e)}function aw(t,e,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=ea(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const u=ws(n,l);if(u!==null&&!o)return u;const h=u??tw(n);if(d===void 0&&(d=e.render(r)),h.textContent=d,u!==null)return u;if(a){const m=l.querySelector(`meta[name="${a}"]`);if(m)return l.insertBefore(h,m),gu(e.els,h),h}return s?l.insertBefore(h,l.querySelector("style, link")):l.appendChild(h),gu(e.els,h),h}function lw(t){return sw(this,this.instance,t)}function cw(t={}){const{id:e,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=t;return aw(this.instance,this,e,r,s,o,a,l,n)}function dw(t={}){const{id:e,parent:n}=t;ow(this.instance,this,e,n)}const ks=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:lw,mount:cw,unmount:dw}},uw=function(t,e,n,r){return Array.isArray(e)?ks(t,{$:null},null,e):Array.isArray(n)?ks(t,e,null,n):Array.isArray(r)?ks(t,e,n,r):ks(t,e,n,null)};function pu(t={}){const e={c:((...n)=>uw(e,...n)),use:(n,...r)=>n.install(e,...r),find:ws,context:{},config:t};return e}function hw(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return ws(t)!==null}const{c:Jn}=pu(),ta="vueuc-style";function yu(t){return t&-t}class bu{constructor(e,n){this.l=e,this.min=n;const r=new Array(e+1);for(let s=0;s<e+1;++s)r[s]=0;this.ft=r}add(e,n){if(n===0)return;const{l:r,ft:s}=this;for(e+=1;e<=r;)s[e]+=n,e+=yu(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:n,min:r,l:s}=this;if(e>s)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let o=e*r;for(;e>0;)o+=n[e],e-=yu(e);return o}getBound(e){let n=0,r=this.l;for(;r>n;){const s=Math.floor((n+r)/2),o=this.sum(s);if(o>e){r=s;continue}else if(o<e){if(n===s)return this.sum(n+1)<=e?n+1:s;n=s}else return s}return n}}function _u(t){return typeof t=="string"?document.querySelector(t):t()||null}const fw=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:z1(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Go("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Go("lazy-teleport",this.$slots)):null}}),vs={top:"bottom",bottom:"top",left:"right",right:"left"},wu={start:"end",center:"center",end:"start"},na={top:"height",bottom:"height",left:"width",right:"width"},mw={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},gw={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},pw={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},xu={top:!0,bottom:!1,left:!0,right:!1},ku={top:"end",bottom:"start",left:"end",right:"start"};function yw(t,e,n,r,s,o){if(!s||o)return{placement:t,top:0,left:0};const[a,l]=t.split("-");let c=l??"center",d={top:0,left:0};const u=(g,f,p)=>{let b=0,y=0;const _=n[g]-e[f]-e[g];return _>0&&r&&(p?y=xu[f]?_:-_:b=xu[f]?_:-_),{left:b,top:y}},h=a==="left"||a==="right";if(c!=="center"){const g=pw[t],f=vs[g],p=na[g];if(n[p]>e[p]){if(e[g]+e[p]<n[p]){const b=(n[p]-e[p])/2;e[g]<b||e[f]<b?e[g]<e[f]?(c=wu[l],d=u(p,f,h)):d=u(p,g,h):c="center"}}else n[p]<e[p]&&e[f]<0&&e[g]>e[f]&&(c=wu[l])}else{const g=a==="bottom"||a==="top"?"left":"top",f=vs[g],p=na[g],b=(n[p]-e[p])/2;(e[g]<b||e[f]<b)&&(e[g]>e[f]?(c=ku[g],d=u(p,g,h)):(c=ku[f],d=u(p,f,h)))}let m=a;return e[a]<n[na[a]]&&e[a]<e[vs[a]]&&(m=vs[a]),{placement:c!=="center"?`${m}-${c}`:m,left:d.left,top:d.top}}function bw(t,e){return e?gw[t]:mw[t]}function _w(t,e,n,r,s,o){if(o)switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+s)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+s)}px`,transform:"translateX(-50%)"}}}const ww=Jn([Jn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Jn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Jn("> *",{pointerEvents:"all"})])]),vu=i.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(t){const e=i.inject("VBinder"),n=Ut(()=>t.enabled!==void 0?t.enabled:t.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:m}=t;m.includes("scroll")&&e.addScrollListener(c),m.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=bi();ww.mount({id:"vueuc/binder",head:!0,anchorMetaName:ta,ssr:l}),i.onBeforeUnmount(()=>{a()}),D1(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const m=r.value;if(m===null)return;const g=e.targetRef,{x:f,y:p,overlap:b}=t,y=f!==void 0&&p!==void 0?j1(f,p):Qo(g);m.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),m.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:_,minWidth:S,placement:v,internalShift:T,flip:R}=t;m.setAttribute("v-placement",v),b?m.setAttribute("v-overlap",""):m.removeAttribute("v-overlap");const{style:w}=m;_==="target"?w.width=`${y.width}px`:_!==void 0?w.width=_:w.width="",S==="target"?w.minWidth=`${y.width}px`:S!==void 0?w.minWidth=S:w.minWidth="";const B=Qo(m),x=Qo(s.value),{left:$,top:P,placement:A}=yw(v,y,B,T,R,b),V=bw(A,b),{left:F,top:N,transform:Y}=_w(A,x,y,P,$,b);m.setAttribute("v-placement",A),m.style.setProperty("--v-offset-left",`${Math.round($)}px`),m.style.setProperty("--v-offset-top",`${Math.round(P)}px`),m.style.transform=`translateX(${F}) translateY(${N}) ${Y}`,m.style.setProperty("--v-transform-origin",V),m.style.transformOrigin=V};i.watch(n,m=>{m?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(m=>console.error(m))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(m=>{i.watch(i.toRef(t,m),c)}),["teleportDisabled"].forEach(m=>{i.watch(i.toRef(t,m),d)}),i.watch(i.toRef(t,"syncTrigger"),m=>{m.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),m.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const u=_s(),h=Ut(()=>{const{to:m}=t;if(m!==void 0)return m;u.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:h,syncPosition:c}},render(){return i.h(fw,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?i.withDirectives(n,[[nu,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var _i=[],xw=function(){return _i.some(function(t){return t.activeTargets.length>0})},kw=function(){return _i.some(function(t){return t.skippedTargets.length>0})},Cu="ResizeObserver loop completed with undelivered notifications.",vw=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Cu}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Cu),window.dispatchEvent(t)},wr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(wr||(wr={}));var wi=function(t){return Object.freeze(t)},Cw=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,wi(this)}return t})(),Su=(function(){function t(e,n,r,s){return this.x=e,this.y=n,this.width=r,this.height=s,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,wi(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,s=e.top,o=e.right,a=e.bottom,l=e.left,c=e.width,d=e.height;return{x:n,y:r,top:s,right:o,bottom:a,left:l,width:c,height:d}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),ia=function(t){return t instanceof SVGElement&&"getBBox"in t},Bu=function(t){if(ia(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var s=t,o=s.offsetWidth,a=s.offsetHeight;return!(o||a||t.getClientRects().length)},Tu=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},Sw=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},xr=typeof window<"u"?window:{},Cs=new WeakMap,Ru=/auto|scroll/,Bw=/^tb|vertical/,Tw=/msie|trident/i.test(xr.navigator&&xr.navigator.userAgent),xn=function(t){return parseFloat(t||"0")},Ji=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new Cw((n?e:t)||0,(n?t:e)||0)},$u=wi({devicePixelContentBoxSize:Ji(),borderBoxSize:Ji(),contentBoxSize:Ji(),contentRect:new Su(0,0,0,0)}),Pu=function(t,e){if(e===void 0&&(e=!1),Cs.has(t)&&!e)return Cs.get(t);if(Bu(t))return Cs.set(t,$u),$u;var n=getComputedStyle(t),r=ia(t)&&t.ownerSVGElement&&t.getBBox(),s=!Tw&&n.boxSizing==="border-box",o=Bw.test(n.writingMode||""),a=!r&&Ru.test(n.overflowY||""),l=!r&&Ru.test(n.overflowX||""),c=r?0:xn(n.paddingTop),d=r?0:xn(n.paddingRight),u=r?0:xn(n.paddingBottom),h=r?0:xn(n.paddingLeft),m=r?0:xn(n.borderTopWidth),g=r?0:xn(n.borderRightWidth),f=r?0:xn(n.borderBottomWidth),p=r?0:xn(n.borderLeftWidth),b=h+d,y=c+u,_=p+g,S=m+f,v=l?t.offsetHeight-S-t.clientHeight:0,T=a?t.offsetWidth-_-t.clientWidth:0,R=s?b+_:0,w=s?y+S:0,B=r?r.width:xn(n.width)-R-T,x=r?r.height:xn(n.height)-w-v,$=B+b+T+_,P=x+y+v+S,A=wi({devicePixelContentBoxSize:Ji(Math.round(B*devicePixelRatio),Math.round(x*devicePixelRatio),o),borderBoxSize:Ji($,P,o),contentBoxSize:Ji(B,x,o),contentRect:new Su(h,c,B,x)});return Cs.set(t,A),A},Nu=function(t,e,n){var r=Pu(t,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case wr.DEVICE_PIXEL_CONTENT_BOX:return a;case wr.BORDER_BOX:return s;default:return o}},Rw=(function(){function t(e){var n=Pu(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=wi([n.borderBoxSize]),this.contentBoxSize=wi([n.contentBoxSize]),this.devicePixelContentBoxSize=wi([n.devicePixelContentBoxSize])}return t})(),Eu=function(t){if(Bu(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},$w=function(){var t=1/0,e=[];_i.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var u=new Rw(d.target),h=Eu(d.target);l.push(u),d.lastReportedSize=Nu(d.target,d.observedBox),h<t&&(t=h)}),e.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var s=r[n];s()}return t},Fu=function(t){_i.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(Eu(s.target)>t?n.activeTargets.push(s):n.skippedTargets.push(s))})})},Pw=function(){var t=0;for(Fu(t);xw();)t=$w(),Fu(t);return kw()&&vw(),t>0},ra,Au=[],Nw=function(){return Au.splice(0).forEach(function(t){return t()})},Ew=function(t){if(!ra){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Nw()}).observe(n,r),ra=function(){n.textContent="".concat(e?e--:e++)}}Au.push(t),ra()},Fw=function(t){Ew(function(){requestAnimationFrame(t)})},Ss=0,Aw=function(){return!!Ss},Mw=250,Vw={attributes:!0,characterData:!0,childList:!0,subtree:!0},Mu=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Vu=function(t){return t===void 0&&(t=0),Date.now()+t},sa=!1,Iw=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=Mw),!sa){sa=!0;var r=Vu(e);Fw(function(){var s=!1;try{s=Pw()}finally{if(sa=!1,e=r-Vu(),!Aw())return;s?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,Vw)};document.body?n():xr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Mu.forEach(function(n){return xr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Mu.forEach(function(n){return xr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),oa=new Iw,Iu=function(t){!Ss&&t>0&&oa.start(),Ss+=t,!Ss&&oa.stop()},Ow=function(t){return!ia(t)&&!Sw(t)&&getComputedStyle(t).display==="inline"},zw=(function(){function t(e,n){this.target=e,this.observedBox=n||wr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Nu(this.target,this.observedBox,!0);return Ow(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),Lw=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Bs=new WeakMap,Ou=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Ts=(function(){function t(){}return t.connect=function(e,n){var r=new Lw(e,n);Bs.set(e,r)},t.observe=function(e,n,r){var s=Bs.get(e),o=s.observationTargets.length===0;Ou(s.observationTargets,n)<0&&(o&&_i.push(s),s.observationTargets.push(new zw(n,r&&r.box)),Iu(1),oa.schedule())},t.unobserve=function(e,n){var r=Bs.get(e),s=Ou(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&_i.splice(_i.indexOf(r),1),r.observationTargets.splice(s,1),Iu(-1))},t.disconnect=function(e){var n=this,r=Bs.get(e);r.observationTargets.slice().forEach(function(s){return n.unobserve(e,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),Dw=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Ts.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Tu(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ts.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Tu(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ts.unobserve(this,e)},t.prototype.disconnect=function(){Ts.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class Hw{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Dw)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const n of e){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(e,n){this.elHandlersMap.set(e,n),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const kr=new Hw,Rs=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const n=i.getCurrentInstance().proxy;function r(s){const{onResize:o}=t;o!==void 0&&o(s)}i.onMounted(()=>{const s=n.$el;if(s===void 0){cu("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){cu("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(kr.registerHandler(s.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&kr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let $s;function Ww(){return typeof document>"u"?!1:($s===void 0&&("matchMedia"in window?$s=window.matchMedia("(pointer:coarse)").matches:$s=!1),$s)}let aa;function zu(){return typeof document>"u"?1:(aa===void 0&&(aa="chrome"in window?window.devicePixelRatio:1),aa)}const Lu="VVirtualListXScroll";function jw({columnsRef:t,renderColRef:e,renderItemWithColsRef:n}){const r=i.ref(0),s=i.ref(0),o=i.computed(()=>{const d=t.value;if(d.length===0)return null;const u=new bu(d.length,0);return d.forEach((h,m)=>{u.add(m,h.width)}),u}),a=Ut(()=>{const d=o.value;return d!==null?Math.max(d.getBound(s.value)-1,0):0}),l=d=>{const u=o.value;return u!==null?u.sum(d):0},c=Ut(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,t.value.length-1):0});return i.provide(Lu,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Du=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:t,endIndexRef:e,columnsRef:n,getLeft:r,renderColRef:s,renderItemWithColsRef:o}=i.inject(Lu);return{startIndex:t,endIndex:e,columns:n,renderCol:s,renderItemWithCols:o,getLeft:r}},render(){const{startIndex:t,endIndex:e,columns:n,renderCol:r,renderItemWithCols:s,getLeft:o,item:a}=this;if(s!=null)return s({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:n,item:a,getLeft:o});if(r!=null){const l=[];for(let c=t;c<=e;++c){const d=n[c];l.push(r({column:d,left:o(c),item:a}))}return l}return null}}),qw=Jn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Jn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Jn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Xw=i.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(t){const e=bi();qw.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:ta,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:V,defaultScrollKey:F}=t;V!=null?b({index:V}):F!=null&&b({key:F})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}b({top:g.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=Ut(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let V=0;return t.columns.forEach(F=>{V+=F.width}),V}),o=i.computed(()=>{const V=new Map,{keyField:F}=t;return t.items.forEach((N,Y)=>{V.set(N[F],Y)}),V}),{scrollLeftRef:a,listWidthRef:l}=jw({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),u=new Map,h=i.computed(()=>{const{items:V,itemSize:F,keyField:N}=t,Y=new bu(V.length,F);return V.forEach((ee,I)=>{const z=ee[N],q=u.get(z);q!==void 0&&Y.add(I,q)}),Y}),m=i.ref(0),g=i.ref(0),f=Ut(()=>Math.max(h.value.getBound(g.value-yr(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:V}=d;if(V===void 0)return[];const{items:F,itemSize:N}=t,Y=f.value,ee=Math.min(Y+Math.ceil(V/N+1),F.length-1),I=[];for(let z=Y;z<=ee;++z)I.push(F[z]);return I}),b=(V,F)=>{if(typeof V=="number"){v(V,F,"auto");return}const{left:N,top:Y,index:ee,key:I,position:z,behavior:q,debounce:W=!0}=V;if(N!==void 0||Y!==void 0)v(N,Y,q);else if(ee!==void 0)S(ee,q,W);else if(I!==void 0){const O=o.value.get(I);O!==void 0&&S(O,q,W)}else z==="bottom"?v(0,Number.MAX_SAFE_INTEGER,q):z==="top"&&v(0,0,q)};let y,_=null;function S(V,F,N){const{value:Y}=h,ee=Y.sum(V)+yr(t.paddingTop);if(!N)c.value.scrollTo({left:0,top:ee,behavior:F});else{y=V,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{y=void 0,_=null},16);const{scrollTop:I,offsetHeight:z}=c.value;if(ee>I){const q=Y.get(V);ee+q<=I+z||c.value.scrollTo({left:0,top:ee+q-z,behavior:F})}else c.value.scrollTo({left:0,top:ee,behavior:F})}}function v(V,F,N){c.value.scrollTo({left:V,top:F,behavior:N})}function T(V,F){var N,Y,ee;if(n||t.ignoreItemResize||A(F.target))return;const{value:I}=h,z=o.value.get(V),q=I.get(z),W=(ee=(Y=(N=F.borderBoxSize)===null||N===void 0?void 0:N[0])===null||Y===void 0?void 0:Y.blockSize)!==null&&ee!==void 0?ee:F.contentRect.height;if(W===q)return;W-t.itemSize===0?u.delete(V):u.set(V,W-t.itemSize);const D=W-q;if(D===0)return;I.add(z,D);const j=c.value;if(j!=null){if(y===void 0){const G=I.sum(z);j.scrollTop>G&&j.scrollBy(0,D)}else if(z<y)j.scrollBy(0,D);else if(z===y){const G=I.sum(z);W+G>j.scrollTop+j.offsetHeight&&j.scrollBy(0,D)}P()}m.value++}const R=!Ww();let w=!1;function B(V){var F;(F=t.onScroll)===null||F===void 0||F.call(t,V),(!R||!w)&&P()}function x(V){var F;if((F=t.onWheel)===null||F===void 0||F.call(t,V),R){const N=c.value;if(N!=null){if(V.deltaX===0&&(N.scrollTop===0&&V.deltaY<=0||N.scrollTop+N.offsetHeight>=N.scrollHeight&&V.deltaY>=0))return;V.preventDefault(),N.scrollTop+=V.deltaY/zu(),N.scrollLeft+=V.deltaX/zu(),P(),w=!0,qd(()=>{w=!1})}}}function $(V){if(n||A(V.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(V.contentRect.height===d.value)return}else if(V.contentRect.height===d.value&&V.contentRect.width===l.value)return;d.value=V.contentRect.height,l.value=V.contentRect.width;const{onResize:F}=t;F!==void 0&&F(V)}function P(){const{value:V}=c;V!=null&&(g.value=V.scrollTop,a.value=V.scrollLeft)}function A(V){let F=V;for(;F!==null;){if(F.style.display==="none")return!0;F=F.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:V}=t,F=br(h.value.sum());return m.value,[t.itemsStyle,{boxSizing:"content-box",width:br(s.value),height:V?"":F,minHeight:V?F:"",paddingTop:br(t.paddingTop),paddingBottom:br(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(m.value,{transform:`translateY(${br(h.value.sum(f.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:b,handleListResize:$,handleListScroll:B,handleListWheel:x,handleItemResize:T}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(Rs,{onResize:this.handleListResize},{default:()=>{var s,o;return i.h("div",i.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?i.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[i.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[e],u=n.get(d),h=a!=null?i.h(Du,{index:u,item:c}):void 0,m=l!=null?i.h(Du,{index:u,item:c}):void 0,g=this.$slots.default({item:c,renderedCols:h,renderedItemWithCols:m,index:u})[0];return t?i.h(Rs,{key:d,onResize:f=>this.handleItemResize(d,f)},{default:()=>g}):(g.key=d,g)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),Pn="v-hidden",Yw=Jn("[v-hidden]",{display:"none!important"}),Hu=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:e}){const n=i.ref(null),r=i.ref(null);function s(a){const{value:l}=n,{getCounter:c,getTail:d}=t;let u;if(c!==void 0?u=c():u=r.value,!l||!u)return;u.hasAttribute(Pn)&&u.removeAttribute(Pn);const{children:h}=l;if(a.showAllItemsBeforeCalculate)for(const S of h)S.hasAttribute(Pn)&&S.removeAttribute(Pn);const m=l.offsetWidth,g=[],f=e.tail?d==null?void 0:d():null;let p=f?f.offsetWidth:0,b=!1;const y=l.children.length-(e.tail?1:0);for(let S=0;S<y-1;++S){if(S<0)continue;const v=h[S];if(b){v.hasAttribute(Pn)||v.setAttribute(Pn,"");continue}else v.hasAttribute(Pn)&&v.removeAttribute(Pn);const T=v.offsetWidth;if(p+=T,g[S]=T,p>m){const{updateCounter:R}=t;for(let w=S;w>=0;--w){const B=y-1-w;R!==void 0?R(B):u.textContent=`${B}`;const x=u.offsetWidth;if(p-=g[w],p+x<=m||w===0){b=!0,S=w-1,f&&(S===-1?(f.style.maxWidth=`${m-x}px`,f.style.boxSizing="border-box"):f.style.maxWidth="");const{onUpdateCount:$}=t;$&&$(B);break}}}}const{onUpdateOverflow:_}=t;b?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(Pn,""))}const o=bi();return Yw.mount({id:"vueuc/overflow",head:!0,anchorMetaName:ta,ssr:o}),i.onMounted(()=>s({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:s}},render(){const{$slots:t}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(t,"default"),t.counter?t.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});function Wu(t){return t instanceof HTMLElement}function ju(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Wu(n)&&(Xu(n)||ju(n)))return!0}return!1}function qu(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Wu(n)&&(Xu(n)||qu(n)))return!0}return!1}function Xu(t){if(!Uw(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function Uw(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.getAttribute("disabled"))return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return t.type!=="hidden"&&t.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let vr=[];const Kw=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=i1(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return vr[vr.length-1]===e}function c(b){var y;b.code==="Escape"&&l()&&((y=t.onEsc)===null||y===void 0||y.call(t,b))}i.onMounted(()=>{i.watch(()=>t.active,b=>{b?(h(),Bt("keydown",document,c)):(it("keydown",document,c),s&&m())},{immediate:!0})}),i.onBeforeUnmount(()=>{it("keydown",document,c),s&&m()});function d(b){if(!o&&l()){const y=u();if(y===null||y.contains(pr(b)))return;g("first")}}function u(){const b=n.value;if(b===null)return null;let y=b;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function h(){var b;if(!t.disabled){if(vr.push(e),t.autoFocus){const{initialFocusTo:y}=t;y===void 0?g("first"):(b=_u(y))===null||b===void 0||b.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function m(){var b;if(t.disabled||(document.removeEventListener("focus",d,!0),vr=vr.filter(_=>_!==e),l()))return;const{finalFocusTo:y}=t;y!==void 0?(b=_u(y))===null||b===void 0||b.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function g(b){if(l()&&t.active){const y=n.value,_=r.value;if(y!==null&&_!==null){const S=u();if(S==null||S===_){o=!0,y.focus({preventScroll:!0}),o=!1;return}o=!0;const v=b==="first"?ju(S):qu(S);o=!1,v||(o=!0,y.focus({preventScroll:!0}),o=!1)}}}function f(b){if(o)return;const y=u();y!==null&&(b.relatedTarget!==null&&y.contains(b.relatedTarget)?g("last"):g("first"))}function p(b){o||(b.relatedTarget!==null&&b.relatedTarget===n.value?g("last"):g("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:f,handleEndFocus:p}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),t(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function YC(t){return t}const la="n-internal-select-menu",Yu="n-internal-select-menu-body",Uu="n-drawer-body",Ku="n-modal-body",Gu="n-popover-body",Zu="__disabled__";function Nn(t){const e=i.inject(Ku,null),n=i.inject(Uu,null),r=i.inject(Gu,null),s=i.inject(Yu,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{Bt("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{it("fullscreenchange",document,a)})}return Ut(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?Zu:l===!0?o.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:s!=null&&s.value?s.value:l??(o.value||"body")})}Nn.tdkey=Zu,Nn.propTo={type:[String,Object,Boolean],default:void 0};function Gw(t){const e={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(e.isDeactivated=!1,!n){n=!0;return}t()}),i.onDeactivated(()=>{e.isDeactivated=!0,n||(n=!0)}),e}function Qu(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&kr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&kr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&kr.unregisterHandler(n)}))}function Ju(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const Zw=/^(\d|\.)+$/,eh=/(\d|\.)+/;function ca(t,{c:e=1,offset:n=0,attachPx:r=!0}={}){if(typeof t=="number"){const s=(t+n)*e;return s===0?"0":`${s}px`}else if(typeof t=="string")if(Zw.test(t)){const s=(Number(t)+n)*e;return r?s===0?"0":`${s}px`:`${s}`}else{const s=eh.exec(t);return s?t.replace(eh,String((Number(s[0])+n)*e)):t}return t}function th(t){const{left:e,right:n,top:r,bottom:s}=en(t);return`${r} ${e} ${s} ${n}`}var nh={};function Qw(t){let e=".",n="__",r="--",s;if(t){let f=t.blockPrefix;f&&(e=f),f=t.elementPrefix,f&&(n=f),f=t.modifierPrefix,f&&(r=f)}const o={install(f){s=f.c;const p=f.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(f){let p,b;return{before(y){p=y.bem.b,b=y.bem.els,y.bem.els=null},after(y){y.bem.b=p,y.bem.els=b},$({context:y,props:_}){return f=typeof f=="string"?f:f({context:y,props:_}),y.bem.b=f,`${(_==null?void 0:_.bPrefix)||e}${y.bem.b}`}}}function l(f){let p;return{before(b){p=b.bem.els},after(b){b.bem.els=p},$({context:b,props:y}){return f=typeof f=="string"?f:f({context:b,props:y}),b.bem.els=f.split(",").map(_=>_.trim()),b.bem.els.map(_=>`${(y==null?void 0:y.bPrefix)||e}${b.bem.b}${n}${_}`).join(", ")}}}function c(f){return{$({context:p,props:b}){f=typeof f=="string"?f:f({context:p,props:b});const y=f.split(",").map(v=>v.trim());function _(v){return y.map(T=>`&${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${v!==void 0?`${n}${v}`:""}${r}${T}`).join(", ")}const S=p.bem.els;if(S!==null){if(nh.NODE_ENV!=="production"&&S.length>=2)throw Error(`[css-render/plugin-bem]: m(${f}) is invalid, using modifier inside multiple elements is not allowed`);return _(S[0])}else return _()}}}function d(f){return{$({context:p,props:b}){f=typeof f=="string"?f:f({context:p,props:b});const y=p.bem.els;if(nh.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${f}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${y!==null&&y.length>0?`${n}${y[0]}`:""}${r}${f})`}}}return Object.assign(o,{cB:((...f)=>s(a(f[0]),f[1],f[2])),cE:((...f)=>s(l(f[0]),f[1],f[2])),cM:((...f)=>s(c(f[0]),f[1],f[2])),cNotM:((...f)=>s(d(f[0]),f[1],f[2]))}),o}const Jw=".n-",ex="__",tx="--",ih=pu(),rh=Qw({blockPrefix:Jw,elementPrefix:ex,modifierPrefix:tx});ih.use(rh);const{c:ce,find:KC}=ih,{cB:ge,cE:be,cM:Se,cNotM:tn}=rh,nx=(...t)=>ce(">",[ge(...t)]);function Ze(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let da;function ix(){return da===void 0&&(da=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),da}const rx=new WeakSet;function sx(t){rx.add(t)}function sh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const oh=new Set;function ei(t,e){const n=`[naive/${t}]: ${e}`;oh.has(n)||(oh.add(n),console.error(n))}function ah(t,e){console.error(`[naive/${t}]: ${e}`)}function lh(t,e){throw new Error(`[naive/${t}]: ${e}`)}function gt(t,...e){if(Array.isArray(t))t.forEach(n=>gt(n,...e));else return t(...e)}function ua(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){ua(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ua(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function ox(t,e="default",n=void 0){const r=t[e];if(!r)return ah("getFirstSlotVNode",`slot[${e}] is empty`),null;const s=ua(r(n));return s.length===1?s[0]:(ah("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function ax(t,e=[],n){const r={};return e.forEach(s=>{r[s]=t[s]}),Object.assign(r,n)}function ha(t){const e=t.filter(n=>n!==void 0);if(e.length!==0)return e.length===1?e[0]:n=>{t.forEach(r=>{r&&r(n)})}}function er(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function Ps(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!Ps(e.children)):!0)?t:null}function fa(t,e){return t&&Ps(t())||e()}function xi(t,e){const n=t&&Ps(t());return e(n||null)}function ch(t){return!(t&&Ps(t()))}const ma=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),ki="n-config-provider",lx="n";function vi(t={},e={defaultBordered:!0}){const n=i.inject(ki,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,s;const{bordered:o}=t;return o!==void 0?o:(s=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&s!==void 0?s:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(lx),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function Ci(t,e,n,r){n||lh("useThemeClass","cssVarsRef is not passed");const s=i.inject(ki,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=bi();let d;const u=`__${t}`,h=()=>{let m=u;const g=e?e.value:void 0,f=o==null?void 0:o.value;f&&(m+=`-${f}`),g&&(m+=`-${g}`);const{themeOverrides:p,builtinThemeOverrides:b}=r;p&&(m+=`-${ea(JSON.stringify(p))}`),b&&(m+=`-${ea(JSON.stringify(b))}`),l.value=m,d=()=>{const y=n.value;let _="";for(const S in y)_+=`${S}: ${y[S]};`;ce(`.${m}`,_).mount({id:m,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{h()}),{themeClass:l,onRender:()=>{d==null||d()}}}const dh="n-form-item";function cx(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(dh,null);i.provide(dh,null);const o=i.computed(n?()=>n(s):()=>{const{size:c}=t;if(c)return c;if(s){const{mergedSize:d}=s;if(d.value!==void 0)return d.value}return e}),a=i.computed(r?()=>r(s):()=>{const{disabled:c}=t;return c!==void 0?c:s?s.disabled.value:!1}),l=i.computed(()=>{const{status:c}=t;return c||(s==null?void 0:s.mergedValidationStatus.value)});return i.onBeforeUnmount(()=>{s&&s.restoreValidation()}),{mergedSizeRef:o,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){s&&s.handleContentBlur()},nTriggerFormChange(){s&&s.handleContentChange()},nTriggerFormFocus(){s&&s.handleContentFocus()},nTriggerFormInput(){s&&s.handleContentInput()}}}const dx={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:t=>`Please load all ${t}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:t=>`Total ${t} items`,selected:t=>`${t} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"},Heatmap:{less:"less",more:"more",monthFormat:"MMM",weekdayFormat:"eee"}};function ga(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function Cr(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[a]}const o=t.argumentCallback?t.argumentCallback(e):e;return s[o]}}function Sr(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(s);if(!o)return null;const a=o[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?hx(l,h=>h.test(a)):ux(l,h=>h.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function ux(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function hx(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function fx(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],o=e.match(t.parsePattern);if(!o)return null;let a=t.valueCallback?t.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const mx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},gx=(t,e,n)=>{let r;const s=mx[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},px={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},yx=(t,e,n,r)=>px[t],bx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_x={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},wx={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},xx={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},kx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},vx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Cx={ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Cr({values:bx,defaultWidth:"wide"}),quarter:Cr({values:_x,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Cr({values:wx,defaultWidth:"wide"}),day:Cr({values:xx,defaultWidth:"wide"}),dayPeriod:Cr({values:kx,defaultWidth:"wide",formattingValues:vx,defaultFormattingWidth:"wide"})},Sx=/^(\d+)(th|st|nd|rd)?/i,Bx=/\d+/i,Tx={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Rx={any:[/^b/i,/^(a|c)/i]},$x={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Px={any:[/1/i,/2/i,/3/i,/4/i]},Nx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ex={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Fx={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ax={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Mx={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Vx={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Ix={ordinalNumber:fx({matchPattern:Sx,parsePattern:Bx,valueCallback:t=>parseInt(t,10)}),era:Sr({matchPatterns:Tx,defaultMatchWidth:"wide",parsePatterns:Rx,defaultParseWidth:"any"}),quarter:Sr({matchPatterns:$x,defaultMatchWidth:"wide",parsePatterns:Px,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Sr({matchPatterns:Nx,defaultMatchWidth:"wide",parsePatterns:Ex,defaultParseWidth:"any"}),day:Sr({matchPatterns:Fx,defaultMatchWidth:"wide",parsePatterns:Ax,defaultParseWidth:"any"}),dayPeriod:Sr({matchPatterns:Mx,defaultMatchWidth:"any",parsePatterns:Vx,defaultParseWidth:"any"})},Ox={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Lx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Dx={date:ga({formats:Ox,defaultWidth:"full"}),time:ga({formats:zx,defaultWidth:"full"}),dateTime:ga({formats:Lx,defaultWidth:"full"})},Hx={name:"en-US",locale:{code:"en-US",formatDistance:gx,formatLong:Dx,formatRelative:yx,localize:Cx,match:Ix,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function uh(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(ki,null)||{},r=i.computed(()=>{var o,a;return(a=(o=e==null?void 0:e.value)===null||o===void 0?void 0:o[t])!==null&&a!==void 0?a:dx[t]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:Hx}),localeRef:r}}const Br="naive-ui-style";function Tr(t,e,n){if(!e)return;const r=bi(),s=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),o=i.inject(ki,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(hw(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:Br,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const Rr={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:Wx,fontFamily:jx,lineHeight:qx}=Rr,hh=ce("body",`
116
+ `)}function ta(t){for(var e=0,n,r=0,s=t.length;s>=4;++r,s-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(s){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function ow(t,e,n,r){const{els:s}=e;if(n===void 0)s.forEach(uu),e.els=[];else{const o=ws(n,r);o&&s.includes(o)&&(uu(o),e.els=s.filter(a=>a!==o))}}function gu(t,e){t.push(e)}function aw(t,e,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=ta(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const u=ws(n,l);if(u!==null&&!o)return u;const h=u??tw(n);if(d===void 0&&(d=e.render(r)),h.textContent=d,u!==null)return u;if(a){const m=l.querySelector(`meta[name="${a}"]`);if(m)return l.insertBefore(h,m),gu(e.els,h),h}return s?l.insertBefore(h,l.querySelector("style, link")):l.appendChild(h),gu(e.els,h),h}function lw(t){return sw(this,this.instance,t)}function cw(t={}){const{id:e,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=t;return aw(this.instance,this,e,r,s,o,a,l,n)}function dw(t={}){const{id:e,parent:n}=t;ow(this.instance,this,e,n)}const ks=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:lw,mount:cw,unmount:dw}},uw=function(t,e,n,r){return Array.isArray(e)?ks(t,{$:null},null,e):Array.isArray(n)?ks(t,e,null,n):Array.isArray(r)?ks(t,e,n,r):ks(t,e,n,null)};function pu(t={}){const e={c:((...n)=>uw(e,...n)),use:(n,...r)=>n.install(e,...r),find:ws,context:{},config:t};return e}function hw(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return ws(t)!==null}const{c:Jn}=pu(),na="vueuc-style";function yu(t){return t&-t}class bu{constructor(e,n){this.l=e,this.min=n;const r=new Array(e+1);for(let s=0;s<e+1;++s)r[s]=0;this.ft=r}add(e,n){if(n===0)return;const{l:r,ft:s}=this;for(e+=1;e<=r;)s[e]+=n,e+=yu(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:n,min:r,l:s}=this;if(e>s)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let o=e*r;for(;e>0;)o+=n[e],e-=yu(e);return o}getBound(e){let n=0,r=this.l;for(;r>n;){const s=Math.floor((n+r)/2),o=this.sum(s);if(o>e){r=s;continue}else if(o<e){if(n===s)return this.sum(n+1)<=e?n+1:s;n=s}else return s}return n}}function _u(t){return typeof t=="string"?document.querySelector(t):t()||null}const fw=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:z1(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Zo("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Zo("lazy-teleport",this.$slots)):null}}),vs={top:"bottom",bottom:"top",left:"right",right:"left"},wu={start:"end",center:"center",end:"start"},ia={top:"height",bottom:"height",left:"width",right:"width"},mw={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},gw={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},pw={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},xu={top:!0,bottom:!1,left:!0,right:!1},ku={top:"end",bottom:"start",left:"end",right:"start"};function yw(t,e,n,r,s,o){if(!s||o)return{placement:t,top:0,left:0};const[a,l]=t.split("-");let c=l??"center",d={top:0,left:0};const u=(g,f,p)=>{let b=0,y=0;const _=n[g]-e[f]-e[g];return _>0&&r&&(p?y=xu[f]?_:-_:b=xu[f]?_:-_),{left:b,top:y}},h=a==="left"||a==="right";if(c!=="center"){const g=pw[t],f=vs[g],p=ia[g];if(n[p]>e[p]){if(e[g]+e[p]<n[p]){const b=(n[p]-e[p])/2;e[g]<b||e[f]<b?e[g]<e[f]?(c=wu[l],d=u(p,f,h)):d=u(p,g,h):c="center"}}else n[p]<e[p]&&e[f]<0&&e[g]>e[f]&&(c=wu[l])}else{const g=a==="bottom"||a==="top"?"left":"top",f=vs[g],p=ia[g],b=(n[p]-e[p])/2;(e[g]<b||e[f]<b)&&(e[g]>e[f]?(c=ku[g],d=u(p,g,h)):(c=ku[f],d=u(p,f,h)))}let m=a;return e[a]<n[ia[a]]&&e[a]<e[vs[a]]&&(m=vs[a]),{placement:c!=="center"?`${m}-${c}`:m,left:d.left,top:d.top}}function bw(t,e){return e?gw[t]:mw[t]}function _w(t,e,n,r,s,o){if(o)switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+s)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+s)}px`,transform:"translateX(-50%)"}}}const ww=Jn([Jn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Jn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Jn("> *",{pointerEvents:"all"})])]),vu=i.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(t){const e=i.inject("VBinder"),n=Ut(()=>t.enabled!==void 0?t.enabled:t.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:m}=t;m.includes("scroll")&&e.addScrollListener(c),m.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=bi();ww.mount({id:"vueuc/binder",head:!0,anchorMetaName:na,ssr:l}),i.onBeforeUnmount(()=>{a()}),D1(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const m=r.value;if(m===null)return;const g=e.targetRef,{x:f,y:p,overlap:b}=t,y=f!==void 0&&p!==void 0?j1(f,p):Jo(g);m.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),m.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:_,minWidth:S,placement:v,internalShift:T,flip:R}=t;m.setAttribute("v-placement",v),b?m.setAttribute("v-overlap",""):m.removeAttribute("v-overlap");const{style:w}=m;_==="target"?w.width=`${y.width}px`:_!==void 0?w.width=_:w.width="",S==="target"?w.minWidth=`${y.width}px`:S!==void 0?w.minWidth=S:w.minWidth="";const B=Jo(m),x=Jo(s.value),{left:$,top:P,placement:A}=yw(v,y,B,T,R,b),V=bw(A,b),{left:F,top:N,transform:Y}=_w(A,x,y,P,$,b);m.setAttribute("v-placement",A),m.style.setProperty("--v-offset-left",`${Math.round($)}px`),m.style.setProperty("--v-offset-top",`${Math.round(P)}px`),m.style.transform=`translateX(${F}) translateY(${N}) ${Y}`,m.style.setProperty("--v-transform-origin",V),m.style.transformOrigin=V};i.watch(n,m=>{m?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(m=>console.error(m))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(m=>{i.watch(i.toRef(t,m),c)}),["teleportDisabled"].forEach(m=>{i.watch(i.toRef(t,m),d)}),i.watch(i.toRef(t,"syncTrigger"),m=>{m.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),m.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const u=_s(),h=Ut(()=>{const{to:m}=t;if(m!==void 0)return m;u.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:h,syncPosition:c}},render(){return i.h(fw,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?i.withDirectives(n,[[nu,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var _i=[],xw=function(){return _i.some(function(t){return t.activeTargets.length>0})},kw=function(){return _i.some(function(t){return t.skippedTargets.length>0})},Cu="ResizeObserver loop completed with undelivered notifications.",vw=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Cu}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Cu),window.dispatchEvent(t)},wr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(wr||(wr={}));var wi=function(t){return Object.freeze(t)},Cw=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,wi(this)}return t})(),Su=(function(){function t(e,n,r,s){return this.x=e,this.y=n,this.width=r,this.height=s,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,wi(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,s=e.top,o=e.right,a=e.bottom,l=e.left,c=e.width,d=e.height;return{x:n,y:r,top:s,right:o,bottom:a,left:l,width:c,height:d}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),ra=function(t){return t instanceof SVGElement&&"getBBox"in t},Bu=function(t){if(ra(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var s=t,o=s.offsetWidth,a=s.offsetHeight;return!(o||a||t.getClientRects().length)},Tu=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},Sw=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},xr=typeof window<"u"?window:{},Cs=new WeakMap,Ru=/auto|scroll/,Bw=/^tb|vertical/,Tw=/msie|trident/i.test(xr.navigator&&xr.navigator.userAgent),xn=function(t){return parseFloat(t||"0")},Ji=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new Cw((n?e:t)||0,(n?t:e)||0)},$u=wi({devicePixelContentBoxSize:Ji(),borderBoxSize:Ji(),contentBoxSize:Ji(),contentRect:new Su(0,0,0,0)}),Pu=function(t,e){if(e===void 0&&(e=!1),Cs.has(t)&&!e)return Cs.get(t);if(Bu(t))return Cs.set(t,$u),$u;var n=getComputedStyle(t),r=ra(t)&&t.ownerSVGElement&&t.getBBox(),s=!Tw&&n.boxSizing==="border-box",o=Bw.test(n.writingMode||""),a=!r&&Ru.test(n.overflowY||""),l=!r&&Ru.test(n.overflowX||""),c=r?0:xn(n.paddingTop),d=r?0:xn(n.paddingRight),u=r?0:xn(n.paddingBottom),h=r?0:xn(n.paddingLeft),m=r?0:xn(n.borderTopWidth),g=r?0:xn(n.borderRightWidth),f=r?0:xn(n.borderBottomWidth),p=r?0:xn(n.borderLeftWidth),b=h+d,y=c+u,_=p+g,S=m+f,v=l?t.offsetHeight-S-t.clientHeight:0,T=a?t.offsetWidth-_-t.clientWidth:0,R=s?b+_:0,w=s?y+S:0,B=r?r.width:xn(n.width)-R-T,x=r?r.height:xn(n.height)-w-v,$=B+b+T+_,P=x+y+v+S,A=wi({devicePixelContentBoxSize:Ji(Math.round(B*devicePixelRatio),Math.round(x*devicePixelRatio),o),borderBoxSize:Ji($,P,o),contentBoxSize:Ji(B,x,o),contentRect:new Su(h,c,B,x)});return Cs.set(t,A),A},Nu=function(t,e,n){var r=Pu(t,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case wr.DEVICE_PIXEL_CONTENT_BOX:return a;case wr.BORDER_BOX:return s;default:return o}},Rw=(function(){function t(e){var n=Pu(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=wi([n.borderBoxSize]),this.contentBoxSize=wi([n.contentBoxSize]),this.devicePixelContentBoxSize=wi([n.devicePixelContentBoxSize])}return t})(),Eu=function(t){if(Bu(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},$w=function(){var t=1/0,e=[];_i.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var u=new Rw(d.target),h=Eu(d.target);l.push(u),d.lastReportedSize=Nu(d.target,d.observedBox),h<t&&(t=h)}),e.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var s=r[n];s()}return t},Fu=function(t){_i.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(Eu(s.target)>t?n.activeTargets.push(s):n.skippedTargets.push(s))})})},Pw=function(){var t=0;for(Fu(t);xw();)t=$w(),Fu(t);return kw()&&vw(),t>0},sa,Au=[],Nw=function(){return Au.splice(0).forEach(function(t){return t()})},Ew=function(t){if(!sa){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Nw()}).observe(n,r),sa=function(){n.textContent="".concat(e?e--:e++)}}Au.push(t),sa()},Fw=function(t){Ew(function(){requestAnimationFrame(t)})},Ss=0,Aw=function(){return!!Ss},Mw=250,Vw={attributes:!0,characterData:!0,childList:!0,subtree:!0},Mu=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Vu=function(t){return t===void 0&&(t=0),Date.now()+t},oa=!1,Iw=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=Mw),!oa){oa=!0;var r=Vu(e);Fw(function(){var s=!1;try{s=Pw()}finally{if(oa=!1,e=r-Vu(),!Aw())return;s?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,Vw)};document.body?n():xr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Mu.forEach(function(n){return xr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Mu.forEach(function(n){return xr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),aa=new Iw,Iu=function(t){!Ss&&t>0&&aa.start(),Ss+=t,!Ss&&aa.stop()},Ow=function(t){return!ra(t)&&!Sw(t)&&getComputedStyle(t).display==="inline"},zw=(function(){function t(e,n){this.target=e,this.observedBox=n||wr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Nu(this.target,this.observedBox,!0);return Ow(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),Lw=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Bs=new WeakMap,Ou=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Ts=(function(){function t(){}return t.connect=function(e,n){var r=new Lw(e,n);Bs.set(e,r)},t.observe=function(e,n,r){var s=Bs.get(e),o=s.observationTargets.length===0;Ou(s.observationTargets,n)<0&&(o&&_i.push(s),s.observationTargets.push(new zw(n,r&&r.box)),Iu(1),aa.schedule())},t.unobserve=function(e,n){var r=Bs.get(e),s=Ou(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&_i.splice(_i.indexOf(r),1),r.observationTargets.splice(s,1),Iu(-1))},t.disconnect=function(e){var n=this,r=Bs.get(e);r.observationTargets.slice().forEach(function(s){return n.unobserve(e,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),Dw=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Ts.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Tu(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Ts.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Tu(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Ts.unobserve(this,e)},t.prototype.disconnect=function(){Ts.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class Hw{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Dw)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const n of e){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(e,n){this.elHandlersMap.set(e,n),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const kr=new Hw,Rs=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const n=i.getCurrentInstance().proxy;function r(s){const{onResize:o}=t;o!==void 0&&o(s)}i.onMounted(()=>{const s=n.$el;if(s===void 0){cu("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){cu("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(kr.registerHandler(s.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&kr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let $s;function Ww(){return typeof document>"u"?!1:($s===void 0&&("matchMedia"in window?$s=window.matchMedia("(pointer:coarse)").matches:$s=!1),$s)}let la;function zu(){return typeof document>"u"?1:(la===void 0&&(la="chrome"in window?window.devicePixelRatio:1),la)}const Lu="VVirtualListXScroll";function jw({columnsRef:t,renderColRef:e,renderItemWithColsRef:n}){const r=i.ref(0),s=i.ref(0),o=i.computed(()=>{const d=t.value;if(d.length===0)return null;const u=new bu(d.length,0);return d.forEach((h,m)=>{u.add(m,h.width)}),u}),a=Ut(()=>{const d=o.value;return d!==null?Math.max(d.getBound(s.value)-1,0):0}),l=d=>{const u=o.value;return u!==null?u.sum(d):0},c=Ut(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,t.value.length-1):0});return i.provide(Lu,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Du=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:t,endIndexRef:e,columnsRef:n,getLeft:r,renderColRef:s,renderItemWithColsRef:o}=i.inject(Lu);return{startIndex:t,endIndex:e,columns:n,renderCol:s,renderItemWithCols:o,getLeft:r}},render(){const{startIndex:t,endIndex:e,columns:n,renderCol:r,renderItemWithCols:s,getLeft:o,item:a}=this;if(s!=null)return s({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:n,item:a,getLeft:o});if(r!=null){const l=[];for(let c=t;c<=e;++c){const d=n[c];l.push(r({column:d,left:o(c),item:a}))}return l}return null}}),qw=Jn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Jn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Jn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Xw=i.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(t){const e=bi();qw.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:na,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:V,defaultScrollKey:F}=t;V!=null?b({index:V}):F!=null&&b({key:F})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}b({top:g.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=Ut(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let V=0;return t.columns.forEach(F=>{V+=F.width}),V}),o=i.computed(()=>{const V=new Map,{keyField:F}=t;return t.items.forEach((N,Y)=>{V.set(N[F],Y)}),V}),{scrollLeftRef:a,listWidthRef:l}=jw({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),u=new Map,h=i.computed(()=>{const{items:V,itemSize:F,keyField:N}=t,Y=new bu(V.length,F);return V.forEach((ee,I)=>{const z=ee[N],q=u.get(z);q!==void 0&&Y.add(I,q)}),Y}),m=i.ref(0),g=i.ref(0),f=Ut(()=>Math.max(h.value.getBound(g.value-yr(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:V}=d;if(V===void 0)return[];const{items:F,itemSize:N}=t,Y=f.value,ee=Math.min(Y+Math.ceil(V/N+1),F.length-1),I=[];for(let z=Y;z<=ee;++z)I.push(F[z]);return I}),b=(V,F)=>{if(typeof V=="number"){v(V,F,"auto");return}const{left:N,top:Y,index:ee,key:I,position:z,behavior:q,debounce:W=!0}=V;if(N!==void 0||Y!==void 0)v(N,Y,q);else if(ee!==void 0)S(ee,q,W);else if(I!==void 0){const O=o.value.get(I);O!==void 0&&S(O,q,W)}else z==="bottom"?v(0,Number.MAX_SAFE_INTEGER,q):z==="top"&&v(0,0,q)};let y,_=null;function S(V,F,N){const{value:Y}=h,ee=Y.sum(V)+yr(t.paddingTop);if(!N)c.value.scrollTo({left:0,top:ee,behavior:F});else{y=V,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{y=void 0,_=null},16);const{scrollTop:I,offsetHeight:z}=c.value;if(ee>I){const q=Y.get(V);ee+q<=I+z||c.value.scrollTo({left:0,top:ee+q-z,behavior:F})}else c.value.scrollTo({left:0,top:ee,behavior:F})}}function v(V,F,N){c.value.scrollTo({left:V,top:F,behavior:N})}function T(V,F){var N,Y,ee;if(n||t.ignoreItemResize||A(F.target))return;const{value:I}=h,z=o.value.get(V),q=I.get(z),W=(ee=(Y=(N=F.borderBoxSize)===null||N===void 0?void 0:N[0])===null||Y===void 0?void 0:Y.blockSize)!==null&&ee!==void 0?ee:F.contentRect.height;if(W===q)return;W-t.itemSize===0?u.delete(V):u.set(V,W-t.itemSize);const D=W-q;if(D===0)return;I.add(z,D);const j=c.value;if(j!=null){if(y===void 0){const G=I.sum(z);j.scrollTop>G&&j.scrollBy(0,D)}else if(z<y)j.scrollBy(0,D);else if(z===y){const G=I.sum(z);W+G>j.scrollTop+j.offsetHeight&&j.scrollBy(0,D)}P()}m.value++}const R=!Ww();let w=!1;function B(V){var F;(F=t.onScroll)===null||F===void 0||F.call(t,V),(!R||!w)&&P()}function x(V){var F;if((F=t.onWheel)===null||F===void 0||F.call(t,V),R){const N=c.value;if(N!=null){if(V.deltaX===0&&(N.scrollTop===0&&V.deltaY<=0||N.scrollTop+N.offsetHeight>=N.scrollHeight&&V.deltaY>=0))return;V.preventDefault(),N.scrollTop+=V.deltaY/zu(),N.scrollLeft+=V.deltaX/zu(),P(),w=!0,qd(()=>{w=!1})}}}function $(V){if(n||A(V.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(V.contentRect.height===d.value)return}else if(V.contentRect.height===d.value&&V.contentRect.width===l.value)return;d.value=V.contentRect.height,l.value=V.contentRect.width;const{onResize:F}=t;F!==void 0&&F(V)}function P(){const{value:V}=c;V!=null&&(g.value=V.scrollTop,a.value=V.scrollLeft)}function A(V){let F=V;for(;F!==null;){if(F.style.display==="none")return!0;F=F.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:V}=t,F=br(h.value.sum());return m.value,[t.itemsStyle,{boxSizing:"content-box",width:br(s.value),height:V?"":F,minHeight:V?F:"",paddingTop:br(t.paddingTop),paddingBottom:br(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(m.value,{transform:`translateY(${br(h.value.sum(f.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:b,handleListResize:$,handleListScroll:B,handleListWheel:x,handleItemResize:T}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(Rs,{onResize:this.handleListResize},{default:()=>{var s,o;return i.h("div",i.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?i.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[i.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[e],u=n.get(d),h=a!=null?i.h(Du,{index:u,item:c}):void 0,m=l!=null?i.h(Du,{index:u,item:c}):void 0,g=this.$slots.default({item:c,renderedCols:h,renderedItemWithCols:m,index:u})[0];return t?i.h(Rs,{key:d,onResize:f=>this.handleItemResize(d,f)},{default:()=>g}):(g.key=d,g)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),Pn="v-hidden",Yw=Jn("[v-hidden]",{display:"none!important"}),Hu=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:e}){const n=i.ref(null),r=i.ref(null);function s(a){const{value:l}=n,{getCounter:c,getTail:d}=t;let u;if(c!==void 0?u=c():u=r.value,!l||!u)return;u.hasAttribute(Pn)&&u.removeAttribute(Pn);const{children:h}=l;if(a.showAllItemsBeforeCalculate)for(const S of h)S.hasAttribute(Pn)&&S.removeAttribute(Pn);const m=l.offsetWidth,g=[],f=e.tail?d==null?void 0:d():null;let p=f?f.offsetWidth:0,b=!1;const y=l.children.length-(e.tail?1:0);for(let S=0;S<y-1;++S){if(S<0)continue;const v=h[S];if(b){v.hasAttribute(Pn)||v.setAttribute(Pn,"");continue}else v.hasAttribute(Pn)&&v.removeAttribute(Pn);const T=v.offsetWidth;if(p+=T,g[S]=T,p>m){const{updateCounter:R}=t;for(let w=S;w>=0;--w){const B=y-1-w;R!==void 0?R(B):u.textContent=`${B}`;const x=u.offsetWidth;if(p-=g[w],p+x<=m||w===0){b=!0,S=w-1,f&&(S===-1?(f.style.maxWidth=`${m-x}px`,f.style.boxSizing="border-box"):f.style.maxWidth="");const{onUpdateCount:$}=t;$&&$(B);break}}}}const{onUpdateOverflow:_}=t;b?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(Pn,""))}const o=bi();return Yw.mount({id:"vueuc/overflow",head:!0,anchorMetaName:na,ssr:o}),i.onMounted(()=>s({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:s}},render(){const{$slots:t}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(t,"default"),t.counter?t.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});function Wu(t){return t instanceof HTMLElement}function ju(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Wu(n)&&(Xu(n)||ju(n)))return!0}return!1}function qu(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Wu(n)&&(Xu(n)||qu(n)))return!0}return!1}function Xu(t){if(!Uw(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function Uw(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.getAttribute("disabled"))return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return t.type!=="hidden"&&t.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let vr=[];const Kw=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=i1(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return vr[vr.length-1]===e}function c(b){var y;b.code==="Escape"&&l()&&((y=t.onEsc)===null||y===void 0||y.call(t,b))}i.onMounted(()=>{i.watch(()=>t.active,b=>{b?(h(),Tt("keydown",document,c)):(it("keydown",document,c),s&&m())},{immediate:!0})}),i.onBeforeUnmount(()=>{it("keydown",document,c),s&&m()});function d(b){if(!o&&l()){const y=u();if(y===null||y.contains(pr(b)))return;g("first")}}function u(){const b=n.value;if(b===null)return null;let y=b;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function h(){var b;if(!t.disabled){if(vr.push(e),t.autoFocus){const{initialFocusTo:y}=t;y===void 0?g("first"):(b=_u(y))===null||b===void 0||b.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function m(){var b;if(t.disabled||(document.removeEventListener("focus",d,!0),vr=vr.filter(_=>_!==e),l()))return;const{finalFocusTo:y}=t;y!==void 0?(b=_u(y))===null||b===void 0||b.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function g(b){if(l()&&t.active){const y=n.value,_=r.value;if(y!==null&&_!==null){const S=u();if(S==null||S===_){o=!0,y.focus({preventScroll:!0}),o=!1;return}o=!0;const v=b==="first"?ju(S):qu(S);o=!1,v||(o=!0,y.focus({preventScroll:!0}),o=!1)}}}function f(b){if(o)return;const y=u();y!==null&&(b.relatedTarget!==null&&y.contains(b.relatedTarget)?g("last"):g("first"))}function p(b){o||(b.relatedTarget!==null&&b.relatedTarget===n.value?g("last"):g("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:f,handleEndFocus:p}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),t(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function YC(t){return t}const ca="n-internal-select-menu",Yu="n-internal-select-menu-body",Uu="n-drawer-body",Ku="n-modal-body",Gu="n-popover-body",Zu="__disabled__";function Nn(t){const e=i.inject(Ku,null),n=i.inject(Uu,null),r=i.inject(Gu,null),s=i.inject(Yu,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{Tt("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{it("fullscreenchange",document,a)})}return Ut(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?Zu:l===!0?o.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:s!=null&&s.value?s.value:l??(o.value||"body")})}Nn.tdkey=Zu,Nn.propTo={type:[String,Object,Boolean],default:void 0};function Gw(t){const e={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(e.isDeactivated=!1,!n){n=!0;return}t()}),i.onDeactivated(()=>{e.isDeactivated=!0,n||(n=!0)}),e}function Qu(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&kr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&kr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&kr.unregisterHandler(n)}))}function Ju(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const Zw=/^(\d|\.)+$/,eh=/(\d|\.)+/;function da(t,{c:e=1,offset:n=0,attachPx:r=!0}={}){if(typeof t=="number"){const s=(t+n)*e;return s===0?"0":`${s}px`}else if(typeof t=="string")if(Zw.test(t)){const s=(Number(t)+n)*e;return r?s===0?"0":`${s}px`:`${s}`}else{const s=eh.exec(t);return s?t.replace(eh,String((Number(s[0])+n)*e)):t}return t}function th(t){const{left:e,right:n,top:r,bottom:s}=en(t);return`${r} ${e} ${s} ${n}`}var nh={};function Qw(t){let e=".",n="__",r="--",s;if(t){let f=t.blockPrefix;f&&(e=f),f=t.elementPrefix,f&&(n=f),f=t.modifierPrefix,f&&(r=f)}const o={install(f){s=f.c;const p=f.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(f){let p,b;return{before(y){p=y.bem.b,b=y.bem.els,y.bem.els=null},after(y){y.bem.b=p,y.bem.els=b},$({context:y,props:_}){return f=typeof f=="string"?f:f({context:y,props:_}),y.bem.b=f,`${(_==null?void 0:_.bPrefix)||e}${y.bem.b}`}}}function l(f){let p;return{before(b){p=b.bem.els},after(b){b.bem.els=p},$({context:b,props:y}){return f=typeof f=="string"?f:f({context:b,props:y}),b.bem.els=f.split(",").map(_=>_.trim()),b.bem.els.map(_=>`${(y==null?void 0:y.bPrefix)||e}${b.bem.b}${n}${_}`).join(", ")}}}function c(f){return{$({context:p,props:b}){f=typeof f=="string"?f:f({context:p,props:b});const y=f.split(",").map(v=>v.trim());function _(v){return y.map(T=>`&${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${v!==void 0?`${n}${v}`:""}${r}${T}`).join(", ")}const S=p.bem.els;if(S!==null){if(nh.NODE_ENV!=="production"&&S.length>=2)throw Error(`[css-render/plugin-bem]: m(${f}) is invalid, using modifier inside multiple elements is not allowed`);return _(S[0])}else return _()}}}function d(f){return{$({context:p,props:b}){f=typeof f=="string"?f:f({context:p,props:b});const y=p.bem.els;if(nh.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${f}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${y!==null&&y.length>0?`${n}${y[0]}`:""}${r}${f})`}}}return Object.assign(o,{cB:((...f)=>s(a(f[0]),f[1],f[2])),cE:((...f)=>s(l(f[0]),f[1],f[2])),cM:((...f)=>s(c(f[0]),f[1],f[2])),cNotM:((...f)=>s(d(f[0]),f[1],f[2]))}),o}const Jw=".n-",ex="__",tx="--",ih=pu(),rh=Qw({blockPrefix:Jw,elementPrefix:ex,modifierPrefix:tx});ih.use(rh);const{c:ce,find:KC}=ih,{cB:ge,cE:be,cM:Se,cNotM:tn}=rh,nx=(...t)=>ce(">",[ge(...t)]);function Ze(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let ua;function ix(){return ua===void 0&&(ua=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ua}const rx=new WeakSet;function sx(t){rx.add(t)}function sh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const oh=new Set;function ei(t,e){const n=`[naive/${t}]: ${e}`;oh.has(n)||(oh.add(n),console.error(n))}function ah(t,e){console.error(`[naive/${t}]: ${e}`)}function lh(t,e){throw new Error(`[naive/${t}]: ${e}`)}function gt(t,...e){if(Array.isArray(t))t.forEach(n=>gt(n,...e));else return t(...e)}function ha(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){ha(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ha(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function ox(t,e="default",n=void 0){const r=t[e];if(!r)return ah("getFirstSlotVNode",`slot[${e}] is empty`),null;const s=ha(r(n));return s.length===1?s[0]:(ah("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function ax(t,e=[],n){const r={};return e.forEach(s=>{r[s]=t[s]}),Object.assign(r,n)}function fa(t){const e=t.filter(n=>n!==void 0);if(e.length!==0)return e.length===1?e[0]:n=>{t.forEach(r=>{r&&r(n)})}}function er(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function Ps(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!Ps(e.children)):!0)?t:null}function ma(t,e){return t&&Ps(t())||e()}function xi(t,e){const n=t&&Ps(t());return e(n||null)}function ch(t){return!(t&&Ps(t()))}const ga=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),ki="n-config-provider",lx="n";function vi(t={},e={defaultBordered:!0}){const n=i.inject(ki,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,s;const{bordered:o}=t;return o!==void 0?o:(s=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&s!==void 0?s:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(lx),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function Ci(t,e,n,r){n||lh("useThemeClass","cssVarsRef is not passed");const s=i.inject(ki,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=bi();let d;const u=`__${t}`,h=()=>{let m=u;const g=e?e.value:void 0,f=o==null?void 0:o.value;f&&(m+=`-${f}`),g&&(m+=`-${g}`);const{themeOverrides:p,builtinThemeOverrides:b}=r;p&&(m+=`-${ta(JSON.stringify(p))}`),b&&(m+=`-${ta(JSON.stringify(b))}`),l.value=m,d=()=>{const y=n.value;let _="";for(const S in y)_+=`${S}: ${y[S]};`;ce(`.${m}`,_).mount({id:m,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{h()}),{themeClass:l,onRender:()=>{d==null||d()}}}const dh="n-form-item";function cx(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(dh,null);i.provide(dh,null);const o=i.computed(n?()=>n(s):()=>{const{size:c}=t;if(c)return c;if(s){const{mergedSize:d}=s;if(d.value!==void 0)return d.value}return e}),a=i.computed(r?()=>r(s):()=>{const{disabled:c}=t;return c!==void 0?c:s?s.disabled.value:!1}),l=i.computed(()=>{const{status:c}=t;return c||(s==null?void 0:s.mergedValidationStatus.value)});return i.onBeforeUnmount(()=>{s&&s.restoreValidation()}),{mergedSizeRef:o,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){s&&s.handleContentBlur()},nTriggerFormChange(){s&&s.handleContentChange()},nTriggerFormFocus(){s&&s.handleContentFocus()},nTriggerFormInput(){s&&s.handleContentInput()}}}const dx={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:t=>`Please load all ${t}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:t=>`Total ${t} items`,selected:t=>`${t} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"},Heatmap:{less:"less",more:"more",monthFormat:"MMM",weekdayFormat:"eee"}};function pa(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function Cr(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[a]}const o=t.argumentCallback?t.argumentCallback(e):e;return s[o]}}function Sr(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(s);if(!o)return null;const a=o[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?hx(l,h=>h.test(a)):ux(l,h=>h.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function ux(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function hx(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function fx(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],o=e.match(t.parsePattern);if(!o)return null;let a=t.valueCallback?t.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const mx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},gx=(t,e,n)=>{let r;const s=mx[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},px={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},yx=(t,e,n,r)=>px[t],bx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_x={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},wx={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},xx={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},kx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},vx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Cx={ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Cr({values:bx,defaultWidth:"wide"}),quarter:Cr({values:_x,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Cr({values:wx,defaultWidth:"wide"}),day:Cr({values:xx,defaultWidth:"wide"}),dayPeriod:Cr({values:kx,defaultWidth:"wide",formattingValues:vx,defaultFormattingWidth:"wide"})},Sx=/^(\d+)(th|st|nd|rd)?/i,Bx=/\d+/i,Tx={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Rx={any:[/^b/i,/^(a|c)/i]},$x={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Px={any:[/1/i,/2/i,/3/i,/4/i]},Nx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ex={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Fx={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ax={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Mx={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Vx={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Ix={ordinalNumber:fx({matchPattern:Sx,parsePattern:Bx,valueCallback:t=>parseInt(t,10)}),era:Sr({matchPatterns:Tx,defaultMatchWidth:"wide",parsePatterns:Rx,defaultParseWidth:"any"}),quarter:Sr({matchPatterns:$x,defaultMatchWidth:"wide",parsePatterns:Px,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Sr({matchPatterns:Nx,defaultMatchWidth:"wide",parsePatterns:Ex,defaultParseWidth:"any"}),day:Sr({matchPatterns:Fx,defaultMatchWidth:"wide",parsePatterns:Ax,defaultParseWidth:"any"}),dayPeriod:Sr({matchPatterns:Mx,defaultMatchWidth:"any",parsePatterns:Vx,defaultParseWidth:"any"})},Ox={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},zx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Lx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Dx={date:pa({formats:Ox,defaultWidth:"full"}),time:pa({formats:zx,defaultWidth:"full"}),dateTime:pa({formats:Lx,defaultWidth:"full"})},Hx={name:"en-US",locale:{code:"en-US",formatDistance:gx,formatLong:Dx,formatRelative:yx,localize:Cx,match:Ix,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function uh(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(ki,null)||{},r=i.computed(()=>{var o,a;return(a=(o=e==null?void 0:e.value)===null||o===void 0?void 0:o[t])!==null&&a!==void 0?a:dx[t]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:Hx}),localeRef:r}}const Br="naive-ui-style";function Tr(t,e,n){if(!e)return;const r=bi(),s=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),o=i.inject(ki,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(hw(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:Br,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const Rr={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:Wx,fontFamily:jx,lineHeight:qx}=Rr,hh=ce("body",`
117
117
  margin: 0;
118
118
  font-size: ${Wx};
119
119
  font-family: ${jx};
@@ -134,7 +134,7 @@ ${s}
134
134
  `,[ce("svg",`
135
135
  height: 1em;
136
136
  width: 1em;
137
- `)]),$r=i.defineComponent({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(t){Ns("-base-icon",Yx,i.toRef(t,"clsPrefix"))},render(){return i.h("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),fh=i.defineComponent({name:"BaseIconSwitchTransition",setup(t,{slots:e}){const n=_s();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},e)}});function mh(t,e){const n=i.defineComponent({render(){return e()}});return i.defineComponent({name:M.upperFirst(t),setup(){var r;const s=(r=i.inject(ki,null))===null||r===void 0?void 0:r.mergedIconsRef;return()=>{var o;const a=(o=s==null?void 0:s.value)===null||o===void 0?void 0:o[t];return a?a():i.h(n,null)}}})}const Ux=i.defineComponent({name:"Checkmark",render(){return i.h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},i.h("g",{fill:"none"},i.h("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}}),Kx=i.defineComponent({name:"ChevronDown",render(){return i.h("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.h("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),Gx=mh("clear",()=>i.h("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i.h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i.h("g",{fill:"currentColor","fill-rule":"nonzero"},i.h("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),Zx=mh("close",()=>i.h("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},i.h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i.h("g",{fill:"currentColor","fill-rule":"nonzero"},i.h("path",{d:"M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"}))))),Qx=i.defineComponent({name:"Empty",render(){return i.h("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.h("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),i.h("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),{cubicBezierEaseInOut:Jx}=Rr;function pa({originalTransform:t="",left:e=0,top:n=0,transition:r=`all .3s ${Jx} !important`}={}){return[ce("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${t} scale(0.75)`,left:e,top:n,opacity:0}),ce("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${t}`,left:e,top:n,opacity:1}),ce("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:e,top:n,transition:r})]}const ek=ge("base-clear",`
137
+ `)]),$r=i.defineComponent({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(t){Ns("-base-icon",Yx,i.toRef(t,"clsPrefix"))},render(){return i.h("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),fh=i.defineComponent({name:"BaseIconSwitchTransition",setup(t,{slots:e}){const n=_s();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},e)}});function mh(t,e){const n=i.defineComponent({render(){return e()}});return i.defineComponent({name:M.upperFirst(t),setup(){var r;const s=(r=i.inject(ki,null))===null||r===void 0?void 0:r.mergedIconsRef;return()=>{var o;const a=(o=s==null?void 0:s.value)===null||o===void 0?void 0:o[t];return a?a():i.h(n,null)}}})}const Ux=i.defineComponent({name:"Checkmark",render(){return i.h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},i.h("g",{fill:"none"},i.h("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}}),Kx=i.defineComponent({name:"ChevronDown",render(){return i.h("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.h("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),Gx=mh("clear",()=>i.h("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i.h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i.h("g",{fill:"currentColor","fill-rule":"nonzero"},i.h("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),Zx=mh("close",()=>i.h("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},i.h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i.h("g",{fill:"currentColor","fill-rule":"nonzero"},i.h("path",{d:"M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"}))))),Qx=i.defineComponent({name:"Empty",render(){return i.h("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.h("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),i.h("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),{cubicBezierEaseInOut:Jx}=Rr;function ya({originalTransform:t="",left:e=0,top:n=0,transition:r=`all .3s ${Jx} !important`}={}){return[ce("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${t} scale(0.75)`,left:e,top:n,opacity:0}),ce("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${t}`,left:e,top:n,opacity:1}),ce("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:e,top:n,transition:r})]}const ek=ge("base-clear",`
138
138
  flex-shrink: 0;
139
139
  height: 1em;
140
140
  width: 1em;
@@ -158,7 +158,7 @@ ${s}
158
158
  left: 50%;
159
159
  top: 50%;
160
160
  transform: translateX(-50%) translateY(-50%);
161
- `,[pa({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),tk=i.defineComponent({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(t){return Ns("-base-clear",ek,i.toRef(t,"clsPrefix")),{handleMouseDown(e){e.preventDefault()}}},render(){const{clsPrefix:t}=this;return i.h("div",{class:`${t}-base-clear`},i.h(fh,null,{default:()=>{var e,n;return this.show?i.h("div",{key:"dismiss",class:`${t}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},fa(this.$slots.icon,()=>[i.h($r,{clsPrefix:t},{default:()=>i.h(Gx,null)})])):i.h("div",{key:"icon",class:`${t}-base-clear__placeholder`},(n=(e=this.$slots).placeholder)===null||n===void 0?void 0:n.call(e))}}))}}),nk=ge("base-close",`
161
+ `,[ya({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),tk=i.defineComponent({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(t){return Ns("-base-clear",ek,i.toRef(t,"clsPrefix")),{handleMouseDown(e){e.preventDefault()}}},render(){const{clsPrefix:t}=this;return i.h("div",{class:`${t}-base-clear`},i.h(fh,null,{default:()=>{var e,n;return this.show?i.h("div",{key:"dismiss",class:`${t}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},ma(this.$slots.icon,()=>[i.h($r,{clsPrefix:t},{default:()=>i.h(Gx,null)})])):i.h("div",{key:"icon",class:`${t}-base-clear__placeholder`},(n=(e=this.$slots).placeholder)===null||n===void 0?void 0:n.call(e))}}))}}),nk=ge("base-close",`
162
162
  display: flex;
163
163
  align-items: center;
164
164
  justify-content: center;
@@ -219,17 +219,17 @@ ${s}
219
219
  position: absolute;
220
220
  width: 100%;
221
221
  height: 100%;
222
- `,[pa()]),be("placeholder",`
222
+ `,[ya()]),be("placeholder",`
223
223
  position: absolute;
224
224
  left: 50%;
225
225
  top: 50%;
226
226
  transform: translateX(-50%) translateY(-50%);
227
- `,[pa({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),be("container",`
227
+ `,[ya({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),be("container",`
228
228
  animation: rotator 3s linear infinite both;
229
229
  `,[be("icon",`
230
230
  height: 1em;
231
231
  width: 1em;
232
- `)])])]),ya="1.6s",ok={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},gh=i.defineComponent({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},ok),setup(t){Ns("-base-loading",sk,i.toRef(t,"clsPrefix"))},render(){const{clsPrefix:t,radius:e,strokeWidth:n,stroke:r,scale:s}=this,o=e/s;return i.h("div",{class:`${t}-base-loading`,role:"img","aria-label":"loading"},i.h(fh,null,{default:()=>this.show?i.h("div",{key:"icon",class:`${t}-base-loading__transition-wrapper`},i.h("div",{class:`${t}-base-loading__container`},i.h("svg",{class:`${t}-base-loading__icon`,viewBox:`0 0 ${2*o} ${2*o}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},i.h("g",null,i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};270 ${o} ${o}`,begin:"0s",dur:ya,fill:"freeze",repeatCount:"indefinite"}),i.h("circle",{class:`${t}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round",cx:o,cy:o,r:e-n/2,"stroke-dasharray":5.67*e,"stroke-dashoffset":18.48*e},i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};135 ${o} ${o};450 ${o} ${o}`,begin:"0s",dur:ya,fill:"freeze",repeatCount:"indefinite"}),i.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*e};${1.42*e};${5.67*e}`,begin:"0s",dur:ya,fill:"freeze",repeatCount:"indefinite"})))))):i.h("div",{key:"placeholder",class:`${t}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:ph}=Rr;function ak({name:t="fade-in",enterDuration:e="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=ph,leaveCubicBezier:s=ph}={}){return[ce(`&.${t}-transition-enter-active`,{transition:`all ${e} ${r}!important`}),ce(`&.${t}-transition-leave-active`,{transition:`all ${n} ${s}!important`}),ce(`&.${t}-transition-enter-from, &.${t}-transition-leave-to`,{opacity:0}),ce(`&.${t}-transition-leave-from, &.${t}-transition-enter-to`,{opacity:1})]}const fe={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaAvatar:"0.2",alphaProgressRail:".08",alphaInput:"0",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},lk=pi(fe.neutralBase),yh=pi(fe.neutralInvertBase),ck=`rgba(${yh.slice(0,3).join(", ")}, `;function bh(t){return`${ck+String(t)})`}function yt(t){const e=Array.from(yh);return e[3]=Number(t),t1(lk,e)}const Si=Object.assign(Object.assign({name:"common"},Rr),{baseColor:fe.neutralBase,primaryColor:fe.primaryDefault,primaryColorHover:fe.primaryHover,primaryColorPressed:fe.primaryActive,primaryColorSuppl:fe.primarySuppl,infoColor:fe.infoDefault,infoColorHover:fe.infoHover,infoColorPressed:fe.infoActive,infoColorSuppl:fe.infoSuppl,successColor:fe.successDefault,successColorHover:fe.successHover,successColorPressed:fe.successActive,successColorSuppl:fe.successSuppl,warningColor:fe.warningDefault,warningColorHover:fe.warningHover,warningColorPressed:fe.warningActive,warningColorSuppl:fe.warningSuppl,errorColor:fe.errorDefault,errorColorHover:fe.errorHover,errorColorPressed:fe.errorActive,errorColorSuppl:fe.errorSuppl,textColorBase:fe.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:yt(fe.alpha4),placeholderColor:yt(fe.alpha4),placeholderColorDisabled:yt(fe.alpha5),iconColor:yt(fe.alpha4),iconColorHover:ms(yt(fe.alpha4),{lightness:.75}),iconColorPressed:ms(yt(fe.alpha4),{lightness:.9}),iconColorDisabled:yt(fe.alpha5),opacity1:fe.alpha1,opacity2:fe.alpha2,opacity3:fe.alpha3,opacity4:fe.alpha4,opacity5:fe.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:yt(Number(fe.alphaClose)),closeIconColorHover:yt(Number(fe.alphaClose)),closeIconColorPressed:yt(Number(fe.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:yt(fe.alpha4),clearColorHover:ms(yt(fe.alpha4),{lightness:.75}),clearColorPressed:ms(yt(fe.alpha4),{lightness:.9}),scrollbarColor:bh(fe.alphaScrollbar),scrollbarColorHover:bh(fe.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:yt(fe.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:fe.neutralPopover,tableColor:fe.neutralCard,cardColor:fe.neutralCard,modalColor:fe.neutralModal,bodyColor:fe.neutralBody,tagColor:"#eee",avatarColor:yt(fe.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:yt(fe.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:fe.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),dk={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function uk(t){const{scrollbarColor:e,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:s,scrollbarBorderRadius:o}=t;return Object.assign(Object.assign({},dk),{height:r,width:s,borderRadius:o,color:e,colorHover:n})}const ba={name:"Scrollbar",common:Si,self:uk},hk=ge("scrollbar",`
232
+ `)])])]),ba="1.6s",ok={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},gh=i.defineComponent({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},ok),setup(t){Ns("-base-loading",sk,i.toRef(t,"clsPrefix"))},render(){const{clsPrefix:t,radius:e,strokeWidth:n,stroke:r,scale:s}=this,o=e/s;return i.h("div",{class:`${t}-base-loading`,role:"img","aria-label":"loading"},i.h(fh,null,{default:()=>this.show?i.h("div",{key:"icon",class:`${t}-base-loading__transition-wrapper`},i.h("div",{class:`${t}-base-loading__container`},i.h("svg",{class:`${t}-base-loading__icon`,viewBox:`0 0 ${2*o} ${2*o}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},i.h("g",null,i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};270 ${o} ${o}`,begin:"0s",dur:ba,fill:"freeze",repeatCount:"indefinite"}),i.h("circle",{class:`${t}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round",cx:o,cy:o,r:e-n/2,"stroke-dasharray":5.67*e,"stroke-dashoffset":18.48*e},i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};135 ${o} ${o};450 ${o} ${o}`,begin:"0s",dur:ba,fill:"freeze",repeatCount:"indefinite"}),i.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*e};${1.42*e};${5.67*e}`,begin:"0s",dur:ba,fill:"freeze",repeatCount:"indefinite"})))))):i.h("div",{key:"placeholder",class:`${t}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:ph}=Rr;function ak({name:t="fade-in",enterDuration:e="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=ph,leaveCubicBezier:s=ph}={}){return[ce(`&.${t}-transition-enter-active`,{transition:`all ${e} ${r}!important`}),ce(`&.${t}-transition-leave-active`,{transition:`all ${n} ${s}!important`}),ce(`&.${t}-transition-enter-from, &.${t}-transition-leave-to`,{opacity:0}),ce(`&.${t}-transition-leave-from, &.${t}-transition-enter-to`,{opacity:1})]}const fe={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaAvatar:"0.2",alphaProgressRail:".08",alphaInput:"0",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},lk=pi(fe.neutralBase),yh=pi(fe.neutralInvertBase),ck=`rgba(${yh.slice(0,3).join(", ")}, `;function bh(t){return`${ck+String(t)})`}function yt(t){const e=Array.from(yh);return e[3]=Number(t),t1(lk,e)}const Si=Object.assign(Object.assign({name:"common"},Rr),{baseColor:fe.neutralBase,primaryColor:fe.primaryDefault,primaryColorHover:fe.primaryHover,primaryColorPressed:fe.primaryActive,primaryColorSuppl:fe.primarySuppl,infoColor:fe.infoDefault,infoColorHover:fe.infoHover,infoColorPressed:fe.infoActive,infoColorSuppl:fe.infoSuppl,successColor:fe.successDefault,successColorHover:fe.successHover,successColorPressed:fe.successActive,successColorSuppl:fe.successSuppl,warningColor:fe.warningDefault,warningColorHover:fe.warningHover,warningColorPressed:fe.warningActive,warningColorSuppl:fe.warningSuppl,errorColor:fe.errorDefault,errorColorHover:fe.errorHover,errorColorPressed:fe.errorActive,errorColorSuppl:fe.errorSuppl,textColorBase:fe.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:yt(fe.alpha4),placeholderColor:yt(fe.alpha4),placeholderColorDisabled:yt(fe.alpha5),iconColor:yt(fe.alpha4),iconColorHover:ms(yt(fe.alpha4),{lightness:.75}),iconColorPressed:ms(yt(fe.alpha4),{lightness:.9}),iconColorDisabled:yt(fe.alpha5),opacity1:fe.alpha1,opacity2:fe.alpha2,opacity3:fe.alpha3,opacity4:fe.alpha4,opacity5:fe.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:yt(Number(fe.alphaClose)),closeIconColorHover:yt(Number(fe.alphaClose)),closeIconColorPressed:yt(Number(fe.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:yt(fe.alpha4),clearColorHover:ms(yt(fe.alpha4),{lightness:.75}),clearColorPressed:ms(yt(fe.alpha4),{lightness:.9}),scrollbarColor:bh(fe.alphaScrollbar),scrollbarColorHover:bh(fe.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:yt(fe.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:fe.neutralPopover,tableColor:fe.neutralCard,cardColor:fe.neutralCard,modalColor:fe.neutralModal,bodyColor:fe.neutralBody,tagColor:"#eee",avatarColor:yt(fe.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:yt(fe.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:fe.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),dk={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function uk(t){const{scrollbarColor:e,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:s,scrollbarBorderRadius:o}=t;return Object.assign(Object.assign({},dk),{height:r,width:s,borderRadius:o,color:e,colorHover:n})}const _a={name:"Scrollbar",common:Si,self:uk},hk=ge("scrollbar",`
233
233
  overflow: hidden;
234
234
  position: relative;
235
235
  z-index: auto;
@@ -294,7 +294,7 @@ ${s}
294
294
  pointer-events: all;
295
295
  background-color: var(--n-scrollbar-color);
296
296
  transition: background-color .2s var(--n-scrollbar-bezier);
297
- `,[ak(),ce("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),fk=Object.assign(Object.assign({},pt.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),_h=i.defineComponent({name:"Scrollbar",props:fk,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=vi(t),s=Tr("Scrollbar",r,e),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(null),m=i.ref(null),g=i.ref(null),f=i.ref(null),p=i.ref(null),b=i.ref(0),y=i.ref(0),_=i.ref(!1),S=i.ref(!1);let v=!1,T=!1,R,w,B=0,x=0,$=0,P=0;const A=W1(),V=pt("Scrollbar","-scrollbar",hk,ba,t,e),F=i.computed(()=>{const{value:E}=m,{value:X}=u,{value:ie}=f;return E===null||X===null||ie===null?0:Math.min(E,ie*E/X+yr(V.value.self.width)*1.5)}),N=i.computed(()=>`${F.value}px`),Y=i.computed(()=>{const{value:E}=g,{value:X}=h,{value:ie}=p;return E===null||X===null||ie===null?0:ie*E/X+yr(V.value.self.height)*1.5}),ee=i.computed(()=>`${Y.value}px`),I=i.computed(()=>{const{value:E}=m,{value:X}=b,{value:ie}=u,{value:de}=f;if(E===null||ie===null||de===null)return 0;{const he=ie-E;return he?X/he*(de-F.value):0}}),z=i.computed(()=>`${I.value}px`),q=i.computed(()=>{const{value:E}=g,{value:X}=y,{value:ie}=h,{value:de}=p;if(E===null||ie===null||de===null)return 0;{const he=ie-E;return he?X/he*(de-Y.value):0}}),W=i.computed(()=>`${q.value}px`),O=i.computed(()=>{const{value:E}=m,{value:X}=u;return E!==null&&X!==null&&X>E}),D=i.computed(()=>{const{value:E}=g,{value:X}=h;return E!==null&&X!==null&&X>E}),j=i.computed(()=>{const{trigger:E}=t;return E==="none"||_.value}),G=i.computed(()=>{const{trigger:E}=t;return E==="none"||S.value}),ue=i.computed(()=>{const{container:E}=t;return E?E():a.value}),oe=i.computed(()=>{const{content:E}=t;return E?E():l.value}),re=(E,X)=>{if(!t.scrollable)return;if(typeof E=="number"){Te(E,X??0,0,!1,"auto");return}const{left:ie,top:de,index:he,elSize:ye,position:we,behavior:ke,el:Ke,debounce:Sn=!0}=E;(ie!==void 0||de!==void 0)&&Te(ie??0,de??0,0,!1,ke),Ke!==void 0?Te(0,Ke.offsetTop,Ke.offsetHeight,Sn,ke):he!==void 0&&ye!==void 0?Te(0,he*ye,ye,Sn,ke):we==="bottom"?Te(0,Number.MAX_SAFE_INTEGER,0,!1,ke):we==="top"&&Te(0,0,0,!1,ke)},Ee=Gw(()=>{t.container||re({top:b.value,left:y.value})}),We=()=>{Ee.isDeactivated||se()},Fe=E=>{if(Ee.isDeactivated)return;const{onResize:X}=t;X&&X(E),se()},Gt=(E,X)=>{if(!t.scrollable)return;const{value:ie}=ue;ie&&(typeof E=="object"?ie.scrollBy(E):ie.scrollBy(E,X||0))};function Te(E,X,ie,de,he){const{value:ye}=ue;if(ye){if(de){const{scrollTop:we,offsetHeight:ke}=ye;if(X>we){X+ie<=we+ke||ye.scrollTo({left:E,top:X+ie-ke,behavior:he});return}}ye.scrollTo({left:E,top:X,behavior:he})}}function sn(){wt(),Ln(),se()}function on(){Rt()}function Rt(){Lt(),an()}function Lt(){w!==void 0&&window.clearTimeout(w),w=window.setTimeout(()=>{S.value=!1},t.duration)}function an(){R!==void 0&&window.clearTimeout(R),R=window.setTimeout(()=>{_.value=!1},t.duration)}function wt(){R!==void 0&&window.clearTimeout(R),_.value=!0}function Ln(){w!==void 0&&window.clearTimeout(w),S.value=!0}function ln(E){const{onScroll:X}=t;X&&X(E),Zt()}function Zt(){const{value:E}=ue;E&&(b.value=E.scrollTop,y.value=E.scrollLeft*(s!=null&&s.value?-1:1))}function $e(){const{value:E}=oe;E&&(u.value=E.offsetHeight,h.value=E.offsetWidth);const{value:X}=ue;X&&(m.value=X.offsetHeight,g.value=X.offsetWidth);const{value:ie}=d,{value:de}=c;ie&&(p.value=ie.offsetWidth),de&&(f.value=de.offsetHeight)}function K(){const{value:E}=ue;E&&(b.value=E.scrollTop,y.value=E.scrollLeft*(s!=null&&s.value?-1:1),m.value=E.offsetHeight,g.value=E.offsetWidth,u.value=E.scrollHeight,h.value=E.scrollWidth);const{value:X}=d,{value:ie}=c;X&&(p.value=X.offsetWidth),ie&&(f.value=ie.offsetHeight)}function se(){t.scrollable&&(t.useUnifiedContainer?K():($e(),Zt()))}function Ie(E){var X;return!(!((X=o.value)===null||X===void 0)&&X.contains(pr(E)))}function ni(E){E.preventDefault(),E.stopPropagation(),T=!0,Bt("mousemove",window,Je,!0),Bt("mouseup",window,Dt,!0),x=y.value,$=s!=null&&s.value?window.innerWidth-E.clientX:E.clientX}function Je(E){if(!T)return;R!==void 0&&window.clearTimeout(R),w!==void 0&&window.clearTimeout(w);const{value:X}=g,{value:ie}=h,{value:de}=Y;if(X===null||ie===null)return;const ye=(s!=null&&s.value?window.innerWidth-E.clientX-$:E.clientX-$)*(ie-X)/(X-de),we=ie-X;let ke=x+ye;ke=Math.min(we,ke),ke=Math.max(ke,0);const{value:Ke}=ue;if(Ke){Ke.scrollLeft=ke*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:Sn}=t;Sn&&Sn(ke)}}function Dt(E){E.preventDefault(),E.stopPropagation(),it("mousemove",window,Je,!0),it("mouseup",window,Dt,!0),T=!1,se(),Ie(E)&&Rt()}function tr(E){E.preventDefault(),E.stopPropagation(),v=!0,Bt("mousemove",window,ii,!0),Bt("mouseup",window,$i,!0),B=b.value,P=E.clientY}function ii(E){if(!v)return;R!==void 0&&window.clearTimeout(R),w!==void 0&&window.clearTimeout(w);const{value:X}=m,{value:ie}=u,{value:de}=F;if(X===null||ie===null)return;const ye=(E.clientY-P)*(ie-X)/(X-de),we=ie-X;let ke=B+ye;ke=Math.min(we,ke),ke=Math.max(ke,0);const{value:Ke}=ue;Ke&&(Ke.scrollTop=ke)}function $i(E){E.preventDefault(),E.stopPropagation(),it("mousemove",window,ii,!0),it("mouseup",window,$i,!0),v=!1,se(),Ie(E)&&Rt()}i.watchEffect(()=>{const{value:E}=D,{value:X}=O,{value:ie}=e,{value:de}=d,{value:he}=c;de&&(E?de.classList.remove(`${ie}-scrollbar-rail--disabled`):de.classList.add(`${ie}-scrollbar-rail--disabled`)),he&&(X?he.classList.remove(`${ie}-scrollbar-rail--disabled`):he.classList.add(`${ie}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||se()}),i.onBeforeUnmount(()=>{R!==void 0&&window.clearTimeout(R),w!==void 0&&window.clearTimeout(w),it("mousemove",window,ii,!0),it("mouseup",window,$i,!0)});const nr=i.computed(()=>{const{common:{cubicBezierEaseInOut:E},self:{color:X,colorHover:ie,height:de,width:he,borderRadius:ye,railInsetHorizontalTop:we,railInsetHorizontalBottom:ke,railInsetVerticalRight:Ke,railInsetVerticalLeft:Sn,railColor:Ba}}=V.value,{top:Ta,right:Ra,bottom:$a,left:Pa}=en(we),{top:Na,right:Ea,bottom:Fa,left:Aa}=en(ke),{top:Ma,right:Va,bottom:Ia,left:Oa}=en(s!=null&&s.value?th(Ke):Ke),{top:za,right:La,bottom:Da,left:Ha}=en(s!=null&&s.value?th(Sn):Sn);return{"--n-scrollbar-bezier":E,"--n-scrollbar-color":X,"--n-scrollbar-color-hover":ie,"--n-scrollbar-border-radius":ye,"--n-scrollbar-width":he,"--n-scrollbar-height":de,"--n-scrollbar-rail-top-horizontal-top":Ta,"--n-scrollbar-rail-right-horizontal-top":Ra,"--n-scrollbar-rail-bottom-horizontal-top":$a,"--n-scrollbar-rail-left-horizontal-top":Pa,"--n-scrollbar-rail-top-horizontal-bottom":Na,"--n-scrollbar-rail-right-horizontal-bottom":Ea,"--n-scrollbar-rail-bottom-horizontal-bottom":Fa,"--n-scrollbar-rail-left-horizontal-bottom":Aa,"--n-scrollbar-rail-top-vertical-right":Ma,"--n-scrollbar-rail-right-vertical-right":Va,"--n-scrollbar-rail-bottom-vertical-right":Ia,"--n-scrollbar-rail-left-vertical-right":Oa,"--n-scrollbar-rail-top-vertical-left":za,"--n-scrollbar-rail-right-vertical-left":La,"--n-scrollbar-rail-bottom-vertical-left":Da,"--n-scrollbar-rail-left-vertical-left":Ha,"--n-scrollbar-rail-color":Ba}}),cn=n?Ci("scrollbar",void 0,nr,t):void 0;return Object.assign(Object.assign({},{scrollTo:re,scrollBy:Gt,sync:se,syncUnifiedContainer:K,handleMouseEnterWrapper:sn,handleMouseLeaveWrapper:on}),{mergedClsPrefix:e,rtlEnabled:s,containerScrollTop:b,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:O,needXBar:D,yBarSizePx:N,xBarSizePx:ee,yBarTopPx:z,xBarLeftPx:W,isShowXBar:j,isShowYBar:G,isIos:A,handleScroll:ln,handleContentResize:We,handleContainerResize:Fe,handleYScrollMouseDown:tr,handleXScrollMouseDown:ni,cssVars:n?void 0:nr,themeClass:cn==null?void 0:cn.themeClass,onRender:cn==null?void 0:cn.onRender})},render(){var t;const{$slots:e,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:s,internalHoistYRail:o,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(t=e.default)===null||t===void 0?void 0:t.call(e);const d=this.trigger==="none",u=(g,f)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,g],"data-scrollbar-rail":!0,style:[f||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?ma:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),h=()=>{var g,f;return(g=this.onRender)===null||g===void 0||g.call(this),i.h("div",i.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${n}-scrollbar`,this.themeClass,s&&`${n}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(f=e.default)===null||f===void 0?void 0:f.call(e):i.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i.h(Rs,{onResize:this.handleContentResize},{default:()=>i.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${n}-scrollbar-content`,this.contentClass]},e)})),o?null:u(void 0,void 0),c&&i.h("div",{ref:"xRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--horizontal`,`${n}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},i.h(d?ma:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:s?this.xBarLeftPx:void 0,left:s?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},m=this.container?h():i.h(Rs,{onResize:this.handleContainerResize},{default:h});return o?i.h(i.Fragment,null,m,u(this.themeClass,this.cssVars)):m}}),mk=_h,gk={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function pk(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},gk),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const wh={name:"Empty",common:Si,self:pk},yk=ge("empty",`
297
+ `,[ak(),ce("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),fk=Object.assign(Object.assign({},pt.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),_h=i.defineComponent({name:"Scrollbar",props:fk,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=vi(t),s=Tr("Scrollbar",r,e),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(null),m=i.ref(null),g=i.ref(null),f=i.ref(null),p=i.ref(null),b=i.ref(0),y=i.ref(0),_=i.ref(!1),S=i.ref(!1);let v=!1,T=!1,R,w,B=0,x=0,$=0,P=0;const A=W1(),V=pt("Scrollbar","-scrollbar",hk,_a,t,e),F=i.computed(()=>{const{value:E}=m,{value:X}=u,{value:ie}=f;return E===null||X===null||ie===null?0:Math.min(E,ie*E/X+yr(V.value.self.width)*1.5)}),N=i.computed(()=>`${F.value}px`),Y=i.computed(()=>{const{value:E}=g,{value:X}=h,{value:ie}=p;return E===null||X===null||ie===null?0:ie*E/X+yr(V.value.self.height)*1.5}),ee=i.computed(()=>`${Y.value}px`),I=i.computed(()=>{const{value:E}=m,{value:X}=b,{value:ie}=u,{value:de}=f;if(E===null||ie===null||de===null)return 0;{const he=ie-E;return he?X/he*(de-F.value):0}}),z=i.computed(()=>`${I.value}px`),q=i.computed(()=>{const{value:E}=g,{value:X}=y,{value:ie}=h,{value:de}=p;if(E===null||ie===null||de===null)return 0;{const he=ie-E;return he?X/he*(de-Y.value):0}}),W=i.computed(()=>`${q.value}px`),O=i.computed(()=>{const{value:E}=m,{value:X}=u;return E!==null&&X!==null&&X>E}),D=i.computed(()=>{const{value:E}=g,{value:X}=h;return E!==null&&X!==null&&X>E}),j=i.computed(()=>{const{trigger:E}=t;return E==="none"||_.value}),G=i.computed(()=>{const{trigger:E}=t;return E==="none"||S.value}),ue=i.computed(()=>{const{container:E}=t;return E?E():a.value}),oe=i.computed(()=>{const{content:E}=t;return E?E():l.value}),re=(E,X)=>{if(!t.scrollable)return;if(typeof E=="number"){Te(E,X??0,0,!1,"auto");return}const{left:ie,top:de,index:he,elSize:ye,position:we,behavior:ke,el:Ke,debounce:Sn=!0}=E;(ie!==void 0||de!==void 0)&&Te(ie??0,de??0,0,!1,ke),Ke!==void 0?Te(0,Ke.offsetTop,Ke.offsetHeight,Sn,ke):he!==void 0&&ye!==void 0?Te(0,he*ye,ye,Sn,ke):we==="bottom"?Te(0,Number.MAX_SAFE_INTEGER,0,!1,ke):we==="top"&&Te(0,0,0,!1,ke)},Ee=Gw(()=>{t.container||re({top:b.value,left:y.value})}),We=()=>{Ee.isDeactivated||se()},Fe=E=>{if(Ee.isDeactivated)return;const{onResize:X}=t;X&&X(E),se()},Gt=(E,X)=>{if(!t.scrollable)return;const{value:ie}=ue;ie&&(typeof E=="object"?ie.scrollBy(E):ie.scrollBy(E,X||0))};function Te(E,X,ie,de,he){const{value:ye}=ue;if(ye){if(de){const{scrollTop:we,offsetHeight:ke}=ye;if(X>we){X+ie<=we+ke||ye.scrollTo({left:E,top:X+ie-ke,behavior:he});return}}ye.scrollTo({left:E,top:X,behavior:he})}}function sn(){wt(),Ln(),se()}function on(){$t()}function $t(){Lt(),an()}function Lt(){w!==void 0&&window.clearTimeout(w),w=window.setTimeout(()=>{S.value=!1},t.duration)}function an(){R!==void 0&&window.clearTimeout(R),R=window.setTimeout(()=>{_.value=!1},t.duration)}function wt(){R!==void 0&&window.clearTimeout(R),_.value=!0}function Ln(){w!==void 0&&window.clearTimeout(w),S.value=!0}function ln(E){const{onScroll:X}=t;X&&X(E),Zt()}function Zt(){const{value:E}=ue;E&&(b.value=E.scrollTop,y.value=E.scrollLeft*(s!=null&&s.value?-1:1))}function $e(){const{value:E}=oe;E&&(u.value=E.offsetHeight,h.value=E.offsetWidth);const{value:X}=ue;X&&(m.value=X.offsetHeight,g.value=X.offsetWidth);const{value:ie}=d,{value:de}=c;ie&&(p.value=ie.offsetWidth),de&&(f.value=de.offsetHeight)}function K(){const{value:E}=ue;E&&(b.value=E.scrollTop,y.value=E.scrollLeft*(s!=null&&s.value?-1:1),m.value=E.offsetHeight,g.value=E.offsetWidth,u.value=E.scrollHeight,h.value=E.scrollWidth);const{value:X}=d,{value:ie}=c;X&&(p.value=X.offsetWidth),ie&&(f.value=ie.offsetHeight)}function se(){t.scrollable&&(t.useUnifiedContainer?K():($e(),Zt()))}function Ie(E){var X;return!(!((X=o.value)===null||X===void 0)&&X.contains(pr(E)))}function ni(E){E.preventDefault(),E.stopPropagation(),T=!0,Tt("mousemove",window,Je,!0),Tt("mouseup",window,Dt,!0),x=y.value,$=s!=null&&s.value?window.innerWidth-E.clientX:E.clientX}function Je(E){if(!T)return;R!==void 0&&window.clearTimeout(R),w!==void 0&&window.clearTimeout(w);const{value:X}=g,{value:ie}=h,{value:de}=Y;if(X===null||ie===null)return;const ye=(s!=null&&s.value?window.innerWidth-E.clientX-$:E.clientX-$)*(ie-X)/(X-de),we=ie-X;let ke=x+ye;ke=Math.min(we,ke),ke=Math.max(ke,0);const{value:Ke}=ue;if(Ke){Ke.scrollLeft=ke*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:Sn}=t;Sn&&Sn(ke)}}function Dt(E){E.preventDefault(),E.stopPropagation(),it("mousemove",window,Je,!0),it("mouseup",window,Dt,!0),T=!1,se(),Ie(E)&&$t()}function tr(E){E.preventDefault(),E.stopPropagation(),v=!0,Tt("mousemove",window,ii,!0),Tt("mouseup",window,$i,!0),B=b.value,P=E.clientY}function ii(E){if(!v)return;R!==void 0&&window.clearTimeout(R),w!==void 0&&window.clearTimeout(w);const{value:X}=m,{value:ie}=u,{value:de}=F;if(X===null||ie===null)return;const ye=(E.clientY-P)*(ie-X)/(X-de),we=ie-X;let ke=B+ye;ke=Math.min(we,ke),ke=Math.max(ke,0);const{value:Ke}=ue;Ke&&(Ke.scrollTop=ke)}function $i(E){E.preventDefault(),E.stopPropagation(),it("mousemove",window,ii,!0),it("mouseup",window,$i,!0),v=!1,se(),Ie(E)&&$t()}i.watchEffect(()=>{const{value:E}=D,{value:X}=O,{value:ie}=e,{value:de}=d,{value:he}=c;de&&(E?de.classList.remove(`${ie}-scrollbar-rail--disabled`):de.classList.add(`${ie}-scrollbar-rail--disabled`)),he&&(X?he.classList.remove(`${ie}-scrollbar-rail--disabled`):he.classList.add(`${ie}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||se()}),i.onBeforeUnmount(()=>{R!==void 0&&window.clearTimeout(R),w!==void 0&&window.clearTimeout(w),it("mousemove",window,ii,!0),it("mouseup",window,$i,!0)});const nr=i.computed(()=>{const{common:{cubicBezierEaseInOut:E},self:{color:X,colorHover:ie,height:de,width:he,borderRadius:ye,railInsetHorizontalTop:we,railInsetHorizontalBottom:ke,railInsetVerticalRight:Ke,railInsetVerticalLeft:Sn,railColor:Ta}}=V.value,{top:Ra,right:$a,bottom:Pa,left:Na}=en(we),{top:Ea,right:Fa,bottom:Aa,left:Ma}=en(ke),{top:Va,right:Ia,bottom:Oa,left:za}=en(s!=null&&s.value?th(Ke):Ke),{top:La,right:Da,bottom:Ha,left:Wa}=en(s!=null&&s.value?th(Sn):Sn);return{"--n-scrollbar-bezier":E,"--n-scrollbar-color":X,"--n-scrollbar-color-hover":ie,"--n-scrollbar-border-radius":ye,"--n-scrollbar-width":he,"--n-scrollbar-height":de,"--n-scrollbar-rail-top-horizontal-top":Ra,"--n-scrollbar-rail-right-horizontal-top":$a,"--n-scrollbar-rail-bottom-horizontal-top":Pa,"--n-scrollbar-rail-left-horizontal-top":Na,"--n-scrollbar-rail-top-horizontal-bottom":Ea,"--n-scrollbar-rail-right-horizontal-bottom":Fa,"--n-scrollbar-rail-bottom-horizontal-bottom":Aa,"--n-scrollbar-rail-left-horizontal-bottom":Ma,"--n-scrollbar-rail-top-vertical-right":Va,"--n-scrollbar-rail-right-vertical-right":Ia,"--n-scrollbar-rail-bottom-vertical-right":Oa,"--n-scrollbar-rail-left-vertical-right":za,"--n-scrollbar-rail-top-vertical-left":La,"--n-scrollbar-rail-right-vertical-left":Da,"--n-scrollbar-rail-bottom-vertical-left":Ha,"--n-scrollbar-rail-left-vertical-left":Wa,"--n-scrollbar-rail-color":Ta}}),cn=n?Ci("scrollbar",void 0,nr,t):void 0;return Object.assign(Object.assign({},{scrollTo:re,scrollBy:Gt,sync:se,syncUnifiedContainer:K,handleMouseEnterWrapper:sn,handleMouseLeaveWrapper:on}),{mergedClsPrefix:e,rtlEnabled:s,containerScrollTop:b,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:O,needXBar:D,yBarSizePx:N,xBarSizePx:ee,yBarTopPx:z,xBarLeftPx:W,isShowXBar:j,isShowYBar:G,isIos:A,handleScroll:ln,handleContentResize:We,handleContainerResize:Fe,handleYScrollMouseDown:tr,handleXScrollMouseDown:ni,cssVars:n?void 0:nr,themeClass:cn==null?void 0:cn.themeClass,onRender:cn==null?void 0:cn.onRender})},render(){var t;const{$slots:e,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:s,internalHoistYRail:o,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(t=e.default)===null||t===void 0?void 0:t.call(e);const d=this.trigger==="none",u=(g,f)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,g],"data-scrollbar-rail":!0,style:[f||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?ga:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),h=()=>{var g,f;return(g=this.onRender)===null||g===void 0||g.call(this),i.h("div",i.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${n}-scrollbar`,this.themeClass,s&&`${n}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(f=e.default)===null||f===void 0?void 0:f.call(e):i.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i.h(Rs,{onResize:this.handleContentResize},{default:()=>i.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${n}-scrollbar-content`,this.contentClass]},e)})),o?null:u(void 0,void 0),c&&i.h("div",{ref:"xRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--horizontal`,`${n}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},i.h(d?ga:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:s?this.xBarLeftPx:void 0,left:s?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},m=this.container?h():i.h(Rs,{onResize:this.handleContainerResize},{default:h});return o?i.h(i.Fragment,null,m,u(this.themeClass,this.cssVars)):m}}),mk=_h,gk={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function pk(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},gk),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const wh={name:"Empty",common:Si,self:pk},yk=ge("empty",`
298
298
  display: flex;
299
299
  flex-direction: column;
300
300
  align-items: center;
@@ -317,7 +317,7 @@ ${s}
317
317
  transition: color .3s var(--n-bezier);
318
318
  margin-top: 12px;
319
319
  color: var(--n-extra-text-color);
320
- `)]),bk=Object.assign(Object.assign({},pt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),_k=i.defineComponent({name:"Empty",props:bk,slots:Object,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedComponentPropsRef:r}=vi(t),s=pt("Empty","-empty",yk,wh,t,e),{localeRef:o}=uh("Empty"),a=i.computed(()=>{var u,h,m;return(u=t.description)!==null&&u!==void 0?u:(m=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||m===void 0?void 0:m.description}),l=i.computed(()=>{var u,h;return((h=(u=r==null?void 0:r.value)===null||u===void 0?void 0:u.Empty)===null||h===void 0?void 0:h.renderIcon)||(()=>i.h(Qx,null))}),c=i.computed(()=>{const{size:u}=t,{common:{cubicBezierEaseInOut:h},self:{[Ze("iconSize",u)]:m,[Ze("fontSize",u)]:g,textColor:f,iconColor:p,extraTextColor:b}}=s.value;return{"--n-icon-size":m,"--n-font-size":g,"--n-bezier":h,"--n-text-color":f,"--n-icon-color":p,"--n-extra-text-color":b}}),d=n?Ci("empty",i.computed(()=>{let u="";const{size:h}=t;return u+=h[0],u}),c,t):void 0;return{mergedClsPrefix:e,mergedRenderIcon:l,localizedDescription:i.computed(()=>a.value||o.value.description),cssVars:n?void 0:c,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{$slots:t,mergedClsPrefix:e,onRender:n}=this;return n==null||n(),i.h("div",{class:[`${e}-empty`,this.themeClass],style:this.cssVars},this.showIcon?i.h("div",{class:`${e}-empty__icon`},t.icon?t.icon():i.h($r,{clsPrefix:e},{default:this.mergedRenderIcon})):null,this.showDescription?i.h("div",{class:`${e}-empty__description`},t.default?t.default():this.localizedDescription):null,t.extra?i.h("div",{class:`${e}-empty__extra`},t.extra()):null)}}),wk={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function xk(t){const{borderRadius:e,popoverColor:n,textColor3:r,dividerColor:s,textColor2:o,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:u,fontSizeTiny:h,fontSizeSmall:m,fontSizeMedium:g,fontSizeLarge:f,fontSizeHuge:p,heightTiny:b,heightSmall:y,heightMedium:_,heightLarge:S,heightHuge:v}=t;return Object.assign(Object.assign({},wk),{optionFontSizeTiny:h,optionFontSizeSmall:m,optionFontSizeMedium:g,optionFontSizeLarge:f,optionFontSizeHuge:p,optionHeightTiny:b,optionHeightSmall:y,optionHeightMedium:_,optionHeightLarge:S,optionHeightHuge:v,borderRadius:e,color:n,groupHeaderTextColor:r,actionDividerColor:s,optionTextColor:o,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:c,optionOpacityDisabled:d,optionCheckColor:c,optionColorPending:u,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:u,actionTextColor:o,loadingColor:c})}const xh={name:"InternalSelectMenu",common:Si,peers:{Scrollbar:ba,Empty:wh},self:xk},kh=i.defineComponent({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:t,renderOptionRef:e,labelFieldRef:n,nodePropsRef:r}=i.inject(la);return{labelField:n,nodeProps:r,renderLabel:t,renderOption:e}},render(){const{clsPrefix:t,renderLabel:e,renderOption:n,nodeProps:r,tmNode:{rawNode:s}}=this,o=r==null?void 0:r(s),a=e?e(s,!1):er(s[this.labelField],s,!1),l=i.h("div",Object.assign({},o,{class:[`${t}-base-select-group-header`,o==null?void 0:o.class]}),a);return s.render?s.render({node:l,option:s}):n?n({node:l,option:s,selected:!1}):l}});function kk(t,e){return i.h(i.Transition,{name:"fade-in-scale-up-transition"},{default:()=>t?i.h($r,{clsPrefix:e,class:`${e}-base-select-option__check`},{default:()=>i.h(Ux)}):null})}const vh=i.defineComponent({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(t){const{valueRef:e,pendingTmNodeRef:n,multipleRef:r,valueSetRef:s,renderLabelRef:o,renderOptionRef:a,labelFieldRef:l,valueFieldRef:c,showCheckmarkRef:d,nodePropsRef:u,handleOptionClick:h,handleOptionMouseEnter:m}=i.inject(la),g=Ut(()=>{const{value:y}=n;return y?t.tmNode.key===y.key:!1});function f(y){const{tmNode:_}=t;_.disabled||h(y,_)}function p(y){const{tmNode:_}=t;_.disabled||m(y,_)}function b(y){const{tmNode:_}=t,{value:S}=g;_.disabled||S||m(y,_)}return{multiple:r,isGrouped:Ut(()=>{const{tmNode:y}=t,{parent:_}=y;return _&&_.rawNode.type==="group"}),showCheckmark:d,nodeProps:u,isPending:g,isSelected:Ut(()=>{const{value:y}=e,{value:_}=r;if(y===null)return!1;const S=t.tmNode.rawNode[c.value];if(_){const{value:v}=s;return v.has(S)}else return y===S}),labelField:l,renderLabel:o,renderOption:a,handleMouseMove:b,handleMouseEnter:p,handleClick:f}},render(){const{clsPrefix:t,tmNode:{rawNode:e},isSelected:n,isPending:r,isGrouped:s,showCheckmark:o,nodeProps:a,renderOption:l,renderLabel:c,handleClick:d,handleMouseEnter:u,handleMouseMove:h}=this,m=kk(n,t),g=c?[c(e,n),o&&m]:[er(e[this.labelField],e,n),o&&m],f=a==null?void 0:a(e),p=i.h("div",Object.assign({},f,{class:[`${t}-base-select-option`,e.class,f==null?void 0:f.class,{[`${t}-base-select-option--disabled`]:e.disabled,[`${t}-base-select-option--selected`]:n,[`${t}-base-select-option--grouped`]:s,[`${t}-base-select-option--pending`]:r,[`${t}-base-select-option--show-checkmark`]:o}],style:[(f==null?void 0:f.style)||"",e.style||""],onClick:ha([d,f==null?void 0:f.onClick]),onMouseenter:ha([u,f==null?void 0:f.onMouseenter]),onMousemove:ha([h,f==null?void 0:f.onMousemove])}),i.h("div",{class:`${t}-base-select-option__content`},g));return e.render?e.render({node:p,option:e,selected:n}):l?l({node:p,option:e,selected:n}):p}}),{cubicBezierEaseIn:Ch,cubicBezierEaseOut:Sh}=Rr;function Bh({transformOrigin:t="inherit",duration:e=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:s=""}={}){return[ce("&.fade-in-scale-up-transition-leave-active",{transformOrigin:t,transition:`opacity ${e} ${Ch}, transform ${e} ${Ch} ${s&&`,${s}`}`}),ce("&.fade-in-scale-up-transition-enter-active",{transformOrigin:t,transition:`opacity ${e} ${Sh}, transform ${e} ${Sh} ${s&&`,${s}`}`}),ce("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),ce("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const vk=ge("base-select-menu",`
320
+ `)]),bk=Object.assign(Object.assign({},pt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),_k=i.defineComponent({name:"Empty",props:bk,slots:Object,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedComponentPropsRef:r}=vi(t),s=pt("Empty","-empty",yk,wh,t,e),{localeRef:o}=uh("Empty"),a=i.computed(()=>{var u,h,m;return(u=t.description)!==null&&u!==void 0?u:(m=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||m===void 0?void 0:m.description}),l=i.computed(()=>{var u,h;return((h=(u=r==null?void 0:r.value)===null||u===void 0?void 0:u.Empty)===null||h===void 0?void 0:h.renderIcon)||(()=>i.h(Qx,null))}),c=i.computed(()=>{const{size:u}=t,{common:{cubicBezierEaseInOut:h},self:{[Ze("iconSize",u)]:m,[Ze("fontSize",u)]:g,textColor:f,iconColor:p,extraTextColor:b}}=s.value;return{"--n-icon-size":m,"--n-font-size":g,"--n-bezier":h,"--n-text-color":f,"--n-icon-color":p,"--n-extra-text-color":b}}),d=n?Ci("empty",i.computed(()=>{let u="";const{size:h}=t;return u+=h[0],u}),c,t):void 0;return{mergedClsPrefix:e,mergedRenderIcon:l,localizedDescription:i.computed(()=>a.value||o.value.description),cssVars:n?void 0:c,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{$slots:t,mergedClsPrefix:e,onRender:n}=this;return n==null||n(),i.h("div",{class:[`${e}-empty`,this.themeClass],style:this.cssVars},this.showIcon?i.h("div",{class:`${e}-empty__icon`},t.icon?t.icon():i.h($r,{clsPrefix:e},{default:this.mergedRenderIcon})):null,this.showDescription?i.h("div",{class:`${e}-empty__description`},t.default?t.default():this.localizedDescription):null,t.extra?i.h("div",{class:`${e}-empty__extra`},t.extra()):null)}}),wk={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function xk(t){const{borderRadius:e,popoverColor:n,textColor3:r,dividerColor:s,textColor2:o,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:u,fontSizeTiny:h,fontSizeSmall:m,fontSizeMedium:g,fontSizeLarge:f,fontSizeHuge:p,heightTiny:b,heightSmall:y,heightMedium:_,heightLarge:S,heightHuge:v}=t;return Object.assign(Object.assign({},wk),{optionFontSizeTiny:h,optionFontSizeSmall:m,optionFontSizeMedium:g,optionFontSizeLarge:f,optionFontSizeHuge:p,optionHeightTiny:b,optionHeightSmall:y,optionHeightMedium:_,optionHeightLarge:S,optionHeightHuge:v,borderRadius:e,color:n,groupHeaderTextColor:r,actionDividerColor:s,optionTextColor:o,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:c,optionOpacityDisabled:d,optionCheckColor:c,optionColorPending:u,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:u,actionTextColor:o,loadingColor:c})}const xh={name:"InternalSelectMenu",common:Si,peers:{Scrollbar:_a,Empty:wh},self:xk},kh=i.defineComponent({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:t,renderOptionRef:e,labelFieldRef:n,nodePropsRef:r}=i.inject(ca);return{labelField:n,nodeProps:r,renderLabel:t,renderOption:e}},render(){const{clsPrefix:t,renderLabel:e,renderOption:n,nodeProps:r,tmNode:{rawNode:s}}=this,o=r==null?void 0:r(s),a=e?e(s,!1):er(s[this.labelField],s,!1),l=i.h("div",Object.assign({},o,{class:[`${t}-base-select-group-header`,o==null?void 0:o.class]}),a);return s.render?s.render({node:l,option:s}):n?n({node:l,option:s,selected:!1}):l}});function kk(t,e){return i.h(i.Transition,{name:"fade-in-scale-up-transition"},{default:()=>t?i.h($r,{clsPrefix:e,class:`${e}-base-select-option__check`},{default:()=>i.h(Ux)}):null})}const vh=i.defineComponent({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(t){const{valueRef:e,pendingTmNodeRef:n,multipleRef:r,valueSetRef:s,renderLabelRef:o,renderOptionRef:a,labelFieldRef:l,valueFieldRef:c,showCheckmarkRef:d,nodePropsRef:u,handleOptionClick:h,handleOptionMouseEnter:m}=i.inject(ca),g=Ut(()=>{const{value:y}=n;return y?t.tmNode.key===y.key:!1});function f(y){const{tmNode:_}=t;_.disabled||h(y,_)}function p(y){const{tmNode:_}=t;_.disabled||m(y,_)}function b(y){const{tmNode:_}=t,{value:S}=g;_.disabled||S||m(y,_)}return{multiple:r,isGrouped:Ut(()=>{const{tmNode:y}=t,{parent:_}=y;return _&&_.rawNode.type==="group"}),showCheckmark:d,nodeProps:u,isPending:g,isSelected:Ut(()=>{const{value:y}=e,{value:_}=r;if(y===null)return!1;const S=t.tmNode.rawNode[c.value];if(_){const{value:v}=s;return v.has(S)}else return y===S}),labelField:l,renderLabel:o,renderOption:a,handleMouseMove:b,handleMouseEnter:p,handleClick:f}},render(){const{clsPrefix:t,tmNode:{rawNode:e},isSelected:n,isPending:r,isGrouped:s,showCheckmark:o,nodeProps:a,renderOption:l,renderLabel:c,handleClick:d,handleMouseEnter:u,handleMouseMove:h}=this,m=kk(n,t),g=c?[c(e,n),o&&m]:[er(e[this.labelField],e,n),o&&m],f=a==null?void 0:a(e),p=i.h("div",Object.assign({},f,{class:[`${t}-base-select-option`,e.class,f==null?void 0:f.class,{[`${t}-base-select-option--disabled`]:e.disabled,[`${t}-base-select-option--selected`]:n,[`${t}-base-select-option--grouped`]:s,[`${t}-base-select-option--pending`]:r,[`${t}-base-select-option--show-checkmark`]:o}],style:[(f==null?void 0:f.style)||"",e.style||""],onClick:fa([d,f==null?void 0:f.onClick]),onMouseenter:fa([u,f==null?void 0:f.onMouseenter]),onMousemove:fa([h,f==null?void 0:f.onMousemove])}),i.h("div",{class:`${t}-base-select-option__content`},g));return e.render?e.render({node:p,option:e,selected:n}):l?l({node:p,option:e,selected:n}):p}}),{cubicBezierEaseIn:Ch,cubicBezierEaseOut:Sh}=Rr;function Bh({transformOrigin:t="inherit",duration:e=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:s=""}={}){return[ce("&.fade-in-scale-up-transition-leave-active",{transformOrigin:t,transition:`opacity ${e} ${Ch}, transform ${e} ${Ch} ${s&&`,${s}`}`}),ce("&.fade-in-scale-up-transition-enter-active",{transformOrigin:t,transition:`opacity ${e} ${Sh}, transform ${e} ${Sh} ${s&&`,${s}`}`}),ce("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),ce("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const vk=ge("base-select-menu",`
321
321
  line-height: 1.5;
322
322
  outline: none;
323
323
  z-index: 0;
@@ -424,7 +424,7 @@ ${s}
424
424
  top: calc(50% - 7px);
425
425
  color: var(--n-option-check-color);
426
426
  transition: color .3s var(--n-bezier);
427
- `,[Bh({enterScale:"0.5"})])])]),Ck=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},pt.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=vi(t),r=Tr("InternalSelectMenu",n,e),s=pt("InternalSelectMenu","-internal-select-menu",vk,xh,t,i.toRef(t,"clsPrefix")),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.computed(()=>t.treeMate.getFlattenedNodes()),d=i.computed(()=>p1(c.value)),u=i.ref(null);function h(){const{treeMate:O}=t;let D=null;const{value:j}=t;j===null?D=O.getFirstAvailableNode():(t.multiple?D=O.getNode((j||[])[(j||[]).length-1]):D=O.getNode(j),(!D||D.disabled)&&(D=O.getFirstAvailableNode())),F(D||null)}function m(){const{value:O}=u;O&&!t.treeMate.getNode(O.key)&&(u.value=null)}let g;i.watch(()=>t.show,O=>{O?g=i.watch(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?h():m(),i.nextTick(N)):m()},{immediate:!0}):g==null||g()},{immediate:!0}),i.onBeforeUnmount(()=>{g==null||g()});const f=i.computed(()=>yr(s.value.self[Ze("optionHeight",t.size)])),p=i.computed(()=>en(s.value.self[Ze("padding",t.size)])),b=i.computed(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),y=i.computed(()=>{const O=c.value;return O&&O.length===0});function _(O){const{onToggle:D}=t;D&&D(O)}function S(O){const{onScroll:D}=t;D&&D(O)}function v(O){var D;(D=l.value)===null||D===void 0||D.sync(),S(O)}function T(){var O;(O=l.value)===null||O===void 0||O.sync()}function R(){const{value:O}=u;return O||null}function w(O,D){D.disabled||F(D,!1)}function B(O,D){D.disabled||_(D)}function x(O){var D;gr(O,"action")||(D=t.onKeyup)===null||D===void 0||D.call(t,O)}function $(O){var D;gr(O,"action")||(D=t.onKeydown)===null||D===void 0||D.call(t,O)}function P(O){var D;(D=t.onMousedown)===null||D===void 0||D.call(t,O),!t.focusable&&O.preventDefault()}function A(){const{value:O}=u;O&&F(O.getNext({loop:!0}),!0)}function V(){const{value:O}=u;O&&F(O.getPrev({loop:!0}),!0)}function F(O,D=!1){u.value=O,D&&N()}function N(){var O,D;const j=u.value;if(!j)return;const G=d.value(j.key);G!==null&&(t.virtualScroll?(O=a.value)===null||O===void 0||O.scrollTo({index:G}):(D=l.value)===null||D===void 0||D.scrollTo({index:G,elSize:f.value}))}function Y(O){var D,j;!((D=o.value)===null||D===void 0)&&D.contains(O.target)&&((j=t.onFocus)===null||j===void 0||j.call(t,O))}function ee(O){var D,j;!((D=o.value)===null||D===void 0)&&D.contains(O.relatedTarget)||(j=t.onBlur)===null||j===void 0||j.call(t,O)}i.provide(la,{handleOptionMouseEnter:w,handleOptionClick:B,valueSetRef:b,pendingTmNodeRef:u,nodePropsRef:i.toRef(t,"nodeProps"),showCheckmarkRef:i.toRef(t,"showCheckmark"),multipleRef:i.toRef(t,"multiple"),valueRef:i.toRef(t,"value"),renderLabelRef:i.toRef(t,"renderLabel"),renderOptionRef:i.toRef(t,"renderOption"),labelFieldRef:i.toRef(t,"labelField"),valueFieldRef:i.toRef(t,"valueField")}),i.provide(Yu,o),i.onMounted(()=>{const{value:O}=l;O&&O.sync()});const I=i.computed(()=>{const{size:O}=t,{common:{cubicBezierEaseInOut:D},self:{height:j,borderRadius:G,color:ue,groupHeaderTextColor:oe,actionDividerColor:re,optionTextColorPressed:Ee,optionTextColor:We,optionTextColorDisabled:Fe,optionTextColorActive:Gt,optionOpacityDisabled:Te,optionCheckColor:sn,actionTextColor:on,optionColorPending:Rt,optionColorActive:Lt,loadingColor:an,loadingSize:wt,optionColorActivePending:Ln,[Ze("optionFontSize",O)]:ln,[Ze("optionHeight",O)]:Zt,[Ze("optionPadding",O)]:$e}}=s.value;return{"--n-height":j,"--n-action-divider-color":re,"--n-action-text-color":on,"--n-bezier":D,"--n-border-radius":G,"--n-color":ue,"--n-option-font-size":ln,"--n-group-header-text-color":oe,"--n-option-check-color":sn,"--n-option-color-pending":Rt,"--n-option-color-active":Lt,"--n-option-color-active-pending":Ln,"--n-option-height":Zt,"--n-option-opacity-disabled":Te,"--n-option-text-color":We,"--n-option-text-color-active":Gt,"--n-option-text-color-disabled":Fe,"--n-option-text-color-pressed":Ee,"--n-option-padding":$e,"--n-option-padding-left":en($e,"left"),"--n-option-padding-right":en($e,"right"),"--n-loading-color":an,"--n-loading-size":wt}}),{inlineThemeDisabled:z}=t,q=z?Ci("internal-select-menu",i.computed(()=>t.size[0]),I,t):void 0,W={selfRef:o,next:A,prev:V,getPendingTmNode:R};return Qu(o,t.onResize),Object.assign({mergedTheme:s,mergedClsPrefix:e,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:f,padding:p,flattenedNodes:c,empty:y,virtualListContainer(){const{value:O}=a;return O==null?void 0:O.listElRef},virtualListContent(){const{value:O}=a;return O==null?void 0:O.itemsElRef},doScroll:S,handleFocusin:Y,handleFocusout:ee,handleKeyUp:x,handleKeyDown:$,handleMouseDown:P,handleVirtualListResize:T,handleVirtualListScroll:v,cssVars:z?void 0:I,themeClass:q==null?void 0:q.themeClass,onRender:q==null?void 0:q.onRender},W)},render(){const{$slots:t,virtualScroll:e,clsPrefix:n,mergedTheme:r,themeClass:s,onRender:o}=this;return o==null||o(),i.h("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,s,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},xi(t.header,a=>a&&i.h("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},a)),this.loading?i.h("div",{class:`${n}-base-select-menu__loading`},i.h(gh,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},fa(t.empty,()=>[i.h(_k,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(_h,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:e?this.virtualListContainer:void 0,content:e?this.virtualListContent:void 0,onScroll:e?void 0:this.doScroll},{default:()=>e?i.h(Xw,{ref:"virtualListRef",class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:a})=>a.isGroup?i.h(kh,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h(vh,{clsPrefix:n,key:a.key,tmNode:a})}):i.h("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(a=>a.isGroup?i.h(kh,{key:a.key,clsPrefix:n,tmNode:a}):i.h(vh,{clsPrefix:n,key:a.key,tmNode:a})))}),xi(t.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(rk,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),Sk={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function Bk(t){const{boxShadow2:e,popoverColor:n,textColor2:r,borderRadius:s,fontSize:o,dividerColor:a}=t;return Object.assign(Object.assign({},Sk),{fontSize:o,borderRadius:s,color:n,dividerColor:a,textColor:r,boxShadow:e})}const Th={name:"Popover",common:Si,peers:{Scrollbar:ba},self:Bk},_a={top:"bottom",bottom:"top",left:"right",right:"left"},rt="var(--n-arrow-height) * 1.414",Tk=ce([ge("popover",`
427
+ `,[Bh({enterScale:"0.5"})])])]),Ck=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},pt.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=vi(t),r=Tr("InternalSelectMenu",n,e),s=pt("InternalSelectMenu","-internal-select-menu",vk,xh,t,i.toRef(t,"clsPrefix")),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.computed(()=>t.treeMate.getFlattenedNodes()),d=i.computed(()=>p1(c.value)),u=i.ref(null);function h(){const{treeMate:O}=t;let D=null;const{value:j}=t;j===null?D=O.getFirstAvailableNode():(t.multiple?D=O.getNode((j||[])[(j||[]).length-1]):D=O.getNode(j),(!D||D.disabled)&&(D=O.getFirstAvailableNode())),F(D||null)}function m(){const{value:O}=u;O&&!t.treeMate.getNode(O.key)&&(u.value=null)}let g;i.watch(()=>t.show,O=>{O?g=i.watch(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?h():m(),i.nextTick(N)):m()},{immediate:!0}):g==null||g()},{immediate:!0}),i.onBeforeUnmount(()=>{g==null||g()});const f=i.computed(()=>yr(s.value.self[Ze("optionHeight",t.size)])),p=i.computed(()=>en(s.value.self[Ze("padding",t.size)])),b=i.computed(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),y=i.computed(()=>{const O=c.value;return O&&O.length===0});function _(O){const{onToggle:D}=t;D&&D(O)}function S(O){const{onScroll:D}=t;D&&D(O)}function v(O){var D;(D=l.value)===null||D===void 0||D.sync(),S(O)}function T(){var O;(O=l.value)===null||O===void 0||O.sync()}function R(){const{value:O}=u;return O||null}function w(O,D){D.disabled||F(D,!1)}function B(O,D){D.disabled||_(D)}function x(O){var D;gr(O,"action")||(D=t.onKeyup)===null||D===void 0||D.call(t,O)}function $(O){var D;gr(O,"action")||(D=t.onKeydown)===null||D===void 0||D.call(t,O)}function P(O){var D;(D=t.onMousedown)===null||D===void 0||D.call(t,O),!t.focusable&&O.preventDefault()}function A(){const{value:O}=u;O&&F(O.getNext({loop:!0}),!0)}function V(){const{value:O}=u;O&&F(O.getPrev({loop:!0}),!0)}function F(O,D=!1){u.value=O,D&&N()}function N(){var O,D;const j=u.value;if(!j)return;const G=d.value(j.key);G!==null&&(t.virtualScroll?(O=a.value)===null||O===void 0||O.scrollTo({index:G}):(D=l.value)===null||D===void 0||D.scrollTo({index:G,elSize:f.value}))}function Y(O){var D,j;!((D=o.value)===null||D===void 0)&&D.contains(O.target)&&((j=t.onFocus)===null||j===void 0||j.call(t,O))}function ee(O){var D,j;!((D=o.value)===null||D===void 0)&&D.contains(O.relatedTarget)||(j=t.onBlur)===null||j===void 0||j.call(t,O)}i.provide(ca,{handleOptionMouseEnter:w,handleOptionClick:B,valueSetRef:b,pendingTmNodeRef:u,nodePropsRef:i.toRef(t,"nodeProps"),showCheckmarkRef:i.toRef(t,"showCheckmark"),multipleRef:i.toRef(t,"multiple"),valueRef:i.toRef(t,"value"),renderLabelRef:i.toRef(t,"renderLabel"),renderOptionRef:i.toRef(t,"renderOption"),labelFieldRef:i.toRef(t,"labelField"),valueFieldRef:i.toRef(t,"valueField")}),i.provide(Yu,o),i.onMounted(()=>{const{value:O}=l;O&&O.sync()});const I=i.computed(()=>{const{size:O}=t,{common:{cubicBezierEaseInOut:D},self:{height:j,borderRadius:G,color:ue,groupHeaderTextColor:oe,actionDividerColor:re,optionTextColorPressed:Ee,optionTextColor:We,optionTextColorDisabled:Fe,optionTextColorActive:Gt,optionOpacityDisabled:Te,optionCheckColor:sn,actionTextColor:on,optionColorPending:$t,optionColorActive:Lt,loadingColor:an,loadingSize:wt,optionColorActivePending:Ln,[Ze("optionFontSize",O)]:ln,[Ze("optionHeight",O)]:Zt,[Ze("optionPadding",O)]:$e}}=s.value;return{"--n-height":j,"--n-action-divider-color":re,"--n-action-text-color":on,"--n-bezier":D,"--n-border-radius":G,"--n-color":ue,"--n-option-font-size":ln,"--n-group-header-text-color":oe,"--n-option-check-color":sn,"--n-option-color-pending":$t,"--n-option-color-active":Lt,"--n-option-color-active-pending":Ln,"--n-option-height":Zt,"--n-option-opacity-disabled":Te,"--n-option-text-color":We,"--n-option-text-color-active":Gt,"--n-option-text-color-disabled":Fe,"--n-option-text-color-pressed":Ee,"--n-option-padding":$e,"--n-option-padding-left":en($e,"left"),"--n-option-padding-right":en($e,"right"),"--n-loading-color":an,"--n-loading-size":wt}}),{inlineThemeDisabled:z}=t,q=z?Ci("internal-select-menu",i.computed(()=>t.size[0]),I,t):void 0,W={selfRef:o,next:A,prev:V,getPendingTmNode:R};return Qu(o,t.onResize),Object.assign({mergedTheme:s,mergedClsPrefix:e,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:f,padding:p,flattenedNodes:c,empty:y,virtualListContainer(){const{value:O}=a;return O==null?void 0:O.listElRef},virtualListContent(){const{value:O}=a;return O==null?void 0:O.itemsElRef},doScroll:S,handleFocusin:Y,handleFocusout:ee,handleKeyUp:x,handleKeyDown:$,handleMouseDown:P,handleVirtualListResize:T,handleVirtualListScroll:v,cssVars:z?void 0:I,themeClass:q==null?void 0:q.themeClass,onRender:q==null?void 0:q.onRender},W)},render(){const{$slots:t,virtualScroll:e,clsPrefix:n,mergedTheme:r,themeClass:s,onRender:o}=this;return o==null||o(),i.h("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,s,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},xi(t.header,a=>a&&i.h("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},a)),this.loading?i.h("div",{class:`${n}-base-select-menu__loading`},i.h(gh,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},ma(t.empty,()=>[i.h(_k,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(_h,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:e?this.virtualListContainer:void 0,content:e?this.virtualListContent:void 0,onScroll:e?void 0:this.doScroll},{default:()=>e?i.h(Xw,{ref:"virtualListRef",class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:a})=>a.isGroup?i.h(kh,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h(vh,{clsPrefix:n,key:a.key,tmNode:a})}):i.h("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(a=>a.isGroup?i.h(kh,{key:a.key,clsPrefix:n,tmNode:a}):i.h(vh,{clsPrefix:n,key:a.key,tmNode:a})))}),xi(t.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(rk,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),Sk={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function Bk(t){const{boxShadow2:e,popoverColor:n,textColor2:r,borderRadius:s,fontSize:o,dividerColor:a}=t;return Object.assign(Object.assign({},Sk),{fontSize:o,borderRadius:s,color:n,dividerColor:a,textColor:r,boxShadow:e})}const Th={name:"Popover",common:Si,peers:{Scrollbar:_a},self:Bk},wa={top:"bottom",bottom:"top",left:"right",right:"left"},rt="var(--n-arrow-height) * 1.414",Tk=ce([ge("popover",`
428
428
  transition:
429
429
  box-shadow .3s var(--n-bezier),
430
430
  background-color .3s var(--n-bezier),
@@ -527,9 +527,9 @@ ${s}
527
527
  right: calc(${rt} / -2);
528
528
  bottom: calc(${En("right-end")} + var(--v-offset-top));
529
529
  `),...M.map({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(t,e)=>{const n=["right","left"].includes(e),r=n?"width":"height";return t.map(s=>{const o=s.split("-")[1]==="end",l=`calc((${`var(--v-target-${r}, 0px)`} - ${rt}) / 2)`,c=En(s);return ce(`[v-placement="${s}"] >`,[ge("popover-shared",[Se("center-arrow",[ge("popover-arrow",`${e}: calc(max(${l}, ${c}) ${o?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function En(t){return["top","bottom"].includes(t.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function Kt(t,e){const n=t.split("-")[0],r=["top","bottom"].includes(n)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return ce(`[v-placement="${t}"] >`,[ge("popover-shared",`
530
- margin-${_a[n]}: var(--n-space);
530
+ margin-${wa[n]}: var(--n-space);
531
531
  `,[Se("show-arrow",`
532
- margin-${_a[n]}: var(--n-space-arrow);
532
+ margin-${wa[n]}: var(--n-space-arrow);
533
533
  `),Se("overlap",`
534
534
  margin: 0;
535
535
  `),nx("popover-arrow-wrapper",`
@@ -538,9 +538,9 @@ ${s}
538
538
  top: 0;
539
539
  bottom: 0;
540
540
  ${n}: 100%;
541
- ${_a[n]}: auto;
541
+ ${wa[n]}: auto;
542
542
  ${r}
543
- `,[ge("popover-arrow",e)])])])}const Rh=Object.assign(Object.assign({},pt.props),{to:Nn.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function Rk({arrowClass:t,arrowStyle:e,arrowWrapperClass:n,arrowWrapperStyle:r,clsPrefix:s}){return i.h("div",{key:"__popover-arrow__",style:r,class:[`${s}-popover-arrow-wrapper`,n]},i.h("div",{class:[`${s}-popover-arrow`,t],style:e}))}const $k=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:Rh,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o,mergedRtlRef:a}=vi(t),l=pt("Popover","-popover",Tk,Th,t,s),c=Tr("Popover",a,s),d=i.ref(null),u=i.inject("NPopover"),h=i.ref(null),m=i.ref(t.show),g=i.ref(!1);i.watchEffect(()=>{const{show:x}=t;x&&!ix()&&!t.internalDeactivateImmediately&&(g.value=!0)});const f=i.computed(()=>{const{trigger:x,onClickoutside:$}=t,P=[],{positionManuallyRef:{value:A}}=u;return A||(x==="click"&&!$&&P.push([bs,R,void 0,{capture:!0}]),x==="hover"&&P.push([V1,T])),$&&P.push([bs,R,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&g.value)&&P.push([i.vShow,t.show]),P}),p=i.computed(()=>{const{common:{cubicBezierEaseInOut:x,cubicBezierEaseIn:$,cubicBezierEaseOut:P},self:{space:A,spaceArrow:V,padding:F,fontSize:N,textColor:Y,dividerColor:ee,color:I,boxShadow:z,borderRadius:q,arrowHeight:W,arrowOffset:O,arrowOffsetVertical:D}}=l.value;return{"--n-box-shadow":z,"--n-bezier":x,"--n-bezier-ease-in":$,"--n-bezier-ease-out":P,"--n-font-size":N,"--n-text-color":Y,"--n-color":I,"--n-divider-color":ee,"--n-border-radius":q,"--n-arrow-height":W,"--n-arrow-offset":O,"--n-arrow-offset-vertical":D,"--n-padding":F,"--n-space":A,"--n-space-arrow":V}}),b=i.computed(()=>{const x=t.width==="trigger"?void 0:ca(t.width),$=[];x&&$.push({width:x});const{maxWidth:P,minWidth:A}=t;return P&&$.push({maxWidth:ca(P)}),A&&$.push({maxWidth:ca(A)}),o||$.push(p.value),$}),y=o?Ci("popover",void 0,p,t):void 0;u.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{u.setBodyInstance(null)}),i.watch(i.toRef(t,"show"),x=>{t.animated||(x?m.value=!0:m.value=!1)});function _(){var x;(x=d.value)===null||x===void 0||x.syncPosition()}function S(x){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&u.handleMouseEnter(x)}function v(x){t.trigger==="hover"&&t.keepAliveOnHover&&u.handleMouseLeave(x)}function T(x){t.trigger==="hover"&&!w().contains(pr(x))&&u.handleMouseMoveOutside(x)}function R(x){(t.trigger==="click"&&!w().contains(pr(x))||t.onClickoutside)&&u.handleClickOutside(x)}function w(){return u.getTriggerElement()}i.provide(Gu,h),i.provide(Uu,null),i.provide(Ku,null);function B(){if(y==null||y.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&g.value))return null;let $;const P=u.internalRenderBodyRef.value,{value:A}=s;if(P)$=P([`${A}-popover-shared`,(c==null?void 0:c.value)&&`${A}-popover--rtl`,y==null?void 0:y.themeClass.value,t.overlap&&`${A}-popover-shared--overlap`,t.showArrow&&`${A}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${A}-popover-shared--center-arrow`],h,b.value,S,v);else{const{value:V}=u.extraClassRef,{internalTrapFocus:F}=t,N=!ch(e.header)||!ch(e.footer),Y=()=>{var ee,I;const z=N?i.h(i.Fragment,null,xi(e.header,O=>O?i.h("div",{class:[`${A}-popover__header`,t.headerClass],style:t.headerStyle},O):null),xi(e.default,O=>O?i.h("div",{class:[`${A}-popover__content`,t.contentClass],style:t.contentStyle},e):null),xi(e.footer,O=>O?i.h("div",{class:[`${A}-popover__footer`,t.footerClass],style:t.footerStyle},O):null)):t.scrollable?(ee=e.default)===null||ee===void 0?void 0:ee.call(e):i.h("div",{class:[`${A}-popover__content`,t.contentClass],style:t.contentStyle},e),q=t.scrollable?i.h(mk,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:N?void 0:`${A}-popover__content ${(I=t.contentClass)!==null&&I!==void 0?I:""}`,contentStyle:N?void 0:t.contentStyle},{default:()=>z}):z,W=t.showArrow?Rk({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:A}):null;return[q,W]};$=i.h("div",i.mergeProps({class:[`${A}-popover`,`${A}-popover-shared`,(c==null?void 0:c.value)&&`${A}-popover--rtl`,y==null?void 0:y.themeClass.value,V.map(ee=>`${A}-${ee}`),{[`${A}-popover--scrollable`]:t.scrollable,[`${A}-popover--show-header-or-footer`]:N,[`${A}-popover--raw`]:t.raw,[`${A}-popover-shared--overlap`]:t.overlap,[`${A}-popover-shared--show-arrow`]:t.showArrow,[`${A}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:h,style:b.value,onKeydown:u.handleKeydown,onMouseenter:S,onMouseleave:v},n),F?i.h(Kw,{active:t.show,autoFocus:!0},{default:Y}):Y())}return i.withDirectives($,f.value)}return{displayed:g,namespace:r,isMounted:u.isMountedRef,zIndex:u.zIndexRef,followerRef:d,adjustedTo:Nn(t),followerEnabled:m,renderContentNode:B}},render(){return i.h(vu,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===Nn.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var t;(t=this.internalOnAfterLeave)===null||t===void 0||t.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var Pk={};const Nk=Object.keys(Rh),Ek={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function Fk(t,e,n){Ek[e].forEach(r=>{t.props?t.props=Object.assign({},t.props):t.props={};const s=t.props[r],o=n[r];s?t.props[r]=(...a)=>{s(...a),o(...a)}:t.props[r]=o})}const Ak={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:Nn.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},Mk=Object.assign(Object.assign(Object.assign({},pt.props),Ak),{internalOnAfterLeave:Function,internalRenderBody:Function}),Vk=i.defineComponent({name:"Popover",inheritAttrs:!1,props:Mk,slots:Object,__popover__:!0,setup(t){Pk.NODE_ENV!=="production"&&i.watchEffect(()=>{t.maxWidth!==void 0&&ei("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&ei("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&ei("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&ei("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&ei("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=_s(),n=i.ref(null),r=i.computed(()=>t.show),s=i.ref(t.defaultShow),o=Ko(r,s),a=Ut(()=>t.disabled?!1:o.value),l=()=>{if(t.disabled)return!0;const{getDisabled:N}=t;return!!(N!=null&&N())},c=()=>l()?!1:o.value,d=iu(t,["arrow","showArrow"]),u=i.computed(()=>t.overlap?!1:d.value);let h=null;const m=i.ref(null),g=i.ref(null),f=Ut(()=>t.x!==void 0&&t.y!==void 0);function p(N){const{"onUpdate:show":Y,onUpdateShow:ee,onShow:I,onHide:z}=t;s.value=N,Y&&gt(Y,N),ee&&gt(ee,N),N&&I&&gt(I,!0),N&&z&&gt(z,!1)}function b(){h&&h.syncPosition()}function y(){const{value:N}=m;N&&(window.clearTimeout(N),m.value=null)}function _(){const{value:N}=g;N&&(window.clearTimeout(N),g.value=null)}function S(){const N=l();if(t.trigger==="focus"&&!N){if(c())return;p(!0)}}function v(){const N=l();if(t.trigger==="focus"&&!N){if(!c())return;p(!1)}}function T(){const N=l();if(t.trigger==="hover"&&!N){if(_(),m.value!==null||c())return;const Y=()=>{p(!0),m.value=null},{delay:ee}=t;ee===0?Y():m.value=window.setTimeout(Y,ee)}}function R(){const N=l();if(t.trigger==="hover"&&!N){if(y(),g.value!==null||!c())return;const Y=()=>{p(!1),g.value=null},{duration:ee}=t;ee===0?Y():g.value=window.setTimeout(Y,ee)}}function w(){R()}function B(N){var Y;c()&&(t.trigger==="click"&&(y(),_(),p(!1)),(Y=t.onClickoutside)===null||Y===void 0||Y.call(t,N))}function x(){if(t.trigger==="click"&&!l()){y(),_();const N=!c();p(N)}}function $(N){t.internalTrapFocus&&N.key==="Escape"&&(y(),_(),p(!1))}function P(N){s.value=N}function A(){var N;return(N=n.value)===null||N===void 0?void 0:N.targetRef}function V(N){h=N}return i.provide("NPopover",{getTriggerElement:A,handleKeydown:$,handleMouseEnter:T,handleMouseLeave:R,handleClickOutside:B,handleMouseMoveOutside:w,setBodyInstance:V,positionManuallyRef:f,isMountedRef:e,zIndexRef:i.toRef(t,"zIndex"),extraClassRef:i.toRef(t,"internalExtraClass"),internalRenderBodyRef:i.toRef(t,"internalRenderBody")}),i.watchEffect(()=>{o.value&&l()&&p(!1)}),{binderInstRef:n,positionManually:f,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:u,getMergedShow:c,setShow:P,handleClick:x,handleMouseEnter:T,handleMouseLeave:R,handleFocus:S,handleBlur:v,syncPosition:b}},render(){var t;const{positionManually:e,$slots:n}=this;let r,s=!1;if(!e&&(r=ox(n,"trigger"),r)){r=i.cloneVNode(r),r=r.type===i.Text?i.h("span",[r]):r;const o={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((t=r.type)===null||t===void 0)&&t.__popover__)s=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[o,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[o];else{const{internalInheritedEventHandlers:a}=this,l=[o,...a],c={onBlur:d=>{l.forEach(u=>{u.onBlur(d)})},onFocus:d=>{l.forEach(u=>{u.onFocus(d)})},onClick:d=>{l.forEach(u=>{u.onClick(d)})},onMouseenter:d=>{l.forEach(u=>{u.onMouseenter(d)})},onMouseleave:d=>{l.forEach(u=>{u.onMouseleave(d)})}};Fk(r,a?"nested":e?"manual":this.trigger,c)}}return i.h(au,{ref:"binderInstRef",syncTarget:!s,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const o=this.getMergedShow();return[this.internalTrapFocus&&o?i.withDirectives(i.h("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[nu,{enabled:o,zIndex:this.zIndex}]]):null,e?null:i.h(lu,null,{default:()=>r}),i.h($k,ax(this.$props,Nk,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:o})),{default:()=>{var a,l;return(l=(a=this.$slots).default)===null||l===void 0?void 0:l.call(a)},header:()=>{var a,l;return(l=(a=this.$slots).header)===null||l===void 0?void 0:l.call(a)},footer:()=>{var a,l;return(l=(a=this.$slots).footer)===null||l===void 0?void 0:l.call(a)}})]}})}}),Ik={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px"};function Ok(t){const{textColor2:e,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:u,opacityDisabled:h,tagColor:m,closeIconColor:g,closeIconColorHover:f,closeIconColorPressed:p,borderRadiusSmall:b,fontSizeMini:y,fontSizeTiny:_,fontSizeSmall:S,fontSizeMedium:v,heightMini:T,heightTiny:R,heightSmall:w,heightMedium:B,closeColorHover:x,closeColorPressed:$,buttonColor2Hover:P,buttonColor2Pressed:A,fontWeightStrong:V}=t;return Object.assign(Object.assign({},Ik),{closeBorderRadius:b,heightTiny:T,heightSmall:R,heightMedium:w,heightLarge:B,borderRadius:b,opacityDisabled:h,fontSizeTiny:y,fontSizeSmall:_,fontSizeMedium:S,fontSizeLarge:v,fontWeightStrong:V,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:P,colorPressedCheckable:A,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:e,color:m,colorBordered:"rgb(250, 250, 252)",closeIconColor:g,closeIconColorHover:f,closeIconColorPressed:p,closeColorHover:x,closeColorPressed:$,borderPrimary:`1px solid ${Ve(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:Ve(s,{alpha:.12}),colorBorderedPrimary:Ve(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:Ve(s,{alpha:.12}),closeColorPressedPrimary:Ve(s,{alpha:.18}),borderInfo:`1px solid ${Ve(o,{alpha:.3})}`,textColorInfo:o,colorInfo:Ve(o,{alpha:.12}),colorBorderedInfo:Ve(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:Ve(o,{alpha:.12}),closeColorPressedInfo:Ve(o,{alpha:.18}),borderSuccess:`1px solid ${Ve(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Ve(a,{alpha:.12}),colorBorderedSuccess:Ve(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Ve(a,{alpha:.12}),closeColorPressedSuccess:Ve(a,{alpha:.18}),borderWarning:`1px solid ${Ve(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Ve(l,{alpha:.15}),colorBorderedWarning:Ve(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Ve(l,{alpha:.12}),closeColorPressedWarning:Ve(l,{alpha:.18}),borderError:`1px solid ${Ve(c,{alpha:.23})}`,textColorError:c,colorError:Ve(c,{alpha:.1}),colorBorderedError:Ve(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Ve(c,{alpha:.12}),closeColorPressedError:Ve(c,{alpha:.18})})}const zk={common:Si,self:Ok},Lk={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},Dk=ge("tag",`
543
+ `,[ge("popover-arrow",e)])])])}const Rh=Object.assign(Object.assign({},pt.props),{to:Nn.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function Rk({arrowClass:t,arrowStyle:e,arrowWrapperClass:n,arrowWrapperStyle:r,clsPrefix:s}){return i.h("div",{key:"__popover-arrow__",style:r,class:[`${s}-popover-arrow-wrapper`,n]},i.h("div",{class:[`${s}-popover-arrow`,t],style:e}))}const $k=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:Rh,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o,mergedRtlRef:a}=vi(t),l=pt("Popover","-popover",Tk,Th,t,s),c=Tr("Popover",a,s),d=i.ref(null),u=i.inject("NPopover"),h=i.ref(null),m=i.ref(t.show),g=i.ref(!1);i.watchEffect(()=>{const{show:x}=t;x&&!ix()&&!t.internalDeactivateImmediately&&(g.value=!0)});const f=i.computed(()=>{const{trigger:x,onClickoutside:$}=t,P=[],{positionManuallyRef:{value:A}}=u;return A||(x==="click"&&!$&&P.push([bs,R,void 0,{capture:!0}]),x==="hover"&&P.push([V1,T])),$&&P.push([bs,R,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&g.value)&&P.push([i.vShow,t.show]),P}),p=i.computed(()=>{const{common:{cubicBezierEaseInOut:x,cubicBezierEaseIn:$,cubicBezierEaseOut:P},self:{space:A,spaceArrow:V,padding:F,fontSize:N,textColor:Y,dividerColor:ee,color:I,boxShadow:z,borderRadius:q,arrowHeight:W,arrowOffset:O,arrowOffsetVertical:D}}=l.value;return{"--n-box-shadow":z,"--n-bezier":x,"--n-bezier-ease-in":$,"--n-bezier-ease-out":P,"--n-font-size":N,"--n-text-color":Y,"--n-color":I,"--n-divider-color":ee,"--n-border-radius":q,"--n-arrow-height":W,"--n-arrow-offset":O,"--n-arrow-offset-vertical":D,"--n-padding":F,"--n-space":A,"--n-space-arrow":V}}),b=i.computed(()=>{const x=t.width==="trigger"?void 0:da(t.width),$=[];x&&$.push({width:x});const{maxWidth:P,minWidth:A}=t;return P&&$.push({maxWidth:da(P)}),A&&$.push({maxWidth:da(A)}),o||$.push(p.value),$}),y=o?Ci("popover",void 0,p,t):void 0;u.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{u.setBodyInstance(null)}),i.watch(i.toRef(t,"show"),x=>{t.animated||(x?m.value=!0:m.value=!1)});function _(){var x;(x=d.value)===null||x===void 0||x.syncPosition()}function S(x){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&u.handleMouseEnter(x)}function v(x){t.trigger==="hover"&&t.keepAliveOnHover&&u.handleMouseLeave(x)}function T(x){t.trigger==="hover"&&!w().contains(pr(x))&&u.handleMouseMoveOutside(x)}function R(x){(t.trigger==="click"&&!w().contains(pr(x))||t.onClickoutside)&&u.handleClickOutside(x)}function w(){return u.getTriggerElement()}i.provide(Gu,h),i.provide(Uu,null),i.provide(Ku,null);function B(){if(y==null||y.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&g.value))return null;let $;const P=u.internalRenderBodyRef.value,{value:A}=s;if(P)$=P([`${A}-popover-shared`,(c==null?void 0:c.value)&&`${A}-popover--rtl`,y==null?void 0:y.themeClass.value,t.overlap&&`${A}-popover-shared--overlap`,t.showArrow&&`${A}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${A}-popover-shared--center-arrow`],h,b.value,S,v);else{const{value:V}=u.extraClassRef,{internalTrapFocus:F}=t,N=!ch(e.header)||!ch(e.footer),Y=()=>{var ee,I;const z=N?i.h(i.Fragment,null,xi(e.header,O=>O?i.h("div",{class:[`${A}-popover__header`,t.headerClass],style:t.headerStyle},O):null),xi(e.default,O=>O?i.h("div",{class:[`${A}-popover__content`,t.contentClass],style:t.contentStyle},e):null),xi(e.footer,O=>O?i.h("div",{class:[`${A}-popover__footer`,t.footerClass],style:t.footerStyle},O):null)):t.scrollable?(ee=e.default)===null||ee===void 0?void 0:ee.call(e):i.h("div",{class:[`${A}-popover__content`,t.contentClass],style:t.contentStyle},e),q=t.scrollable?i.h(mk,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:N?void 0:`${A}-popover__content ${(I=t.contentClass)!==null&&I!==void 0?I:""}`,contentStyle:N?void 0:t.contentStyle},{default:()=>z}):z,W=t.showArrow?Rk({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:A}):null;return[q,W]};$=i.h("div",i.mergeProps({class:[`${A}-popover`,`${A}-popover-shared`,(c==null?void 0:c.value)&&`${A}-popover--rtl`,y==null?void 0:y.themeClass.value,V.map(ee=>`${A}-${ee}`),{[`${A}-popover--scrollable`]:t.scrollable,[`${A}-popover--show-header-or-footer`]:N,[`${A}-popover--raw`]:t.raw,[`${A}-popover-shared--overlap`]:t.overlap,[`${A}-popover-shared--show-arrow`]:t.showArrow,[`${A}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:h,style:b.value,onKeydown:u.handleKeydown,onMouseenter:S,onMouseleave:v},n),F?i.h(Kw,{active:t.show,autoFocus:!0},{default:Y}):Y())}return i.withDirectives($,f.value)}return{displayed:g,namespace:r,isMounted:u.isMountedRef,zIndex:u.zIndexRef,followerRef:d,adjustedTo:Nn(t),followerEnabled:m,renderContentNode:B}},render(){return i.h(vu,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===Nn.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var t;(t=this.internalOnAfterLeave)===null||t===void 0||t.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var Pk={};const Nk=Object.keys(Rh),Ek={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function Fk(t,e,n){Ek[e].forEach(r=>{t.props?t.props=Object.assign({},t.props):t.props={};const s=t.props[r],o=n[r];s?t.props[r]=(...a)=>{s(...a),o(...a)}:t.props[r]=o})}const Ak={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:Nn.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},Mk=Object.assign(Object.assign(Object.assign({},pt.props),Ak),{internalOnAfterLeave:Function,internalRenderBody:Function}),Vk=i.defineComponent({name:"Popover",inheritAttrs:!1,props:Mk,slots:Object,__popover__:!0,setup(t){Pk.NODE_ENV!=="production"&&i.watchEffect(()=>{t.maxWidth!==void 0&&ei("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&ei("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&ei("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&ei("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&ei("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=_s(),n=i.ref(null),r=i.computed(()=>t.show),s=i.ref(t.defaultShow),o=Go(r,s),a=Ut(()=>t.disabled?!1:o.value),l=()=>{if(t.disabled)return!0;const{getDisabled:N}=t;return!!(N!=null&&N())},c=()=>l()?!1:o.value,d=iu(t,["arrow","showArrow"]),u=i.computed(()=>t.overlap?!1:d.value);let h=null;const m=i.ref(null),g=i.ref(null),f=Ut(()=>t.x!==void 0&&t.y!==void 0);function p(N){const{"onUpdate:show":Y,onUpdateShow:ee,onShow:I,onHide:z}=t;s.value=N,Y&&gt(Y,N),ee&&gt(ee,N),N&&I&&gt(I,!0),N&&z&&gt(z,!1)}function b(){h&&h.syncPosition()}function y(){const{value:N}=m;N&&(window.clearTimeout(N),m.value=null)}function _(){const{value:N}=g;N&&(window.clearTimeout(N),g.value=null)}function S(){const N=l();if(t.trigger==="focus"&&!N){if(c())return;p(!0)}}function v(){const N=l();if(t.trigger==="focus"&&!N){if(!c())return;p(!1)}}function T(){const N=l();if(t.trigger==="hover"&&!N){if(_(),m.value!==null||c())return;const Y=()=>{p(!0),m.value=null},{delay:ee}=t;ee===0?Y():m.value=window.setTimeout(Y,ee)}}function R(){const N=l();if(t.trigger==="hover"&&!N){if(y(),g.value!==null||!c())return;const Y=()=>{p(!1),g.value=null},{duration:ee}=t;ee===0?Y():g.value=window.setTimeout(Y,ee)}}function w(){R()}function B(N){var Y;c()&&(t.trigger==="click"&&(y(),_(),p(!1)),(Y=t.onClickoutside)===null||Y===void 0||Y.call(t,N))}function x(){if(t.trigger==="click"&&!l()){y(),_();const N=!c();p(N)}}function $(N){t.internalTrapFocus&&N.key==="Escape"&&(y(),_(),p(!1))}function P(N){s.value=N}function A(){var N;return(N=n.value)===null||N===void 0?void 0:N.targetRef}function V(N){h=N}return i.provide("NPopover",{getTriggerElement:A,handleKeydown:$,handleMouseEnter:T,handleMouseLeave:R,handleClickOutside:B,handleMouseMoveOutside:w,setBodyInstance:V,positionManuallyRef:f,isMountedRef:e,zIndexRef:i.toRef(t,"zIndex"),extraClassRef:i.toRef(t,"internalExtraClass"),internalRenderBodyRef:i.toRef(t,"internalRenderBody")}),i.watchEffect(()=>{o.value&&l()&&p(!1)}),{binderInstRef:n,positionManually:f,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:u,getMergedShow:c,setShow:P,handleClick:x,handleMouseEnter:T,handleMouseLeave:R,handleFocus:S,handleBlur:v,syncPosition:b}},render(){var t;const{positionManually:e,$slots:n}=this;let r,s=!1;if(!e&&(r=ox(n,"trigger"),r)){r=i.cloneVNode(r),r=r.type===i.Text?i.h("span",[r]):r;const o={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((t=r.type)===null||t===void 0)&&t.__popover__)s=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[o,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[o];else{const{internalInheritedEventHandlers:a}=this,l=[o,...a],c={onBlur:d=>{l.forEach(u=>{u.onBlur(d)})},onFocus:d=>{l.forEach(u=>{u.onFocus(d)})},onClick:d=>{l.forEach(u=>{u.onClick(d)})},onMouseenter:d=>{l.forEach(u=>{u.onMouseenter(d)})},onMouseleave:d=>{l.forEach(u=>{u.onMouseleave(d)})}};Fk(r,a?"nested":e?"manual":this.trigger,c)}}return i.h(au,{ref:"binderInstRef",syncTarget:!s,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const o=this.getMergedShow();return[this.internalTrapFocus&&o?i.withDirectives(i.h("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[nu,{enabled:o,zIndex:this.zIndex}]]):null,e?null:i.h(lu,null,{default:()=>r}),i.h($k,ax(this.$props,Nk,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:o})),{default:()=>{var a,l;return(l=(a=this.$slots).default)===null||l===void 0?void 0:l.call(a)},header:()=>{var a,l;return(l=(a=this.$slots).header)===null||l===void 0?void 0:l.call(a)},footer:()=>{var a,l;return(l=(a=this.$slots).footer)===null||l===void 0?void 0:l.call(a)}})]}})}}),Ik={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px"};function Ok(t){const{textColor2:e,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:u,opacityDisabled:h,tagColor:m,closeIconColor:g,closeIconColorHover:f,closeIconColorPressed:p,borderRadiusSmall:b,fontSizeMini:y,fontSizeTiny:_,fontSizeSmall:S,fontSizeMedium:v,heightMini:T,heightTiny:R,heightSmall:w,heightMedium:B,closeColorHover:x,closeColorPressed:$,buttonColor2Hover:P,buttonColor2Pressed:A,fontWeightStrong:V}=t;return Object.assign(Object.assign({},Ik),{closeBorderRadius:b,heightTiny:T,heightSmall:R,heightMedium:w,heightLarge:B,borderRadius:b,opacityDisabled:h,fontSizeTiny:y,fontSizeSmall:_,fontSizeMedium:S,fontSizeLarge:v,fontWeightStrong:V,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:P,colorPressedCheckable:A,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:e,color:m,colorBordered:"rgb(250, 250, 252)",closeIconColor:g,closeIconColorHover:f,closeIconColorPressed:p,closeColorHover:x,closeColorPressed:$,borderPrimary:`1px solid ${Ve(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:Ve(s,{alpha:.12}),colorBorderedPrimary:Ve(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:Ve(s,{alpha:.12}),closeColorPressedPrimary:Ve(s,{alpha:.18}),borderInfo:`1px solid ${Ve(o,{alpha:.3})}`,textColorInfo:o,colorInfo:Ve(o,{alpha:.12}),colorBorderedInfo:Ve(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:Ve(o,{alpha:.12}),closeColorPressedInfo:Ve(o,{alpha:.18}),borderSuccess:`1px solid ${Ve(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Ve(a,{alpha:.12}),colorBorderedSuccess:Ve(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Ve(a,{alpha:.12}),closeColorPressedSuccess:Ve(a,{alpha:.18}),borderWarning:`1px solid ${Ve(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Ve(l,{alpha:.15}),colorBorderedWarning:Ve(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Ve(l,{alpha:.12}),closeColorPressedWarning:Ve(l,{alpha:.18}),borderError:`1px solid ${Ve(c,{alpha:.23})}`,textColorError:c,colorError:Ve(c,{alpha:.1}),colorBorderedError:Ve(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Ve(c,{alpha:.12}),closeColorPressedError:Ve(c,{alpha:.18})})}const zk={common:Si,self:Ok},Lk={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},Dk=ge("tag",`
544
544
  --n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);
545
545
  white-space: nowrap;
546
546
  position: relative;
@@ -610,7 +610,7 @@ ${s}
610
610
  `,[tn("disabled",[ce("&:hover","background-color: var(--n-color-hover-checkable);",[tn("checked","color: var(--n-text-color-hover-checkable);")]),ce("&:active","background-color: var(--n-color-pressed-checkable);",[tn("checked","color: var(--n-text-color-pressed-checkable);")])]),Se("checked",`
611
611
  color: var(--n-text-color-checked);
612
612
  background-color: var(--n-color-checked);
613
- `,[tn("disabled",[ce("&:hover","background-color: var(--n-color-checked-hover);"),ce("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var Hk={};const Wk=Object.assign(Object.assign(Object.assign({},pt.props),Lk),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),jk="n-tag",wa=i.defineComponent({name:"Tag",props:Wk,slots:Object,setup(t){Hk.NODE_ENV!=="production"&&i.watchEffect(()=>{t.onCheckedChange!==void 0&&ei("tag","`on-checked-change` is deprecated, please use `on-update:checked` instead")});const e=i.ref(null),{mergedBorderedRef:n,mergedClsPrefixRef:r,inlineThemeDisabled:s,mergedRtlRef:o}=vi(t),a=pt("Tag","-tag",Dk,zk,t,r);i.provide(jk,{roundRef:i.toRef(t,"round")});function l(){if(!t.disabled&&t.checkable){const{checked:g,onCheckedChange:f,onUpdateChecked:p,"onUpdate:checked":b}=t;p&&p(!g),b&&b(!g),f&&f(!g)}}function c(g){if(t.triggerClickOnClose||g.stopPropagation(),!t.disabled){const{onClose:f}=t;f&&gt(f,g)}}const d={setTextContent(g){const{value:f}=e;f&&(f.textContent=g)}},u=Tr("Tag",o,r),h=i.computed(()=>{const{type:g,size:f,color:{color:p,textColor:b}={}}=t,{common:{cubicBezierEaseInOut:y},self:{padding:_,closeMargin:S,borderRadius:v,opacityDisabled:T,textColorCheckable:R,textColorHoverCheckable:w,textColorPressedCheckable:B,textColorChecked:x,colorCheckable:$,colorHoverCheckable:P,colorPressedCheckable:A,colorChecked:V,colorCheckedHover:F,colorCheckedPressed:N,closeBorderRadius:Y,fontWeightStrong:ee,[Ze("colorBordered",g)]:I,[Ze("closeSize",f)]:z,[Ze("closeIconSize",f)]:q,[Ze("fontSize",f)]:W,[Ze("height",f)]:O,[Ze("color",g)]:D,[Ze("textColor",g)]:j,[Ze("border",g)]:G,[Ze("closeIconColor",g)]:ue,[Ze("closeIconColorHover",g)]:oe,[Ze("closeIconColorPressed",g)]:re,[Ze("closeColorHover",g)]:Ee,[Ze("closeColorPressed",g)]:We}}=a.value,Fe=en(S);return{"--n-font-weight-strong":ee,"--n-avatar-size-override":`calc(${O} - 8px)`,"--n-bezier":y,"--n-border-radius":v,"--n-border":G,"--n-close-icon-size":q,"--n-close-color-pressed":We,"--n-close-color-hover":Ee,"--n-close-border-radius":Y,"--n-close-icon-color":ue,"--n-close-icon-color-hover":oe,"--n-close-icon-color-pressed":re,"--n-close-icon-color-disabled":ue,"--n-close-margin-top":Fe.top,"--n-close-margin-right":Fe.right,"--n-close-margin-bottom":Fe.bottom,"--n-close-margin-left":Fe.left,"--n-close-size":z,"--n-color":p||(n.value?I:D),"--n-color-checkable":$,"--n-color-checked":V,"--n-color-checked-hover":F,"--n-color-checked-pressed":N,"--n-color-hover-checkable":P,"--n-color-pressed-checkable":A,"--n-font-size":W,"--n-height":O,"--n-opacity-disabled":T,"--n-padding":_,"--n-text-color":b||j,"--n-text-color-checkable":R,"--n-text-color-checked":x,"--n-text-color-hover-checkable":w,"--n-text-color-pressed-checkable":B}}),m=s?Ci("tag",i.computed(()=>{let g="";const{type:f,size:p,color:{color:b,textColor:y}={}}=t;return g+=f[0],g+=p[0],b&&(g+=`a${Ju(b)}`),y&&(g+=`b${Ju(y)}`),n.value&&(g+="c"),g}),h,t):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:u,mergedClsPrefix:r,contentRef:e,mergedBordered:n,handleClick:l,handleCloseClick:c,cssVars:s?void 0:h,themeClass:m==null?void 0:m.themeClass,onRender:m==null?void 0:m.onRender})},render(){var t,e;const{mergedClsPrefix:n,rtlEnabled:r,closable:s,color:{borderColor:o}={},round:a,onRender:l,$slots:c}=this;l==null||l();const d=xi(c.avatar,h=>h&&i.h("div",{class:`${n}-tag__avatar`},h)),u=xi(c.icon,h=>h&&i.h("div",{class:`${n}-tag__icon`},h));return i.h("div",{class:[`${n}-tag`,this.themeClass,{[`${n}-tag--rtl`]:r,[`${n}-tag--strong`]:this.strong,[`${n}-tag--disabled`]:this.disabled,[`${n}-tag--checkable`]:this.checkable,[`${n}-tag--checked`]:this.checkable&&this.checked,[`${n}-tag--round`]:a,[`${n}-tag--avatar`]:d,[`${n}-tag--icon`]:u,[`${n}-tag--closable`]:s}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},u||d,i.h("span",{class:`${n}-tag__content`,ref:"contentRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)),!this.checkable&&s?i.h(ik,{clsPrefix:n,class:`${n}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:a,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?i.h("div",{class:`${n}-tag__border`,style:{borderColor:o}}):null)}}),qk=i.defineComponent({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(t,{slots:e}){return()=>{const{clsPrefix:n}=t;return i.h(gh,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:t.loading},{default:()=>t.showArrow?i.h(tk,{clsPrefix:n,show:t.showClear,onClear:t.onClear},{placeholder:()=>i.h($r,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>fa(e.default,()=>[i.h(Kx,null)])})}):null})}}}),Xk={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function Yk(t){const{borderRadius:e,textColor2:n,textColorDisabled:r,inputColor:s,inputColorDisabled:o,primaryColor:a,primaryColorHover:l,warningColor:c,warningColorHover:d,errorColor:u,errorColorHover:h,borderColor:m,iconColor:g,iconColorDisabled:f,clearColor:p,clearColorHover:b,clearColorPressed:y,placeholderColor:_,placeholderColorDisabled:S,fontSizeTiny:v,fontSizeSmall:T,fontSizeMedium:R,fontSizeLarge:w,heightTiny:B,heightSmall:x,heightMedium:$,heightLarge:P,fontWeight:A}=t;return Object.assign(Object.assign({},Xk),{fontSizeTiny:v,fontSizeSmall:T,fontSizeMedium:R,fontSizeLarge:w,heightTiny:B,heightSmall:x,heightMedium:$,heightLarge:P,borderRadius:e,fontWeight:A,textColor:n,textColorDisabled:r,placeholderColor:_,placeholderColorDisabled:S,color:s,colorDisabled:o,colorActive:s,border:`1px solid ${m}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${Ve(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${Ve(a,{alpha:.2})}`,caretColor:a,arrowColor:g,arrowColorDisabled:f,loadingColor:a,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${d}`,borderActiveWarning:`1px solid ${c}`,borderFocusWarning:`1px solid ${d}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${Ve(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${Ve(c,{alpha:.2})}`,colorActiveWarning:s,caretColorWarning:c,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${h}`,borderActiveError:`1px solid ${u}`,borderFocusError:`1px solid ${h}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${Ve(u,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${Ve(u,{alpha:.2})}`,colorActiveError:s,caretColorError:u,clearColor:p,clearColorHover:b,clearColorPressed:y})}const $h={name:"InternalSelection",common:Si,peers:{Popover:Th},self:Yk},Uk=ce([ge("base-selection",`
613
+ `,[tn("disabled",[ce("&:hover","background-color: var(--n-color-checked-hover);"),ce("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var Hk={};const Wk=Object.assign(Object.assign(Object.assign({},pt.props),Lk),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),jk="n-tag",xa=i.defineComponent({name:"Tag",props:Wk,slots:Object,setup(t){Hk.NODE_ENV!=="production"&&i.watchEffect(()=>{t.onCheckedChange!==void 0&&ei("tag","`on-checked-change` is deprecated, please use `on-update:checked` instead")});const e=i.ref(null),{mergedBorderedRef:n,mergedClsPrefixRef:r,inlineThemeDisabled:s,mergedRtlRef:o}=vi(t),a=pt("Tag","-tag",Dk,zk,t,r);i.provide(jk,{roundRef:i.toRef(t,"round")});function l(){if(!t.disabled&&t.checkable){const{checked:g,onCheckedChange:f,onUpdateChecked:p,"onUpdate:checked":b}=t;p&&p(!g),b&&b(!g),f&&f(!g)}}function c(g){if(t.triggerClickOnClose||g.stopPropagation(),!t.disabled){const{onClose:f}=t;f&&gt(f,g)}}const d={setTextContent(g){const{value:f}=e;f&&(f.textContent=g)}},u=Tr("Tag",o,r),h=i.computed(()=>{const{type:g,size:f,color:{color:p,textColor:b}={}}=t,{common:{cubicBezierEaseInOut:y},self:{padding:_,closeMargin:S,borderRadius:v,opacityDisabled:T,textColorCheckable:R,textColorHoverCheckable:w,textColorPressedCheckable:B,textColorChecked:x,colorCheckable:$,colorHoverCheckable:P,colorPressedCheckable:A,colorChecked:V,colorCheckedHover:F,colorCheckedPressed:N,closeBorderRadius:Y,fontWeightStrong:ee,[Ze("colorBordered",g)]:I,[Ze("closeSize",f)]:z,[Ze("closeIconSize",f)]:q,[Ze("fontSize",f)]:W,[Ze("height",f)]:O,[Ze("color",g)]:D,[Ze("textColor",g)]:j,[Ze("border",g)]:G,[Ze("closeIconColor",g)]:ue,[Ze("closeIconColorHover",g)]:oe,[Ze("closeIconColorPressed",g)]:re,[Ze("closeColorHover",g)]:Ee,[Ze("closeColorPressed",g)]:We}}=a.value,Fe=en(S);return{"--n-font-weight-strong":ee,"--n-avatar-size-override":`calc(${O} - 8px)`,"--n-bezier":y,"--n-border-radius":v,"--n-border":G,"--n-close-icon-size":q,"--n-close-color-pressed":We,"--n-close-color-hover":Ee,"--n-close-border-radius":Y,"--n-close-icon-color":ue,"--n-close-icon-color-hover":oe,"--n-close-icon-color-pressed":re,"--n-close-icon-color-disabled":ue,"--n-close-margin-top":Fe.top,"--n-close-margin-right":Fe.right,"--n-close-margin-bottom":Fe.bottom,"--n-close-margin-left":Fe.left,"--n-close-size":z,"--n-color":p||(n.value?I:D),"--n-color-checkable":$,"--n-color-checked":V,"--n-color-checked-hover":F,"--n-color-checked-pressed":N,"--n-color-hover-checkable":P,"--n-color-pressed-checkable":A,"--n-font-size":W,"--n-height":O,"--n-opacity-disabled":T,"--n-padding":_,"--n-text-color":b||j,"--n-text-color-checkable":R,"--n-text-color-checked":x,"--n-text-color-hover-checkable":w,"--n-text-color-pressed-checkable":B}}),m=s?Ci("tag",i.computed(()=>{let g="";const{type:f,size:p,color:{color:b,textColor:y}={}}=t;return g+=f[0],g+=p[0],b&&(g+=`a${Ju(b)}`),y&&(g+=`b${Ju(y)}`),n.value&&(g+="c"),g}),h,t):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:u,mergedClsPrefix:r,contentRef:e,mergedBordered:n,handleClick:l,handleCloseClick:c,cssVars:s?void 0:h,themeClass:m==null?void 0:m.themeClass,onRender:m==null?void 0:m.onRender})},render(){var t,e;const{mergedClsPrefix:n,rtlEnabled:r,closable:s,color:{borderColor:o}={},round:a,onRender:l,$slots:c}=this;l==null||l();const d=xi(c.avatar,h=>h&&i.h("div",{class:`${n}-tag__avatar`},h)),u=xi(c.icon,h=>h&&i.h("div",{class:`${n}-tag__icon`},h));return i.h("div",{class:[`${n}-tag`,this.themeClass,{[`${n}-tag--rtl`]:r,[`${n}-tag--strong`]:this.strong,[`${n}-tag--disabled`]:this.disabled,[`${n}-tag--checkable`]:this.checkable,[`${n}-tag--checked`]:this.checkable&&this.checked,[`${n}-tag--round`]:a,[`${n}-tag--avatar`]:d,[`${n}-tag--icon`]:u,[`${n}-tag--closable`]:s}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},u||d,i.h("span",{class:`${n}-tag__content`,ref:"contentRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)),!this.checkable&&s?i.h(ik,{clsPrefix:n,class:`${n}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:a,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?i.h("div",{class:`${n}-tag__border`,style:{borderColor:o}}):null)}}),qk=i.defineComponent({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(t,{slots:e}){return()=>{const{clsPrefix:n}=t;return i.h(gh,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:t.loading},{default:()=>t.showArrow?i.h(tk,{clsPrefix:n,show:t.showClear,onClear:t.onClear},{placeholder:()=>i.h($r,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>ma(e.default,()=>[i.h(Kx,null)])})}):null})}}}),Xk={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function Yk(t){const{borderRadius:e,textColor2:n,textColorDisabled:r,inputColor:s,inputColorDisabled:o,primaryColor:a,primaryColorHover:l,warningColor:c,warningColorHover:d,errorColor:u,errorColorHover:h,borderColor:m,iconColor:g,iconColorDisabled:f,clearColor:p,clearColorHover:b,clearColorPressed:y,placeholderColor:_,placeholderColorDisabled:S,fontSizeTiny:v,fontSizeSmall:T,fontSizeMedium:R,fontSizeLarge:w,heightTiny:B,heightSmall:x,heightMedium:$,heightLarge:P,fontWeight:A}=t;return Object.assign(Object.assign({},Xk),{fontSizeTiny:v,fontSizeSmall:T,fontSizeMedium:R,fontSizeLarge:w,heightTiny:B,heightSmall:x,heightMedium:$,heightLarge:P,borderRadius:e,fontWeight:A,textColor:n,textColorDisabled:r,placeholderColor:_,placeholderColorDisabled:S,color:s,colorDisabled:o,colorActive:s,border:`1px solid ${m}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${Ve(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${Ve(a,{alpha:.2})}`,caretColor:a,arrowColor:g,arrowColorDisabled:f,loadingColor:a,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${d}`,borderActiveWarning:`1px solid ${c}`,borderFocusWarning:`1px solid ${d}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${Ve(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${Ve(c,{alpha:.2})}`,colorActiveWarning:s,caretColorWarning:c,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${h}`,borderActiveError:`1px solid ${u}`,borderFocusError:`1px solid ${h}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${Ve(u,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${Ve(u,{alpha:.2})}`,colorActiveError:s,caretColorError:u,clearColor:p,clearColorHover:b,clearColorPressed:y})}const $h={name:"InternalSelection",common:Si,peers:{Popover:Th},self:Yk},Uk=ce([ge("base-selection",`
614
614
  --n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);
615
615
  --n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);
616
616
  position: relative;
@@ -810,7 +810,7 @@ ${s}
810
810
  line-height: 1.25;
811
811
  text-overflow: ellipsis;
812
812
  overflow: hidden;
813
- `)])])]),Kk=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},pt.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=vi(t),r=Tr("InternalSelection",n,e),s=i.ref(null),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(null),m=i.ref(null),g=i.ref(null),f=i.ref(!1),p=i.ref(!1),b=i.ref(!1),y=pt("InternalSelection","-internal-selection",Uk,$h,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(b.value||t.active)),S=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):er(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),v=i.computed(()=>{const K=t.selectedOption;if(K)return K[t.labelField]}),T=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function R(){var K;const{value:se}=s;if(se){const{value:Ie}=o;Ie&&(Ie.style.width=`${se.offsetWidth}px`,t.maxTagCount!=="responsive"&&((K=m.value)===null||K===void 0||K.sync({showAllItemsBeforeCalculate:!1})))}}function w(){const{value:K}=g;K&&(K.style.display="none")}function B(){const{value:K}=g;K&&(K.style.display="inline-block")}i.watch(i.toRef(t,"active"),K=>{K||w()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick(R)});function x(K){const{onFocus:se}=t;se&&se(K)}function $(K){const{onBlur:se}=t;se&&se(K)}function P(K){const{onDeleteOption:se}=t;se&&se(K)}function A(K){const{onClear:se}=t;se&&se(K)}function V(K){const{onPatternInput:se}=t;se&&se(K)}function F(K){var se;(!K.relatedTarget||!(!((se=a.value)===null||se===void 0)&&se.contains(K.relatedTarget)))&&x(K)}function N(K){var se;!((se=a.value)===null||se===void 0)&&se.contains(K.relatedTarget)||$(K)}function Y(K){A(K)}function ee(){b.value=!0}function I(){b.value=!1}function z(K){!t.active||!t.filterable||K.target!==o.value&&K.preventDefault()}function q(K){P(K)}const W=i.ref(!1);function O(K){if(K.key==="Backspace"&&!W.value&&!t.pattern.length){const{selectedOptions:se}=t;se!=null&&se.length&&q(se[se.length-1])}}let D=null;function j(K){const{value:se}=s;if(se){const Ie=K.target.value;se.textContent=Ie,R()}t.ignoreComposition&&W.value?D=K:V(K)}function G(){W.value=!0}function ue(){W.value=!1,t.ignoreComposition&&V(D),D=null}function oe(K){var se;p.value=!0,(se=t.onPatternFocus)===null||se===void 0||se.call(t,K)}function re(K){var se;p.value=!1,(se=t.onPatternBlur)===null||se===void 0||se.call(t,K)}function Ee(){var K,se;if(t.filterable)p.value=!1,(K=d.value)===null||K===void 0||K.blur(),(se=o.value)===null||se===void 0||se.blur();else if(t.multiple){const{value:Ie}=l;Ie==null||Ie.blur()}else{const{value:Ie}=c;Ie==null||Ie.blur()}}function We(){var K,se,Ie;t.filterable?(p.value=!1,(K=d.value)===null||K===void 0||K.focus()):t.multiple?(se=l.value)===null||se===void 0||se.focus():(Ie=c.value)===null||Ie===void 0||Ie.focus()}function Fe(){const{value:K}=o;K&&(B(),K.focus())}function Gt(){const{value:K}=o;K&&K.blur()}function Te(K){const{value:se}=u;se&&se.setTextContent(`+${K}`)}function sn(){const{value:K}=h;return K}function on(){return o.value}let Rt=null;function Lt(){Rt!==null&&window.clearTimeout(Rt)}function an(){t.active||(Lt(),Rt=window.setTimeout(()=>{T.value&&(f.value=!0)},100))}function wt(){Lt()}function Ln(K){K||(Lt(),f.value=!1)}i.watch(T,K=>{K||(f.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const K=d.value;K&&(t.disabled?K.removeAttribute("tabindex"):K.tabIndex=p.value?-1:0)})}),Qu(a,t.onResize);const{inlineThemeDisabled:ln}=t,Zt=i.computed(()=>{const{size:K}=t,{common:{cubicBezierEaseInOut:se},self:{fontWeight:Ie,borderRadius:ni,color:Je,placeholderColor:Dt,textColor:tr,paddingSingle:ii,paddingMultiple:$i,caretColor:nr,colorDisabled:cn,textColorDisabled:Dn,placeholderColorDisabled:E,colorActive:X,boxShadowFocus:ie,boxShadowActive:de,boxShadowHover:he,border:ye,borderFocus:we,borderHover:ke,borderActive:Ke,arrowColor:Sn,arrowColorDisabled:Ba,loadingColor:Ta,colorActiveWarning:Ra,boxShadowFocusWarning:$a,boxShadowActiveWarning:Pa,boxShadowHoverWarning:Na,borderWarning:Ea,borderFocusWarning:Fa,borderHoverWarning:Aa,borderActiveWarning:Ma,colorActiveError:Va,boxShadowFocusError:Ia,boxShadowActiveError:Oa,boxShadowHoverError:za,borderError:La,borderFocusError:Da,borderHoverError:Ha,borderActiveError:VC,clearColor:IC,clearColorHover:OC,clearColorPressed:zC,clearSize:LC,arrowSize:DC,[Ze("height",K)]:HC,[Ze("fontSize",K)]:WC}}=y.value,Ms=en(ii),Vs=en($i);return{"--n-bezier":se,"--n-border":ye,"--n-border-active":Ke,"--n-border-focus":we,"--n-border-hover":ke,"--n-border-radius":ni,"--n-box-shadow-active":de,"--n-box-shadow-focus":ie,"--n-box-shadow-hover":he,"--n-caret-color":nr,"--n-color":Je,"--n-color-active":X,"--n-color-disabled":cn,"--n-font-size":WC,"--n-height":HC,"--n-padding-single-top":Ms.top,"--n-padding-multiple-top":Vs.top,"--n-padding-single-right":Ms.right,"--n-padding-multiple-right":Vs.right,"--n-padding-single-left":Ms.left,"--n-padding-multiple-left":Vs.left,"--n-padding-single-bottom":Ms.bottom,"--n-padding-multiple-bottom":Vs.bottom,"--n-placeholder-color":Dt,"--n-placeholder-color-disabled":E,"--n-text-color":tr,"--n-text-color-disabled":Dn,"--n-arrow-color":Sn,"--n-arrow-color-disabled":Ba,"--n-loading-color":Ta,"--n-color-active-warning":Ra,"--n-box-shadow-focus-warning":$a,"--n-box-shadow-active-warning":Pa,"--n-box-shadow-hover-warning":Na,"--n-border-warning":Ea,"--n-border-focus-warning":Fa,"--n-border-hover-warning":Aa,"--n-border-active-warning":Ma,"--n-color-active-error":Va,"--n-box-shadow-focus-error":Ia,"--n-box-shadow-active-error":Oa,"--n-box-shadow-hover-error":za,"--n-border-error":La,"--n-border-focus-error":Da,"--n-border-hover-error":Ha,"--n-border-active-error":VC,"--n-clear-size":LC,"--n-clear-color":IC,"--n-clear-color-hover":OC,"--n-clear-color-pressed":zC,"--n-arrow-size":DC,"--n-font-weight":Ie}}),$e=ln?Ci("internal-selection",i.computed(()=>t.size[0]),Zt,t):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:S,label:v,selected:T,showTagsPanel:f,isComposing:W,counterRef:u,counterWrapperRef:h,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:m,inputTagElRef:g,handleMouseDown:z,handleFocusin:F,handleClear:Y,handleMouseEnter:ee,handleMouseLeave:I,handleDeleteOption:q,handlePatternKeyDown:O,handlePatternInputInput:j,handlePatternInputBlur:re,handlePatternInputFocus:oe,handleMouseEnterCounter:an,handleMouseLeaveCounter:wt,handleFocusout:N,handleCompositionEnd:ue,handleCompositionStart:G,onPopoverUpdateShow:Ln,focus:We,focusInput:Fe,blur:Ee,blurInput:Gt,updateCounter:Te,getCounter:sn,getTail:on,renderLabel:t.renderLabel,cssVars:ln?void 0:Zt,themeClass:$e==null?void 0:$e.themeClass,onRender:$e==null?void 0:$e.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:u,renderLabel:h}=this;d==null||d();const m=o==="responsive",g=typeof o=="number",f=m||g,p=i.h(ma,null,{default:()=>i.h(qk,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var y,_;return(_=(y=this.$slots).arrow)===null||_===void 0?void 0:_.call(y)}})});let b;if(e){const{labelField:y}=this,_=V=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:V.value},u?u({option:V,handleClose:()=>{this.handleDeleteOption(V)}}):i.h(wa,{size:n,closable:!V.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(V)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(V,!0):er(V[y],V,!0)})),S=()=>(g?this.selectedOptions.slice(0,o):this.selectedOptions).map(_),v=s?i.h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${l}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),i.h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,T=m?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(wa,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let R;if(g){const V=this.selectedOptions.length-o;V>0&&(R=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(wa,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${V}`})))}const w=m?s?i.h(Hu,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:T,tail:()=>v}):i.h(Hu,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:T}):g&&R?S().concat(R):S(),B=f?()=>i.h("div",{class:`${l}-base-selection-popover`},m?S():this.selectedOptions.map(_)):void 0,x=f?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},c):null,P=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,A=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},w,m?null:v,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},w,p);b=i.h(i.Fragment,null,f?i.h(Vk,Object.assign({},x,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>A,default:B}):A,P)}else if(s){const y=this.pattern||this.isComposing,_=this.active?!y:!this.selected,S=this.active?!1:this.selected;b=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:sh(this.label)},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),S?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(this.label,this.selectedOption,!0))):null,_?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,p)}else b=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:sh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(this.label,this.selectedOption,!0))):i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),p);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},b,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function Gk(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const Zk={name:"Select",common:Si,peers:{InternalSelection:$h,InternalSelectMenu:xh},self:Gk},Qk=ce([ge("select",`
813
+ `)])])]),Kk=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},pt.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=vi(t),r=Tr("InternalSelection",n,e),s=i.ref(null),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(null),m=i.ref(null),g=i.ref(null),f=i.ref(!1),p=i.ref(!1),b=i.ref(!1),y=pt("InternalSelection","-internal-selection",Uk,$h,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(b.value||t.active)),S=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):er(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),v=i.computed(()=>{const K=t.selectedOption;if(K)return K[t.labelField]}),T=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function R(){var K;const{value:se}=s;if(se){const{value:Ie}=o;Ie&&(Ie.style.width=`${se.offsetWidth}px`,t.maxTagCount!=="responsive"&&((K=m.value)===null||K===void 0||K.sync({showAllItemsBeforeCalculate:!1})))}}function w(){const{value:K}=g;K&&(K.style.display="none")}function B(){const{value:K}=g;K&&(K.style.display="inline-block")}i.watch(i.toRef(t,"active"),K=>{K||w()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick(R)});function x(K){const{onFocus:se}=t;se&&se(K)}function $(K){const{onBlur:se}=t;se&&se(K)}function P(K){const{onDeleteOption:se}=t;se&&se(K)}function A(K){const{onClear:se}=t;se&&se(K)}function V(K){const{onPatternInput:se}=t;se&&se(K)}function F(K){var se;(!K.relatedTarget||!(!((se=a.value)===null||se===void 0)&&se.contains(K.relatedTarget)))&&x(K)}function N(K){var se;!((se=a.value)===null||se===void 0)&&se.contains(K.relatedTarget)||$(K)}function Y(K){A(K)}function ee(){b.value=!0}function I(){b.value=!1}function z(K){!t.active||!t.filterable||K.target!==o.value&&K.preventDefault()}function q(K){P(K)}const W=i.ref(!1);function O(K){if(K.key==="Backspace"&&!W.value&&!t.pattern.length){const{selectedOptions:se}=t;se!=null&&se.length&&q(se[se.length-1])}}let D=null;function j(K){const{value:se}=s;if(se){const Ie=K.target.value;se.textContent=Ie,R()}t.ignoreComposition&&W.value?D=K:V(K)}function G(){W.value=!0}function ue(){W.value=!1,t.ignoreComposition&&V(D),D=null}function oe(K){var se;p.value=!0,(se=t.onPatternFocus)===null||se===void 0||se.call(t,K)}function re(K){var se;p.value=!1,(se=t.onPatternBlur)===null||se===void 0||se.call(t,K)}function Ee(){var K,se;if(t.filterable)p.value=!1,(K=d.value)===null||K===void 0||K.blur(),(se=o.value)===null||se===void 0||se.blur();else if(t.multiple){const{value:Ie}=l;Ie==null||Ie.blur()}else{const{value:Ie}=c;Ie==null||Ie.blur()}}function We(){var K,se,Ie;t.filterable?(p.value=!1,(K=d.value)===null||K===void 0||K.focus()):t.multiple?(se=l.value)===null||se===void 0||se.focus():(Ie=c.value)===null||Ie===void 0||Ie.focus()}function Fe(){const{value:K}=o;K&&(B(),K.focus())}function Gt(){const{value:K}=o;K&&K.blur()}function Te(K){const{value:se}=u;se&&se.setTextContent(`+${K}`)}function sn(){const{value:K}=h;return K}function on(){return o.value}let $t=null;function Lt(){$t!==null&&window.clearTimeout($t)}function an(){t.active||(Lt(),$t=window.setTimeout(()=>{T.value&&(f.value=!0)},100))}function wt(){Lt()}function Ln(K){K||(Lt(),f.value=!1)}i.watch(T,K=>{K||(f.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const K=d.value;K&&(t.disabled?K.removeAttribute("tabindex"):K.tabIndex=p.value?-1:0)})}),Qu(a,t.onResize);const{inlineThemeDisabled:ln}=t,Zt=i.computed(()=>{const{size:K}=t,{common:{cubicBezierEaseInOut:se},self:{fontWeight:Ie,borderRadius:ni,color:Je,placeholderColor:Dt,textColor:tr,paddingSingle:ii,paddingMultiple:$i,caretColor:nr,colorDisabled:cn,textColorDisabled:Dn,placeholderColorDisabled:E,colorActive:X,boxShadowFocus:ie,boxShadowActive:de,boxShadowHover:he,border:ye,borderFocus:we,borderHover:ke,borderActive:Ke,arrowColor:Sn,arrowColorDisabled:Ta,loadingColor:Ra,colorActiveWarning:$a,boxShadowFocusWarning:Pa,boxShadowActiveWarning:Na,boxShadowHoverWarning:Ea,borderWarning:Fa,borderFocusWarning:Aa,borderHoverWarning:Ma,borderActiveWarning:Va,colorActiveError:Ia,boxShadowFocusError:Oa,boxShadowActiveError:za,boxShadowHoverError:La,borderError:Da,borderFocusError:Ha,borderHoverError:Wa,borderActiveError:VC,clearColor:IC,clearColorHover:OC,clearColorPressed:zC,clearSize:LC,arrowSize:DC,[Ze("height",K)]:HC,[Ze("fontSize",K)]:WC}}=y.value,Ms=en(ii),Vs=en($i);return{"--n-bezier":se,"--n-border":ye,"--n-border-active":Ke,"--n-border-focus":we,"--n-border-hover":ke,"--n-border-radius":ni,"--n-box-shadow-active":de,"--n-box-shadow-focus":ie,"--n-box-shadow-hover":he,"--n-caret-color":nr,"--n-color":Je,"--n-color-active":X,"--n-color-disabled":cn,"--n-font-size":WC,"--n-height":HC,"--n-padding-single-top":Ms.top,"--n-padding-multiple-top":Vs.top,"--n-padding-single-right":Ms.right,"--n-padding-multiple-right":Vs.right,"--n-padding-single-left":Ms.left,"--n-padding-multiple-left":Vs.left,"--n-padding-single-bottom":Ms.bottom,"--n-padding-multiple-bottom":Vs.bottom,"--n-placeholder-color":Dt,"--n-placeholder-color-disabled":E,"--n-text-color":tr,"--n-text-color-disabled":Dn,"--n-arrow-color":Sn,"--n-arrow-color-disabled":Ta,"--n-loading-color":Ra,"--n-color-active-warning":$a,"--n-box-shadow-focus-warning":Pa,"--n-box-shadow-active-warning":Na,"--n-box-shadow-hover-warning":Ea,"--n-border-warning":Fa,"--n-border-focus-warning":Aa,"--n-border-hover-warning":Ma,"--n-border-active-warning":Va,"--n-color-active-error":Ia,"--n-box-shadow-focus-error":Oa,"--n-box-shadow-active-error":za,"--n-box-shadow-hover-error":La,"--n-border-error":Da,"--n-border-focus-error":Ha,"--n-border-hover-error":Wa,"--n-border-active-error":VC,"--n-clear-size":LC,"--n-clear-color":IC,"--n-clear-color-hover":OC,"--n-clear-color-pressed":zC,"--n-arrow-size":DC,"--n-font-weight":Ie}}),$e=ln?Ci("internal-selection",i.computed(()=>t.size[0]),Zt,t):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:S,label:v,selected:T,showTagsPanel:f,isComposing:W,counterRef:u,counterWrapperRef:h,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:m,inputTagElRef:g,handleMouseDown:z,handleFocusin:F,handleClear:Y,handleMouseEnter:ee,handleMouseLeave:I,handleDeleteOption:q,handlePatternKeyDown:O,handlePatternInputInput:j,handlePatternInputBlur:re,handlePatternInputFocus:oe,handleMouseEnterCounter:an,handleMouseLeaveCounter:wt,handleFocusout:N,handleCompositionEnd:ue,handleCompositionStart:G,onPopoverUpdateShow:Ln,focus:We,focusInput:Fe,blur:Ee,blurInput:Gt,updateCounter:Te,getCounter:sn,getTail:on,renderLabel:t.renderLabel,cssVars:ln?void 0:Zt,themeClass:$e==null?void 0:$e.themeClass,onRender:$e==null?void 0:$e.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:u,renderLabel:h}=this;d==null||d();const m=o==="responsive",g=typeof o=="number",f=m||g,p=i.h(ga,null,{default:()=>i.h(qk,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var y,_;return(_=(y=this.$slots).arrow)===null||_===void 0?void 0:_.call(y)}})});let b;if(e){const{labelField:y}=this,_=V=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:V.value},u?u({option:V,handleClose:()=>{this.handleDeleteOption(V)}}):i.h(xa,{size:n,closable:!V.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(V)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(V,!0):er(V[y],V,!0)})),S=()=>(g?this.selectedOptions.slice(0,o):this.selectedOptions).map(_),v=s?i.h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${l}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),i.h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,T=m?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(xa,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let R;if(g){const V=this.selectedOptions.length-o;V>0&&(R=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(xa,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${V}`})))}const w=m?s?i.h(Hu,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:T,tail:()=>v}):i.h(Hu,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:T}):g&&R?S().concat(R):S(),B=f?()=>i.h("div",{class:`${l}-base-selection-popover`},m?S():this.selectedOptions.map(_)):void 0,x=f?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},c):null,P=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,A=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},w,m?null:v,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},w,p);b=i.h(i.Fragment,null,f?i.h(Vk,Object.assign({},x,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>A,default:B}):A,P)}else if(s){const y=this.pattern||this.isComposing,_=this.active?!y:!this.selected,S=this.active?!1:this.selected;b=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:sh(this.label)},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),S?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(this.label,this.selectedOption,!0))):null,_?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,p)}else b=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:sh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(this.label,this.selectedOption,!0))):i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),p);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},b,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function Gk(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const Zk={name:"Select",common:Si,peers:{InternalSelection:$h,InternalSelectMenu:xh},self:Gk},Qk=ce([ge("select",`
814
814
  z-index: auto;
815
815
  outline: none;
816
816
  width: 100%;
@@ -819,4 +819,4 @@ ${s}
819
819
  `),ge("select-menu",`
820
820
  margin: 4px 0;
821
821
  box-shadow: var(--n-menu-box-shadow);
822
- `,[Bh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Es(t){return t.type==="group"}function Ph(t){return t.type==="ignored"}function xa(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function Jk(t,e){return{getIsGroup:Es,getIgnored:Ph,getKey(r){return Es(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function ev(t,e,n,r){if(!e)return t;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(Es(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Ph(l))continue;e(n,l)&&a.push(l)}return a}return s(t)}function tv(t,e,n){const r=new Map;return t.forEach(s=>{Es(s)?s[n].forEach(o=>{r.set(o[e],o)}):r.set(s[e],s)}),r}var nv={};const iv=Object.assign(Object.assign({},pt.props),{to:Nn.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),rv=i.defineComponent({name:"Select",props:iv,slots:Object,setup(t){nv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&ei("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&ei("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=vi(t),o=pt("Select","-select",Qk,Zk,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Ko(l,a),d=i.ref(!1),u=i.ref(""),h=iu(t,["items","options"]),m=i.ref([]),g=i.ref([]),f=i.computed(()=>g.value.concat(m.value).concat(h.value)),p=i.computed(()=>{const{filter:E}=t;if(E)return E;const{labelField:X,valueField:ie}=t;return(de,he)=>{if(!he)return!1;const ye=he[X];if(typeof ye=="string")return xa(de,ye);const we=he[ie];return typeof we=="string"?xa(de,we):typeof we=="number"?xa(de,String(we)):!1}}),b=i.computed(()=>{if(t.remote)return h.value;{const{value:E}=f,{value:X}=u;return!X.length||!t.filterable?E:ev(E,p.value,X,t.childrenField)}}),y=i.computed(()=>{const{valueField:E,childrenField:X}=t,ie=Jk(E,X);return P1(b.value,ie)}),_=i.computed(()=>tv(f.value,t.valueField,t.childrenField)),S=i.ref(!1),v=Ko(i.toRef(t,"show"),S),T=i.ref(null),R=i.ref(null),w=i.ref(null),{localeRef:B}=uh("Select"),x=i.computed(()=>{var E;return(E=t.placeholder)!==null&&E!==void 0?E:B.value.placeholder}),$=[],P=i.ref(new Map),A=i.computed(()=>{const{fallbackOption:E}=t;if(E===void 0){const{labelField:X,valueField:ie}=t;return de=>({[X]:String(de),[ie]:de})}return E===!1?!1:X=>Object.assign(E(X),{value:X})});function V(E){const X=t.remote,{value:ie}=P,{value:de}=_,{value:he}=A,ye=[];return E.forEach(we=>{if(de.has(we))ye.push(de.get(we));else if(X&&ie.has(we))ye.push(ie.get(we));else if(he){const ke=he(we);ke&&ye.push(ke)}}),ye}const F=i.computed(()=>{if(t.multiple){const{value:E}=c;return Array.isArray(E)?V(E):[]}return null}),N=i.computed(()=>{const{value:E}=c;return!t.multiple&&!Array.isArray(E)?E===null?null:V([E])[0]||null:null}),Y=cx(t),{mergedSizeRef:ee,mergedDisabledRef:I,mergedStatusRef:z}=Y;function q(E,X){const{onChange:ie,"onUpdate:value":de,onUpdateValue:he}=t,{nTriggerFormChange:ye,nTriggerFormInput:we}=Y;ie&&gt(ie,E,X),he&&gt(he,E,X),de&&gt(de,E,X),a.value=E,ye(),we()}function W(E){const{onBlur:X}=t,{nTriggerFormBlur:ie}=Y;X&&gt(X,E),ie()}function O(){const{onClear:E}=t;E&&gt(E)}function D(E){const{onFocus:X,showOnFocus:ie}=t,{nTriggerFormFocus:de}=Y;X&&gt(X,E),de(),ie&&re()}function j(E){const{onSearch:X}=t;X&&gt(X,E)}function G(E){const{onScroll:X}=t;X&&gt(X,E)}function ue(){var E;const{remote:X,multiple:ie}=t;if(X){const{value:de}=P;if(ie){const{valueField:he}=t;(E=F.value)===null||E===void 0||E.forEach(ye=>{de.set(ye[he],ye)})}else{const he=N.value;he&&de.set(he[t.valueField],he)}}}function oe(E){const{onUpdateShow:X,"onUpdate:show":ie}=t;X&&gt(X,E),ie&&gt(ie,E),S.value=E}function re(){I.value||(oe(!0),S.value=!0,t.filterable&&ii())}function Ee(){oe(!1)}function We(){u.value="",g.value=$}const Fe=i.ref(!1);function Gt(){t.filterable&&(Fe.value=!0)}function Te(){t.filterable&&(Fe.value=!1,v.value||We())}function sn(){I.value||(v.value?t.filterable?ii():Ee():re())}function on(E){var X,ie;!((ie=(X=w.value)===null||X===void 0?void 0:X.selfRef)===null||ie===void 0)&&ie.contains(E.relatedTarget)||(d.value=!1,W(E),Ee())}function Rt(E){D(E),d.value=!0}function Lt(){d.value=!0}function an(E){var X;!((X=T.value)===null||X===void 0)&&X.$el.contains(E.relatedTarget)||(d.value=!1,W(E),Ee())}function wt(){var E;(E=T.value)===null||E===void 0||E.focus(),Ee()}function Ln(E){var X;v.value&&(!((X=T.value)===null||X===void 0)&&X.$el.contains(pr(E))||Ee())}function ln(E){if(!Array.isArray(E))return[];if(A.value)return Array.from(E);{const{remote:X}=t,{value:ie}=_;if(X){const{value:de}=P;return E.filter(he=>ie.has(he)||de.has(he))}else return E.filter(de=>ie.has(de))}}function Zt(E){$e(E.rawNode)}function $e(E){if(I.value)return;const{tag:X,remote:ie,clearFilterAfterSelect:de,valueField:he}=t;if(X&&!ie){const{value:ye}=g,we=ye[0]||null;if(we){const ke=m.value;ke.length?ke.push(we):m.value=[we],g.value=$}}if(ie&&P.value.set(E[he],E),t.multiple){const ye=ln(c.value),we=ye.findIndex(ke=>ke===E[he]);if(~we){if(ye.splice(we,1),X&&!ie){const ke=K(E[he]);~ke&&(m.value.splice(ke,1),de&&(u.value=""))}}else ye.push(E[he]),de&&(u.value="");q(ye,V(ye))}else{if(X&&!ie){const ye=K(E[he]);~ye?m.value=[m.value[ye]]:m.value=$}tr(),Ee(),q(E[he],E)}}function K(E){return m.value.findIndex(ie=>ie[t.valueField]===E)}function se(E){v.value||re();const{value:X}=E.target;u.value=X;const{tag:ie,remote:de}=t;if(j(X),ie&&!de){if(!X){g.value=$;return}const{onCreate:he}=t,ye=he?he(X):{[t.labelField]:X,[t.valueField]:X},{valueField:we,labelField:ke}=t;h.value.some(Ke=>Ke[we]===ye[we]||Ke[ke]===ye[ke])||m.value.some(Ke=>Ke[we]===ye[we]||Ke[ke]===ye[ke])?g.value=$:g.value=[ye]}}function Ie(E){E.stopPropagation();const{multiple:X}=t;!X&&t.filterable&&Ee(),O(),X?q([],[]):q(null,null)}function ni(E){!gr(E,"action")&&!gr(E,"empty")&&!gr(E,"header")&&E.preventDefault()}function Je(E){G(E)}function Dt(E){var X,ie,de,he,ye;if(!t.keyboard){E.preventDefault();return}switch(E.key){case" ":if(t.filterable)break;E.preventDefault();case"Enter":if(!(!((X=T.value)===null||X===void 0)&&X.isComposing)){if(v.value){const we=(ie=w.value)===null||ie===void 0?void 0:ie.getPendingTmNode();we?Zt(we):t.filterable||(Ee(),tr())}else if(re(),t.tag&&Fe.value){const we=g.value[0];if(we){const ke=we[t.valueField],{value:Ke}=c;t.multiple&&Array.isArray(Ke)&&Ke.includes(ke)||$e(we)}}}E.preventDefault();break;case"ArrowUp":if(E.preventDefault(),t.loading)return;v.value&&((de=w.value)===null||de===void 0||de.prev());break;case"ArrowDown":if(E.preventDefault(),t.loading)return;v.value?(he=w.value)===null||he===void 0||he.next():re();break;case"Escape":v.value&&(sx(E),Ee()),(ye=T.value)===null||ye===void 0||ye.focus();break}}function tr(){var E;(E=T.value)===null||E===void 0||E.focus()}function ii(){var E;(E=T.value)===null||E===void 0||E.focusInput()}function $i(){var E;v.value&&((E=R.value)===null||E===void 0||E.syncPosition())}ue(),i.watch(i.toRef(t,"options"),ue);const nr={focus:()=>{var E;(E=T.value)===null||E===void 0||E.focus()},focusInput:()=>{var E;(E=T.value)===null||E===void 0||E.focusInput()},blur:()=>{var E;(E=T.value)===null||E===void 0||E.blur()},blurInput:()=>{var E;(E=T.value)===null||E===void 0||E.blurInput()}},cn=i.computed(()=>{const{self:{menuBoxShadow:E}}=o.value;return{"--n-menu-box-shadow":E}}),Dn=s?Ci("select",void 0,cn,t):void 0;return Object.assign(Object.assign({},nr),{mergedStatus:z,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:y,isMounted:_s(),triggerRef:T,menuRef:w,pattern:u,uncontrolledShow:S,mergedShow:v,adjustedTo:Nn(t),uncontrolledValue:a,mergedValue:c,followerRef:R,localizedPlaceholder:x,selectedOption:N,selectedOptions:F,mergedSize:ee,mergedDisabled:I,focused:d,activeWithoutMenuOpen:Fe,inlineThemeDisabled:s,onTriggerInputFocus:Gt,onTriggerInputBlur:Te,handleTriggerOrMenuResize:$i,handleMenuFocus:Lt,handleMenuBlur:an,handleMenuTabOut:wt,handleTriggerClick:sn,handleToggle:Zt,handleDeleteOption:$e,handlePatternInput:se,handleClear:Ie,handleTriggerBlur:on,handleTriggerFocus:Rt,handleKeydown:Dt,handleMenuAfterLeave:We,handleMenuClickOutside:Ln,handleMenuScroll:Je,handleMenuKeydown:Dt,handleMenuMousedown:ni,mergedTheme:o,cssVars:s?void 0:cn,themeClass:Dn==null?void 0:Dn.themeClass,onRender:Dn==null?void 0:Dn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(au,null,{default:()=>[i.h(lu,null,{default:()=>i.h(Kk,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var t,e;return[(e=(t=this.$slots).arrow)===null||e===void 0?void 0:e.call(t)]}})}),i.h(vu,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Nn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var t,e,n;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),i.withDirectives(i.h(Ck,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(e=this.menuProps)===null||e===void 0?void 0:e.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,s;return[(s=(r=this.$slots).empty)===null||s===void 0?void 0:s.call(r)]},header:()=>{var r,s;return[(s=(r=this.$slots).header)===null||s===void 0?void 0:s.call(r)]},action:()=>{var r,s;return[(s=(r=this.$slots).action)===null||s===void 0?void 0:s.call(r)]}}),this.displayDirective==="show"?[[i.vShow,this.mergedShow],[bs,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[bs,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),sv={},Nh=i.defineComponent({...sv,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=Z.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>o.value?r.value.map(_=>_.id):r.value?r.value.id:null),l=i.ref(o.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=i.computed(()=>l.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=i.ref(!1),u=i.useTemplateRef("select-component"),h=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(S=>{if(M.isEmpty(S))return;const v=o.value?r.value:r.value?[r.value]:[],T=S.filter(R=>!v.some(w=>w.id===R.id));l.value=r.optionsListConverter([...v,...T])}).finally(()=>{d.value=!1}))};let m="";const g=M.debounce(()=>h(m),800),f=_=>{m=_,g()},p=_=>{var S;if(M.isArray(_)){const v=_.length>0?_.map(T=>{var R;return i.toRaw((R=l.value.find(w=>w.value===T))==null?void 0:R.item)}):[];s("update:value",v)}else if(_>0){const v=i.toRaw((S=l.value.find(T=>T.value===_))==null?void 0:S.item);s("update:value",v)}else s("update:value",null)};return e({focus:()=>{var _;return(_=u.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=u.value)==null?void 0:_.blurInput()}}),(_,S)=>(i.openBlock(),i.createBlock(i.unref(rv),{ref:"select-component","clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled,filterable:!0,loading:d.value,multiple:o.value,options:c.value,placeholder:t.placeholder,remote:!0,value:a.value,"render-label":t.renderLabel,"render-tag":t.renderTag,onSearch:f,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),ov={},Eh=i.defineComponent({...ov,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=Z.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.useTemplateRef("select-component"),a=async h=>r.searchType==="categories"?Z.HttpRequester.getInstance(Z.ProductCategoryDataProvider).publicSimpleSearch(h):r.searchType==="products"?Z.HttpRequester.getInstance(Z.ProductDataProvider).publicSimpleSearch(h):new Promise(m=>{m([])}),l=h=>r.searchType==="categories"?Mt.convertReferencesToSelectOptionsList(h,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":m.name):r.searchType==="products"?Mt.convertReferencesToSelectOptionsList(h,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":`[${m.code}] ${m.name}`):[],c=(h,m)=>{if(r.renderLabel)return r.renderLabel(h,m);if(r.searchType==="products"){const g=h.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},g.code),i.h("span",{},[g.name])])}if(r.searchType==="categories"){const g=h.item;return i.h("div",{},[g.name])}};return e({focus:()=>{var h;return(h=o.value)==null?void 0:h.focus()},blur:()=>{var h;return(h=o.value)==null?void 0:h.blur()}}),(h,m)=>(i.openBlock(),i.createBlock(Nh,{ref:"select-component",value:t.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":t.consistentMenuWidth,"wrap-content":t.wrapContent,"min-term-length":t.minTermLength,"render-label":c,"render-tag":t.renderTag,"onUpdate:value":m[0]||(m[0]=g=>s("update:value",g))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),av={class:"col-span-2 flex flex-row gap-2.5"},lv={class:"flex-1"},cv={class:"text-sc-grey"},dv={class:"ml-2.5"},uv={key:0,class:"flex-none"},hv={},fv=i.defineComponent({...hv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=Z.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(null),o=()=>structuredClone(i.toRaw(n.value)),a=i.ref(o()),l=()=>{r("update:value",a.value.map(h=>i.toRaw(h)))},c=h=>{h&&(a.value=[...a.value.map(m=>i.toRaw(m)),...(M.isArray(h)?h:[h]).filter(m=>!a.value.some(g=>g.id===m.id))],i.nextTick(()=>{s.value=null}),l())},d=h=>{h&&(a.value=a.value.map(m=>m.id===h.id?h:i.toRaw(m)),l())},u=h=>{a.value=a.value.filter(m=>m.id!==h.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(h,m)=>{const g=L.NListItem,f=H_,p=L.NButton,b=L.NList;return i.openBlock(),i.createBlock(b,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(h.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Eh,{value:s.value,"onUpdate:value":[m[0]||(m[0]=y=>s.value=y),c],clearable:!0,disabled:t.disabled,"min-term-length":t.minTermLength,"search-type":t.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(g,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>[...m[1]||(m[1]=[i.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,y=>(i.openBlock(),i.createBlock(g,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(p,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>u(y)},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",av,[i.createElementVNode("span",lv,[i.createElementVNode("span",cv,i.toDisplayString(y.code),1),i.createElementVNode("span",dv,i.toDisplayString(y.name),1)]),h.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",uv,[i.renderSlot(h.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),mv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gv(t,e){return i.openBlock(),i.createElementBlock("svg",mv,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M13 4a1 1 0 0 1 1 1h4a1 1 0 0 1 .783.378l.074.108l3 5l.055.103l.04.107l.029.109l.016.11L22 11v6a1 1 0 0 1-1 1h-1.171a3.001 3.001 0 0 1-5.658 0H9.829a3.001 3.001 0 0 1-5.658 0H3a1 1 0 0 1-1-1V6a2 2 0 0 1 2-2zM7 16a1 1 0 1 0 0 2a1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2m.434-9H14v3h5.234z"},null,-1)])])}const pv=i.markRaw({name:"tabler-truck-filled",render:gv}),yv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bv(t,e){return i.openBlock(),i.createElementBlock("svg",yv,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M5 17a2 2 0 1 0 4 0a2 2 0 1 0-4 0m10 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"}),i.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const _v=i.markRaw({name:"tabler-truck-delivery",render:bv}),wv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xv(t,e){return i.openBlock(),i.createElementBlock("svg",wv,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),i.createElementVNode("path",{d:"M9 9a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v2a3 3 0 0 1-3 3h-4a3 3 0 0 1-3-3zM7 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m9 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"})],-1)])])}const kv=i.markRaw({name:"tabler-truck-loading",render:xv}),vv={class:"flex flex-col gap-1"},Cv={key:0,class:"flex flex-row gap-1 text-base"},Sv={key:1,class:"text-sc-dark-grey text-sm"},Bv={class:"text-sc-grey mr-1.5"},Tv={key:0},Rv={key:1},$v={key:2},Pv={},Fs=i.defineComponent({...Pv,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=i.computed(()=>{var s;return(s=Z.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Hn.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(s,o)=>{var d,u,h,m,g,f,p,b;const a=kv,l=_v,c=pv;return i.openBlock(),i.createElementBlock("div",vv,[t.showType?(i.openBlock(),i.createElementBlock("span",Cv,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((u=e.value)==null?void 0:u.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((m=e.value)==null?void 0:m.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",Sv,[i.createElementVNode("span",Bv,i.toDisplayString(n.value),1),(f=(g=t.delivery)==null?void 0:g.address)!=null&&f.address?(i.openBlock(),i.createElementBlock("span",Tv,i.toDisplayString(t.delivery.address.address),1)):i.createCommentVNode("",!0),(b=(p=t.delivery)==null?void 0:p.warehouse)!=null&&b.address?(i.openBlock(),i.createElementBlock("span",Rv,"со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",$v,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),Nv={class:"flex flex-col gap-2.5"},Ev={class:"text-base"},Fv=["href"],Av={class:"text-sc-grey"},Mv={},Fh=i.defineComponent({...Mv,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Qe.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Qe.Status)?(c=(l=Z.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(e.order.status??-1)))==null?void 0:c.name:void 0}),s=i.computed(()=>e.fields.includes(Qe.CreatedAt)),o=i.computed(()=>e.fields.includes(Qe.ClientInfo)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Qe.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",Nv,[i.createElementVNode("span",Ev,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.orderUrl.replace(":id",t.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,Fv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(zo,{date:t.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[c[1]||(c[1]=i.createTextVNode(" - ",-1)),i.createElementVNode("span",Av,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(hs,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Fs,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),Vv={},Ah=i.defineComponent({...Vv,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=Z.useReferencesStore().paymentTypeReference)==null?void 0:r.find(s=>s.id===e.payment.type)});return(r,s)=>{var o;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((o=n.value)==null?void 0:o.name)??"-"),1)}}}),Iv={class:"inline-block py-[0.0625rem] px-1.5 text-xs font-bold text-center whitespace-nowrap rounded text-white bg-[#17a2b8]"},Ov={},ka=i.defineComponent({...Ov,__name:"creator-user-type-tag",props:{userType:{},prefixText:{default:"Добавлено"}},setup(t){const e=(n,r)=>{const s={[Z.UserTypeEnum.Manager]:"менеджером",[Z.UserTypeEnum.Operator]:"оператором",[Z.UserTypeEnum.Client]:"клиентом",[Z.UserTypeEnum.Admin]:"администратором"};return`${r} ${s[n]}`};return(n,r)=>(i.openBlock(),i.createElementBlock("small",Iv,i.toDisplayString(e(t.userType,t.prefixText)),1))}}),zv={class:"flex flex-row gap-1.5"},Lv={class:"flex-none text-nowrap"},Dv={class:"flex flex-1 flex-col"},Hv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},Wv={key:0},jv={key:1},qv={},Mh=i.defineComponent({...qv,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>{const r=ka;return i.openBlock(),i.createElementBlock("div",zv,[i.createElementVNode("span",Lv,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Dv,[i.createVNode(ar,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),t.product.creatorUser&&t.product.creatorUser.type?(i.openBlock(),i.createBlock(r,{key:0,"user-type":t.product.creatorUser.type,class:"mt-1 self-start"},null,8,["user-type"])):i.createCommentVNode("",!0),i.createElementVNode("div",Hv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",Wv,i.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",jv,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit.name}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"costOneRub"},null,8,["product"]),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"cost"},null,8,["product"])])])])}}}),Xv={},Yv=i.defineComponent({...Xv,__name:"order-items-list",props:{products:{},maxHeight:{default:void 0}},setup(t){const e=()=>{const s=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(o,a)=>i.h("span",{class:"text-base"},[a+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:o=>i.h("span",{class:"text-base"},[o.product.code])},{title:"Наименование",key:"name",resizable:!0,width:"45%",render:o=>i.h("div",{},[i.h(ar,{product:o.product,showCode:!1,showPlanningDates:!1}),..."creatorUser"in o&&o.creatorUser&&o.creatorUser.type?[i.h(ka,{class:"mt-1",userType:o.creatorUser.type,prefixText:"Добавлено"})]:[]])},{title:"Кол-во",key:"quantity",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-nowrap text-base"},o.product.getIsMeasurable()?[`${o.length} ${o.product.unit.name} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit.name}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h(jn,{product:o,costFieldName:"costOne",showQuantityUnit:!0})},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h(jn,{product:o,costFieldName:"cost",showQuantityUnit:!0})}];switch(xt.getDeviceTypeByResolution()){case Ge.phone:case Ge.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(Mh,{product:o,index:a})}];case Ge.laptop:return s;default:return s}},n=i.ref(e()),r=()=>{n.value=e()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(s,o)=>{const a=L.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[o[0]||(o[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(a,{columns:n.value,data:t.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),Vh=Wn(Yv,[["__scopeId","data-v-e5948917"]]),Uv={class:"text-base"},Kv={},va=i.defineComponent({...Kv,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",Uv,i.toDisplayString(t.user.name),1),t.showUserType?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"ml-1":!t.extraInfoOnSecondLine},"text-sc-grey"])}," ["+i.toDisplayString(t.user.type)+"] ",3)):i.createCommentVNode("",!0)],2))}}),Gv={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},Zv={class:"col-span-2"},Qv={class:"col-span-2"},Jv={class:"btn btn-primary",href:"{{ invoice }}"},e2={},Ih=i.defineComponent({...e2,__name:"order-details",props:{order:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",null,[n[11]||(n[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",Gv,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[n[0]||(n[0]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(va,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),n[10]||(n[10]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(hs,{client:t.order.client,class:"col-span-2"},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n[1]||(n[1]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(Od,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):i.createCommentVNode("",!0),t.order.image?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[n[2]||(n[2]=i.createElementVNode("span",null,"Графический файл клиента",-1)),n[3]||(n[3]=i.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):i.createCommentVNode("",!0),t.order.barcode?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[n[4]||(n[4]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",Zv,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[n[5]||(n[5]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(Ah,{payment:t.order.payment,class:"col-span-2"},null,8,["payment"])],64)):i.createCommentVNode("",!0),t.order.delivery?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[n[6]||(n[6]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(Fs,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):i.createCommentVNode("",!0),t.order.comment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:6},[n[7]||(n[7]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",Qv,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[n[8]||(n[8]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(va,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),t.order.invoices&&t.order.invoices.length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:8},[n[9]||(n[9]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(r,s)=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"col-span-2"},[i.createElementVNode("a",Jv," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),t2={key:0},n2={class:"text-sc-dark-grey my-2 text-center"},i2={key:1,class:"text-sc-dark-grey my-2 text-center"},r2={key:2},s2={class:"text-sc-dark-grey mt-4 text-right font-bold"},o2={class:"text-sc-primary"},a2={},Oh=i.defineComponent({...a2,__name:"order-info",props:{order:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(new Z.Order(e.order)),s=()=>{n.value=!0,Z.HttpRequester.getInstance(Z.OrdersDataProvider).getOrder(e.order.id).then(a=>{r.value=a}).finally(()=>{n.value=!1})},o=i.computed(()=>(r.value.products??[]).reduce((a,l)=>a+l.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.onMounted(()=>{s()}),(a,l)=>{const c=L.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",t2,[i.createElementVNode("div",n2,[i.createVNode(c,{size:"small",class:"mb-2.5 align-middle"}),l[0]||(l[0]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):r.value.products.length===0?(i.openBlock(),i.createElementBlock("div",i2," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",r2,[i.createVNode(Vh,{products:r.value.products},null,8,["products"]),i.createElementVNode("div",s2,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",o2,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode(Ih,{order:r.value},null,8,["order"])]))}}}),l2={},c2=i.defineComponent({...l2,__name:"orders-list",props:{fields:{},orderUrl:{},filters:{},sort:{},pagination:{}},setup(t){const e=t,n=()=>structuredClone(i.toRaw(e.sort??{field:"id",direction:"desc"})),r=i.ref(n()),s=i.ref([]),o=i.ref(!1),a=i.computed(()=>Z.useReferencesStore().orderStatusReference),l=()=>{const p=e.fields.length>0?e.fields:[Qe.CreatedAt,Qe.Id,Qe.DeliveryInfo,Qe.Status,Qe.SalesDirections,Qe.AttachedUser],b={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},y={type:"expand",expandable:M.constant(!0),renderExpand:S=>i.h(Oh,{order:S,class:"pl-10 pt-3 pb-10"}),width:"30"},_=[{title:"Дата заказа",key:Qe.CreatedAt,resizable:!0,minWidth:100,render:S=>i.h(zo,{date:S.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Qe.Id,resizable:!0,minWidth:70,render:S=>i.h("a",{href:e.orderUrl.replace(":id",S.id.toString()),target:"_blank",class:"text-base"},S.id)},{title:"Клиент",key:Qe.ClientInfo,resizable:!0,render:S=>i.h(hs,{client:S.client})},{title:"Тип доставки",key:Qe.DeliveryInfo,resizable:!0,render:S=>i.h(Fs,{delivery:S.delivery})},{title:"Статус",key:Qe.Status,resizable:!0,minWidth:90,render:S=>{var v,T;return i.h("span",{class:"text-base"},[((T=(v=a.value)==null?void 0:v.find(R=>R.id===(S.status??-1)))==null?void 0:T.name)??""])}},{title:"Напр. продаж",key:Qe.SalesDirections,resizable:!0,minWidth:70,render:S=>i.h("span",{class:"text-base"},[S.salesDirection.name])},{title:"Закреплено за",key:Qe.AttachedUser,resizable:!0,render:S=>{var v;return i.h("span",{class:"text-base"},[(v=S==null?void 0:S.attachedUser)==null?void 0:v.name])}}];switch(xt.getDeviceTypeByResolution()){case Ge.phone:case Ge.tablet:return[y,{key:"order",title:"Заказ",resizable:!0,render:S=>i.h(Fh,{order:S,fields:p,orderUrl:e.orderUrl})}];case Ge.laptop:return[y,...p.map(S=>_.find(v=>v.key===S)??b)];default:return[b]}},c=i.ref(l()),d=i.ref(new Z.DataTablePagination(e.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),u=()=>{e.filters&&(o.value=!0,Z.HttpRequester.getInstance(Z.OrdersDataProvider).getOrders(e.filters,r.value,{page:d.value.page,pageSize:d.value.pageSize}).then(p=>{d.value.itemCount!==p.meta.total&&(d.value.itemCount=p.meta.total),d.value.page!==p.meta.currentPage&&(d.value.page=p.meta.currentPage),d.value.pageCount!==p.meta.lastPage&&(d.value.pageCount=p.meta.lastPage),d.value.pageSize!==p.meta.perPage&&(d.value.pageSize=p.meta.perPage),s.value=p.data}).finally(()=>{o.value=!1}))},h=p=>{d.value.page=p,u()},m=p=>{d.value.pageSize=p,u()},g=p=>{M.isNull(p)?r.value=n():(r.value.field=p.columnKey.toString(),r.value.direction=p.order==="ascend"?"asc":"desc"),c.value.forEach(b=>{if(Object.hasOwn(b,"sortOrder")){const y=b;y.sortOrder=y.key===(p==null?void 0:p.columnKey)&&(p!=null&&p.sorter)&&p.order!==!1?p.order:!1}}),u()},f=()=>{c.value=l()};return i.watch(()=>e.filters,()=>{u()}),i.watch(()=>e.sort,()=>{r.value=n(),u()}),i.onMounted(()=>{f(),window.addEventListener("resize",f),i.nextTick(()=>{u()})}),i.onUnmounted(()=>{window.removeEventListener("resize",f)}),(p,b)=>{const y=L.NDataTable;return i.openBlock(),i.createBlock(y,{columns:c.value,data:s.value,"row-key":_=>_.id,pagination:d.value,loading:o.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"pagination-behavior-on-filter":"first","onUpdate:page":h,"onUpdate:pageSize":m,"onUpdate:sorter":g},null,8,["columns","data","row-key","pagination","loading"])}}}),d2=Wn(c2,[["__scopeId","data-v-7c4554f4"]]),u2=["href"],h2={class:"text-sc-dark-grey"},f2={},m2=i.defineComponent({...f2,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>Hn.format(n.order.createdAt,Z.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),o=a=>{M.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #",-1)),i.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>o(c))},i.toDisplayString(t.order.id),9,u2),i.createTextVNode(" от "+i.toDisplayString(s.value),1),t.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",h2,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),g2={class:"sc-page flex flex-col"},p2={class:"my-2 flex flex-row items-end"},y2={class:"sc-title grow"},b2={key:0,class:"sc-title-buttons flex-1 grow-0"},_2={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},w2={key:0,class:"sc-title-extra mt-2 sm:mt-4"},x2={},zh=i.defineComponent({...x2,__name:"page",props:{title:{}},setup(t){return(e,n)=>{const r=L.NH1;return i.openBlock(),i.createElementBlock("div",g2,[i.createElementVNode("div",p2,[i.createElementVNode("div",y2,[i.renderSlot(e.$slots,"title",{},()=>[i.createVNode(r,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),e.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",b2,[i.createElementVNode("div",_2,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",w2,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"default")])}}}),k2={class:"overflow-hidden transition-all duration-300"},v2={class:"text-lg font-medium leading-none"},C2={},Lh=i.defineComponent({...C2,__name:"sliding-content-with-drawer",props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:""}},emits:["update:show-drawer"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(0),o=i.ref(n.showDrawer),a=()=>{switch(xt.getDeviceTypeByResolution()){case Ge.phone:return window.innerWidth*.66;case Ge.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?M.isUndefined(n.drawerWidth)?s.value=a():s.value=M.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:s.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>o.value,()=>{l(),r("update:show-drawer",o.value)}),i.watch(()=>n.showDrawer,c=>{o.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const u=L.NDrawerContent,h=L.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",k2,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(h,{show:o.value,"onUpdate:show":d[0]||(d[0]=m=>o.value=m),resizable:!0,width:s.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(u,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",v2,i.toDisplayString(t.title),1)])]),default:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-content")]),footer:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),S2={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},B2={key:0},T2={class:"sc-page-preview-panel grow"},R2={key:1,class:"sc-page-preview-panel-extra flex-none"},$2={},P2=i.defineComponent({...$2,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""}},setup(t,{expose:e}){const n=i.ref(!1),r=()=>{n.value=!0},s=()=>{n.value=!1},o=i.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:l=>{var c;(c=o.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&i.nextTick(()=>{var d,u;window.scrollTo({top:(((u=(d=o.value)==null?void 0:d.getBoundingClientRect())==null?void 0:u.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:s}),(l,c)=>{const d=L.NButton;return i.openBlock(),i.createBlock(zh,{title:t.title},i.createSlots({default:i.withCtx(()=>[l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",S2,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",B2,[i.renderSlot(l.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=u=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",T2,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",R2,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Lh,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=u=>n.value=u),title:t.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(l.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0]),1032,["title"])}}}),N2={},E2=i.defineComponent({...N2,__name:"curator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},managerReferenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>{var f;return M.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>{const f=new Z.Curator({id:-1,name:"",contacts:{},curatedDirection:new Z.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),p=r.showEmptyValue?[f]:[];return r.managerReferenceList.filter(b=>{var y;return(((y=b==null?void 0:b.curatedDirections)==null?void 0:y.length)??0)>0}).forEach(b=>{((b==null?void 0:b.curatedDirections)??[]).forEach(y=>{p.push(new Z.Curator({id:b.id,guid:b.guid,name:b.name,photo:b.photo,contacts:b.contacts??{},curatedDirection:y}))})}),p}),c=i.computed(()=>Mt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,f=>{const p=M.some(o.value?r.value:[r.value],["id",f.id])?` (${f.curatedDirection.name}) `:"";return f.curatedDirection.isNewRec()?f.name:`${f.name}${p}`})),d=i.computed(()=>c.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),u=i.useTemplateRef("select-component"),h=f=>{if(M.isArray(f)){const p=f.length>0?f.map(b=>l.value.find(y=>y.id===b)).filter(b=>!M.isNil(b)):[];s("update:value",p)}else{const p=f>0?l.value.find(b=>b.id===f):null;s("update:value",p??null)}};return i.watch(()=>r.value,()=>{var f,p;(p=(f=u.value)==null?void 0:f.$forceUpdate)==null||p.call(f)},{deep:!0}),e({focus:()=>{var f;return(f=u.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=u.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(L.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),F2={},A2=i.defineComponent({...F2,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!0},managerReferenceList:{default:()=>[]},disabledManagerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1},groupBySalesDirection:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>{var f;return M.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>r.showEmptyValue?[Z.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=i.computed(()=>{var b;let f=l.value,p=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=M.isArray(r.value)?r.value.map(_=>_.id):[(b=r.value)==null?void 0:b.id];p=M.union(p,l.value.filter(_=>!_.isActive).map(_=>_.id)),f=f.filter(_=>(r.showEmptyValue?Z.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||y.includes(_.id))}return Mt.convertReferencesToSelectOptionsList(f,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,y=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&M.some(o.value?r.value:[r.value],["id",y.id])?` (${y.salesDirection.name}) `:"";return y.salesDirection.isNewRec()?y.name:`${y.name}${_}${y.isActive?"":" [Не активен]"}`},y=>p.includes(y.id)&&y.isActive)}),d=i.computed(()=>c.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),u=i.useTemplateRef("select-component"),h=f=>{if(M.isArray(f)){const p=f.length>0?f.filter(b=>!M.some(r.disabledManagerReferenceList,["id",b])).map(b=>l.value.find(y=>y.id===b)).filter(b=>!M.isNil(b)):[];s("update:value",p)}else{const p=f>0&&!M.some(r.disabledManagerReferenceList,["id",f])?l.value.find(b=>b.id===f):new Z.Manager;s("update:value",p??new Z.Manager)}};return i.watch(()=>r.value,()=>{var f,p;(p=(f=u.value)==null?void 0:f.$forceUpdate)==null||p.call(f)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,f=>{if(f.length>0&&r.value)if(o.value){const p=r.value;M.some(p,b=>M.some(f,["id",b.id]))&&s("update:value",p.filter(b=>!M.some(f,["id",b.id])))}else{const p=r.value;M.some(f,["id",p.id])&&s("update:value",new Z.Manager)}}),e({focus:()=>{var f;return(f=u.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=u.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(L.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),M2={class:"m-0.5 flex flex-col p-0.5"},V2={class:"flex flex-row gap-1"},I2={key:0},O2={key:1},z2={key:2},L2={key:3},D2={class:"flex flex-row gap-1"},H2={key:0},W2={key:1},j2={key:2},q2={key:3},X2={},Dh=i.defineComponent({...X2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",M2,[i.createElementVNode("span",V2,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",I2,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",O2,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",z2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",L2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",D2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",H2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",W2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",j2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",q2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Ca={clearable:!1,value:"",field:void 0,disabled:!1},Y2={},U2=i.defineComponent({...Y2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Ca,minTermLength:()=>{var t,e;return((e=(t=Z.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"addressString"]??"-",value:p.id})));i.watch(()=>r.value,p=>{o.value=p}),i.watch(o,()=>{s("update:value",o.value)});const d=M.debounce(()=>u(),800),u=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(o.value,a):Z.HttpRequester.getInstance(Z.DataSuggestionProvider).searchAddresses(o.value)).finally(()=>{a.value=!1}))},h=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Dh,{addr:y,selected:b},{default:M.constant("-")})},m=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},g=i.ref(null);function f(){g.value.focus()}return e({focus:f}),(p,b)=>{const y=L.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[b[0]||(b[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":h,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),K2={class:"m-0.5 flex flex-col p-0.5"},G2={class:"font-medium"},Z2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},Q2={key:0},J2={key:1},eC={},Hh=i.defineComponent({...eC,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",K2,[i.createElementVNode("span",G2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",Z2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",Q2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",J2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),tC={},nC=i.defineComponent({...tC,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Ca,minTermLength:()=>{var t,e;return((e=(t=Z.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"_"]??"-",value:p.id})));i.watch(()=>r.value,p=>{o.value=p}),i.watch(o,()=>{s("update:value",o.value)});const d=M.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Z.HttpRequester.getInstance(Z.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},h=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Hh,{bank:y,selected:b},{default:M.constant("-")})},m=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},g=i.ref(null);function f(){g.value.focus()}return e({focus:f}),(p,b)=>{const y=L.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[b[0]||(b[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":h,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),iC={class:"font-medium"},rC={key:0,class:"flex flex-row gap-2"},sC={key:0,class:"text-xs font-light text-blue-800"},oC={key:1,class:"text-sc-dark-grey text-xs font-light"},aC={},Wh=i.defineComponent({...aC,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>{var s,o;return((o=(s=e.org.rawData)==null?void 0:s.state)==null?void 0:o.liquidationDate)??!1}),r=i.computed(()=>{var s,o;return((o=(s=e.org.rawData)==null?void 0:s.address)==null?void 0:o.value)??""});return(s,o)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(`m-0.5 flex flex-col p-0.5 ${n.value?"line-through":""}`)},[i.createElementVNode("span",iC,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",rC,[t.org.inn?(i.openBlock(),i.createElementBlock("span",sC,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",oC,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),lC={},cC=i.defineComponent({...lC,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Ca,minTermLength:()=>{var t,e;return((e=(t=Z.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=b=>{var y,_;return!!(((_=(y=b.rawData)==null?void 0:y.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>Mt.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,b=>b[r.field??"_"]??"-",b=>!r.allowSelectTerminated&&c(b)));i.watch(()=>r.value,b=>{o.value=b}),i.watch(o,()=>{s("update:value",o.value)});const u=M.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Z.HttpRequester.getInstance(Z.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},m=(b,y)=>{const _=l.value.find(S=>S.id===b.value)||{};return i.h(Wh,{org:_,selected:y},{default:M.constant("-")})},g=b=>{u.cancel();const y=l.value.find(_=>_.id===b)||{};(r.allowSelectTerminated||!c(y))&&s("select",y)},f=i.ref(null);function p(){f.value.focus()}return e({focus:p}),(b,y)=>{const _=L.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[y[0]||(y[0]=S=>o.value=S),i.unref(u)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":m,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),dC={},uC=i.defineComponent({...dC,__name:"button-with-confirm-action",props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:""},dialogContent:{default:""},disableConfirm:{type:Boolean,default:!1},popoverText:{default:""},type:{default:"default"},size:{default:"small"},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["accept"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=()=>{r("accept",()=>{s.value=!1})},a=()=>{n.disableConfirm?o():s.value=!0};return(l,c)=>{const d=L.NButton,u=L.NPopover,h=L.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(u,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:t.disabled,ghost:t.ghost,loading:t.loading,size:t.size,type:t.type,quaternary:t.quaternary,circle:t.circle,onClick:a},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(h,{show:s.value,"onUpdate:show":c[1]||(c[1]=m=>s.value=m),content:t.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:t.dialogTitle,"action-class":"",preset:"dialog"},{action:i.withCtx(()=>[i.createVNode(d,{type:"primary",class:"px-8",onClick:o},{default:i.withCtx(()=>[...c[2]||(c[2]=[i.createTextVNode(" Да ",-1)])]),_:1}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=m=>s.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),hC={key:0,class:"whitespace-pre-line"},fC={key:1,class:"text-sc-dark-grey"},mC={},gC=i.defineComponent({...mC,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.comment);i.watch(()=>s.value,l=>{s.value=l});const o=l=>{r("update:comment",s.value,l)},a=()=>{s.value=n.comment};return(l,c)=>{const d=L.NInput;return i.openBlock(),i.createBlock(Wd,{disabled:t.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",hC,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",fC," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=u=>s.value=u),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),pC={},yC=i.defineComponent({...pC,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,s)=>t.debt!==0?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"text-sm":t.wrapAsSmall})},[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},i.toDisplayString(t.debt)+" ₽ ",3)],2)):i.createCommentVNode("",!0)}}),bC={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _C(t,e){return i.openBlock(),i.createElementBlock("svg",bC,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"},null,-1)])])}const wC=i.markRaw({name:"ion-warning",render:_C}),xC={},kC=i.defineComponent({...xC,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=wC,s=L.NPopover;return i.openBlock(),i.createBlock(s,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),_t=class _t{static init(e,n){_t.messagesService&&_t.notificationsService||(_t.messagesService=e,_t.notificationsService=n)}static getMessagesService(){if(!_t.messagesService)throw new Error("UI provider is not initialized.");return _t.messagesService}static getNotificationsService(){if(!_t.notificationsService)throw new Error("UI provider is not initialized.");return _t.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,s;if(M.isEmpty(e.errors)){const o=(s=(r=e.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";_t.notificationsService?_t.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:e.message,meta:`#${e.status}${a}: ${e.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",e)}else for(const o in e.errors)Object.prototype.hasOwnProperty.call(n,o)?n[o]=new Z.FieldValidationResultData(e.errors[o].toString(),"error"):_t.messagesService?_t.messagesService.error(e.errors[o].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[o])}};C(_t,"messagesService"),C(_t,"notificationsService");let Sa=_t;const vC=i.computed(()=>Z.useReferencesStore().deliveryTypeReference??[]),CC=i.computed(()=>Z.useReferencesStore().managersList??[]),SC=i.computed(()=>Z.useReferencesStore().opfReference??[]),BC=i.computed(()=>Z.useReferencesStore().partnerGroupsReference??[]),TC=i.computed(()=>Z.useReferencesStore().priceCoefficientsReference??[]),RC=i.computed(()=>Z.useReferencesStore().productFilesTypesReference??[]),$C=i.computed(()=>Z.useReferencesStore().resourceTypesReference),PC=i.computed(()=>Z.useReferencesStore().salesDirectionsReference??[]),NC=i.computed(()=>Z.useReferencesStore().warehousesReference??[]),EC=i.computed(()=>Mt.convertReferencesToSelectOptionsList(Z.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),FC=i.computed(()=>Mt.convertReferencesToSelectOptionsList(Z.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),AC=t=>Z.HttpRequester.getInstance(Z.ReferenceDataProvider).searchCity(t),MC=t=>Mt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>{var n,r,s;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(n=e==null?void 0:e.region)==null?void 0:n.name}, ${(s=(r=e==null?void 0:e.region)==null?void 0:r.country)==null?void 0:s.name}`},e=>e==null?void 0:e.isNewRec());H.AddProductToCartDialog=H0,H.ConfiguratorSettingsKozyrek=bd,H.ConfiguratorSettingsMosquito=Kb,H.ConfiguratorsEnum=us,H.ContentHelper=ai,H.KozyrekLine=bn,H.KozyrekTailTemplate=Io,H.KozyrekTemplate=Ui,H.OrdersTableFields=Qe,H.Point=Vo,H.ScAddressSuggestion=U2,H.ScAddressSuggestionLabel=Dh,H.ScBankSuggestion=nC,H.ScBankSuggestionLabel=Hh,H.ScBaseDialog=Id,H.ScButtonWithConfirmAction=uC,H.ScCategoryCollapse=Md,H.ScClientNameWithShortInfo=hs,H.ScCollapse=Ad,H.ScCollapseItem=Ga,H.ScCommentEditor=gC,H.ScConfiguratorsProductInfo=lr,H.ScContragentWithShortInfo=Od,H.ScCreatorUserTypeTag=ka,H.ScCuratorSelect=E2,H.ScDateRange=e_,H.ScDateTimeLabel=zo,H.ScDebouncedInput=T_,H.ScDebouncedInputNumber=$_,H.ScDebt=yC,H.ScDialogHeader=l_,H.ScDynamicConfigurator=Nd,H.ScEmail=rb,H.ScExternalLink=z_,H.ScImageGallery=tl,H.ScInlineEditableItem=Wd,H.ScInlineView=Lo,H.ScKozyrekConfigurator=_d,H.ScKozyrekConfiguratorParamsForm=il,H.ScKozyrekConfiguratorPreview=yd,H.ScKozyrekConfiguratorTemplates=pd,H.ScLightGallery=el,H.ScManagerSelect=A2,H.ScMetalForDoorsConfigurator=Rd,H.ScMetalForDoorsConfiguratorForm=Td,H.ScMosquitoConfigurator=kd,H.ScMosquitoConfiguratorForm=wd,H.ScMosquitoConfiguratorMeasurementInstructions=xd,H.ScMosquitoConfiguratorPreview=Oo,H.ScOrderCommonInfo=Fh,H.ScOrderDeliveryLabel=Fs,H.ScOrderDetails=Ih,H.ScOrderInfo=Oh,H.ScOrderItemsList=Vh,H.ScOrderPayment=Ah,H.ScOrderProductInfo=Mh,H.ScOrdersList=d2,H.ScOrgSuggestion=cC,H.ScOrgSuggestionLabel=Wh,H.ScPage=zh,H.ScPageWithSlidingPanel=P2,H.ScPersonContactsBlock=Ub,H.ScPhone=Rb,H.ScPhoneInput=E_,H.ScProductName=ar,H.ScProductsList=fv,H.ScReferenceSelect=Vd,H.ScSandwichConfigurator=Pd,H.ScSandwichConfiguratorForm=$d,H.ScSearchableProductSelect=Eh,H.ScSearchableReferenceSelect=Nh,H.ScSetClientPriceFormItem=V0,H.ScShortTextOrderInfo=m2,H.ScSingleFileUploadSelector=f_,H.ScSlidingContentWithDrawer=Lh,H.ScStripConfigurator=Bd,H.ScStripConfiguratorForm=Cd,H.ScStripConfiguratorLineItem=vd,H.ScStripConfiguratorPreview=Sd,H.ScUserShortInfo=va,H.ScWarningIcon=kC,H.SelectOptionHelper=Mt,H.UiNotificationProvider=Sa,H.WindowResolutionEnum=Ge,H.WindowResolutionProvider=xt,H.channelPrimaryInterestOptionsList=EC,H.componentSizeInjectionKey=Mr,H.deliveryTypeReferenceList=vC,H.handleFloatInput=qa,H.handleIntegerInput=st,H.isCanSandwichShow=Fd,H.isConfiguratorType=Ed,H.managersReferenceList=CC,H.naiveUiTheme=Mf,H.opfReferenceList=SC,H.parse=Pt,H.partnerGroupReferenceList=BC,H.priceCoefficientsReferenceList=TC,H.productFilesTypesReferenceList=RC,H.renderConfig=Le,H.resetInputValidation=Oe,H.resourceReferencesList=$C,H.salesDirectionsReferenceList=PC,H.searchCityReferenceDataHandler=AC,H.searchCityReferenceLabelRenderer=MC,H.selectAllTextOnFocus=ze,H.sourcePrimaryInterestOptionsList=FC,H.warehousesReferenceList=NC,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})}));
822
+ `,[Bh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Es(t){return t.type==="group"}function Ph(t){return t.type==="ignored"}function ka(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function Jk(t,e){return{getIsGroup:Es,getIgnored:Ph,getKey(r){return Es(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function ev(t,e,n,r){if(!e)return t;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(Es(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Ph(l))continue;e(n,l)&&a.push(l)}return a}return s(t)}function tv(t,e,n){const r=new Map;return t.forEach(s=>{Es(s)?s[n].forEach(o=>{r.set(o[e],o)}):r.set(s[e],s)}),r}var nv={};const iv=Object.assign(Object.assign({},pt.props),{to:Nn.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),rv=i.defineComponent({name:"Select",props:iv,slots:Object,setup(t){nv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&ei("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&ei("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=vi(t),o=pt("Select","-select",Qk,Zk,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Go(l,a),d=i.ref(!1),u=i.ref(""),h=iu(t,["items","options"]),m=i.ref([]),g=i.ref([]),f=i.computed(()=>g.value.concat(m.value).concat(h.value)),p=i.computed(()=>{const{filter:E}=t;if(E)return E;const{labelField:X,valueField:ie}=t;return(de,he)=>{if(!he)return!1;const ye=he[X];if(typeof ye=="string")return ka(de,ye);const we=he[ie];return typeof we=="string"?ka(de,we):typeof we=="number"?ka(de,String(we)):!1}}),b=i.computed(()=>{if(t.remote)return h.value;{const{value:E}=f,{value:X}=u;return!X.length||!t.filterable?E:ev(E,p.value,X,t.childrenField)}}),y=i.computed(()=>{const{valueField:E,childrenField:X}=t,ie=Jk(E,X);return P1(b.value,ie)}),_=i.computed(()=>tv(f.value,t.valueField,t.childrenField)),S=i.ref(!1),v=Go(i.toRef(t,"show"),S),T=i.ref(null),R=i.ref(null),w=i.ref(null),{localeRef:B}=uh("Select"),x=i.computed(()=>{var E;return(E=t.placeholder)!==null&&E!==void 0?E:B.value.placeholder}),$=[],P=i.ref(new Map),A=i.computed(()=>{const{fallbackOption:E}=t;if(E===void 0){const{labelField:X,valueField:ie}=t;return de=>({[X]:String(de),[ie]:de})}return E===!1?!1:X=>Object.assign(E(X),{value:X})});function V(E){const X=t.remote,{value:ie}=P,{value:de}=_,{value:he}=A,ye=[];return E.forEach(we=>{if(de.has(we))ye.push(de.get(we));else if(X&&ie.has(we))ye.push(ie.get(we));else if(he){const ke=he(we);ke&&ye.push(ke)}}),ye}const F=i.computed(()=>{if(t.multiple){const{value:E}=c;return Array.isArray(E)?V(E):[]}return null}),N=i.computed(()=>{const{value:E}=c;return!t.multiple&&!Array.isArray(E)?E===null?null:V([E])[0]||null:null}),Y=cx(t),{mergedSizeRef:ee,mergedDisabledRef:I,mergedStatusRef:z}=Y;function q(E,X){const{onChange:ie,"onUpdate:value":de,onUpdateValue:he}=t,{nTriggerFormChange:ye,nTriggerFormInput:we}=Y;ie&&gt(ie,E,X),he&&gt(he,E,X),de&&gt(de,E,X),a.value=E,ye(),we()}function W(E){const{onBlur:X}=t,{nTriggerFormBlur:ie}=Y;X&&gt(X,E),ie()}function O(){const{onClear:E}=t;E&&gt(E)}function D(E){const{onFocus:X,showOnFocus:ie}=t,{nTriggerFormFocus:de}=Y;X&&gt(X,E),de(),ie&&re()}function j(E){const{onSearch:X}=t;X&&gt(X,E)}function G(E){const{onScroll:X}=t;X&&gt(X,E)}function ue(){var E;const{remote:X,multiple:ie}=t;if(X){const{value:de}=P;if(ie){const{valueField:he}=t;(E=F.value)===null||E===void 0||E.forEach(ye=>{de.set(ye[he],ye)})}else{const he=N.value;he&&de.set(he[t.valueField],he)}}}function oe(E){const{onUpdateShow:X,"onUpdate:show":ie}=t;X&&gt(X,E),ie&&gt(ie,E),S.value=E}function re(){I.value||(oe(!0),S.value=!0,t.filterable&&ii())}function Ee(){oe(!1)}function We(){u.value="",g.value=$}const Fe=i.ref(!1);function Gt(){t.filterable&&(Fe.value=!0)}function Te(){t.filterable&&(Fe.value=!1,v.value||We())}function sn(){I.value||(v.value?t.filterable?ii():Ee():re())}function on(E){var X,ie;!((ie=(X=w.value)===null||X===void 0?void 0:X.selfRef)===null||ie===void 0)&&ie.contains(E.relatedTarget)||(d.value=!1,W(E),Ee())}function $t(E){D(E),d.value=!0}function Lt(){d.value=!0}function an(E){var X;!((X=T.value)===null||X===void 0)&&X.$el.contains(E.relatedTarget)||(d.value=!1,W(E),Ee())}function wt(){var E;(E=T.value)===null||E===void 0||E.focus(),Ee()}function Ln(E){var X;v.value&&(!((X=T.value)===null||X===void 0)&&X.$el.contains(pr(E))||Ee())}function ln(E){if(!Array.isArray(E))return[];if(A.value)return Array.from(E);{const{remote:X}=t,{value:ie}=_;if(X){const{value:de}=P;return E.filter(he=>ie.has(he)||de.has(he))}else return E.filter(de=>ie.has(de))}}function Zt(E){$e(E.rawNode)}function $e(E){if(I.value)return;const{tag:X,remote:ie,clearFilterAfterSelect:de,valueField:he}=t;if(X&&!ie){const{value:ye}=g,we=ye[0]||null;if(we){const ke=m.value;ke.length?ke.push(we):m.value=[we],g.value=$}}if(ie&&P.value.set(E[he],E),t.multiple){const ye=ln(c.value),we=ye.findIndex(ke=>ke===E[he]);if(~we){if(ye.splice(we,1),X&&!ie){const ke=K(E[he]);~ke&&(m.value.splice(ke,1),de&&(u.value=""))}}else ye.push(E[he]),de&&(u.value="");q(ye,V(ye))}else{if(X&&!ie){const ye=K(E[he]);~ye?m.value=[m.value[ye]]:m.value=$}tr(),Ee(),q(E[he],E)}}function K(E){return m.value.findIndex(ie=>ie[t.valueField]===E)}function se(E){v.value||re();const{value:X}=E.target;u.value=X;const{tag:ie,remote:de}=t;if(j(X),ie&&!de){if(!X){g.value=$;return}const{onCreate:he}=t,ye=he?he(X):{[t.labelField]:X,[t.valueField]:X},{valueField:we,labelField:ke}=t;h.value.some(Ke=>Ke[we]===ye[we]||Ke[ke]===ye[ke])||m.value.some(Ke=>Ke[we]===ye[we]||Ke[ke]===ye[ke])?g.value=$:g.value=[ye]}}function Ie(E){E.stopPropagation();const{multiple:X}=t;!X&&t.filterable&&Ee(),O(),X?q([],[]):q(null,null)}function ni(E){!gr(E,"action")&&!gr(E,"empty")&&!gr(E,"header")&&E.preventDefault()}function Je(E){G(E)}function Dt(E){var X,ie,de,he,ye;if(!t.keyboard){E.preventDefault();return}switch(E.key){case" ":if(t.filterable)break;E.preventDefault();case"Enter":if(!(!((X=T.value)===null||X===void 0)&&X.isComposing)){if(v.value){const we=(ie=w.value)===null||ie===void 0?void 0:ie.getPendingTmNode();we?Zt(we):t.filterable||(Ee(),tr())}else if(re(),t.tag&&Fe.value){const we=g.value[0];if(we){const ke=we[t.valueField],{value:Ke}=c;t.multiple&&Array.isArray(Ke)&&Ke.includes(ke)||$e(we)}}}E.preventDefault();break;case"ArrowUp":if(E.preventDefault(),t.loading)return;v.value&&((de=w.value)===null||de===void 0||de.prev());break;case"ArrowDown":if(E.preventDefault(),t.loading)return;v.value?(he=w.value)===null||he===void 0||he.next():re();break;case"Escape":v.value&&(sx(E),Ee()),(ye=T.value)===null||ye===void 0||ye.focus();break}}function tr(){var E;(E=T.value)===null||E===void 0||E.focus()}function ii(){var E;(E=T.value)===null||E===void 0||E.focusInput()}function $i(){var E;v.value&&((E=R.value)===null||E===void 0||E.syncPosition())}ue(),i.watch(i.toRef(t,"options"),ue);const nr={focus:()=>{var E;(E=T.value)===null||E===void 0||E.focus()},focusInput:()=>{var E;(E=T.value)===null||E===void 0||E.focusInput()},blur:()=>{var E;(E=T.value)===null||E===void 0||E.blur()},blurInput:()=>{var E;(E=T.value)===null||E===void 0||E.blurInput()}},cn=i.computed(()=>{const{self:{menuBoxShadow:E}}=o.value;return{"--n-menu-box-shadow":E}}),Dn=s?Ci("select",void 0,cn,t):void 0;return Object.assign(Object.assign({},nr),{mergedStatus:z,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:y,isMounted:_s(),triggerRef:T,menuRef:w,pattern:u,uncontrolledShow:S,mergedShow:v,adjustedTo:Nn(t),uncontrolledValue:a,mergedValue:c,followerRef:R,localizedPlaceholder:x,selectedOption:N,selectedOptions:F,mergedSize:ee,mergedDisabled:I,focused:d,activeWithoutMenuOpen:Fe,inlineThemeDisabled:s,onTriggerInputFocus:Gt,onTriggerInputBlur:Te,handleTriggerOrMenuResize:$i,handleMenuFocus:Lt,handleMenuBlur:an,handleMenuTabOut:wt,handleTriggerClick:sn,handleToggle:Zt,handleDeleteOption:$e,handlePatternInput:se,handleClear:Ie,handleTriggerBlur:on,handleTriggerFocus:$t,handleKeydown:Dt,handleMenuAfterLeave:We,handleMenuClickOutside:Ln,handleMenuScroll:Je,handleMenuKeydown:Dt,handleMenuMousedown:ni,mergedTheme:o,cssVars:s?void 0:cn,themeClass:Dn==null?void 0:Dn.themeClass,onRender:Dn==null?void 0:Dn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(au,null,{default:()=>[i.h(lu,null,{default:()=>i.h(Kk,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var t,e;return[(e=(t=this.$slots).arrow)===null||e===void 0?void 0:e.call(t)]}})}),i.h(vu,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Nn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var t,e,n;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),i.withDirectives(i.h(Ck,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(e=this.menuProps)===null||e===void 0?void 0:e.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,s;return[(s=(r=this.$slots).empty)===null||s===void 0?void 0:s.call(r)]},header:()=>{var r,s;return[(s=(r=this.$slots).header)===null||s===void 0?void 0:s.call(r)]},action:()=>{var r,s;return[(s=(r=this.$slots).action)===null||s===void 0?void 0:s.call(r)]}}),this.displayDirective==="show"?[[i.vShow,this.mergedShow],[bs,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[bs,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),sv={},Nh=i.defineComponent({...sv,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=Z.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>o.value?r.value.map(_=>_.id):r.value?r.value.id:null),l=i.ref(o.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=i.computed(()=>l.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=i.ref(!1),u=i.useTemplateRef("select-component"),h=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(S=>{if(M.isEmpty(S))return;const v=o.value?r.value:r.value?[r.value]:[],T=S.filter(R=>!v.some(w=>w.id===R.id));l.value=r.optionsListConverter([...v,...T])}).finally(()=>{d.value=!1}))};let m="";const g=M.debounce(()=>h(m),800),f=_=>{m=_,g()},p=_=>{var S;if(M.isArray(_)){const v=_.length>0?_.map(T=>{var R;return i.toRaw((R=l.value.find(w=>w.value===T))==null?void 0:R.item)}):[];s("update:value",v)}else if(_>0){const v=i.toRaw((S=l.value.find(T=>T.value===_))==null?void 0:S.item);s("update:value",v)}else s("update:value",null)};return e({focus:()=>{var _;return(_=u.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=u.value)==null?void 0:_.blurInput()}}),(_,S)=>(i.openBlock(),i.createBlock(i.unref(rv),{ref:"select-component","clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled,filterable:!0,loading:d.value,multiple:o.value,options:c.value,placeholder:t.placeholder,remote:!0,value:a.value,"render-label":t.renderLabel,"render-tag":t.renderTag,onSearch:f,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),ov={},Eh=i.defineComponent({...ov,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=Z.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.useTemplateRef("select-component"),a=async h=>r.searchType==="categories"?Z.HttpRequester.getInstance(Z.ProductCategoryDataProvider).publicSimpleSearch(h):r.searchType==="products"?Z.HttpRequester.getInstance(Z.ProductDataProvider).publicSimpleSearch(h):new Promise(m=>{m([])}),l=h=>r.searchType==="categories"?Mt.convertReferencesToSelectOptionsList(h,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":m.name):r.searchType==="products"?Mt.convertReferencesToSelectOptionsList(h,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":`[${m.code}] ${m.name}`):[],c=(h,m)=>{if(r.renderLabel)return r.renderLabel(h,m);if(r.searchType==="products"){const g=h.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},g.code),i.h("span",{},[g.name])])}if(r.searchType==="categories"){const g=h.item;return i.h("div",{},[g.name])}};return e({focus:()=>{var h;return(h=o.value)==null?void 0:h.focus()},blur:()=>{var h;return(h=o.value)==null?void 0:h.blur()}}),(h,m)=>(i.openBlock(),i.createBlock(Nh,{ref:"select-component",value:t.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":t.consistentMenuWidth,"wrap-content":t.wrapContent,"min-term-length":t.minTermLength,"render-label":c,"render-tag":t.renderTag,"onUpdate:value":m[0]||(m[0]=g=>s("update:value",g))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),av={class:"col-span-2 flex flex-row gap-2.5"},lv={class:"flex-1"},cv={class:"text-sc-grey"},dv={class:"ml-2.5"},uv={key:0,class:"flex-none"},hv={},fv=i.defineComponent({...hv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=Z.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(null),o=()=>structuredClone(i.toRaw(n.value)),a=i.ref(o()),l=()=>{r("update:value",a.value.map(h=>i.toRaw(h)))},c=h=>{h&&(a.value=[...a.value.map(m=>i.toRaw(m)),...(M.isArray(h)?h:[h]).filter(m=>!a.value.some(g=>g.id===m.id))],i.nextTick(()=>{s.value=null}),l())},d=h=>{h&&(a.value=a.value.map(m=>m.id===h.id?h:i.toRaw(m)),l())},u=h=>{a.value=a.value.filter(m=>m.id!==h.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(h,m)=>{const g=L.NListItem,f=H_,p=L.NButton,b=L.NList;return i.openBlock(),i.createBlock(b,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(h.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Eh,{value:s.value,"onUpdate:value":[m[0]||(m[0]=y=>s.value=y),c],clearable:!0,disabled:t.disabled,"min-term-length":t.minTermLength,"search-type":t.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(g,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>[...m[1]||(m[1]=[i.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,y=>(i.openBlock(),i.createBlock(g,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(p,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>u(y)},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",av,[i.createElementVNode("span",lv,[i.createElementVNode("span",cv,i.toDisplayString(y.code),1),i.createElementVNode("span",dv,i.toDisplayString(y.name),1)]),h.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",uv,[i.renderSlot(h.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),mv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gv(t,e){return i.openBlock(),i.createElementBlock("svg",mv,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M13 4a1 1 0 0 1 1 1h4a1 1 0 0 1 .783.378l.074.108l3 5l.055.103l.04.107l.029.109l.016.11L22 11v6a1 1 0 0 1-1 1h-1.171a3.001 3.001 0 0 1-5.658 0H9.829a3.001 3.001 0 0 1-5.658 0H3a1 1 0 0 1-1-1V6a2 2 0 0 1 2-2zM7 16a1 1 0 1 0 0 2a1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2m.434-9H14v3h5.234z"},null,-1)])])}const pv=i.markRaw({name:"tabler-truck-filled",render:gv}),yv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bv(t,e){return i.openBlock(),i.createElementBlock("svg",yv,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M5 17a2 2 0 1 0 4 0a2 2 0 1 0-4 0m10 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"}),i.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const _v=i.markRaw({name:"tabler-truck-delivery",render:bv}),wv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xv(t,e){return i.openBlock(),i.createElementBlock("svg",wv,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),i.createElementVNode("path",{d:"M9 9a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v2a3 3 0 0 1-3 3h-4a3 3 0 0 1-3-3zM7 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m9 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"})],-1)])])}const kv=i.markRaw({name:"tabler-truck-loading",render:xv}),vv={class:"flex flex-col gap-1"},Cv={key:0,class:"flex flex-row gap-1 text-base"},Sv={key:1,class:"text-sc-dark-grey text-sm"},Bv={class:"text-sc-grey mr-1.5"},Tv={key:0},Rv={key:1},$v={key:2},Pv={},Fs=i.defineComponent({...Pv,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=i.computed(()=>{var s;return(s=Z.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Hn.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(s,o)=>{var d,u,h,m,g,f,p,b;const a=kv,l=_v,c=pv;return i.openBlock(),i.createElementBlock("div",vv,[t.showType?(i.openBlock(),i.createElementBlock("span",Cv,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((u=e.value)==null?void 0:u.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((m=e.value)==null?void 0:m.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",Sv,[i.createElementVNode("span",Bv,i.toDisplayString(n.value),1),(f=(g=t.delivery)==null?void 0:g.address)!=null&&f.address?(i.openBlock(),i.createElementBlock("span",Tv,i.toDisplayString(t.delivery.address.address),1)):i.createCommentVNode("",!0),(b=(p=t.delivery)==null?void 0:p.warehouse)!=null&&b.address?(i.openBlock(),i.createElementBlock("span",Rv,"со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",$v,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),Nv={class:"flex flex-col gap-2.5"},Ev={class:"text-base"},Fv=["href"],Av={class:"text-sc-grey"},Mv={},Fh=i.defineComponent({...Mv,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Qe.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Qe.Status)?(c=(l=Z.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(e.order.status??-1)))==null?void 0:c.name:void 0}),s=i.computed(()=>e.fields.includes(Qe.CreatedAt)),o=i.computed(()=>e.fields.includes(Qe.ClientInfo)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Qe.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",Nv,[i.createElementVNode("span",Ev,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.orderUrl.replace(":id",t.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,Fv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(Lo,{date:t.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[c[1]||(c[1]=i.createTextVNode(" - ",-1)),i.createElementVNode("span",Av,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(hs,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Fs,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),Vv={},Ah=i.defineComponent({...Vv,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=Z.useReferencesStore().paymentTypeReference)==null?void 0:r.find(s=>s.id===e.payment.type)});return(r,s)=>{var o;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((o=n.value)==null?void 0:o.name)??"-"),1)}}}),Iv={class:"inline-block py-[0.0625rem] px-1.5 text-xs font-bold text-center whitespace-nowrap rounded text-white bg-[#17a2b8]"},Ov={},va=i.defineComponent({...Ov,__name:"creator-user-type-tag",props:{userType:{},prefixText:{default:"Добавлено"}},setup(t){const e=(n,r)=>{const s={[Z.UserTypeEnum.Manager]:"менеджером",[Z.UserTypeEnum.Operator]:"оператором",[Z.UserTypeEnum.Client]:"клиентом",[Z.UserTypeEnum.Admin]:"администратором"};return`${r} ${s[n]}`};return(n,r)=>(i.openBlock(),i.createElementBlock("small",Iv,i.toDisplayString(e(t.userType,t.prefixText)),1))}}),zv={class:"flex flex-row gap-1.5"},Lv={class:"flex-none text-nowrap"},Dv={class:"flex flex-1 flex-col"},Hv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},Wv={key:0},jv={key:1},qv={},Mh=i.defineComponent({...qv,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>{const r=va;return i.openBlock(),i.createElementBlock("div",zv,[i.createElementVNode("span",Lv,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Dv,[i.createVNode(ar,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),t.product.creatorUser&&t.product.creatorUser.type?(i.openBlock(),i.createBlock(r,{key:0,"user-type":t.product.creatorUser.type,class:"mt-1 self-start"},null,8,["user-type"])):i.createCommentVNode("",!0),i.createElementVNode("div",Hv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",Wv,i.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",jv,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit.name}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"costOneRub"},null,8,["product"]),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"cost"},null,8,["product"])])])])}}}),Xv={},Yv=i.defineComponent({...Xv,__name:"order-items-list",props:{products:{},maxHeight:{default:void 0}},setup(t){const e=()=>{const s=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(o,a)=>i.h("span",{class:"text-base"},[a+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:o=>i.h("span",{class:"text-base"},[o.product.code])},{title:"Наименование",key:"name",resizable:!0,width:"45%",render:o=>i.h("div",{},[i.h(ar,{product:o.product,showCode:!1,showPlanningDates:!1}),..."creatorUser"in o&&o.creatorUser&&o.creatorUser.type?[i.h(va,{class:"mt-1",userType:o.creatorUser.type,prefixText:"Добавлено"})]:[]])},{title:"Кол-во",key:"quantity",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-nowrap text-base"},o.product.getIsMeasurable()?[`${o.length} ${o.product.unit.name} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit.name}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h(jn,{product:o,costFieldName:"costOne",showQuantityUnit:!0})},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h(jn,{product:o,costFieldName:"cost",showQuantityUnit:!0})}];switch(kt.getDeviceTypeByResolution()){case Ge.phone:case Ge.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(Mh,{product:o,index:a})}];case Ge.laptop:return s;default:return s}},n=i.ref(e()),r=()=>{n.value=e()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(s,o)=>{const a=L.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[o[0]||(o[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(a,{columns:n.value,data:t.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),Vh=Wn(Yv,[["__scopeId","data-v-e5948917"]]),Uv={class:"text-base"},Kv={},Ca=i.defineComponent({...Kv,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",Uv,i.toDisplayString(t.user.name),1),t.showUserType?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"ml-1":!t.extraInfoOnSecondLine},"text-sc-grey"])}," ["+i.toDisplayString(t.user.type)+"] ",3)):i.createCommentVNode("",!0)],2))}}),Gv={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},Zv={class:"col-span-2"},Qv={class:"col-span-2"},Jv={class:"btn btn-primary",href:"{{ invoice }}"},e2={},Ih=i.defineComponent({...e2,__name:"order-details",props:{order:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",null,[n[11]||(n[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",Gv,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[n[0]||(n[0]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(Ca,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),n[10]||(n[10]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(hs,{client:t.order.client,class:"col-span-2"},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n[1]||(n[1]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(Od,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):i.createCommentVNode("",!0),t.order.image?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[n[2]||(n[2]=i.createElementVNode("span",null,"Графический файл клиента",-1)),n[3]||(n[3]=i.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):i.createCommentVNode("",!0),t.order.barcode?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[n[4]||(n[4]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",Zv,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[n[5]||(n[5]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(Ah,{payment:t.order.payment,class:"col-span-2"},null,8,["payment"])],64)):i.createCommentVNode("",!0),t.order.delivery?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[n[6]||(n[6]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(Fs,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):i.createCommentVNode("",!0),t.order.comment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:6},[n[7]||(n[7]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",Qv,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[n[8]||(n[8]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(Ca,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),t.order.invoices&&t.order.invoices.length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:8},[n[9]||(n[9]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(r,s)=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"col-span-2"},[i.createElementVNode("a",Jv," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),t2={key:0},n2={class:"text-sc-dark-grey my-2 text-center"},i2={key:1,class:"text-sc-dark-grey my-2 text-center"},r2={key:2},s2={class:"text-sc-dark-grey mt-4 text-right font-bold"},o2={class:"text-sc-primary"},a2={},Oh=i.defineComponent({...a2,__name:"order-info",props:{order:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(new Z.Order(e.order)),s=()=>{n.value=!0,Z.HttpRequester.getInstance(Z.OrdersDataProvider).getOrder(e.order.id).then(a=>{r.value=a}).finally(()=>{n.value=!1})},o=i.computed(()=>(r.value.products??[]).reduce((a,l)=>a+l.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.onMounted(()=>{s()}),(a,l)=>{const c=L.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",t2,[i.createElementVNode("div",n2,[i.createVNode(c,{size:"small",class:"mb-2.5 align-middle"}),l[0]||(l[0]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):r.value.products.length===0?(i.openBlock(),i.createElementBlock("div",i2," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",r2,[i.createVNode(Vh,{products:r.value.products},null,8,["products"]),i.createElementVNode("div",s2,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",o2,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode(Ih,{order:r.value},null,8,["order"])]))}}}),l2={},c2=i.defineComponent({...l2,__name:"orders-list",props:{fields:{},orderUrl:{},filters:{},sort:{},pagination:{}},setup(t){const e=t,n=()=>structuredClone(i.toRaw(e.sort??{field:"id",direction:"desc"})),r=i.ref(n()),s=i.ref([]),o=i.ref(!1),a=i.computed(()=>Z.useReferencesStore().orderStatusReference),l=()=>{const p=e.fields.length>0?e.fields:[Qe.CreatedAt,Qe.Id,Qe.DeliveryInfo,Qe.Status,Qe.SalesDirections,Qe.AttachedUser],b={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},y={type:"expand",expandable:M.constant(!0),renderExpand:S=>i.h(Oh,{order:S,class:"pl-10 pt-3 pb-10"}),width:"30"},_=[{title:"Дата заказа",key:Qe.CreatedAt,resizable:!0,minWidth:100,render:S=>i.h(Lo,{date:S.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Qe.Id,resizable:!0,minWidth:70,render:S=>i.h("a",{href:e.orderUrl.replace(":id",S.id.toString()),target:"_blank",class:"text-base"},S.id)},{title:"Клиент",key:Qe.ClientInfo,resizable:!0,render:S=>i.h(hs,{client:S.client})},{title:"Тип доставки",key:Qe.DeliveryInfo,resizable:!0,render:S=>i.h(Fs,{delivery:S.delivery})},{title:"Статус",key:Qe.Status,resizable:!0,minWidth:90,render:S=>{var v,T;return i.h("span",{class:"text-base"},[((T=(v=a.value)==null?void 0:v.find(R=>R.id===(S.status??-1)))==null?void 0:T.name)??""])}},{title:"Напр. продаж",key:Qe.SalesDirections,resizable:!0,minWidth:70,render:S=>i.h("span",{class:"text-base"},[S.salesDirection.name])},{title:"Закреплено за",key:Qe.AttachedUser,resizable:!0,render:S=>{var v;return i.h("span",{class:"text-base"},[(v=S==null?void 0:S.attachedUser)==null?void 0:v.name])}}];switch(kt.getDeviceTypeByResolution()){case Ge.phone:case Ge.tablet:return[y,{key:"order",title:"Заказ",resizable:!0,render:S=>i.h(Fh,{order:S,fields:p,orderUrl:e.orderUrl})}];case Ge.laptop:return[y,...p.map(S=>_.find(v=>v.key===S)??b)];default:return[b]}},c=i.ref(l()),d=i.ref(new Z.DataTablePagination(e.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),u=()=>{e.filters&&(o.value=!0,Z.HttpRequester.getInstance(Z.OrdersDataProvider).getOrders(e.filters,r.value,{page:d.value.page,pageSize:d.value.pageSize}).then(p=>{d.value.itemCount!==p.meta.total&&(d.value.itemCount=p.meta.total),d.value.page!==p.meta.currentPage&&(d.value.page=p.meta.currentPage),d.value.pageCount!==p.meta.lastPage&&(d.value.pageCount=p.meta.lastPage),d.value.pageSize!==p.meta.perPage&&(d.value.pageSize=p.meta.perPage),s.value=p.data}).finally(()=>{o.value=!1}))},h=p=>{d.value.page=p,u()},m=p=>{d.value.pageSize=p,u()},g=p=>{M.isNull(p)?r.value=n():(r.value.field=p.columnKey.toString(),r.value.direction=p.order==="ascend"?"asc":"desc"),c.value.forEach(b=>{if(Object.hasOwn(b,"sortOrder")){const y=b;y.sortOrder=y.key===(p==null?void 0:p.columnKey)&&(p!=null&&p.sorter)&&p.order!==!1?p.order:!1}}),u()},f=()=>{c.value=l()};return i.watch(()=>e.filters,()=>{u()}),i.watch(()=>e.sort,()=>{r.value=n(),u()}),i.onMounted(()=>{f(),window.addEventListener("resize",f),i.nextTick(()=>{u()})}),i.onUnmounted(()=>{window.removeEventListener("resize",f)}),(p,b)=>{const y=L.NDataTable;return i.openBlock(),i.createBlock(y,{columns:c.value,data:s.value,"row-key":_=>_.id,pagination:d.value,loading:o.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"pagination-behavior-on-filter":"first","onUpdate:page":h,"onUpdate:pageSize":m,"onUpdate:sorter":g},null,8,["columns","data","row-key","pagination","loading"])}}}),d2=Wn(c2,[["__scopeId","data-v-7c4554f4"]]),u2=["href"],h2={class:"text-sc-dark-grey"},f2={},m2=i.defineComponent({...f2,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>Hn.format(n.order.createdAt,Z.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),o=a=>{M.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #",-1)),i.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>o(c))},i.toDisplayString(t.order.id),9,u2),i.createTextVNode(" от "+i.toDisplayString(s.value),1),t.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",h2,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),g2={class:"sc-page flex flex-col"},p2={class:"my-2 flex flex-row items-end"},y2={class:"sc-title grow"},b2={key:0,class:"sc-title-buttons flex-1 grow-0"},_2={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},w2={key:0,class:"sc-title-extra mt-2 sm:mt-4"},x2={},zh=i.defineComponent({...x2,__name:"page",props:{title:{}},setup(t){return(e,n)=>{const r=L.NH1;return i.openBlock(),i.createElementBlock("div",g2,[i.createElementVNode("div",p2,[i.createElementVNode("div",y2,[i.renderSlot(e.$slots,"title",{},()=>[i.createVNode(r,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),e.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",b2,[i.createElementVNode("div",_2,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",w2,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"default")])}}}),k2={class:"overflow-hidden transition-all duration-300"},v2={class:"text-lg font-medium leading-none"},C2={},Lh=i.defineComponent({...C2,__name:"sliding-content-with-drawer",props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:""}},emits:["update:show-drawer"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(0),o=i.ref(n.showDrawer),a=()=>{switch(kt.getDeviceTypeByResolution()){case Ge.phone:return window.innerWidth*.66;case Ge.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?M.isUndefined(n.drawerWidth)?s.value=a():s.value=M.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:s.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>o.value,()=>{l(),r("update:show-drawer",o.value)}),i.watch(()=>n.showDrawer,c=>{o.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const u=L.NDrawerContent,h=L.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",k2,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(h,{show:o.value,"onUpdate:show":d[0]||(d[0]=m=>o.value=m),resizable:!0,width:s.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(u,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",v2,i.toDisplayString(t.title),1)])]),default:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-content")]),footer:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),S2={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},B2={key:0},T2={class:"sc-page-preview-panel grow"},R2={key:1,class:"sc-page-preview-panel-extra flex-none"},$2={},P2=i.defineComponent({...$2,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""}},setup(t,{expose:e}){const n=i.ref(!1),r=()=>{n.value=!0},s=()=>{n.value=!1},o=i.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:l=>{var c;(c=o.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&i.nextTick(()=>{var d,u;window.scrollTo({top:(((u=(d=o.value)==null?void 0:d.getBoundingClientRect())==null?void 0:u.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:s}),(l,c)=>{const d=L.NButton;return i.openBlock(),i.createBlock(zh,{title:t.title},i.createSlots({default:i.withCtx(()=>[l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",S2,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",B2,[i.renderSlot(l.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=u=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",T2,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",R2,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Lh,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=u=>n.value=u),title:t.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(l.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0]),1032,["title"])}}}),N2={},E2=i.defineComponent({...N2,__name:"curator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},managerReferenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>{var f;return M.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>{const f=new Z.Curator({id:-1,name:"",contacts:{},curatedDirection:new Z.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),p=r.showEmptyValue?[f]:[];return r.managerReferenceList.filter(b=>{var y;return(((y=b==null?void 0:b.curatedDirections)==null?void 0:y.length)??0)>0}).forEach(b=>{((b==null?void 0:b.curatedDirections)??[]).forEach(y=>{p.push(new Z.Curator({id:b.id,guid:b.guid,name:b.name,photo:b.photo,contacts:b.contacts??{},curatedDirection:y}))})}),p}),c=i.computed(()=>Mt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,f=>{const p=M.some(o.value?r.value:[r.value],["id",f.id])?` (${f.curatedDirection.name}) `:"";return f.curatedDirection.isNewRec()?f.name:`${f.name}${p}`})),d=i.computed(()=>c.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),u=i.useTemplateRef("select-component"),h=f=>{if(M.isArray(f)){const p=f.length>0?f.map(b=>l.value.find(y=>y.id===b)).filter(b=>!M.isNil(b)):[];s("update:value",p)}else{const p=f>0?l.value.find(b=>b.id===f):null;s("update:value",p??null)}};return i.watch(()=>r.value,()=>{var f,p;(p=(f=u.value)==null?void 0:f.$forceUpdate)==null||p.call(f)},{deep:!0}),e({focus:()=>{var f;return(f=u.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=u.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(L.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),F2={},A2=i.defineComponent({...F2,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!0},managerReferenceList:{default:()=>[]},disabledManagerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1},groupBySalesDirection:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>{var f;return M.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>r.showEmptyValue?[Z.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=i.computed(()=>{var b;let f=l.value,p=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=M.isArray(r.value)?r.value.map(_=>_.id):[(b=r.value)==null?void 0:b.id];p=M.union(p,l.value.filter(_=>!_.isActive).map(_=>_.id)),f=f.filter(_=>(r.showEmptyValue?Z.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||y.includes(_.id))}return Mt.convertReferencesToSelectOptionsList(f,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,y=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&M.some(o.value?r.value:[r.value],["id",y.id])?` (${y.salesDirection.name}) `:"";return y.salesDirection.isNewRec()?y.name:`${y.name}${_}${y.isActive?"":" [Не активен]"}`},y=>p.includes(y.id)&&y.isActive)}),d=i.computed(()=>c.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),u=i.useTemplateRef("select-component"),h=f=>{if(M.isArray(f)){const p=f.length>0?f.filter(b=>!M.some(r.disabledManagerReferenceList,["id",b])).map(b=>l.value.find(y=>y.id===b)).filter(b=>!M.isNil(b)):[];s("update:value",p)}else{const p=f>0&&!M.some(r.disabledManagerReferenceList,["id",f])?l.value.find(b=>b.id===f):new Z.Manager;s("update:value",p??new Z.Manager)}};return i.watch(()=>r.value,()=>{var f,p;(p=(f=u.value)==null?void 0:f.$forceUpdate)==null||p.call(f)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,f=>{if(f.length>0&&r.value)if(o.value){const p=r.value;M.some(p,b=>M.some(f,["id",b.id]))&&s("update:value",p.filter(b=>!M.some(f,["id",b.id])))}else{const p=r.value;M.some(f,["id",p.id])&&s("update:value",new Z.Manager)}}),e({focus:()=>{var f;return(f=u.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=u.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(L.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),M2={class:"m-0.5 flex flex-col p-0.5"},V2={class:"flex flex-row gap-1"},I2={key:0},O2={key:1},z2={key:2},L2={key:3},D2={class:"flex flex-row gap-1"},H2={key:0},W2={key:1},j2={key:2},q2={key:3},X2={},Dh=i.defineComponent({...X2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",M2,[i.createElementVNode("span",V2,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",I2,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",O2,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",z2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",L2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",D2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",H2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",W2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",j2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",q2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Sa={clearable:!1,value:"",field:void 0,disabled:!1},Y2={},U2=i.defineComponent({...Y2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Sa,minTermLength:()=>{var t,e;return((e=(t=Z.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"addressString"]??"-",value:p.id})));i.watch(()=>r.value,p=>{o.value=p}),i.watch(o,()=>{s("update:value",o.value)});const d=M.debounce(()=>u(),800),u=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(o.value,a):Z.HttpRequester.getInstance(Z.DataSuggestionProvider).searchAddresses(o.value)).finally(()=>{a.value=!1}))},h=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Dh,{addr:y,selected:b},{default:M.constant("-")})},m=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},g=i.ref(null);function f(){g.value.focus()}return e({focus:f}),(p,b)=>{const y=L.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[b[0]||(b[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":h,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),K2={class:"m-0.5 flex flex-col p-0.5"},G2={class:"font-medium"},Z2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},Q2={key:0},J2={key:1},eC={},Hh=i.defineComponent({...eC,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",K2,[i.createElementVNode("span",G2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",Z2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",Q2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",J2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),tC={},nC=i.defineComponent({...tC,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Sa,minTermLength:()=>{var t,e;return((e=(t=Z.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"_"]??"-",value:p.id})));i.watch(()=>r.value,p=>{o.value=p}),i.watch(o,()=>{s("update:value",o.value)});const d=M.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Z.HttpRequester.getInstance(Z.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},h=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Hh,{bank:y,selected:b},{default:M.constant("-")})},m=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},g=i.ref(null);function f(){g.value.focus()}return e({focus:f}),(p,b)=>{const y=L.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[b[0]||(b[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":h,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),iC={class:"font-medium"},rC={key:0,class:"flex flex-row gap-2"},sC={key:0,class:"text-xs font-light text-blue-800"},oC={key:1,class:"text-sc-dark-grey text-xs font-light"},aC={},Wh=i.defineComponent({...aC,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>{var s,o;return((o=(s=e.org.rawData)==null?void 0:s.state)==null?void 0:o.liquidationDate)??!1}),r=i.computed(()=>{var s,o;return((o=(s=e.org.rawData)==null?void 0:s.address)==null?void 0:o.value)??""});return(s,o)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(`m-0.5 flex flex-col p-0.5 ${n.value?"line-through":""}`)},[i.createElementVNode("span",iC,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",rC,[t.org.inn?(i.openBlock(),i.createElementBlock("span",sC,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",oC,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),lC={},cC=i.defineComponent({...lC,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Sa,minTermLength:()=>{var t,e;return((e=(t=Z.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=b=>{var y,_;return!!(((_=(y=b.rawData)==null?void 0:y.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>Mt.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,b=>b[r.field??"_"]??"-",b=>!r.allowSelectTerminated&&c(b)));i.watch(()=>r.value,b=>{o.value=b}),i.watch(o,()=>{s("update:value",o.value)});const u=M.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Z.HttpRequester.getInstance(Z.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},m=(b,y)=>{const _=l.value.find(S=>S.id===b.value)||{};return i.h(Wh,{org:_,selected:y},{default:M.constant("-")})},g=b=>{u.cancel();const y=l.value.find(_=>_.id===b)||{};(r.allowSelectTerminated||!c(y))&&s("select",y)},f=i.ref(null);function p(){f.value.focus()}return e({focus:p}),(b,y)=>{const _=L.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[y[0]||(y[0]=S=>o.value=S),i.unref(u)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":m,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),dC={},uC=i.defineComponent({...dC,__name:"button-with-confirm-action",props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:""},dialogContent:{default:""},disableConfirm:{type:Boolean,default:!1},popoverText:{default:""},type:{default:"default"},size:{default:"small"},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["accept"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=()=>{r("accept",()=>{s.value=!1})},a=()=>{n.disableConfirm?o():s.value=!0};return(l,c)=>{const d=L.NButton,u=L.NPopover,h=L.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(u,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:t.disabled,ghost:t.ghost,loading:t.loading,size:t.size,type:t.type,quaternary:t.quaternary,circle:t.circle,onClick:a},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(h,{show:s.value,"onUpdate:show":c[1]||(c[1]=m=>s.value=m),content:t.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:t.dialogTitle,"action-class":"",preset:"dialog"},{action:i.withCtx(()=>[i.createVNode(d,{type:"primary",class:"px-8",onClick:o},{default:i.withCtx(()=>[...c[2]||(c[2]=[i.createTextVNode(" Да ",-1)])]),_:1}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=m=>s.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),hC={key:0,class:"whitespace-pre-line"},fC={key:1,class:"text-sc-dark-grey"},mC={},gC=i.defineComponent({...mC,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.comment);i.watch(()=>s.value,l=>{s.value=l});const o=l=>{r("update:comment",s.value,l)},a=()=>{s.value=n.comment};return(l,c)=>{const d=L.NInput;return i.openBlock(),i.createBlock(Wd,{disabled:t.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",hC,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",fC," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=u=>s.value=u),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),pC={},yC=i.defineComponent({...pC,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,s)=>t.debt!==0?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"text-sm":t.wrapAsSmall})},[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},i.toDisplayString(t.debt)+" ₽ ",3)],2)):i.createCommentVNode("",!0)}}),bC={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _C(t,e){return i.openBlock(),i.createElementBlock("svg",bC,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"},null,-1)])])}const wC=i.markRaw({name:"ion-warning",render:_C}),xC={},kC=i.defineComponent({...xC,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=wC,s=L.NPopover;return i.openBlock(),i.createBlock(s,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),_t=class _t{static init(e,n){_t.messagesService&&_t.notificationsService||(_t.messagesService=e,_t.notificationsService=n)}static getMessagesService(){if(!_t.messagesService)throw new Error("UI provider is not initialized.");return _t.messagesService}static getNotificationsService(){if(!_t.notificationsService)throw new Error("UI provider is not initialized.");return _t.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,s;if(M.isEmpty(e.errors)){const o=(s=(r=e.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";_t.notificationsService?_t.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:e.message,meta:`#${e.status}${a}: ${e.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",e)}else for(const o in e.errors)Object.prototype.hasOwnProperty.call(n,o)?n[o]=new Z.FieldValidationResultData(e.errors[o].toString(),"error"):_t.messagesService?_t.messagesService.error(e.errors[o].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[o])}};C(_t,"messagesService"),C(_t,"notificationsService");let Ba=_t;const vC=i.computed(()=>Z.useReferencesStore().deliveryTypeReference??[]),CC=i.computed(()=>Z.useReferencesStore().managersList??[]),SC=i.computed(()=>Z.useReferencesStore().opfReference??[]),BC=i.computed(()=>Z.useReferencesStore().partnerGroupsReference??[]),TC=i.computed(()=>Z.useReferencesStore().priceCoefficientsReference??[]),RC=i.computed(()=>Z.useReferencesStore().productFilesTypesReference??[]),$C=i.computed(()=>Z.useReferencesStore().resourceTypesReference),PC=i.computed(()=>Z.useReferencesStore().salesDirectionsReference??[]),NC=i.computed(()=>Z.useReferencesStore().warehousesReference??[]),EC=i.computed(()=>Mt.convertReferencesToSelectOptionsList(Z.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),FC=i.computed(()=>Mt.convertReferencesToSelectOptionsList(Z.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),AC=t=>Z.HttpRequester.getInstance(Z.ReferenceDataProvider).searchCity(t),MC=t=>Mt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>{var n,r,s;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(n=e==null?void 0:e.region)==null?void 0:n.name}, ${(s=(r=e==null?void 0:e.region)==null?void 0:r.country)==null?void 0:s.name}`},e=>e==null?void 0:e.isNewRec());H.AddProductToCartDialog=H0,H.ConfiguratorSettingsKozyrek=bd,H.ConfiguratorSettingsMosquito=Kb,H.ConfiguratorsEnum=us,H.ContentHelper=ai,H.KozyrekLine=bn,H.KozyrekTailTemplate=Oo,H.KozyrekTemplate=Ui,H.OrdersTableFields=Qe,H.Point=Io,H.ScAddressSuggestion=U2,H.ScAddressSuggestionLabel=Dh,H.ScBankSuggestion=nC,H.ScBankSuggestionLabel=Hh,H.ScBaseDialog=Id,H.ScButtonWithConfirmAction=uC,H.ScCategoryCollapse=Md,H.ScClientNameWithShortInfo=hs,H.ScCollapse=Ad,H.ScCollapseItem=Ga,H.ScCommentEditor=gC,H.ScConfiguratorsProductInfo=lr,H.ScContragentWithShortInfo=Od,H.ScCreatorUserTypeTag=va,H.ScCuratorSelect=E2,H.ScDateRange=e_,H.ScDateTimeLabel=Lo,H.ScDebouncedInput=T_,H.ScDebouncedInputNumber=$_,H.ScDebt=yC,H.ScDialogHeader=l_,H.ScDynamicConfigurator=Nd,H.ScEmail=rb,H.ScExternalLink=z_,H.ScImageGallery=tl,H.ScInlineEditableItem=Wd,H.ScInlineView=Do,H.ScKozyrekConfigurator=_d,H.ScKozyrekConfiguratorParamsForm=il,H.ScKozyrekConfiguratorPreview=yd,H.ScKozyrekConfiguratorTemplates=pd,H.ScLightGallery=el,H.ScManagerSelect=A2,H.ScMetalForDoorsConfigurator=Rd,H.ScMetalForDoorsConfiguratorForm=Td,H.ScMosquitoConfigurator=kd,H.ScMosquitoConfiguratorForm=wd,H.ScMosquitoConfiguratorMeasurementInstructions=xd,H.ScMosquitoConfiguratorPreview=zo,H.ScOrderCommonInfo=Fh,H.ScOrderDeliveryLabel=Fs,H.ScOrderDetails=Ih,H.ScOrderInfo=Oh,H.ScOrderItemsList=Vh,H.ScOrderPayment=Ah,H.ScOrderProductInfo=Mh,H.ScOrdersList=d2,H.ScOrgSuggestion=cC,H.ScOrgSuggestionLabel=Wh,H.ScPage=zh,H.ScPageWithSlidingPanel=P2,H.ScPersonContactsBlock=Ub,H.ScPhone=Rb,H.ScPhoneInput=E_,H.ScProductName=ar,H.ScProductsList=fv,H.ScReferenceSelect=Vd,H.ScSandwichConfigurator=Pd,H.ScSandwichConfiguratorForm=$d,H.ScSearchableProductSelect=Eh,H.ScSearchableReferenceSelect=Nh,H.ScSetClientPriceFormItem=V0,H.ScShortTextOrderInfo=m2,H.ScSingleFileUploadSelector=f_,H.ScSlidingContentWithDrawer=Lh,H.ScStripConfigurator=Bd,H.ScStripConfiguratorForm=Cd,H.ScStripConfiguratorLineItem=vd,H.ScStripConfiguratorPreview=Sd,H.ScUserShortInfo=Ca,H.ScWarningIcon=kC,H.SelectOptionHelper=Mt,H.UiNotificationProvider=Ba,H.WindowResolutionEnum=Ge,H.WindowResolutionProvider=kt,H.channelPrimaryInterestOptionsList=EC,H.componentSizeInjectionKey=Mr,H.deliveryTypeReferenceList=vC,H.handleFloatInput=zs,H.handleIntegerInput=lt,H.isCanSandwichShow=Fd,H.isConfiguratorType=Ed,H.managersReferenceList=CC,H.naiveUiTheme=Mf,H.opfReferenceList=SC,H.parse=xt,H.partnerGroupReferenceList=BC,H.priceCoefficientsReferenceList=TC,H.productFilesTypesReferenceList=RC,H.renderConfig=Le,H.resetInputValidation=Oe,H.resourceReferencesList=$C,H.salesDirectionsReferenceList=PC,H.searchCityReferenceDataHandler=AC,H.searchCityReferenceLabelRenderer=MC,H.selectAllTextOnFocus=ze,H.sourcePrimaryInterestOptionsList=FC,H.warehousesReferenceList=NC,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})}));