@snabcentr/vue-ui-lib 3.3.5 → 3.4.0
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(W,V){typeof exports=="object"&&typeof module<"u"?V(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("ts-case-convert"),require("libphonenumber-js"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","ts-case-convert","libphonenumber-js","vue-tel-input"],V):(W=typeof globalThis<"u"?globalThis:W||self,V(W.SC_VueUiLib={},W["lodash-es"],W.Vue,W["naive-ui"],W["@snabcentr/common-lib"],W["date-fns"],W["ts-case-convert"],W["libphonenumber-js"],W["vue-tel-input"]))})(this,(function(W,V,i,z,U,Mn,Ps,Ji,Au){"use strict";var eC=Object.defineProperty;var Nu=W=>{throw TypeError(W)};var tC=(W,V,i)=>V in W?eC(W,V,{enumerable:!0,configurable:!0,writable:!0,value:i}):W[V]=i;var x=(W,V,i)=>tC(W,typeof V!="symbol"?V+"":V,i),Pu=(W,V,i)=>V.has(W)||Nu("Cannot "+i);var Bt=(W,V,i)=>(Pu(W,V,"read from private field"),i?i.call(W):V.get(W)),Aa=(W,V,i)=>V.has(W)?Nu("Cannot add the same private member more than once"):V instanceof WeakSet?V.add(W):V.set(W,i),Fu=(W,V,i,z)=>(Pu(W,V,"write to private field"),z?z.call(W,i):V.set(W,i),i);var yi,ot,Rs;var Ke=(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))(Ke||{}),Ue=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Ue||{});class Kn{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&V.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&Kn.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!Kn.isVnodeEmpty(e()):!1}}class zt{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(V.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],h=V.isString(r.key)?V.get(d,r.key):r.key(c),u=V.isString(r.label)?V.get(d,r.label):r.label(c);return{type:"group",label:V.isEmpty(u)?"- Не определено -":u,key:`group_${h}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return zt.convertReferencesToOptionsList(e,n,r,s,o,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return zt.convertReferencesToOptionsList(e,n,r,s,o,a)}}const Vu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ou(t,e){return i.openBlock(),i.createElementBlock("svg",Vu,[...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 Oa=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Ou}),Iu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zu(t,e){return i.openBlock(),i.createElementBlock("svg",Iu,[...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 Ia=i.markRaw({name:"tabler-edit",render:zu}),Lu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Du(t,e){return i.openBlock(),i.createElementBlock("svg",Lu,[...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 za=i.markRaw({name:"ion-checkmark-done-circle",render:Du}),Hu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Wu(t,e){return i.openBlock(),i.createElementBlock("svg",Hu,[...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 La=i.markRaw({name:"ion-checkmark-done-circle-outline",render:Wu}),ju={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function qu(t,e){return i.openBlock(),i.createElementBlock("svg",ju,[...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 Xu=i.markRaw({name:"fluent-pin32-regular",render:qu}),Yu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Uu(t,e){return i.openBlock(),i.createElementBlock("svg",Yu,[...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 Gu=i.markRaw({name:"ion-eye-outline",render:Uu}),Ku={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Zu(t,e){return i.openBlock(),i.createElementBlock("svg",Ku,[...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 Qu=i.markRaw({name:"fluent-pin32-filled",render:Zu}),Ju={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ef(t,e){return i.openBlock(),i.createElementBlock("svg",Ju,[...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 tf=i.markRaw({name:"ion-bookmark-outline",render:ef}),nf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function rf(t,e){return i.openBlock(),i.createElementBlock("svg",nf,[...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 sf=i.markRaw({name:"ion-eye-off-sharp",render:rf}),of={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function af(t,e){return i.openBlock(),i.createElementBlock("svg",of,[...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 lf=i.markRaw({name:"ion-chevron-forward-outline",render:af}),cf=["data-name"],df={class:"sc-collapse-item-header flex flex-row gap-2.5"},hf={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},uf={key:0},ff={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},gf={class:"flex flex-1 flex-col"},mf={key:0,class:"sc-collapse-item-sub-title flex-1"},pf={key:1,class:"sc-collapse-item-title-extra flex-none"},yf={key:0,class:"sc-collapse-item-content"},bf={},_f=i.defineComponent({...bf,__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",V.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=V.some(a,p=>p===r.name),d=i.computed(()=>V.some(l,p=>p===r.name)),h=i.ref(c),u=()=>{r.disabled||(h.value=d.value||!h.value,s("header:click",r.name,h.value),o(r.name,h.value))};return e({expand:()=>{!r.disabled&&!h.value&&(h.value=!0,s("header:click",r.name,h.value),o(r.name,h.value))},toggle:()=>{r.disabled||u()},collapse:()=>{!r.disabled&&h.value&&!d.value&&(h.value=!1,s("header:click",r.name,h.value),o(r.name,h.value))},expanded:i.readonly(h)}),(p,y)=>{const b=lf;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":t.disabled})},[i.createElementVNode("div",df,[i.createElementVNode("div",hf,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":h.value}),onClick:u},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(b)],!0)],2)]),i.unref(Kn).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",uf,[i.createElementVNode("div",ff,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",gf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:u},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(Kn).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",mf,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(Kn).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",pf,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||h.value?(i.openBlock(),i.createElementBlock("div",yf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,cf)}}}),Zn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},Da=Zn(_f,[["__scopeId","data-v-415a3dda"]]),wf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xf(t,e){return i.openBlock(),i.createElementBlock("svg",wf,[...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 vf=i.markRaw({name:"ion-cart-outline",render:xf}),$r=Symbol(),kf={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"}},Cf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Sf={},Ha=i.defineComponent({...Sf,__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($r,"medium"),r=i.computed(()=>V.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=i.computed(()=>V.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),o=i.computed(()=>V.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>V.isNil(e.productContextButtonsConfig)?[]:V.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})},h=u=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:u})};return(u,m)=>{var C;const f=La,g=za,p=z.NButton,y=z.NTooltip,b=Ia,_=vf,v=Oa,k=z.NDropdown;return i.openBlock(),i.createElementBlock("div",Cf,[o.value?(i.openBlock(),i.createBlock(y,{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(g,{key:1})):(i.openBlock(),i.createBlock(f,{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(y,{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(b)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[1]||(m[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(y,{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),((C=a.value)==null?void 0:C.length)>0?(i.openBlock(),i.createBlock(k,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:h},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(v)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Bf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Tf(t,e){return i.openBlock(),i.createElementBlock("svg",Bf,[...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 Rf=i.markRaw({name:"tabler-history",render:Tf}),$f={class:"flex flex-row gap-1"},Ef={key:0,class:"flex flex-row text-nowrap text-sm line-through"},Nf={key:1,class:"flex flex-row text-nowrap text-sm"},Pf={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Ff={},Er=i.defineComponent({...Ff,__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){const e=t,n=i.computed(()=>V.find(e.product.priceCoefficients,["coefficient.slug",e.costFieldName])),r=i.computed(()=>n.value?n.value.cost:V.get(e.product,e.costFieldName)),s=i.computed(()=>e.additionalThroughFieldName?V.get(e.product,e.additionalThroughFieldName):void 0),o=i.computed(()=>e.product.costDate?Mn.format(e.product.costDate,U.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),a=i.computed(()=>(V.isFunction(e.allowPriceClick)?e.allowPriceClick(e.product):e.allowPriceClick)&&!V.isNil(r.value)),l=i.computed(()=>V.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value))),c=i.computed(()=>{if(e.product.currencySignature==="RUB"||!e.currencyRates||!e.currencyRates[e.product.currencySignature])return null;const h=e.currencyRates[e.product.currencySignature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)*h)}),d=i.computed(()=>V.isNil(s.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(s.value));return(h,u)=>{var p;const m=z.NTag,f=z.NTooltip,g=Rf;return i.openBlock(),i.createElementBlock("div",$f,[t.showTag?(i.openBlock(),i.createBlock(f,{key:0},{trigger:i.withCtx(()=>[i.createVNode(m,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!n.value}])},{default:i.withCtx(()=>{var y;return[i.createTextVNode(i.toDisplayString(((y=n.value)==null?void 0:y.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var y;return[i.createTextVNode(" "+i.toDisplayString(((y=n.value)==null?void 0:y.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[s.value&&s.value!==r.value?(i.openBlock(),i.createElementBlock("span",Ef,i.toDisplayString(d.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${t.product.currency}/${t.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(p=n.value)==null?void 0:p.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":a.value&&t.eventEmitter}),onClick:u[0]||(u[0]=()=>{var y;a.value&&((y=t.eventEmitter)==null||y.emit("cost:click",{product:t.product,cost:r.value}))})},i.toDisplayString(l.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${t.product.currency}/${t.product.quantityUnit}`:""),1)],2),c.value?(i.openBlock(),i.createElementBlock("span",Nf," ~ "+i.toDisplayString(c.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${t.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(V.isNil)(o.value)?(i.openBlock(),i.createElementBlock("span",Pf,[i.createTextVNode(i.toDisplayString(o.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(f,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"cursor-pointer",onClick:u[1]||(u[1]=y=>{var b;return(b=t.eventEmitter)==null?void 0:b.emit("cost:show-price-history",{product:t.product})})})]),default:i.withCtx(()=>[u[2]||(u[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Mf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Af(t,e){return i.openBlock(),i.createElementBlock("svg",Mf,[...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 Fs=i.markRaw({name:"ion-information-circle-outline",render:Af}),Vf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Of(t,e){return i.openBlock(),i.createElementBlock("svg",Vf,[...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 Wa=i.markRaw({name:"ion-images",render:Of});/*!
|
|
1
|
+
(function(W,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("ts-case-convert"),require("libphonenumber-js"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","ts-case-convert","libphonenumber-js","vue-tel-input"],A):(W=typeof globalThis<"u"?globalThis:W||self,A(W.SC_VueUiLib={},W["lodash-es"],W.Vue,W["naive-ui"],W["@snabcentr/common-lib"],W["date-fns"],W["ts-case-convert"],W["libphonenumber-js"],W["vue-tel-input"]))})(this,(function(W,A,i,z,Y,Mn,Ps,Ji,Au){"use strict";var eC=Object.defineProperty;var Nu=W=>{throw TypeError(W)};var tC=(W,A,i)=>A in W?eC(W,A,{enumerable:!0,configurable:!0,writable:!0,value:i}):W[A]=i;var x=(W,A,i)=>tC(W,typeof A!="symbol"?A+"":A,i),Pu=(W,A,i)=>A.has(W)||Nu("Cannot "+i);var Bt=(W,A,i)=>(Pu(W,A,"read from private field"),i?i.call(W):A.get(W)),Aa=(W,A,i)=>A.has(W)?Nu("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(W):A.set(W,i),Fu=(W,A,i,z)=>(Pu(W,A,"write to private field"),z?z.call(W,i):A.set(W,i),i);var yi,ot,Rs;var Ke=(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))(Ke||{}),Ue=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Ue||{});class Kn{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&A.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&Kn.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!Kn.isVnodeEmpty(e()):!1}}class zt{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(A.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],h=A.isString(r.key)?A.get(d,r.key):r.key(c),u=A.isString(r.label)?A.get(d,r.label):r.label(c);return{type:"group",label:A.isEmpty(u)?"- Не определено -":u,key:`group_${h}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return zt.convertReferencesToOptionsList(e,n,r,s,o,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return zt.convertReferencesToOptionsList(e,n,r,s,o,a)}}const Vu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Iu(t,e){return i.openBlock(),i.createElementBlock("svg",Vu,[...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 Ia=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Iu}),Ou={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zu(t,e){return i.openBlock(),i.createElementBlock("svg",Ou,[...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 Oa=i.markRaw({name:"tabler-edit",render:zu}),Lu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Du(t,e){return i.openBlock(),i.createElementBlock("svg",Lu,[...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 za=i.markRaw({name:"ion-checkmark-done-circle",render:Du}),Hu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Wu(t,e){return i.openBlock(),i.createElementBlock("svg",Hu,[...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 La=i.markRaw({name:"ion-checkmark-done-circle-outline",render:Wu}),ju={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function qu(t,e){return i.openBlock(),i.createElementBlock("svg",ju,[...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 Xu=i.markRaw({name:"fluent-pin32-regular",render:qu}),Yu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Uu(t,e){return i.openBlock(),i.createElementBlock("svg",Yu,[...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 Gu=i.markRaw({name:"ion-eye-outline",render:Uu}),Ku={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Zu(t,e){return i.openBlock(),i.createElementBlock("svg",Ku,[...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 Qu=i.markRaw({name:"fluent-pin32-filled",render:Zu}),Ju={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ef(t,e){return i.openBlock(),i.createElementBlock("svg",Ju,[...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 tf=i.markRaw({name:"ion-bookmark-outline",render:ef}),nf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function rf(t,e){return i.openBlock(),i.createElementBlock("svg",nf,[...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 sf=i.markRaw({name:"ion-eye-off-sharp",render:rf}),of={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function af(t,e){return i.openBlock(),i.createElementBlock("svg",of,[...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 lf=i.markRaw({name:"ion-chevron-forward-outline",render:af}),cf=["data-name"],df={class:"sc-collapse-item-header flex flex-row gap-2.5"},hf={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},uf={key:0},ff={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},gf={class:"flex flex-1 flex-col"},mf={key:0,class:"sc-collapse-item-sub-title flex-1"},pf={key:1,class:"sc-collapse-item-title-extra flex-none"},yf={key:0,class:"sc-collapse-item-content"},bf={},_f=i.defineComponent({...bf,__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",A.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=A.some(a,p=>p===r.name),d=i.computed(()=>A.some(l,p=>p===r.name)),h=i.ref(c),u=()=>{r.disabled||(h.value=d.value||!h.value,s("header:click",r.name,h.value),o(r.name,h.value))};return e({expand:()=>{!r.disabled&&!h.value&&(h.value=!0,s("header:click",r.name,h.value),o(r.name,h.value))},toggle:()=>{r.disabled||u()},collapse:()=>{!r.disabled&&h.value&&!d.value&&(h.value=!1,s("header:click",r.name,h.value),o(r.name,h.value))},expanded:i.readonly(h)}),(p,y)=>{const b=lf;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":t.disabled})},[i.createElementVNode("div",df,[i.createElementVNode("div",hf,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":h.value}),onClick:u},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(b)],!0)],2)]),i.unref(Kn).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",uf,[i.createElementVNode("div",ff,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",gf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:u},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(Kn).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",mf,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(Kn).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",pf,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||h.value?(i.openBlock(),i.createElementBlock("div",yf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,cf)}}}),Zn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},Da=Zn(_f,[["__scopeId","data-v-415a3dda"]]),wf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xf(t,e){return i.openBlock(),i.createElementBlock("svg",wf,[...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 vf=i.markRaw({name:"ion-cart-outline",render:xf}),$r=Symbol(),kf={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"}},Cf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Sf={},Ha=i.defineComponent({...Sf,__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($r,"medium"),r=i.computed(()=>A.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=i.computed(()=>A.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),o=i.computed(()=>A.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>A.isNil(e.productContextButtonsConfig)?[]:A.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})},h=u=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:u})};return(u,m)=>{var S;const f=La,g=za,p=z.NButton,y=z.NTooltip,b=Oa,_=vf,v=Ia,k=z.NDropdown;return i.openBlock(),i.createElementBlock("div",Cf,[o.value?(i.openBlock(),i.createBlock(y,{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(g,{key:1})):(i.openBlock(),i.createBlock(f,{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(y,{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(b)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[1]||(m[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(y,{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),((S=a.value)==null?void 0:S.length)>0?(i.openBlock(),i.createBlock(k,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:h},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(v)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Bf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Tf(t,e){return i.openBlock(),i.createElementBlock("svg",Bf,[...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 Rf=i.markRaw({name:"tabler-history",render:Tf}),$f={class:"flex flex-row gap-1"},Ef={key:0,class:"flex flex-row text-nowrap text-sm line-through"},Nf={key:1,class:"flex flex-row text-nowrap text-sm"},Pf={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Ff={},Er=i.defineComponent({...Ff,__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){const e=t,n=i.computed(()=>A.find(e.product.priceCoefficients,["coefficient.slug",e.costFieldName])),r=i.computed(()=>n.value?n.value.cost:A.get(e.product,e.costFieldName)),s=i.computed(()=>e.additionalThroughFieldName?A.get(e.product,e.additionalThroughFieldName):void 0),o=i.computed(()=>e.product.costDate?Mn.format(e.product.costDate,Y.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),a=i.computed(()=>(A.isFunction(e.allowPriceClick)?e.allowPriceClick(e.product):e.allowPriceClick)&&!A.isNil(r.value)),l=i.computed(()=>A.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value))),c=i.computed(()=>{if(e.product.currencySignature==="RUB"||!e.currencyRates||!e.currencyRates[e.product.currencySignature])return null;const h=e.currencyRates[e.product.currencySignature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)*h)}),d=i.computed(()=>A.isNil(s.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(s.value));return(h,u)=>{var p;const m=z.NTag,f=z.NTooltip,g=Rf;return i.openBlock(),i.createElementBlock("div",$f,[t.showTag?(i.openBlock(),i.createBlock(f,{key:0},{trigger:i.withCtx(()=>[i.createVNode(m,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!n.value}])},{default:i.withCtx(()=>{var y;return[i.createTextVNode(i.toDisplayString(((y=n.value)==null?void 0:y.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var y;return[i.createTextVNode(" "+i.toDisplayString(((y=n.value)==null?void 0:y.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[s.value&&s.value!==r.value?(i.openBlock(),i.createElementBlock("span",Ef,i.toDisplayString(d.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${t.product.currency}/${t.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(p=n.value)==null?void 0:p.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":a.value&&t.eventEmitter}),onClick:u[0]||(u[0]=()=>{var y;a.value&&((y=t.eventEmitter)==null||y.emit("cost:click",{product:t.product,cost:r.value}))})},i.toDisplayString(l.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${t.product.currency}/${t.product.quantityUnit}`:""),1)],2),c.value?(i.openBlock(),i.createElementBlock("span",Nf," ~ "+i.toDisplayString(c.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${t.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(A.isNil)(o.value)?(i.openBlock(),i.createElementBlock("span",Pf,[i.createTextVNode(i.toDisplayString(o.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(f,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"cursor-pointer",onClick:u[1]||(u[1]=y=>{var b;return(b=t.eventEmitter)==null?void 0:b.emit("cost:show-price-history",{product:t.product})})})]),default:i.withCtx(()=>[u[2]||(u[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Mf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Af(t,e){return i.openBlock(),i.createElementBlock("svg",Mf,[...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 Fs=i.markRaw({name:"ion-information-circle-outline",render:Af}),Vf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function If(t,e){return i.openBlock(),i.createElementBlock("svg",Vf,[...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 Wa=i.markRaw({name:"ion-images",render:If});/*!
|
|
2
2
|
* lightgallery | 2.9.0 | October 1st 2025
|
|
3
3
|
* http://www.lightgalleryjs.com/
|
|
4
4
|
* Copyright (c) 2020 Sachin Neravath;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
17
17
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
18
18
|
PERFORMANCE OF THIS SOFTWARE.
|
|
19
|
-
***************************************************************************** */var Nr=function(){return Nr=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},Nr.apply(this,arguments)},
|
|
19
|
+
***************************************************************************** */var Nr=function(){return Nr=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},Nr.apply(this,arguments)},Of={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",alignThumbnails:"middle",thumbWidth:100,thumbHeight:"80px",thumbMargin:5,appendThumbnailsTo:".lg-components",toggleThumb:!1,enableThumbDrag:!0,enableThumbSwipe:!0,thumbnailSwipeThreshold:10,loadYouTubeThumbnail:!0,youTubeThumbSize:1,thumbnailPluginStrings:{toggleThumbnails:"Toggle thumbnails"}},er={containerResize:"lgContainerResize",updateSlides:"lgUpdateSlides",beforeOpen:"lgBeforeOpen",beforeSlide:"lgBeforeSlide"},zf=(function(){function t(e,n){return this.thumbOuterWidth=0,this.thumbTotalWidth=0,this.translateX=0,this.thumbClickable=!1,this.core=e,this.$LG=n,this}return t.prototype.init=function(){this.settings=Nr(Nr({},Of),this.core.settings),this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.galleryItems.length*(this.settings.thumbWidth+this.settings.thumbMargin),this.translateX=0,this.setAnimateThumbStyles(),this.core.settings.allowMediaOverlap||(this.settings.toggleThumb=!1),this.settings.thumbnail&&(this.build(),this.settings.animateThumb?(this.settings.enableThumbDrag&&this.enableThumbDrag(),this.settings.enableThumbSwipe&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toggleThumbBar(),this.thumbKeyPress())},t.prototype.build=function(){var e=this;this.setThumbMarkup(),this.manageActiveClassOnSlideChange(),this.$lgThumb.first().on("click.lg touchend.lg",function(n){var r=e.$LG(n.target);r.hasAttribute("data-lg-item-id")&&setTimeout(function(){if(e.thumbClickable&&!e.core.lgBusy){var s=parseInt(r.attr("data-lg-item-id"));e.core.slide(s,!1,!0,!1)}},50)}),this.core.LGel.on(er.beforeSlide+".thumb",function(n){var r=n.detail.index;e.animateThumb(r)}),this.core.LGel.on(er.beforeOpen+".thumb",function(){e.thumbOuterWidth=e.core.outer.get().offsetWidth}),this.core.LGel.on(er.updateSlides+".thumb",function(){e.rebuildThumbnails()}),this.core.LGel.on(er.containerResize+".thumb",function(){e.core.lgOpened&&setTimeout(function(){e.thumbOuterWidth=e.core.outer.get().offsetWidth,e.animateThumb(e.core.index),e.thumbOuterWidth=e.core.outer.get().offsetWidth},50)})},t.prototype.setThumbMarkup=function(){var e="lg-thumb-outer ";this.settings.alignThumbnails&&(e+="lg-thumb-align-"+this.settings.alignThumbnails);var n='<div class="'+e+`">
|
|
20
20
|
<div class="lg-thumb lg-group">
|
|
21
21
|
</div>
|
|
22
22
|
</div>`;this.core.outer.addClass("lg-has-thumb"),this.settings.appendThumbnailsTo===".lg-components"?this.core.$lgComponents.append(n):this.core.outer.append(n),this.$thumbOuter=this.core.outer.find(".lg-thumb-outer").first(),this.$lgThumb=this.core.outer.find(".lg-thumb").first(),this.settings.animateThumb&&this.core.outer.find(".lg-thumb").css("transition-duration",this.core.settings.speed+"ms").css("width",this.thumbTotalWidth+"px").css("position","relative"),this.setThumbItemHtml(this.core.galleryItems)},t.prototype.enableThumbDrag=function(){var e=this,n={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0},r=!1;this.$thumbOuter.addClass("lg-grab"),this.core.outer.find(".lg-thumb").first().on("mousedown.lg.thumb",function(s){e.thumbTotalWidth>e.thumbOuterWidth&&(s.preventDefault(),n.cords.startX=s.pageX,n.startTime=new Date,e.thumbClickable=!1,r=!0,e.core.outer.get().scrollLeft+=1,e.core.outer.get().scrollLeft-=1,e.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))}),this.$LG(window).on("mousemove.lg.thumb.global"+this.core.lgId,function(s){e.core.lgOpened&&r&&(n.cords.endX=s.pageX,n=e.onThumbTouchMove(n))}),this.$LG(window).on("mouseup.lg.thumb.global"+this.core.lgId,function(){e.core.lgOpened&&(n.isMoved?n=e.onThumbTouchEnd(n):e.thumbClickable=!0,r&&(r=!1,e.$thumbOuter.removeClass("lg-grabbing").addClass("lg-grab")))})},t.prototype.enableThumbSwipe=function(){var e=this,n={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0};this.$lgThumb.on("touchstart.lg",function(r){e.thumbTotalWidth>e.thumbOuterWidth&&(r.preventDefault(),n.cords.startX=r.targetTouches[0].pageX,e.thumbClickable=!1,n.startTime=new Date)}),this.$lgThumb.on("touchmove.lg",function(r){e.thumbTotalWidth>e.thumbOuterWidth&&(r.preventDefault(),n.cords.endX=r.targetTouches[0].pageX,n=e.onThumbTouchMove(n))}),this.$lgThumb.on("touchend.lg",function(){n.isMoved?n=e.onThumbTouchEnd(n):e.thumbClickable=!0})},t.prototype.rebuildThumbnails=function(){var e=this;this.$thumbOuter.addClass("lg-rebuilding-thumbnails"),setTimeout(function(){e.thumbTotalWidth=e.core.galleryItems.length*(e.settings.thumbWidth+e.settings.thumbMargin),e.$lgThumb.css("width",e.thumbTotalWidth+"px"),e.$lgThumb.empty(),e.setThumbItemHtml(e.core.galleryItems),e.animateThumb(e.core.index)},50),setTimeout(function(){e.$thumbOuter.removeClass("lg-rebuilding-thumbnails")},200)},t.prototype.setTranslate=function(e){this.$lgThumb.css("transform","translate3d(-"+e+"px, 0px, 0px)")},t.prototype.getPossibleTransformX=function(e){return e>this.thumbTotalWidth-this.thumbOuterWidth&&(e=this.thumbTotalWidth-this.thumbOuterWidth),e<0&&(e=0),e},t.prototype.animateThumb=function(e){if(this.$lgThumb.css("transition-duration",this.core.settings.speed+"ms"),this.settings.animateThumb){var n=0;switch(this.settings.currentPagerPosition){case"left":n=0;break;case"middle":n=this.thumbOuterWidth/2-this.settings.thumbWidth/2;break;case"right":n=this.thumbOuterWidth-this.settings.thumbWidth}this.translateX=(this.settings.thumbWidth+this.settings.thumbMargin)*e-1-n,this.translateX>this.thumbTotalWidth-this.thumbOuterWidth&&(this.translateX=this.thumbTotalWidth-this.thumbOuterWidth),this.translateX<0&&(this.translateX=0),this.setTranslate(this.translateX)}},t.prototype.onThumbTouchMove=function(e){return e.newTranslateX=this.translateX,e.isMoved=!0,e.touchMoveTime=new Date().valueOf(),e.newTranslateX-=e.cords.endX-e.cords.startX,e.newTranslateX=this.getPossibleTransformX(e.newTranslateX),this.setTranslate(e.newTranslateX),this.$thumbOuter.addClass("lg-dragging"),e},t.prototype.onThumbTouchEnd=function(e){e.isMoved=!1,e.endTime=new Date,this.$thumbOuter.removeClass("lg-dragging");var n=e.endTime.valueOf()-e.startTime.valueOf(),r=e.cords.endX-e.cords.startX,s=Math.abs(r)/n;return s>.15&&e.endTime.valueOf()-e.touchMoveTime<30?(s+=1,s>2&&(s+=1),s=s+s*(Math.abs(r)/this.thumbOuterWidth),this.$lgThumb.css("transition-duration",Math.min(s-1,2)+"settings"),r=r*s,this.translateX=this.getPossibleTransformX(this.translateX-r),this.setTranslate(this.translateX)):this.translateX=e.newTranslateX,Math.abs(e.cords.endX-e.cords.startX)<this.settings.thumbnailSwipeThreshold&&(this.thumbClickable=!0),e},t.prototype.getThumbHtml=function(e,n,r){var s=this.core.galleryItems[n].__slideVideoInfo||{},o;s.youtube&&this.settings.loadYouTubeThumbnail?o="//img.youtube.com/vi/"+s.youtube[1]+"/"+this.settings.youTubeThumbSize+".jpg":o=e;var a=document.createElement("div");a.setAttribute("data-lg-item-id",n+""),a.className="lg-thumb-item "+(n===this.core.index?"active":""),a.style.cssText="width: "+this.settings.thumbWidth+"px; height: "+this.settings.thumbHeight+"; margin-right: "+this.settings.thumbMargin+"px;";var l=document.createElement("img");return l.alt=r||"",l.setAttribute("data-lg-item-id",n+""),l.src=o,a.appendChild(l),a},t.prototype.setThumbItemHtml=function(e){for(var n=0;n<e.length;n++){var r=this.getThumbHtml(e[n].thumb,n,e[n].alt);this.$lgThumb.append(r)}},t.prototype.setAnimateThumbStyles=function(){this.settings.animateThumb&&this.core.outer.addClass("lg-animate-thumb")},t.prototype.manageActiveClassOnSlideChange=function(){var e=this;this.core.LGel.on(er.beforeSlide+".thumb",function(n){var r=e.core.outer.find(".lg-thumb-item"),s=n.detail.index;r.removeClass("active"),r.eq(s).addClass("active")})},t.prototype.toggleThumbBar=function(){var e=this;this.settings.toggleThumb&&(this.core.outer.addClass("lg-can-toggle"),this.core.$toolbar.append('<button type="button" aria-label="'+this.settings.thumbnailPluginStrings.toggleThumbnails+'" class="lg-toggle-thumb lg-icon"></button>'),this.core.outer.find(".lg-toggle-thumb").first().on("click.lg",function(){e.core.outer.toggleClass("lg-components-open")}))},t.prototype.thumbKeyPress=function(){var e=this;this.$LG(window).on("keydown.lg.thumb.global"+this.core.lgId,function(n){!e.core.lgOpened||!e.settings.toggleThumb||(n.keyCode===38?(n.preventDefault(),e.core.outer.addClass("lg-components-open")):n.keyCode===40&&(n.preventDefault(),e.core.outer.removeClass("lg-components-open")))})},t.prototype.destroy=function(){this.settings.thumbnail&&(this.$LG(window).off(".lg.thumb.global"+this.core.lgId),this.core.LGel.off(".lg.thumb"),this.core.LGel.off(".thumb"),this.$thumbOuter.remove(),this.core.outer.removeClass("lg-has-thumb"))},t})();/*!
|
|
@@ -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 Pr=function(){return Pr=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},Pr.apply(this,arguments)},Lf={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"}},_n={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ms=500,Df=(function(){function t(e,n){return this.core=e,this.$LG=n,this.settings=Pr(Pr({},Lf),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(_n.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),h=d.allowY,u=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),f,g,p=o-this.pageX,y=a-this.pageY;if(e-n>1){var b=(e-n)/Math.abs(n);p=(n<0?-p:p)+this.left*(b+(n<0?-1:1)),y=(n<0?-y:y)+this.top*(b+(n<0?-1:1)),f=p/b,g=y/b}else{var b=(e-n)*n;f=p*b,g=y*b}r&&(u?this.isBeyondPossibleLeft(f,m.minX)?f=m.minX:this.isBeyondPossibleRight(f,m.maxX)&&(f=m.maxX):e>1&&(f<m.minX?f=m.minX:f>m.maxX&&(f=m.maxX)),h?this.isBeyondPossibleTop(g,m.minY)?g=m.minY:this.isBeyondPossibleBottom(g,m.maxY)&&(g=m.maxY):e>1&&(g<m.minY?g=m.minY:g>m.maxY&&(g=m.maxY))),this.setZoomStyles({x:f,y:g,scale:e}),this.left=f,this.top=g,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)},Ms),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")}},Ms+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},Ms+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(_n.containerResize+".zoom "+_n.rotateRight+".zoom "+_n.rotateLeft+".zoom "+_n.flipHorizontal+".zoom "+_n.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(_n.beforeOpen+".zoom",function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(_n.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(_n.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 h=Math.max(1,s+-d*.02);e.scale=Math.round((h+Number.EPSILON)*100)/100;var u=e.scale-o;e.zoomImage(e.scale,Math.round((u+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 h=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),u={};u.x=this.left+a,u.y=this.top+l;var m=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(u.y,m.minY)?u.y=m.minY:this.isBeyondPossibleBottom(u.y,m.maxY)&&(u.y=m.maxY)),r&&(this.isBeyondPossibleLeft(u.x,m.minX)?u.x=m.minX:this.isBeyondPossibleRight(u.x,m.maxX)&&(u.x=m.maxX)),s?this.top=u.y:u.y=this.top,r?this.left=u.x:u.x=this.left,this.setZoomSwipeStyles(h,u),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 h=a.x-o.maxX;a.x=o.maxX+h/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,h=(this.containerRect.width-a)/2,u={minY:l,maxY:c,minX:d,maxX:h};return u},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,h,u=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(m){if(e.isImageSlide(e.core.index)&&(u=e.core.getSlideItem(e.core.index),(e.$LG(m.target).hasClass("lg-item")||u.get().contains(m.target))&&m.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){m.preventDefault(),l=new Date,e.core.touchAction="zoomSwipe",h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var f=e.getDragAllowedAxises(0);a=f.allowY,o=f.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")||u.get().contains(m.target))){m.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(m);var f=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(h,f))}}),this.core.$inner.on("touchend.lg",function(m){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(m.target).hasClass("lg-item")||u.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 f=c.valueOf()-l.valueOf();e.touchendZoom(n,r,o,a,f)}})},t.prototype.zoomDrag=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,u;this.core.outer.on("mousedown.lg.zoom",function(m){if(e.isImageSlide(e.core.index)){var f=e.core.getSlideItem(e.core.index);if(e.$LG(m.target).hasClass("lg-item")||f.get().contains(m.target)){c=new Date,u=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var g=e.getDragAllowedAxises(0);l=g.allowY,a=g.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(m.target).hasClass("lg-object")&&(a||l)&&(m.preventDefault(),n=e.getDragCords(m),h=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 f=e.getZoomSwipeCords(n,r,a,l,h);e.setZoomSwipeStyles(u,f)}}),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 f=d.valueOf()-c.valueOf();e.touchendZoom(n,r,a,l,f)}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 Hf={ref:"gallery-container",class:"lightgallery-wrapper"},Wf={},ja=i.defineComponent({...Wf,__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}),V.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",Hf,[i.renderSlot(o.$slots,"default")],512))}}),rt=class rt{static init(){rt.isInitialized||(rt.isInitialized=!0,rt.windowResizeHandler(),window.addEventListener("resize",rt.windowResizeHandler))}static destroy(){window.removeEventListener("resize",rt.windowResizeHandler),rt.isInitialized=!1}static getDeviceTypeByResolution(){const e=U.AppConfigProvider.getConfig().deviceTypeByResolution;return window.innerWidth<e.tablet?Ue.phone:window.innerWidth<e.laptop?Ue.tablet:Ue.laptop}static initRefDependingOnDeviceResolution(e,n,r){const s=i.ref(r);return rt.setRefValueDependingOnDeviceResolution(s,e,n,r),rt.refsDependingOnDeviceResolution.push({r:s,phoneValue:e,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return rt.getDeviceTypeByResolution()===Ue.phone}static isTabletDevice(){return rt.getDeviceTypeByResolution()===Ue.tablet}static isLaptopDevice(){return rt.getDeviceTypeByResolution()===Ue.laptop}static setRefValueDependingOnDeviceResolution(e,n,r,s){switch(rt.getDeviceTypeByResolution()){case Ue.phone:e.value=n;break;case Ue.tablet:e.value=r;break;default:e.value=s;break}}static windowResizeHandler(){V.forEach(rt.refsDependingOnDeviceResolution,e=>{rt.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};x(rt,"isInitialized",!1),x(rt,"refsDependingOnDeviceResolution",[]);let bt=rt;const jf=["href"],qf=["src","alt"],Xf={},qa=i.defineComponent({...Xf,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[zf,Df],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(bt.getDeviceTypeByResolution()===Ue.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,h)=>{const u=Wa,m=z.NPopover;return i.openBlock(),i.createBlock(m,{trigger:"manual",show:n.value,class:"sc-image",placement:"top-start",onClickoutside:h[3]||(h[3]=()=>{r.value||(n.value=!1)})},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:"inline-flex",onClick:h[0]||(h[0]=f=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(u)])])]),default:i.withCtx(()=>[i.createVNode(ja,{settings:s.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:h[1]||(h[1]=()=>{r.value=!0}),onAfterClose:h[2]||(h[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.images,(f,g)=>(i.openBlock(),i.createElementBlock("a",{key:g,href:f.image},[i.createElementVNode("img",{src:f.preview,alt:`Изображение #${g+1}`},null,8,qf)],8,jf))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Yf={class:"flex flex-col text-sm"},Uf={},Gf=i.defineComponent({...Uf,__name:"product-stock-count",props:{product:{}},setup(t){return(e,n)=>{const r=Fs,s=z.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",Yf,[(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.quantityUnit),1))),128))])]),_:3})}}}),Kf={class:"flex flex-row justify-between"},Zf={key:0},Qf={class:"ml-2 align-sub"},Jf={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},eg={class:"@container"},tg={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},ng={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},ig={class:"text-sc-dark-grey"},rg={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},sg={class:"text-gray-600"},og={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},ag={key:3,class:"underline decoration-dashed"},lg={key:4,class:"sc-product-pack whitespace-nowrap"},cg={class:"text-gray-600"},dg={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},hg={class:"text-gray-600"},ug={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},fg={key:0},gg={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},mg={},tr=i.defineComponent({...mg,__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(()=>V.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>V.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,u;return(u=(h=n.product)==null?void 0:h.properties)==null?void 0:u.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>V.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return e({showProductImagesPreview:l}),(h,u)=>{var b,_,v,k,C;const m=Wa,f=z.NText,g=Ha,p=Fs,y=z.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",Kf,[i.createVNode(f,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>[i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&t.eventEmitter}),onClick:d},i.toDisplayString(t.product.name),3),t.product.onOrder?(i.openBlock(),i.createElementBlock("span",Zf," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",Qf,[t.product.images&&t.product.images.length>0?(i.openBlock(),i.createBlock(qa,{key:0,ref:"image-gallery",images:t.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",Jf,[i.createVNode(m)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]),_:1}),t.showProductAddToCartButton||t.showProductEditButton||t.showProductRequiredButton||((b=t.productContextButtonsConfig)==null?void 0:b.length)>0?(i.openBlock(),i.createBlock(g,{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",eg,[i.createElementVNode("div",tg,[t.product.supplierSku?(i.openBlock(),i.createElementBlock("div",ng,[u[0]||(u[0]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",ig,i.toDisplayString(t.product.supplierSku),1)])):i.createCommentVNode("",!0),t.showCode?(i.openBlock(),i.createElementBlock("span",rg,[u[1]||(u[1]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",sg,i.toDisplayString(t.product.code),1)])):i.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(i.openBlock(),i.createBlock(Gf,{key:2,product:t.product},{default:i.withCtx(()=>[i.createElementVNode("span",og,[u[2]||(u[2]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(p,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",ag," Нет в наличии ")),(v=(_=t.product)==null?void 0:_.properties)!=null&&v.pack?(i.openBlock(),i.createElementBlock("span",lg,[u[3]||(u[3]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",cg,i.toDisplayString((C=(k=t.product)==null?void 0:k.properties)==null?void 0:C.pack),1)])):i.createCommentVNode("",!0),t.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",dg,[u[4]||(u[4]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",hg,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(y,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",ug,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,B=>(i.openBlock(),i.createBlock(Er,{key:B.coefficient.slug,product:t.product,"cost-field-name":B.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(Er,{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",fg,[i.createElementVNode("ul",gg,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.product.id,slug:t.product.slug},(B,S)=>(i.openBlock(),i.createElementBlock("li",{key:S}," ("+i.toDisplayString(S)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.product.properties,(B,S)=>(i.openBlock(),i.createElementBlock("li",{key:S}," ("+i.toDisplayString(S)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),pg=(t,e,n)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>i.h(Er,{product:r,costFieldName:t,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),yg=(t,e)=>{if(t.length===0)return[];const n=[],r={};switch(V.isNil(e.isProductItemSelected)||n.push({key:"checkbox",title:"",className:"align-top",width:"32",render:s=>{var o,a;return i.h(z.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})}})}}),bt.getDeviceTypeByResolution()){case Ue.phone:case Ue.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(tr,{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(tr,{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&&(V.forEach(t,s=>{V.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),V.forEach(V.sortBy(r,["slug"]),s=>{n.push(pg(s.slug??"",s.name,e))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(Er,{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||!V.isNil(e.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(Ha,{product:s,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return n},bg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _g(t,e){return i.openBlock(),i.createElementBlock("svg",bg,[...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 Xa=i.markRaw({name:"ion-trash",render:_g}),wg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xg(t,e){return i.openBlock(),i.createElementBlock("svg",wg,[...e[0]||(e[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const Ya=i.markRaw({name:"ion-plus",render:xg}),vg={key:0,class:"flex w-fit items-center gap-2"},kg={key:1,class:"flex flex-wrap gap-1"},Cg={key:0},Sg={},nr=i.defineComponent({...Sg,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{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=z.NSpin;return t.isProductSearching?(i.openBlock(),i.createElementBlock("div",vg,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):t.product.isNewRec()?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",kg,[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),1),n.value?(i.openBlock(),i.createElementBlock("div",Cg,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)]))}}}),Bg={class:"flex flex-col gap-4"},Tg={class:"flex flex-col gap-2"},Rg={class:"mt-8 font-bold"},$g={class:"grid grow grid-cols-2 items-start gap-2"},Eg={class:"text-sm"},Ng={class:"font-medium"},Pg={key:0,class:"text-red-500"},Fg={key:2,class:"text-red-500 text-sm mb-2"},Mg={class:"flex flex-col gap-4"},Ag={key:0},Vg={class:"text-lg font-semibold"},Og={class:"flex gap-3"},Ig={},Ua=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,{emit:e}){const n=t,r=e,s=i.ref(structuredClone(i.toRaw(n.value.configuratorParams))),o=i.ref(!1),a=i.computed(()=>{var y;const{length:m}=s.value,{quantity:f}=n.value,g=((y=n.value.product)==null?void 0:y.costRub)||0;if(!m||!f||g===0)return null;const p=m/100;return(g*f*p).toLocaleString("ru-ru",{minimumFractionDigits:2})}),l=i.computed(()=>V.reduce(s.value.linesWidths,(m,f)=>m+(f||0),0)),c=i.computed(()=>{const m=l.value;return m>=n.settings.stripMinWidth&&m<=n.settings.stripMaxWidth}),d=i.computed(()=>{const m=V.every(s.value.linesWidths,y=>!!(y&&y>0)),f=V.every(s.value.linesAngles,y=>!V.isNil(y)),g=!!(n.value.quantity&&n.value.quantity>0),p=s.value.length>0&&s.value.length>0;return m&&f&&g&&p&&c.value}),h=()=>{d.value&&(r("update:params",s.value),u("configuratorParams",s.value))},u=(m,f)=>{const g=new U.CartItemBase(n.value);g[m]=f,r("update:value",g)};return i.watch(()=>n.value.configuratorParams,m=>{s.value=V.cloneDeep(i.toRaw(m))},{deep:!0}),i.watch(()=>n.previewParams,m=>{s.value.linesWidths=m.linesWidths,s.value.linesAngles=m.linesAngles},{deep:!0}),(m,f)=>{const g=Ya,p=Xa,y=z.NInput;return i.openBlock(),i.createBlock(i.unref(z.NForm),{class:"grid gap-2 md:grid-cols-2 md:gap-6"},{default:i.withCtx(()=>{var b,_,v,k,C,B,S,T,$,E;return[i.createElementVNode("div",Bg,[f[9]||(f[9]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),t.settings.startTailConfigs&&t.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:s.value.startTailType,"onUpdate:value":[f[0]||(f[0]=O=>s.value.startTailType=O),h],options:t.settings.startTailConfigs.map(({label:O},I)=>({label:O,value:I})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Tg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value.linesAngles,(O,I)=>{var A,L,D,ee,N,P;return i.openBlock(),i.createElementBlock("div",{key:I,class:"flex items-start gap-2"},[i.createElementVNode("div",Rg,i.toDisplayString(I+1),1),i.createElementVNode("div",$g,[i.createVNode(i.unref(z.NFormItem),{label:"Ширина, мм",required:!0,feedback:((A=t.validation[`lines_widths[${I+1}]`])==null?void 0:A.feedback)||"","show-feedback":((L=t.validation[`lines_widths[${I+1}]`])==null?void 0:L.showFeedback)||!1,"validation-status":(D=t.validation[`lines_widths[${I+1}]`])==null?void 0:D.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:s.value.linesWidths[I],"onUpdate:value":[H=>s.value.linesWidths[I]=H,h],"show-button":!1,min:s.value.linesWidths.length>1?t.settings.minLineWidth:t.settings.stripMinWidth,max:t.settings.maxLineWidth,step:t.settings.lineWidthStep,validator:H=>!H||H>=(s.value.linesWidths.length>1?t.settings.minLineWidth:t.settings.stripMinWidth)&&H<=t.settings.maxLineWidth&&H%t.settings.lineWidthStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{label:"Угол сгиба, °",required:!0,feedback:((ee=t.validation[`lines_angles[${I+1}]`])==null?void 0:ee.feedback)||"","show-feedback":((N=t.validation[`lines_angles[${I+1}]`])==null?void 0:N.showFeedback)||!1,"validation-status":(P=t.validation[`lines_angles[${I+1}]`])==null?void 0:P.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:s.value.linesAngles[I],"onUpdate:value":[H=>s.value.linesAngles[I]=H,h],"show-button":!1,min:t.settings.minLineAngle,max:t.settings.maxLineAngle,step:t.settings.lineAngleStep,validator:H=>!H||H%t.settings.lineAngleStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"])]),i.createVNode(i.unref(z.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(z.NButton),{key:0,size:"medium",onClick:H=>r("click:add-line",I)},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,disabled:s.value.linesWidths.length===1,size:"medium",class:"ml-2",onClick:H=>r("click:remove-line",I)},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled","onClick"]))]),_:2},1024)])}),128))]),t.settings.endTailConfigs&&t.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:s.value.endTailType,"onUpdate:value":[f[1]||(f[1]=O=>s.value.endTailType=O),h],options:t.settings.endTailConfigs.map(({label:O},I)=>({label:O,value:I})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(nr,{"is-product-searching":t.isProductSearching,product:t.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",Eg,[i.createElementVNode("div",Ng,"Суммарная ширина участков: "+i.toDisplayString(l.value)+" мм",1),c.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Pg," Должна быть от "+i.toDisplayString(t.settings.stripMinWidth)+" до "+i.toDisplayString(t.settings.stripMaxWidth)+" мм ",1))]),d.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Fg," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((b=t.settings.allTemplates)==null?void 0:b.length)-1?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:3,type:"tertiary",class:"self-start",loading:o.value,onClick:f[2]||(f[2]=O=>r("click:save-template"))},{default:i.withCtx(()=>[...f[8]||(f[8]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Mg,[i.createVNode(i.unref(z.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:s.value.colorSide,"onUpdate:value":[f[3]||(f[3]=O=>s.value.colorSide=O),h],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":((_=t.validation.length)==null?void 0:_.showFeedback)||!1,feedback:((v=t.validation.length)==null?void 0:v.feedback)||"","validation-status":(k=t.validation.length)==null?void 0:k.validationStatus,label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:s.value.length,"onUpdate:value":[f[4]||(f[4]=O=>s.value.length=O),h],required:!0,"show-button":!1,max:t.settings.stripMaxLength||void 0,min:t.settings.stripMinLength,step:t.settings.lengthStep,validator:O=>!O||O%t.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]),_:1},8,["show-feedback","feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":((C=t.validation.quantity)==null?void 0:C.showFeedback)||!1,feedback:((B=t.validation.quantity)==null?void 0:B.feedback)||"","validation-status":(S=t.validation.quantity)==null?void 0:S.validationStatus,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,"onUpdate:value":f[5]||(f[5]=O=>t.value.quantity=O),min:1,"show-button":!1,validator:O=>Number.isInteger(O),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{required:!1,"show-feedback":((T=t.validation.marker)==null?void 0:T.showFeedback)||!1,feedback:(($=t.validation.marker)==null?void 0:$.feedback)||"","validation-status":(E=t.validation.marker)==null?void 0:E.validationStatus,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(y,{value:t.value.marker,"onUpdate:value":f[6]||(f[6]=O=>t.value.marker=O),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["show-feedback","feedback","validation-status"]),a.value?(i.openBlock(),i.createElementBlock("div",Ag,[f[10]||(f[10]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Vg,i.toDisplayString(a.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",Og,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!d.value,type:"primary",class:"self-start",onClick:f[7]||(f[7]=O=>r("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1})}}});var Ga=Object.defineProperty,zg=Object.defineProperties,Lg=Object.getOwnPropertyDescriptors,Ka=Object.getOwnPropertySymbols,Dg=Object.prototype.hasOwnProperty,Hg=Object.prototype.propertyIsEnumerable,Za=t=>{throw TypeError(t)},As=(t,e,n)=>e in t?Ga(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Vs=(t,e)=>{for(var n in e||(e={}))Dg.call(e,n)&&As(t,n,e[n]);if(Ka)for(var n of Ka(e))Hg.call(e,n)&&As(t,n,e[n]);return t},Os=(t,e)=>zg(t,Lg(e)),Qa=(t,e)=>{for(var n in e)Ga(t,n,{get:e[n],enumerable:!0})},w=(t,e,n)=>As(t,typeof e!="symbol"?e+"":e,n),Ja=(t,e,n)=>e.has(t)||Za("Cannot "+n),Tt=(t,e,n)=>(Ja(t,e,"read from private field"),n?n.call(t):e.get(t)),el=(t,e,n)=>e.has(t)?Za("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Wg=(t,e,n,r)=>(Ja(t,e,"write to private field"),e.set(t,n),n),_t={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 _t.shim(t),typeof e<"u"&&(_t.Image=e),_t.isHeadless=!0,t}},tl={};Qa(tl,{Curve:()=>Ei,getAnchorsFromArcData:()=>Xg,getComponentOnCubicBezier:()=>ir,getControlPoints:()=>ul,getCurveBoundingBox:()=>cl,getCurveFromPoints:()=>hl,getCurveLength:()=>ll,getReflection:()=>Ds,integrate:()=>dl,subdivide:()=>Ls});var nl={};Qa(nl,{HALF_PI:()=>Ze,NumArray:()=>nn,TWO_PI:()=>at,decomposeMatrix:()=>Qn,getComputedMatrix:()=>Is,getEffectiveStrokeWidth:()=>rn,getPoT:()=>sl,lerp:()=>Nt,mod:()=>Pt,setMatrix:()=>rl,toFixed:()=>Ne});var He;typeof window<"u"?He=window:typeof global<"u"?He=global:typeof self<"u"&&(He=self);var il,at=Math.PI*2,Ze=Math.PI*.5;function Qn(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 rl(t){il=t}function Is(t,e){e=e&&e.identity()||new il;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 Nt(t,e,n){return n*(e-t)+t}var zs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function sl(t){let e=0;for(;zs[e]&&zs[e]<t;)e++;return zs[e]}function Pt(t,e){for(;t<0;)t+=e;return t%e}var nn=He.Float32Array||Array,jg=Math.floor;function Ne(t){return jg(t*1e6)/1e6}function rn(t,e){const n=t._linewidth;if(t.strokeAttenuation)return n;e||(e=t.worldMatrix||Is(t));const r=Qn(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 te={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},X=class{constructor(){w(this,"_events",{}),w(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 h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}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}};w(X,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),w(X,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var ol={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(X.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(X.Types.change))}}},qt=class Zi extends X{constructor(e=0,n=0){super(),w(this,"_x",0),w(this,"_y",0);for(let r in ol)Object.defineProperty(this,r,ol[r]);this.x=e,this.y=n}static add(e,n){return new Zi(e.x+n.x,e.y+n.y)}static sub(e,n){return new Zi(e.x-n.x,e.y-n.y)}static subtract(e,n){return Zi.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(Zi.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 Zi(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:Ne(this.x),y:Ne(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}};w(qt,"zero",new qt),w(qt,"left",new qt(-1,0)),w(qt,"right",new qt(1,0)),w(qt,"up",new qt(0,-1)),w(qt,"down",new qt(0,1));var Q=qt,ve=class Ns extends Q{constructor(e=0,n=0,r=0,s=0,o=0,a=0,l=te.move){super(e,n),w(this,"controls",{left:new Q,right:new Q}),w(this,"_command",te.move),w(this,"_relative",!0),w(this,"_rx",0),w(this,"_ry",0),w(this,"_xAxisRotation",0),w(this,"_largeArcFlag",0),w(this,"_sweepFlag",1);for(let d in al)Object.defineProperty(this,d,al[d]);this.command=l,this.relative=!0;const c=Ns.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(X.Types.change,c),this.controls.right.set(o,a).addEventListener(X.Types.change,c)}static makeBroadcast(e){return n;function n(){e._bound&&e.dispatchEvent(X.Types.change)}}static fromObject(e){return new Ns().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 Ns().copy(this)}toObject(){return{x:Ne(this.x),y:Ne(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Ne(this.rx),ry:Ne(this.ry),xAxisRotation:Ne(this.xAxisRotation),largeArcFlag:Ne(this.largeArcFlag),sweepFlag:Ne(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},al={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(X.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(X.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(X.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(X.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(X.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(X.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(X.Types.change))}}},qg=0,wt={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 qg++}},Ei={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 ir(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 Ls(t,e,n,r,s,o,a,l,c){c=c||Ei.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new ve(a,l)];const h=[];for(let u=0;u<d;u++){const m=u/d,f=ir(m,t,n,s,a),g=ir(m,e,r,o,l);h.push(new ve(f,g))}return h}function ll(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const y=a-t,b=l-e;return Math.sqrt(y*y+b*b)}const d=9*(n-s)+3*(a-t),h=6*(t+s)-12*n,u=3*(n-t),m=9*(r-o)+3*(l-e),f=6*(e+o)-12*r,g=3*(r-e);function p(y){const b=(d*y+h)*y+u,_=(m*y+f)*y+g;return Math.sqrt(b*b+_*_)}return dl(p,0,1,c||Ei.RecursionLimit)}function cl(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,m,f,g,p,y,b;for(let C=0;C<2;++C){if(C===0?(u=6*t-12*n+6*s,h=-3*t+9*n-9*s+3*a,m=3*n-3*t):(u=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(h)<.001){if(Math.abs(u)<.001)continue;f=-m/u,0<f&&f<1&&c.push(f);continue}y=u*u-4*m*h,b=Math.sqrt(y),!(y<0)&&(g=(-u+b)/(2*h),0<g&&g<1&&c.push(g),p=(-u-b)/(2*h),0<p&&p<1&&c.push(p))}let _=c.length,v=_,k;for(;_--;)f=c[_],k=1-f,d[0][_]=k*k*k*t+3*k*k*f*n+3*k*f*f*s+f*f*f*a,d[1][_]=k*k*k*e+3*k*k*f*r+3*k*f*f*o+f*f*f*l;return d[0][v]=t,d[1][v]=e,d[0][v+1]=a,d[1][v+1]=l,d[0].length=d[1].length=v+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 dl(t,e,n,r){let s=Ei.abscissas[r-2],o=Ei.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,h=r&1?o[c++]*t(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(t(l+u)+t(l-u))}return a*h}function hl(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Pt(s-1,n):Math.max(s-1,0),l=e?Pt(s+1,n):Math.min(s+1,r),c=t[a],d=o,h=t[l];ul(c,d,h),d.command=s===0?te.move:te.curve}}function ul(t,e,n){const r=Q.angleBetween(t,e),s=Q.angleBetween(n,e);let o=Q.distanceBetween(t,e),a=Q.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+=Ze:l-=Ze,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 Ds(t,e,n){return new Q(2*t.x-(e.x+t.x)-(n?t.x:0),2*t.y-(e.y+t.y)-(n?t.y:0))}function Xg(t,e,n,r,s,o,a){const l=wt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,u=n*Math.cos(h),m=r*Math.sin(h),f=new ve(u,m);f.command=te.line}}var fl=Array.prototype.slice;function Yg(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var K={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=fl.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=fl.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=!Yg(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:He.performance&&He.performance.now?He.performance:Date},Ft={hasEventListeners:typeof He.addEventListener=="function",bind:function(t,e,n,r){return this.hasEventListeners?t.addEventListener(e,n,!!r):t.attachEvent("on"+e,n),Ft},unbind:function(t,e,n,r){return Ft.hasEventListeners?t.removeEventListeners(e,n,!!r):t.detachEvent("on"+e,n),Ft},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,n=He.requestAnimationFrame;if(!n){for(let s=0;s<t.length;s++)n=He[t[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=He.setTimeout(d,l);e=a+l;function d(){s(a+l)}return c}return n}},Ni=He.document?He.document.createElement("div"):{};Ni.id="help-two-load",Object.defineProperty(Ft,"temp",{enumerable:!0,get:function(){return K.isElement(Ni)&&!He.document.head.contains(Ni)&&(Ni.style.display="none",He.document.head.appendChild(Ni)),Ni}});var Rt=class extends Error{constructor(e){super(),w(this,"name","Two.js"),w(this,"message"),this.message=e}},Ug=He.devicePixelRatio||1;function Gg(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function Hs(t){return Ug/Gg(t)}var Fr=class{constructor(){w(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}},lt,An=class extends Array{constructor(){super(),el(this,lt,new X),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 Tt(this,lt)}set _events(e){Wg(this,lt,e)}get _bound(){return Tt(this,lt)._bound}set _bound(e){Tt(this,lt)._bound=e}addEventListener(){return Tt(this,lt).addEventListener.apply(this,arguments)}on(){return Tt(this,lt).on.apply(this,arguments)}bind(){return Tt(this,lt).bind.apply(this,arguments)}removeEventListener(){return Tt(this,lt).removeEventListener.apply(this,arguments)}off(){return Tt(this,lt).off.apply(this,arguments)}unbind(){return Tt(this,lt).unbind.apply(this,arguments)}dispatchEvent(){return Tt(this,lt).dispatchEvent.apply(this,arguments)}trigger(){return Tt(this,lt).trigger.apply(this,arguments)}listen(){return Tt(this,lt).listen.apply(this,arguments)}ignore(){return Tt(this,lt).ignore.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(X.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(X.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(X.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(X.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(X.Types.remove,e),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(X.Types.insert,n),this.trigger(X.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(X.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(X.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}};lt=new WeakMap;var gl=class Mu extends X{constructor(){super(),w(this,"_flagId",!1),w(this,"_flagClassName",!1),w(this,"_renderer",{}),w(this,"_id",wt.Identifier+wt.uniqueId()),w(this,"_className",""),w(this,"classList",[]);for(let e in ml)Object.defineProperty(this,e,ml[e])}static fromObject(e){const n=new Mu().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}};w(gl,"Properties",["renderer","id","className"]);var Pi=gl,ml={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)}}},Mr,pl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};He.document&&(Mr=document.createElement("a"));var Xt=class Vt extends Pi{constructor(e,n){super(),w(this,"_flagSrc",!1),w(this,"_flagImage",!1),w(this,"_flagVideo",!1),w(this,"_flagLoaded",!1),w(this,"_flagRepeat",!1),w(this,"_flagOffset",!1),w(this,"_flagScale",!1),w(this,"_src",""),w(this,"_image",null),w(this,"_loaded",!1),w(this,"_repeat","no-repeat"),w(this,"_scale",1),w(this,"_offset",null);for(let r in yl)Object.defineProperty(this,r,yl[r]);if(this._renderer.type="texture",this._renderer.flagOffset=Kg.bind(this),this._renderer.flagScale=Zg.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new Q,typeof n=="function"){const r=(function(){this.unbind(X.Types.load,r),typeof n=="function"&&n()}).bind(this);this.bind(X.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 Vt().copy(e);return"id"in e&&(n.id=e.id),n}static getAbsoluteURL(e){return Mr?(Mr.href=e,Mr.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=Vt.getAbsoluteURL(e);if(Vt.ImageRegistry.contains(n))return Vt.ImageRegistry.get(n);let r;return _t.Image?(r=new _t.Image,_t.shim(r,"img")):He.document?pl.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=Vt.getTag(r);e._flagImage&&(/canvas/i.test(s)?Vt.Register.canvas(e,n):(e._src=!_t.isHeadless&&r.getAttribute("two-src")||r.src,Vt.Register[s](e,n))),e._flagSrc&&(r||(r=Vt.getImage(e.src),e.image=r),s=Vt.getTag(r),Vt.Register[s](e,n))}clone(){const e=new Vt(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 Q?e.offset:new Q().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof Q?e.scale:new Q().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(X.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Vt.load(this,(function(){this.loaded=!0,this.trigger(X.Types.change).trigger(X.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}};w(Xt,"Properties",["src","loaded","repeat","scale","offset","image"]),w(Xt,"RegularExpressions",pl),w(Xt,"ImageRegistry",new Fr),w(Xt,"Register",{canvas:function(t,e){t._src="#"+t.id,Xt.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const n=t.image,r=function(o){!_t.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!_t.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new Rt("unable to load "+t.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!_t.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),t._src=Xt.getAbsoluteURL(t._src),!(!_t.isHeadless&&n&&n.getAttribute("two-src"))&&(_t.isHeadless||n.setAttribute("two-src",t.src),Xt.ImageRegistry.add(t.src,n),_t.isHeadless?Xt.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(_t.isHeadless)throw new Rt("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 Rt("unable to load "+t.src)};t._src=Xt.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),Xt.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 Pe=Xt,yl={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=Pe.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Pe.ImageRegistry.contains(n)?this._image=Pe.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(X.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(X.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof Q&&this._scale.unbind(X.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof Q&&this._scale.bind(X.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Kg(){this._flagOffset=!0}function Zg(){this._flagScale=!0}var Ws=class tn extends Pi{constructor(e,n,r){super(),w(this,"_flagOffset",!0),w(this,"_flagOpacity",!0),w(this,"_flagColor",!0),w(this,"_offset",0),w(this,"_opacity",1),w(this,"_color","#fff");for(let s in bl)Object.defineProperty(this,s,bl[s]);this._renderer.type="stop",this.offset=typeof e=="number"?e:tn.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof n=="string"?n:tn.Index<=0?"#fff":"#000",tn.Index=(tn.Index+1)%2}static fromObject(e){const n=new tn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<tn.Properties.length;n++){const r=tn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new tn;return K.each(tn.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",K.each(tn.Properties,n=>{e[n]=this[n]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};w(Ws,"Index",0),w(Ws,"Properties",["offset","opacity","color"]);var Vn=Ws,bl={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)}}},js=class vi extends Pi{constructor(e){super(),w(this,"_flagStops",!1),w(this,"_flagSpread",!1),w(this,"_flagUnits",!1),w(this,"_spread",""),w(this,"_units","");for(let n in _l)Object.defineProperty(this,n,_l[n]);this._renderer.type="gradient",this._renderer.flagStops=Qg.bind(this),this._renderer.bindStops=Jg.bind(this),this._renderer.unbindStops=em.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 Vn?s:new Vn().copy(s)));const r=new vi(n).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const n=this.stops.map(s=>s.clone()),r=new vi(n);return K.each(vi.Properties,s=>{r[s]=this[s]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let n=0;n<vi.Properties.length;n++){const r=vi.Properties[n];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(n=>n.toObject())};return K.each(vi.Properties,n=>{e[n]=this[n]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(X.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}};w(js,"Stop",Vn),w(js,"Properties",["spread","stops","units"]);var Qe=js,_l={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(X.Types.insert,e).unbind(X.Types.remove,n),this._stops=new An((t||[]).slice(0)),this._stops.bind(X.Types.insert,e).bind(X.Types.remove,n),e(this._stops)}}};function Qg(){this._flagStops=!0}function Jg(t){let e=t.length;for(;e--;)t[e].bind(X.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function em(t){let e=t.length;for(;e--;)t[e].unbind(X.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var qs=class Sr extends Qe{constructor(e,n,r,s,o){super(o),w(this,"_flagEndPoints",!1),w(this,"_left",null),w(this,"_right",null);for(let a in wl)Object.defineProperty(this,a,wl[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=tm.bind(this),this.left=new Q,this.right=new Q,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 Sr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Sr.Properties.length;n++){const r=Sr.Properties[n];r in e&&(this[r]=e[r]instanceof Q?e[r]:new Q().copy(e[r]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new Sr(this.left._x,this.left._y,this.right._x,this.right._y,n);return K.each(Qe.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(X.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};w(qs,"Stop",Vn),w(qs,"Properties",["left","right"]);var We=qs,wl={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof Q&&this._left.unbind(X.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(X.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof Q&&this._right.unbind(X.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(X.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function tm(){this._flagEndPoints=!0}var Xs=class ki extends Qe{constructor(e,n,r,s,o,a){super(s),w(this,"_flagRadius",!1),w(this,"_flagCenter",!1),w(this,"_flagFocal",!1),w(this,"_radius",0),w(this,"_center",null),w(this,"_focal",null);for(let l in xl)Object.defineProperty(this,l,xl[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=nm.bind(this),this._renderer.flagFocal=im.bind(this),this.center=new Q,this.radius=typeof r=="number"?r:1,this.focal=new Q,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 ki().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<ki.Properties.length;n++){const r=ki.Properties[n];r in e&&(/(center|focal)i/.test(r)?this[r]=e[r]instanceof Q?e[r]:new Q().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 ki(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return K.each(Qe.Properties.concat(ki.Properties),function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return K.each(ki.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(X.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};w(Xs,"Stop",Vn),w(Xs,"Properties",["center","radius","focal"]);var je=Xs,xl={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(X.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(X.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(X.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(X.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function nm(){this._flagCenter=!0}function im(){this._flagFocal=!0}function vl(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 Ar(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 kl(t,e,n){let r,s,o,a,l,c,d,h;const u=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(u||e).x,c=(u||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,u&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),ll(r,l,s,c,o,d,a,h,n)}function Cl(t,e,n){let r,s,o,a,l,c,d,h;const u=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(u||e).x,c=(u||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,u&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),Ls(r,l,s,c,o,d,a,h,n)}function Jn(t){switch(t.renderer.type){case"texture":return Pe.fromObject(t);case"gradient":return Qe.fromObject(t);case"linear-gradient":return We.fromObject(t);case"radial-gradient":return je.fromObject(t)}return t}var rm=Math.cos,sm=Math.sin,Sl=Math.tan,Ys=[],Bl=class Ot extends X{constructor(e,n,r,s,o,a){super(),w(this,"elements",new nn(9)),w(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 B=e;let S,T,$;const E=n[0]||0,O=n[1]||0,I=n[2]||0;return S=B[0]*E+B[1]*O+B[2]*I,T=B[3]*E+B[4]*O+B[5]*I,$=B[6]*E+B[7]*O+B[8]*I,[S,T,$]}const s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],h=e[6],u=e[7],m=e[8],f=n[0],g=n[1],p=n[2],y=n[3],b=n[4],_=n[5],v=n[6],k=n[7],C=n[8];return r=r||new nn(9),r[0]=s*f+o*y+a*v,r[1]=s*g+o*b+a*k,r[2]=s*p+o*_+a*C,r[3]=l*f+c*y+d*v,r[4]=l*g+c*b+d*k,r[5]=l*p+c*_+d*C,r[6]=h*f+u*y+m*v,r[7]=h*g+u*b+m*k,r[8]=h*p+u*_+m*C,r}static fromObject(e){return new Ot().copy(e)}set(e,n,r,s,o,a,l,c,d){if(typeof n>"u"){const h=e;e=h[0],n=h[1],r=h[2],s=h[3],o=h[4],a=h[5],l=h[6],c=h[7],d=h[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(X.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(X.Types.change)}identity(){return this.elements[0]=Ot.Identity[0],this.elements[1]=Ot.Identity[1],this.elements[2]=Ot.Identity[2],this.elements[3]=Ot.Identity[3],this.elements[4]=Ot.Identity[4],this.elements[5]=Ot.Identity[5],this.elements[6]=Ot.Identity[6],this.elements[7]=Ot.Identity[7],this.elements[8]=Ot.Identity[8],this.trigger(X.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(X.Types.change);if(typeof r>"u"&&(r=1),typeof s>"u"){e=e||0,n=n||0,r=r||0,o=this.elements;const L=o[0]*e+o[1]*n+o[2]*r,D=o[3]*e+o[4]*n+o[5]*r,ee=o[6]*e+o[7]*n+o[8]*r;return[L,D,ee]}const h=this.elements,u=[e,n,r,s,o,a,l,c,d],m=h[0],f=h[1],g=h[2],p=h[3],y=h[4],b=h[5],_=h[6],v=h[7],k=h[8],C=u[0],B=u[1],S=u[2],T=u[3],$=u[4],E=u[5],O=u[6],I=u[7],A=u[8];return this.elements[0]=m*C+f*T+g*O,this.elements[1]=m*B+f*$+g*I,this.elements[2]=m*S+f*E+g*A,this.elements[3]=p*C+y*T+b*O,this.elements[4]=p*B+y*$+b*I,this.elements[5]=p*S+y*E+b*A,this.elements[6]=_*C+v*T+k*O,this.elements[7]=_*B+v*$+k*I,this.elements[8]=_*S+v*E+k*A,this.trigger(X.Types.change)}inverse(e){const n=this.elements;e=e||new Ot;const r=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],d=n[6],h=n[7],u=n[8],m=u*l-c*h,f=-u*a+c*d,g=h*a-l*d;let p=r*m+s*f+o*g;return p?(p=1/p,e.elements[0]=m*p,e.elements[1]=(-u*s+o*h)*p,e.elements[2]=(c*s-o*l)*p,e.elements[3]=f*p,e.elements[4]=(u*r-o*d)*p,e.elements[5]=(-c*r+o*a)*p,e.elements[6]=g*p,e.elements[7]=(-h*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=rm(e),r=sm(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=Sl(e);return this.multiply(1,n,0,0,1,0,0,0,1)}skewY(e){const n=Sl(e);return this.multiply(1,0,0,n,1,0,0,0,1)}toString(e){return Ys.length=0,this.toTransformArray(e,Ys),Ys.map(Ne).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],h=r[5];if(e){const u=r[6],m=r[7],f=r[8];if(s){n[0]=o,n[1]=c,n[2]=u,n[3]=a,n[4]=d,n[5]=m,n[6]=l,n[7]=h,n[8]=f;return}return[o,c,u,a,d,m,l,h,f]}if(s){n[0]=o,n[1]=c,n[2]=a,n[3]=d,n[4]=l,n[5]=h;return}return[o,c,a,d,l,h]}toArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],h=r[5];if(e){const u=r[6],m=r[7],f=r[8];if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=h,n[6]=u,n[7]=m,n[8]=f;return}return[o,a,l,c,d,h,u,m,f]}if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=h;return}return[o,a,l,c,d,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Ot().copy(this)}};w(Bl,"Identity",[1,0,0,0,1,0,0,0,1]);var Fi=Bl;rl(Fi);var Tl=class Va extends Pi{constructor(){super(),w(this,"_flagMatrix",!0),w(this,"_flagScale",!1),w(this,"_matrix",null),w(this,"_worldMatrix",null),w(this,"_position",null),w(this,"_rotation",0),w(this,"_scale",1),w(this,"_skewX",0),w(this,"_skewY",0);for(let e in Vr)Object.defineProperty(this,e,Vr[e]);this._renderer.flagMatrix=Rl.bind(this),this.isShape=!0,this.matrix=new Fi,this.worldMatrix=new Fi,this.position=new Q,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const n=new Va().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 Vr.position.get.apply(this,arguments)}set translation(e){Vr.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 Q?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 Q?e.scale:new Q(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 Va;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 Q?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 Q?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}};w(Tl,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var On=Tl,Vr={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(X.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(X.Types.change,this._renderer.flagMatrix),Rl.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 Q&&this._scale.unbind(X.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof Q&&this._scale.bind(X.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 Is(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Rl(){this._flagMatrix=!0}var Mi=Math.min,Ai=Math.max,om=Math.ceil,am=Math.floor,lm=new Q,Us=class Yn extends On{constructor(e,n,r,s){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagCap",!0),w(this,"_flagJoin",!0),w(this,"_flagMiter",!0),w(this,"_flagStrokeAttenuation",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null),w(this,"_strokeAttenuation",!0);for(let o in $l)Object.defineProperty(this,o,$l[o]);this._renderer.type="path",this._renderer.flagVertices=El.bind(this),this._renderer.bindVertices=Nl.bind(this),this._renderer.unbindVertices=Pl.bind(this),this._renderer.flagFill=Fl.bind(this),this._renderer.flagStroke=Ml.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:Jn(e.fill),r=typeof e.stroke=="string"?e.stroke:Jn(e.stroke),s=new Yn().copy(Os(Vs({},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<Yn.Properties.length;n++){const r=Yn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Yn;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<Yn.Properties.length;r++){const s=Yn.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()),K.each(Yn.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,h=1/0,u=-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:f}=Qn(n.elements[0],n.elements[3],n.elements[1],n.elements[4],n.elements[2],n.elements[5]);typeof m=="number"&&typeof f=="number"&&(r=Math.max(m,f)*(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,f]=n.multiply(a.x,a.y),[g,p]=n.multiply(l.x,l.y);if(a.controls&&l.controls){let y=a.controls.right.x,b=a.controls.right.y;a.relative&&(y+=a.x,b+=a.y);let[_,v]=n.multiply(y,b),k=l.controls.left.x,C=l.controls.left.y;l.relative&&(k+=l.x,C+=l.y);let[B,S]=n.multiply(k,C);const T=cl(m,f,_,v,B,S,g,p);h=Mi(T.min.y-r,h),c=Mi(T.min.x-r,c),d=Ai(T.max.x+r,d),u=Ai(T.max.y+r,u)}else o<=1&&(h=Mi(f-r,h),c=Mi(m-r,c),d=Ai(m+r,d),u=Ai(f+r,u)),h=Mi(p-r,h),c=Mi(g-r,c),d=Ai(g+r,d),u=Ai(p+r,u)}return{top:h,left:c,right:d,bottom:u,width:d-c,height:u-h}}getPointAt(e,n){let r,s,o,a,l,c,d,h,u,m,f,g,p,y,b,_=this.length*Math.min(Math.max(e,0),1);const v=this.vertices.length,k=v-1;let C=null,B=null;for(let N=0,P=this._lengths.length,H=0;N<P;N++){if(H+this._lengths[N]>=_){this._closed?(r=Pt(N,v),s=Pt(N-1,v),N===0&&(r=s,s=N)):(r=N,s=Math.min(Math.max(N-1,0),k)),C=this.vertices[r],B=this.vertices[s],_-=H,this._lengths[N]!==0?e=_/this._lengths[N]:e=0;break}H+=this._lengths[N]}if(C===null||B===null)return null;if(C){if(!B)return C}else return B;b=B.controls&&B.controls.right,y=C.controls&&C.controls.left,l=B.x,m=B.y,c=(b||B).x,f=(b||B).y,d=(y||C).x,g=(y||C).y,h=C.x,p=C.y,b&&B.relative&&(c+=B.x,f+=B.y),y&&C.relative&&(d+=C.x,g+=C.y),a=ir(e,l,c,d,h),u=ir(e,m,f,g,p);const S=Nt(l,c,e),T=Nt(m,f,e),$=Nt(c,d,e),E=Nt(f,g,e),O=Nt(d,h,e),I=Nt(g,p,e),A=Nt(S,$,e),L=Nt(T,E,e),D=Nt($,O,e),ee=Nt(E,I,e);return K.isObject(n)?(n.x=a,n.y=u,n instanceof ve&&(n.controls.left.x=A,n.controls.left.y=L,n.controls.right.x=D,n.controls.right.y=ee,(typeof n.relative!="boolean"||n.relative)&&(n.controls.left.x-=a,n.controls.left.y-=u,n.controls.right.x-=a,n.controls.right.y-=u)),n.t=e,n):(o=new ve(a,u,A-a,L-u,D-a,ee-u,this._curved?te.curve:te.line),o.t=e,o)}plot(){if(this.curved)return hl(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?te.move:te.line;return this}subdivide(e){this._update();const n=this.vertices.length-1,r=this._closed||this.vertices[n]._command===te.close;let s=this.vertices[n],o=[],a;return K.each(this.vertices,function(l,c){if(c<=0&&!r){s=l;return}if(l.command===te.move){o.push(new ve(s.x,s.y)),c>0&&(o[o.length-1].command=te.line),s=l;return}a=Cl(l,s,e),o=o.concat(a),K.each(a,function(d,h){h<=0&&s.command===te.move?d.command=te.move:d.command=te.line}),c>=n&&(this._closed&&this._automatic&&(s=l,a=Cl(l,s,e),o=o.concat(a),K.each(a,function(d,h){h<=0&&s.command===te.move?d.command=te.move:d.command=te.line})),o.push(new ve(l.x,l.y)),o[o.length-1].command=r?te.close:te.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=[]),K.each(this.vertices,function(l,c){if(c<=0||l.command===te.move){o=l,this._lengths[c]=0;return}this._lengths[c]=kl(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=Ar(this,r*this._length),a=Ar(this,s*this._length),l=om(o),c=am(a);let d,h,u,m,f,g;for(this._renderer.vertices.length=0,g=0;g<e;g++)this._renderer.collection.length<=g&&this._renderer.collection.push(new ve),g>c&&!h?(f=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(s,f),f.command=this._renderer.collection[g].command,this._renderer.vertices.push(f),h=f,u=this._collection[g-1],u&&u.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f),u.relative?this._renderer.collection[g-1].controls.right.copy(u.controls.right).lerp(Q.zero,1-f.t):this._renderer.collection[g-1].controls.right.copy(u.controls.right).lerp(u,1-f.t))):g>=l&&g<=c&&(f=this._renderer.collection[g].copy(this._collection[g]),this._renderer.vertices.push(f),g===c&&vl(this,s)?(h=f,!n&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):g===l&&vl(this,r)&&(d=f,d.command=te.move,!n&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(g=l-1,f=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(r,f),f.command=te.move,this._renderer.vertices.unshift(f),m=this._collection[g+1],m&&m.controls&&(f.controls.left.clear(),m.relative?this._renderer.collection[g+1].controls.left.copy(m.controls.left).lerp(Q.zero,f.t):(lm.copy(m),this._renderer.collection[g+1].controls.left.copy(m.controls.left).lerp(m,f.t))))}return On.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,On.prototype.flagReset.call(this),this}};w(Us,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),w(Us,"Utils",{getCurveLength:kl});var Se=Us,$l={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 Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.bind(X.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";K.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(X.Types.insert,e).unbind(X.Types.remove,n),t instanceof An?this._collection=t:this._collection=new An(t||[]),this._collection.bind(X.Types.insert,e).bind(X.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,K.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 El(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Nl(t){let e=t.length;for(;e--;)t[e].bind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Pl(t){let e=t.length;for(;e--;)t[e].unbind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Fl(){this._flagFill=!0}function Ml(){this._flagStroke=!0}var Al=class Br extends Se{constructor(e,n,r,s){const o=[new ve,new ve,new ve,new ve];super(o,!0,!1,!0),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_width",0),w(this,"_height",0),w(this,"_origin",null),this._renderer.type="rectangle";for(let a in Vl)Object.defineProperty(this,a,Vl[a]);this.width=typeof r=="number"?r:1,this.height=typeof s=="number"?s:1,this.origin=new Q,typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n),this._update()}static fromObject(e){const n=new Br().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Br.Properties.length;n++){const r=Br.Properties[n];r in e&&(typeof e[r]=="number"?this[r]=e[r]:this[r]instanceof Q&&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=te.move,this.vertices[1].set(e,-n).sub(this._origin).command=te.line,this.vertices[2].set(e,n).sub(this._origin).command=te.line,this.vertices[3].set(-e,n).sub(this._origin).command=te.line,this.vertices[4]&&(this.vertices[4].set(-e,-n).sub(this._origin).command=te.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=new Br(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<Se.Properties.length;r++){const s=Se.Properties[r];n[s]instanceof Q?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}};w(Al,"Properties",["width","height","origin"]);var In=Al,Vl={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(X.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(X.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Ol=class Tr extends In{constructor(e,n,r,s,o,a){super(n,r,0,0),w(this,"_flagTexture",!1),w(this,"_flagColumns",!1),w(this,"_flagRows",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_texture",null),w(this,"_columns",1),w(this,"_rows",1),w(this,"_frameRate",0),w(this,"_index",0),w(this,"_origin",null),this._renderer.type="sprite";for(let l in Il)Object.defineProperty(this,l,Il[l]);this.noStroke(),this.noFill(),e instanceof Pe?this.texture=e:typeof e=="string"&&(this.texture=new Pe(e)),this.origin=new Q,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 Tr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Tr.Properties.length;n++){const r=Tr.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=K.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 Tr(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,h,u,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)){h=e.image.width,u=e.image.height,s=h/n,o=u/r,l=this._amount,this.width!==s&&(this.width=s),this.height!==o&&(this.height=o),this._playing&&this._frameRate>0&&(K.isNaN(this._lastFrame)&&(this._lastFrame=l-1),a=K.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=Nt(this._firstFrame,m,a/c),d=Math.floor(d),d!==this._index&&(this._index=d,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const f=this._index%n,g=Math.floor(this._index/n),p=-s*f+(h-s)/2,y=-o*g+(u-o)/2;p!==e.offset.x&&(e.offset.x=p),y!==e.offset.y&&(e.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}};w(Ol,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var Or=Ol,Il={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}}},Gs,zl=class extends An{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),el(this,Gs,{}),this.attach(e),this.on(X.Types.insert,this.attach),this.on(X.Types.remove,this.detach)}get ids(){return Tt(this,Gs)}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}};Gs=new WeakMap;var Ll=class Ci extends Se{constructor(e,n,r,s,o,a,l){const c=l||wt.Resolution*3,d=[];for(let h=0;h<c;h++)d.push(new ve);super(d,!0,!1,!0),w(this,"_flagStartAngle",!1),w(this,"_flagEndAngle",!1),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_startAngle",0),w(this,"_endAngle",at),w(this,"_innerRadius",0),w(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let h in Dl)Object.defineProperty(this,h,Dl[h]);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 Ci().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ci.Properties.length;n++){const r=Ci.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=Pt(e,at)===Pt(n,at),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,h=0,u,m,f,g,p,y,b,_,v;for(o?c--:a||(c-=2),u=0,m=c-1;u<c;u++){switch(f=u/m,g=l[h],p=f*(n-e)+e,y=(n-e)/c,b=s*Math.cos(p),_=s*Math.sin(p),u){case 0:d=te.move;break;default:d=te.curve}g.command=d,g.x=b,g.y=_,g.controls.left.clear(),g.controls.right.clear(),g.command===te.curve&&(v=s*y/Math.PI,g.controls.left.x=v*Math.cos(p-Ze),g.controls.left.y=v*Math.sin(p-Ze),g.controls.right.x=v*Math.cos(p+Ze),g.controls.right.y=v*Math.sin(p+Ze),u===1&&g.controls.left.multiplyScalar(2),u===m&&g.controls.right.multiplyScalar(2)),h++}if(a){for(o?(l[h].command=te.close,h++):(c--,m=c-1),u=0;u<c;u++)f=u/m,g=l[h],p=(1-f)*(n-e)+e,y=(n-e)/c,b=r*Math.cos(p),_=r*Math.sin(p),d=te.curve,u<=0&&(d=o?te.move:te.line),g.command=d,g.x=b,g.y=_,g.controls.left.clear(),g.controls.right.clear(),g.command===te.curve&&(v=r*y/Math.PI,g.controls.left.x=v*Math.cos(p+Ze),g.controls.left.y=v*Math.sin(p+Ze),g.controls.right.x=v*Math.cos(p-Ze),g.controls.right.y=v*Math.sin(p-Ze),u===1&&g.controls.left.multiplyScalar(2),u===m&&g.controls.right.multiplyScalar(2)),h++;l[h].copy(l[0]),l[h].command=te.line}else o||(l[h].command=te.line,l[h].x=0,l[h].y=0,h++,l[h].copy(l[0]),l[h].command=te.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 Ci(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<Se.Properties.length;c++){const d=Se.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<Ci.Properties.length;n++){const r=Ci.Properties[n];e[r]=this[r]}return e}};w(Ll,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var Ks=Ll,Dl={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}}},Zs=Math.cos,Qs=Math.sin,Hl=class Si extends Se{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),w(this,"_flagRadius",!1),w(this,"_radius",0),this._renderer.type="circle";for(let l in Wl)Object.defineProperty(this,l,Wl[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 Si().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Si.Properties.length;n++){const r=Si.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*at,c=r*Zs(l),d=r*Qs(l),h=s*Zs(l-Ze),u=s*Qs(l-Ze),m=s*Zs(l+Ze),f=s*Qs(l+Ze),g=this.vertices[o];g.command=o===0?te.move:te.curve,g.set(c,d),g.controls.left.set(h,u),g.controls.right.set(m,f)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=new Si(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<Se.Properties.length;r++){const s=Se.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<Si.Properties.length;n++){const r=Si.Properties[n];e[r]=this[r]}return e}};w(Hl,"Properties",["radius"]);var Ir=Hl,Wl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},Js=Math.cos,eo=Math.sin,jl=class Bi extends Se{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),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_width",0),w(this,"_height",0),this._renderer.type="ellipse";for(let c in ql)Object.defineProperty(this,c,ql[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 Bi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Bi.Properties.length;n++){const r=Bi.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*at,c=r*Js(l),d=s*eo(l),h=r*n*Js(l-Ze),u=s*n*eo(l-Ze),m=r*n*Js(l+Ze),f=s*n*eo(l+Ze),g=this.vertices[o];g.command=o===0?te.move:te.curve,g.set(c,d),g.controls.left.set(h,u),g.controls.right.set(m,f)}}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 Bi(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<Se.Properties.length;a++){const l=Se.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<Bi.Properties.length;n++){const r=Bi.Properties[n];e[r]=this[r]}return e}};w(jl,"Properties",["width","height"]);var zr=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}}},cm=Math.ceil,dm=Math.floor,Xl=class Un extends On{constructor(e){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagSize",!0),w(this,"_flagSizeAttenuation",!0),w(this,"_flagStrokeAttenuation",!0),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_size",1),w(this,"_sizeAttenuation",!1),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_dashes",null),w(this,"_strokeAttenuation",!0),w(this,"noFill",Se.prototype.noFill),w(this,"noStroke",Se.prototype.noStroke),w(this,"corner",Se.prototype.corner),w(this,"center",Se.prototype.center),w(this,"getBoundingClientRect",Se.prototype.getBoundingClientRect),w(this,"_updateLength",Se.prototype._updateLength);for(let n in Yl)Object.defineProperty(this,n,Yl[n]);this._renderer.type="points",this._renderer.flagVertices=El.bind(this),this._renderer.bindVertices=Nl.bind(this),this._renderer.unbindVertices=Pl.bind(this),this._renderer.flagFill=Fl.bind(this),this._renderer.flagStroke=Ml.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:Jn(e.fill),r=typeof e.stroke=="string"?e.stroke:Jn(e.stroke),s=new Un().copy(Os(Vs({},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<Un.Properties.length;n++){const r=Un.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Un;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<Un.Properties.length;r++){const s=Un.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()),K.each(Un.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,h=Ls(a,l,a,l,c,d,c,d,e);n=n.concat(h)}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=Ar(this,e*this._length),s=Ar(this,n*this._length),o=cm(r),a=dm(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}};w(Xl,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var to=Xl,Yl={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 Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.bind(X.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(X.Types.insert,e).unbind(X.Types.remove,n),t instanceof An?this._collection=t:this._collection=new An(t||[]),this._collection.bind(X.Types.insert,e).bind(X.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}}},hm=Math.cos,um=Math.sin,Ul=class Ti extends Se{constructor(e,n,r,s){s=Math.max(s||0,3),super(),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagSides",!1),w(this,"_radius",0),w(this,"_width",0),w(this,"_height",0),w(this,"_sides",0),this._renderer.type="polygon";for(let o in Gl)Object.defineProperty(this,o,Gl[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 Ti().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ti.Properties.length;n++){const r=Ti.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=at*o+Math.PI/2,l=this._width*hm(a)/2,c=this._height*um(a)/2;s>=r?this.vertices.push(new ve(l,c)):this.vertices[s].set(l,c),this.vertices[s].command=s===0?te.move:te.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 Ti(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<Se.Properties.length;r++){const s=Se.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<Ti.Properties.length;n++){const r=Ti.Properties[n];e[r]=this[r]}return e}};w(Ul,"Properties",["width","height","sides"]);var no=Ul,Gl={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}}},Kl=class Ri extends Se{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?te.move:te.curve));super(a),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagRadius",!1),w(this,"_width",0),w(this,"_height",0),w(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let l in Zl)Object.defineProperty(this,l,Zl[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=fm.bind(this),typeof r=="number"&&(this.width=r),typeof s=="number"&&(this.height=s),(typeof o=="number"||o instanceof Q)&&(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 Ri().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ri.Properties.length;n++){const r=Ri.Properties[n];if(r in e){const s=e[r];/radius/i.test(r)?this[r]=typeof s=="number"||s instanceof Q?s:new Q().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 Q?(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 Ri(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<Se.Properties.length;a++){const l=Se.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<Ri.Properties.length;n++){const r=Ri.Properties[n];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};w(Kl,"Properties",["width","height","radius"]);var Lr=Kl,Zl={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 Q&&this._radius.unbind(X.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof Q&&this._radius.bind(X.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function fm(){this._flagRadius=!0}var gm=Math.cos,mm=Math.sin,Ql=class $i extends Se{constructor(e,n,r,s,o){arguments.length<=3&&(s=r,r=s/2),(typeof o!="number"||o<=0)&&(o=5),super(),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_flagSides",!1),w(this,"_innerRadius",0),w(this,"_outerRadius",0),w(this,"_sides",0),this._renderer.type="star";for(let a in Jl)Object.defineProperty(this,a,Jl[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 $i().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<$i.Properties.length;n++){const r=$i.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=at*o,l=(s%2?this._outerRadius:this._innerRadius)/2,c=l*gm(a),d=l*mm(a);s>=r?this.vertices.push(new ve(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?te.move:te.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 $i(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<Se.Properties.length;a++){const l=Se.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<$i.Properties.length;n++){const r=$i.Properties[n];e[r]=this[r]}return e}};w(Ql,"Properties",["innerRadius","outerRadius","sides"]);var io=Ql,Jl={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}}},ro,ec=Math.min,tc=Math.max;He.document&&(ro=document.createElement("canvas"));var so=class It extends On{constructor(e,n,r,s){super(),w(this,"_flagValue",!0),w(this,"_flagFamily",!0),w(this,"_flagSize",!0),w(this,"_flagLeading",!0),w(this,"_flagAlignment",!0),w(this,"_flagBaseline",!0),w(this,"_flagStyle",!0),w(this,"_flagWeight",!0),w(this,"_flagDecoration",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_flagDirection",!0),w(this,"_flagStrokeAttenuation",!0),w(this,"_value",""),w(this,"_family","sans-serif"),w(this,"_size",13),w(this,"_leading",17),w(this,"_alignment","center"),w(this,"_baseline","middle"),w(this,"_style","normal"),w(this,"_weight",500),w(this,"_decoration","none"),w(this,"_direction","ltr"),w(this,"_fill","#000"),w(this,"_stroke","none"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null),w(this,"_strokeAttenuation",!0);for(let o in nc)Object.defineProperty(this,o,nc[o]);if(this._renderer.type="text",this._renderer.flagFill=pm.bind(this),this._renderer.flagStroke=ym.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,!K.isObject(s))return this;for(let o=0;o<It.Properties.length;o++){const a=It.Properties[o];a in s&&(this[a]=s[a])}}static Measure(e){if(ro){const n=ro.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*It.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:Jn(e.fill),r=typeof e.stroke=="string"?e.stroke:Jn(e.stroke),s=new It().copy(Os(Vs({},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<It.Properties.length;n++){const r=It.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new It(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let r=0;r<It.Properties.length;r++){const s=It.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<It.Properties.length;n++){const r=It.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}=It.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[h,u]=n.multiply(r,o),[m,f]=n.multiply(r,a),[g,p]=n.multiply(s,o),[y,b]=n.multiply(s,a);return o=ec(u,f,p,b),r=ec(h,m,g,y),s=tc(h,m,g,y),a=tc(u,f,p,b),{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}};w(so,"Ratio",.6),w(so,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var sn=so,nc={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 Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,K.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 pm(){this._flagFill=!0}function ym(){this._flagStroke=!0}var oo=class Qi extends In{constructor(e,n,r,s){super(n,r,0,0),w(this,"_flagTextures",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_index",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_textures",null),w(this,"_frameRate",0),w(this,"_origin",null),this._renderer.type="image-sequence";for(let o in ic)Object.defineProperty(this,o,ic[o]);this._renderer.flagTextures=bm.bind(this),this._renderer.bindTextures=_m.bind(this),this._renderer.unbindTextures=wm.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(rc.bind(this)):typeof e=="string"&&(this.textures=[rc(e)]),this.origin=new Q,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=Qi.DefaultFrameRate,this.index=0}static fromObject(e){const n=new Qi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Qi.Properties.length;n++){const r=Qi.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=K.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 Qi(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,K.isNaN(this._lastFrame)&&(this._lastFrame=o-1),s=K.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=Nt(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 Pe))&&(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}};w(oo,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),w(oo,"DefaultFrameRate",30);var ao=oo,ic={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(X.Types.insert,e).unbind(X.Types.remove,n),this._textures=new An((t||[]).slice(0)),this._textures.bind(X.Types.insert,e).bind(X.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 bm(){this._flagTextures=!0}function _m(t){let e=t.length;for(;e--;)t[e].bind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function wm(t){let e=t.length;for(;e--;)t[e].unbind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function rc(t){if(t instanceof Pe)return t;if(typeof t=="string")return new Pe(t)}var Dr=Math.min,Hr=Math.max,lo=class Gn extends On{constructor(e){super(),w(this,"_flagAdditions",!1),w(this,"_flagSubtractions",!1),w(this,"_flagOrder",!1),w(this,"_flagOpacity",!0),w(this,"_flagBeginning",!1),w(this,"_flagEnding",!1),w(this,"_flagLength",!1),w(this,"_flagMask",!1),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_length",0),w(this,"_mask",null),w(this,"_strokeAttenuation",!0);for(let n in sc)Object.defineProperty(this,n,sc[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++)oc.call(this,e[n],this)}static RemoveChildren(e){for(let n=0;n<e.length;n++)oc.call(this,e[n])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const n=new Gn;for(let s=0;s<Gn.Properties.length;s++){const o=Gn.Properties[s];o in e&&(/(fill|stroke)/i.test(o)?n[o]=typeof e[o]=="string"?e[o]:Jn(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 Ks.fromObject(s);case"circle":return Ir.fromObject(s);case"element":return Pi.fromObject(s);case"ellipse":return zr.fromObject(s);case"group":return Gn.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return ao.fromObject(s);case"path":return Se.fromObject(s);case"points":return to.fromObject(s);case"polygon":return no.fromObject(s);case"rectangle":return In.fromObject(s);case"rounded-rectangle":return Lr.fromObject(s);case"shape":return On.fromObject(s);case"sprite":return Or.fromObject(s);case"star":return io.fromObject(s);case"text":return sn.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<Gn.Properties.length;n++){const r=Gn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Gn,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,K.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,h=1/0,u=-1/0;const m=/texture|gradient/i;r=e?this.matrix:this.worldMatrix;for(let f=0;f<this.children.length;f++){const g=this.children[f];if(!(!g.visible||m.test(g._renderer.type))&&(n=g.getBoundingClientRect(e),s=typeof n.top!="number"||K.isNaN(n.top)||!isFinite(n.top),o=typeof n.left!="number"||K.isNaN(n.left)||!isFinite(n.left),a=typeof n.right!="number"||K.isNaN(n.right)||!isFinite(n.right),l=typeof n.bottom!="number"||K.isNaN(n.bottom)||!isFinite(n.bottom),!(s||o||a||l)))if(e){const[p,y]=r.multiply(n.left,n.top),[b,_]=r.multiply(n.right,n.top),[v,k]=r.multiply(n.left,n.bottom),[C,B]=r.multiply(n.right,n.bottom);h=Dr(y,_,k,B,h),c=Dr(p,b,v,C,c),d=Hr(p,b,v,C,d),u=Hr(y,_,k,B,u)}else h=Dr(n.top,h),c=Dr(n.left,c),d=Hr(n.right,d),u=Hr(n.bottom,u)}return{top:h,left:c,right:d,bottom:u,width:d-c,height:u-h}}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}};w(lo,"Children",zl),w(lo,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var nt=lo,sc={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=nt.InsertChildren.bind(this),n=nt.RemoveChildren.bind(this),r=nt.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new zl(t),this._children.bind(X.Types.insert,e),this._children.bind(X.Types.remove,n),this._children.bind(X.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,K.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 oc(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 Wr=class extends Se{constructor(e,n,r,s){const o=[new ve(e,n),new ve(r,s)];super(o);for(let a in ac)Object.defineProperty(this,a,ac[a]);this.vertices[0].command=te.move,this.vertices[1].command=te.line,this.automatic=!1}};w(Wr,"Properties",["left","right"]);var ac={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(K.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=te.move;else{const e=new Rt("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(K.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=te.line;else{const e=new Rt("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},on={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},xm={start:"left",middle:"center",end:"right"},lc=["id","class","transform","xmlns","viewBox"],vm=["x","y","width","height","href","xlink:href"];function km(t){return xm[t]}function Cm(t){const e=t.getAttribute("dominant-baseline"),n=t.getAttribute("alignment-baseline");return e||n}function rr(t){return t.replace(/svg:/gi,"").toLowerCase()}function cc(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 Sm(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 Bm(t){const e={},n=Tm(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 Tm(t){const e=t.getAttributeNames();for(let n=0;n<lc.length;n++){const r=lc[n],s=Array.prototype.indexOf.call(e,r);s>=0&&e.splice(s,1)}return e}function Rm(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 u=0;u<t.children.length;u++){const m=t.children[u];"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",h=typeof t.height=="number";return l&&(t.translation.x+=t.x),c&&(t.translation.y+=t.y),(d||h)&&(t.scale=new Q(1,1)),d&&(t.scale.x=t.width/o),h&&(t.scale.y=t.height/a),t.mask=new In(0,0,o,a),t.mask.origin.set(-o/2,-a/2),t}function Lt(t,e,n){const r={},s={},o={};let a,l,c,d,h,u,m,f,g,p,y,b,_,v,k,C,B;if(t===null)return r;if(He.getComputedStyle){const S=He.getComputedStyle(t);for(a=S.length;a--;)c=S[a],d=S[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<t.attributes.length;a++)u=t.attributes[a],/style/i.test(u.nodeName)?Sm(u.value,o):s[u.nodeName]=u.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&K.defaults(r,n),K.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=Qn(l),e._renderer.type){case"linear-gradient":cc(m,e.left),cc(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=Qn(l),e.translation.set(m.translateX,m.translateY),e.rotation=Math.PI*(m.rotation/180),e.scale=new Q(m.scaleX,m.scaleY),f=parseFloat((r.x+"").replace("px")),g=parseFloat((r.y+"").replace("px")),f&&(e.translation.x=f),g&&(e.translation.y=g);break;case"visible":if(e instanceof nt){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof nt){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof nt){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof nt){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof nt){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof nt){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(on.cssBackgroundImage.test(d)&&(p=d.replace(on.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(p)&&(b=ze.defs.current.get(p),b&&b.childNodes.length>0)))switch(b=b.childNodes[0],_=rr(b.nodeName),e.mask=ze[_].call(this,b,{}),e._renderer.type){case"text":case"path":e.position.add(e.mask.position),e.mask.position.clear();break}break;case"fill":case"stroke":h=(e instanceof nt?"_":"")+c,on.cssBackgroundImage.test(d)?(p=d.replace(on.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(p)?(b=ze.defs.current.get(p),b.object||(_=rr(b.nodeName),b.object=ze[_].call(this,b,{})),b=b.object):(y=Em(this),b=y.getById(p)),e[h]=b):e[h]=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(v=e instanceof Qe,k=e instanceof We,C=e instanceof je,v||k||C)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Rt("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof sn&&(e.family=d);break;case"font-size":e instanceof sn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Rt("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof sn&&(e.weight=d);break;case"font-style":e instanceof sn&&(e.style=d);break;case"text-decoration":e instanceof sn&&(e.decoration=d);break;case"line-height":e instanceof sn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function $m(t,e){for(let n=0,r=t.childNodes.length;n<r;n++){const s=t.childNodes[n];!s.id||rr(t.nodeName)==="#text"||e.add(s.id,s)}}function Em(t){for(;t.parent;)t=t.parent;return t.scene}var ze={svg:function(t){const e=ze.defs.current=new Fr,n=t.getElementsByTagName("defs");for(let g=0;g<n.length;g++)$m(n[g],e);const r=ze.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,h=o!==null,u=a!==null,m=l!==null,f=c!==null;return h&&(r.x=parseFloat(o.replace(on.unitSuffix,""))),u&&(r.y=parseFloat(a.replace(on.unitSuffix,""))),m&&(r.width=parseFloat(l.replace(on.unitSuffix,""))),f&&(r.height=parseFloat(c.replace(on.unitSuffix,""))),d&&Rm(r,s),delete ze.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 Rt("encountered <use /> with no href."),console.warn(n.name,n.message),null;const s=r.slice(1);if(!ze.defs.current.contains(s))return n=new Rt("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=ze.defs.current.get(s).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],h=vm.includes(d.nodeName),u=!a.hasAttribute(d.nodeName);(h||u)&&a.setAttribute(d.nodeName,d.value)}const l=rr(a.nodeName);return ze[l].call(this,a,e)},g:function(t,e){const n=new nt;Lt.call(this,t,n,e),this.add(n);const r=Bm.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=rr(l);if(c in ze){const d=ze[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 Se(r,!0);return s.stroke="none",s.fill="black",Lt.call(this,t,s,e),s},polyline:function(t,e){const n=ze.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,h=n.match(/[a-df-z][^a-df-z]*/gi);const u=h.length-1;K.each(h.slice(0),function(m,f){const g=m.slice(1).trim().match(on.path),p=m[0],y=p.toLowerCase();let b,_,v,k,C;const B=[];switch(f===0&&(h=[]),y){case"h":case"v":g.length>1&&(b=1);break;case"m":case"l":case"t":g.length>2&&(b=2);break;case"s":case"q":g.length>4&&(b=4);break;case"c":g.length>6&&(b=6);break;case"a":g.length>7&&(b=7);break}if(b){for(_=0,v=g.length,C=0;_<v;_+=b){if(k=p,C>0)switch(p){case"m":k="l";break;case"M":k="L";break}B.push(k+g.slice(_,_+b).join(" ")),C++}h=Array.prototype.concat.apply(h,B)}else h.push(m)}),K.each(h,function(m,f){let g,p,y;const b=m[0],_=b.toLowerCase();d=m.slice(1).trim().match(on.path),o=b===_;let v,k,C,B,S,T,$,E,O,I,A,L,D,ee,N,P,H;switch(_){case"z":if(f>=u)s=!0;else{p=l.x,y=l.y,g=new ve(p,y,void 0,void 0,void 0,void 0,te.close);for(let q=r.length-1;q>=0;q--){const Y=r[q];if(/m/i.test(Y.command)){l=Y;break}}}break;case"m":case"l":c=void 0,p=parseFloat(d[0]),y=parseFloat(d[1]),g=new ve(p,y,void 0,void 0,void 0,void 0,/m/i.test(_)?te.move:te.line),o&&g.addSelf(l),l=g;break;case"h":case"v":I=/h/i.test(_)?"x":"y",A=/x/i.test(I)?"y":"x",g=new ve(void 0,void 0,void 0,void 0,void 0,void 0,te.line),g[I]=parseFloat(d[0]),g[A]=l[A],o&&(g[I]+=l[I]),l=g;break;case"c":case"s":v=l.x,k=l.y,c||(c=new Q),/c/i.test(_)?(C=parseFloat(d[0]),B=parseFloat(d[1]),S=parseFloat(d[2]),T=parseFloat(d[3]),$=parseFloat(d[4]),E=parseFloat(d[5])):(O=Ds(l,c,o),C=O.x,B=O.y,S=parseFloat(d[0]),T=parseFloat(d[1]),$=parseFloat(d[2]),E=parseFloat(d[3])),o&&(C+=v,B+=k,S+=v,T+=k,$+=v,E+=k),l.controls.right.set(C-l.x,B-l.y),g=new ve($,E,S-$,T-E,void 0,void 0,te.curve),l=g,c=g.controls.left;break;case"t":case"q":v=l.x,k=l.y,c||(c=new Q),/q/i.test(_)?(C=parseFloat(d[0]),B=parseFloat(d[1]),S=parseFloat(d[0]),T=parseFloat(d[1]),$=parseFloat(d[2]),E=parseFloat(d[3])):(O=Ds(l,c,o),C=O.x,B=O.y,S=O.x,T=O.y,$=parseFloat(d[0]),E=parseFloat(d[1])),o&&(C+=v,B+=k,S+=v,T+=k,$+=v,E+=k),l.controls.right.set((C-l.x)*.33,(B-l.y)*.33),g=new ve($,E,S-$,T-E,void 0,void 0,te.curve),l=g,c=g.controls.left;break;case"a":v=l.x,k=l.y,D=parseFloat(d[0]),ee=parseFloat(d[1]),N=parseFloat(d[2]),P=parseFloat(d[3]),H=parseFloat(d[4]),$=parseFloat(d[5]),E=parseFloat(d[6]),o&&($+=v,E+=k),L=new ve($,E),L.command=te.arc,L.rx=D,L.ry=ee,L.xAxisRotation=N,L.largeArcFlag=P,L.sweepFlag=H,g=L,l=L,c=void 0;break}g&&(Array.isArray(g)?r=r.concat(g):r.push(g))})}n=new Se(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},K.each(n.vertices,function(l){l.subSelf(a.centroid)}),Lt.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 Ir(0,0,s);return o.stroke="none",o.fill="black",Lt.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 zr(0,0,s,o);return a.stroke="none",a.fill="black",Lt.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(!K.isNaN(n)||!K.isNaN(r))return ze["rounded-rect"](t);const s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new In(0,0,s,o);return c.stroke="none",c.fill="black",Lt.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 Q(n,r),d=new Lr(0,0,s,o,c);return d.stroke="none",d.fill="black",Lt.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 Wr(n,r,s,o).noFill();return Lt.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 h=[];for(let m=0;m<t.children.length;m++){const f=t.children[m];let g=f.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let p=f.getAttribute("stop-color"),y=f.getAttribute("stop-opacity"),b=f.getAttribute("style"),_;p===null&&(_=b?b.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,p=_&&_.length>1?_[1]:void 0),y===null?(_=b?b.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=_&&_.length>1?parseFloat(_[1]):1):y=parseFloat(y),h.push(new Vn(g,p,y))}const u=new We(s,o,a,l,h);return u.spread=r,u.units=n,Lt.call(this,t,u,e),u},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"));K.isNaN(l)&&(l=s),K.isNaN(c)&&(c=o);const d=Math.abs(s+l)/2,h=Math.abs(o+c)/2;/userSpaceOnUse/i.test(n)&&(s-=d,o-=h,l-=d,c-=h);const u=[];for(let f=0;f<t.children.length;f++){const g=t.children[f];let p=g.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let y=g.getAttribute("stop-color"),b=g.getAttribute("stop-opacity"),_=g.getAttribute("style"),v;y===null&&(v=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,y=v&&v.length>1?v[1]:void 0),b===null?(v=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=v&&v.length>1?parseFloat(v[1]):1):b=parseFloat(b),u.push(new Vn(p,y,b))}const m=new je(s,o,a,u,l,c);return m.spread=r,m.units=n,Lt.call(this,t,m,e),m},text:function(t,e){const n=km(t.getAttribute("text-anchor"))||"left",r=Cm(t)||"baseline";let s="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?s=t.childNodes[0].textContent:s=t.textContent;const o=new sn(s);return Lt.call(this,t,o,e),o.alignment=n,o.baseline=r,o},clippath:function(t,e){return ze.defs.current&&!ze.defs.current.contains(t.id)&&ze.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 Rt("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 Or(r,s,o);return K.isNaN(a)||(c.width=a),K.isNaN(l)||(c.height=l),Lt.call(this,t,c,e),c}};function dc(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 co=class bn extends In{constructor(e,n,r,s,o,a){super(n,r,s||1,o||1),w(this,"_flagTexture",!1),w(this,"_flagMode",!1),w(this,"_texture",null),w(this,"_mode","fill"),this._renderer.type="image";for(let l in uc)Object.defineProperty(this,l,uc[l]);this.noStroke(),this.noFill(),e instanceof Pe?this.texture=e:typeof e=="string"&&(this.texture=new Pe(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 Q(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}};w(co,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),w(co,"Properties",["texture","mode"]);var hc=co,uc={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}}},ho=[],uo=Math.max,Nm=Math.min,fc=Math.abs,jr=Math.sin,qr=Math.cos,Pm=Math.acos,Xr=Math.sqrt,Te={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 Te?t:"path"},group:{renderChild:function(t){const e=Te.getRendererType(t._renderer.type);Te[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;K.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=Yr(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=Te.getRendererType(r._renderer.type);Te[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=Te.getRendererType(l._renderer.type);Te[c].render.call(l,t)}return o&&t.restore(),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t,e,n){let r,s,o,a,l,c,d,h,u,m,f,g,p,y,b,_,v,k,C,B,S,T,$,E,O,I,A,L,D,ee,N,P,H,q;if(q=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,D=this._mask,ee=this._clip,l=this._opacity*(q||1),c=this._visible,!e&&(!c||ee||l===0))return this;if(K.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,h=this._join,u=this._miter,m=this._closed,f=this._renderer.vertices,g=f.length,p=g-1,N=Yr(r),H=this.dashes,N||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),D){const re=Te.getRendererType(D._renderer.type);Te[re].render.call(D,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const re=Te.getRendererType(a._renderer.type);Te[re].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const re=Te.getRendererType(s._renderer.type);Te[re].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=rn(this)),u&&(t.miterLimit=u),h&&(t.lineJoin=h),!m&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),H&&H.length>0&&(t.lineDashOffset=H.offset||0,t.setLineDash(H)),t.beginPath();let Y,F,M,Z,fe,ie,me;for(let re=0;re<g;re++)switch(_=f[re],A=_.x,L=_.y,_.command){case te.close:t.closePath();break;case te.arc:Y=_.rx,F=_.ry,M=_.xAxisRotation,Z=_.largeArcFlag,fe=_.sweepFlag,y=m?Pt(re-1,g):uo(re-1,0),b=f[y],ie=b.x,me=b.y,Te.renderSvgArcCommand(t,ie,me,Y,F,Z,fe,M,A,L);break;case te.curve:y=m?Pt(re-1,g):Math.max(re-1,0),b=f[y],$=b.controls&&b.controls.right||Q.zero,E=_.controls&&_.controls.left||Q.zero,b._relative?(S=$.x+b.x,T=$.y+b.y):(S=$.x,T=$.y),_._relative?(C=E.x+_.x,B=E.y+_.y):(C=E.x,B=E.y),t.bezierCurveTo(S,T,C,B,A,L),re>=p&&m&&(v=k,O=_.controls&&_.controls.right||Q.zero,I=v.controls&&v.controls.left||Q.zero,_._relative?(S=O.x+_.x,T=O.y+_.y):(S=O.x,T=O.y),v._relative?(C=I.x+v.x,B=I.y+v.y):(C=I.x,B=I.y),A=v.x,L=v.y,t.bezierCurveTo(S,T,C,B,A,L));break;case te.line:t.lineTo(A,L);break;case te.move:k=_,t.moveTo(A,L);break}return m&&t.closePath(),!ee&&!n&&(Te.isHidden.test(a)||(P=a._renderer&&a._renderer.offset,P&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),P&&t.restore()),Te.isHidden.test(s)||(P=s._renderer&&s._renderer.offset,P&&(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(),P&&t.restore())),N||t.restore(),ee&&!n&&t.clip(),H&&H.length>0&&t.setLineDash(ho),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,n){let r,s,o,a,l,c,d,h,u,m,f,g,p,y,b,_;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(K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,h=this._renderer.collection,u=h.length,p=Yr(r),b=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 C=Te.getRendererType(a._renderer.type);Te[C].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const C=Te.getRendererType(s._renderer.type);Te[C].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=rn(this))}typeof l=="number"&&(t.globalAlpha=l),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),t.beginPath();let v=d*.5,k;this._sizeAttenuation||(k=this.worldMatrix.elements,k=Qn(k[0],k[3],k[1],k[4],k[2],k[5]),v/=Math.max(k.scaleX,k.scaleY));for(let C=0;C<u;C++)m=h[C],f=m.x,g=m.y,t.moveTo(f+v,g),t.arc(f,g,v,0,at);return n||(Te.isHidden.test(a)||(y=a._renderer&&a._renderer.offset,y&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),y&&t.restore()),Te.isHidden.test(s)||(y=s._renderer&&s._renderer.offset,y&&(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(),y&&t.restore())),p||t.restore(),b&&b.length>0&&t.setLineDash(ho),K.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;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,h=this._linewidth,u=this._fill,m=this._decoration,f=this._direction,g=Yr(c),p=u._renderer&&u._renderer.offset&&d._renderer&&d._renderer.offset,y=this.dashes,b=Te.alignments[this._alignment]||this._alignment,_=Te.baselines[this._baseline]||this._baseline;let v,k,C,B,S,T,$,E,O,I,A;if(g||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const L=Te.getRendererType(a._renderer.type);Te[L].render.call(a,t,!0)}if(p||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=b,t.textBaseline=_,t.direction=f,u)if(typeof u=="string")t.fillStyle=u;else{const L=Te.getRendererType(u._renderer.type);Te[L].render.call(u,t,this),t.fillStyle=u._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const L=Te.getRendererType(d._renderer.type);Te[L].render.call(d,t,this),t.strokeStyle=d._renderer.effect}h&&(t.lineWidth=rn(this))}if(typeof s=="number"&&(t.globalAlpha=s),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),!l&&!n&&(Te.isHidden.test(u)||(u._renderer&&u._renderer.offset?(T=u._renderer.scale.x,$=u._renderer.scale.y,t.save(),t.translate(-u._renderer.offset.x,-u._renderer.offset.y),t.scale(T,$),v=this._size/u._renderer.scale.y,k=this._leading/u._renderer.scale.y,t.font=[this._style,this._weight,v+"px/",k+"px",this._family].join(" "),C=u._renderer.offset.x/u._renderer.scale.x,B=u._renderer.offset.y/u._renderer.scale.y,t.fillText(this.value,C,B),t.restore()):t.fillText(this.value,0,0)),Te.isHidden.test(d)||(d._renderer&&d._renderer.offset?(T=d._renderer.scale.x,$=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(T,$),v=this._size/d._renderer.scale.y,k=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,v+"px/",k+"px",this._family].join(" "),C=d._renderer.offset.x/d._renderer.scale.x,B=d._renderer.offset.y/d._renderer.scale.y,S=h/d._renderer.scale.x,t.lineWidth=S,t.strokeText(this.value,C,B),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(m)){const L=t.measureText(this.value);let D=1;switch(m){case"underline":O=L.actualBoundingBoxDescent,A=L.actualBoundingBoxDescent;break;case"strikethrough":O=0,A=0,D=.5;break}switch(_){case"top":O+=this._size*D,A+=this._size*D;break;case"baseline":case"bottom":O-=this._size*D,A-=this._size*D;break}switch(b){case"left":case"start":E=0,I=L.width;break;case"right":case"end":E=-L.width,I=0;break;default:E=-L.width/2,I=L.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo(E,O),t.lineTo(I,A),t.stroke()}return g||t.restore(),l&&!n&&t.clip(),y&&y.length>0&&t.setLineDash(ho),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(K.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 K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(K.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 K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){K.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 Q||(this._renderer.offset=new Q),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 Q?(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 Q||(this._renderer.scale=new Q),this._scale instanceof Q?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),K.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=fc(r),s=fc(s);const h=(e-c)/2,u=(n-d)/2,m=qr(l)*h+jr(l)*u,f=-jr(l)*h+qr(l)*u,g=m*m,p=f*f;let y=r*r,b=s*s;const _=g/y+p/b;if(_>1){const L=Xr(_);r=L*r,s=L*s,y=r*r,b=s*s}const v=y*p+b*g,k=(y*b-v)/v;let C=Xr(uo(0,k));o===a&&(C=-C);const B=C*r*f/s,S=-C*s*m/r,T=qr(l)*B-jr(l)*S+(e+c)/2,$=jr(l)*B+qr(l)*S+(n+d)/2,E=gc(1,0,(m-B)/r,(f-S)/s),O=gc((m-B)/r,(f-S)/s,(-m-B)/r,(-f-S)/s)%at,I=E+O;Fm(t,T,$,r,s,E,I,a===0,l)}},ct=class extends X{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 nt,this.scene.parent=this}setSize(t,e,n){return this.width=t,this.height=e,this.ratio=typeof n>"u"?Hs(this.ctx):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&K.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(X.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),Te.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};w(ct,"Utils",Te);function Fm(t,e,n,r,s,o,a,l,c){const d=a-o,h=Ei.Tolerance.epsilon,u=Math.abs(d)<h;let m=Pt(d,at);m<h&&(u?m=0:m=at),l===!0&&!u&&(m===at?m=-at:m=m-at);for(let f=0;f<wt.Resolution;f++){const g=f/(wt.Resolution-1),p=o+g*m;let y=e+r*Math.cos(p),b=n+s*Math.sin(p);if(c!==0){const _=Math.cos(c),v=Math.sin(c),k=y-e,C=b-n;y=k*_-C*v+e,b=k*v+C*_+n}t.lineTo(y,b)}}function gc(t,e,n,r){const s=t*n+e*r,o=Xr(t*t+e*e)*Xr(n*n+r*r);let a=Pm(uo(-1,Nm(1,s/o)));return t*r-e*n<0&&(a=-a),a}function Yr(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var oe={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(oe.ns,n);return n==="svg"&&(e=K.defaults(e||{},{version:oe.version})),e&&Object.keys(e).length>0&&oe.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(oe.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?Pt(a-1,n):Math.max(a-1,0),d=t[c];let h,u,m,f,g,p,y,b,_,v,k,C,B,S,T,$=Ne(l.x),E=Ne(l.y);switch(l.command){case te.close:h=te.close;break;case te.arc:k=l.rx,C=l.ry,B=l.xAxisRotation,S=l.largeArcFlag,T=l.sweepFlag,h=te.arc+" "+k+" "+C+" "+B+" "+S+" "+T+" "+$+" "+E;break;case te.curve:y=d.controls&&d.controls.right||Q.zero,b=l.controls&&l.controls.left||Q.zero,d.relative?(m=Ne(y.x+d.x),f=Ne(y.y+d.y)):(m=Ne(y.x),f=Ne(y.y)),l.relative?(g=Ne(b.x+l.x),p=Ne(b.y+l.y)):(g=Ne(b.x),p=Ne(b.y)),h=(a===0?te.move:te.curve)+" "+m+" "+f+" "+g+" "+p+" "+$+" "+E;break;case te.move:s=l,h=te.move+" "+$+" "+E;break;default:h=l.command+" "+$+" "+E}a>=r&&e&&(l.command===te.curve&&(u=s,_=l.controls&&l.controls.right||l,v=u.controls&&u.controls.left||u,l.relative?(m=Ne(_.x+l.x),f=Ne(_.y+l.y)):(m=Ne(_.x),f=Ne(_.y)),u.relative?(g=Ne(v.x+u.x),p=Ne(v.y+u.y)):(g=Ne(v.x),p=Ne(v.y)),$=Ne(u.x),E=Ne(u.y),h+=" C "+m+" "+f+" "+g+" "+p+" "+$+" "+E),l.command!==te.close&&(h+=" Z")),o+=h+" "}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+=te.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=oe.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&e.defs.appendChild(n),n},getRendererType:function(t){return t in oe?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=oe.getRendererType(t._renderer.type);oe[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=oe.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=oe.getRendererType(s._renderer.type);oe[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(oe.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(oe.group.removeChild,n),this._flagOrder&&this.children.forEach(oe.group.orderChild,n),this._flagMask)if(this._mask){const r=oe.getRendererType(this._mask._renderer.type);oe[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),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;K.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=oe.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=oe.getRendererType(this._fill._renderer.type);oe[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=oe.getRendererType(this._stroke._renderer.type);oe[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"]=rn(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?oe.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=oe.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=oe.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=oe.getRendererType(this._mask._renderer.type);oe[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;K.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=Qn(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=oe.pointsToString(this._renderer.collection,r);e.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=oe.getRendererType(this._fill._renderer.type);oe[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=oe.getRendererType(this._stroke._renderer.type);oe[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"]=rn(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?oe.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=oe.createElement("path",e),t.appendChild(this._renderer.elem)),K.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"]=oe.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=oe.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=oe.getRendererType(this._fill._renderer.type);oe[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=oe.getRendererType(this._stroke._renderer.type);oe[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"]=rn(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?oe.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=oe.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=oe.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=oe.getRendererType(this._mask._renderer.type);oe[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){K.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?oe.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=oe.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?oe.setAttributes(o._renderer.elem,a):o._renderer.elem=oe.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){K.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?oe.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=oe.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?oe.setAttributes(o._renderer.elem,a):o._renderer.elem=oe.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){K.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 Q?(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 Q?(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?oe.setAttributes(this._renderer.image,r):this._renderer.image=oe.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&oe.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=oe.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),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},mc=class extends X{constructor(t){super(),this.domElement=t.domElement||oe.createElement("svg"),this.scene=new nt,this.scene.parent=this,this.defs=oe.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,oe.setAttributes(this.domElement,{width:t,height:e}),this.trigger(X.Types.resize,t,e)}render(){return oe.group.render.call(this.scene,this.domElement),oe.defs.update(this.domElement),this}};w(mc,"Utils",oe);var Dt={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 Rt("unable to compile shader "+r+": "+o)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
|
|
40
|
+
***************************************************************************** */var Pr=function(){return Pr=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},Pr.apply(this,arguments)},Lf={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"}},_n={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ms=500,Df=(function(){function t(e,n){return this.core=e,this.$LG=n,this.settings=Pr(Pr({},Lf),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(_n.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),h=d.allowY,u=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),f,g,p=o-this.pageX,y=a-this.pageY;if(e-n>1){var b=(e-n)/Math.abs(n);p=(n<0?-p:p)+this.left*(b+(n<0?-1:1)),y=(n<0?-y:y)+this.top*(b+(n<0?-1:1)),f=p/b,g=y/b}else{var b=(e-n)*n;f=p*b,g=y*b}r&&(u?this.isBeyondPossibleLeft(f,m.minX)?f=m.minX:this.isBeyondPossibleRight(f,m.maxX)&&(f=m.maxX):e>1&&(f<m.minX?f=m.minX:f>m.maxX&&(f=m.maxX)),h?this.isBeyondPossibleTop(g,m.minY)?g=m.minY:this.isBeyondPossibleBottom(g,m.maxY)&&(g=m.maxY):e>1&&(g<m.minY?g=m.minY:g>m.maxY&&(g=m.maxY))),this.setZoomStyles({x:f,y:g,scale:e}),this.left=f,this.top=g,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)},Ms),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")}},Ms+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},Ms+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(_n.containerResize+".zoom "+_n.rotateRight+".zoom "+_n.rotateLeft+".zoom "+_n.flipHorizontal+".zoom "+_n.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(_n.beforeOpen+".zoom",function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(_n.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(_n.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 h=Math.max(1,s+-d*.02);e.scale=Math.round((h+Number.EPSILON)*100)/100;var u=e.scale-o;e.zoomImage(e.scale,Math.round((u+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 h=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),u={};u.x=this.left+a,u.y=this.top+l;var m=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(u.y,m.minY)?u.y=m.minY:this.isBeyondPossibleBottom(u.y,m.maxY)&&(u.y=m.maxY)),r&&(this.isBeyondPossibleLeft(u.x,m.minX)?u.x=m.minX:this.isBeyondPossibleRight(u.x,m.maxX)&&(u.x=m.maxX)),s?this.top=u.y:u.y=this.top,r?this.left=u.x:u.x=this.left,this.setZoomSwipeStyles(h,u),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 h=a.x-o.maxX;a.x=o.maxX+h/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,h=(this.containerRect.width-a)/2,u={minY:l,maxY:c,minX:d,maxX:h};return u},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,h,u=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(m){if(e.isImageSlide(e.core.index)&&(u=e.core.getSlideItem(e.core.index),(e.$LG(m.target).hasClass("lg-item")||u.get().contains(m.target))&&m.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){m.preventDefault(),l=new Date,e.core.touchAction="zoomSwipe",h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var f=e.getDragAllowedAxises(0);a=f.allowY,o=f.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")||u.get().contains(m.target))){m.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(m);var f=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(h,f))}}),this.core.$inner.on("touchend.lg",function(m){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(m.target).hasClass("lg-item")||u.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 f=c.valueOf()-l.valueOf();e.touchendZoom(n,r,o,a,f)}})},t.prototype.zoomDrag=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,u;this.core.outer.on("mousedown.lg.zoom",function(m){if(e.isImageSlide(e.core.index)){var f=e.core.getSlideItem(e.core.index);if(e.$LG(m.target).hasClass("lg-item")||f.get().contains(m.target)){c=new Date,u=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var g=e.getDragAllowedAxises(0);l=g.allowY,a=g.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(m.target).hasClass("lg-object")&&(a||l)&&(m.preventDefault(),n=e.getDragCords(m),h=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 f=e.getZoomSwipeCords(n,r,a,l,h);e.setZoomSwipeStyles(u,f)}}),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 f=d.valueOf()-c.valueOf();e.touchendZoom(n,r,a,l,f)}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 Hf={ref:"gallery-container",class:"lightgallery-wrapper"},Wf={},ja=i.defineComponent({...Wf,__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}),A.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",Hf,[i.renderSlot(o.$slots,"default")],512))}}),rt=class rt{static init(){rt.isInitialized||(rt.isInitialized=!0,rt.windowResizeHandler(),window.addEventListener("resize",rt.windowResizeHandler))}static destroy(){window.removeEventListener("resize",rt.windowResizeHandler),rt.isInitialized=!1}static getDeviceTypeByResolution(){const e=Y.AppConfigProvider.getConfig().deviceTypeByResolution;return window.innerWidth<e.tablet?Ue.phone:window.innerWidth<e.laptop?Ue.tablet:Ue.laptop}static initRefDependingOnDeviceResolution(e,n,r){const s=i.ref(r);return rt.setRefValueDependingOnDeviceResolution(s,e,n,r),rt.refsDependingOnDeviceResolution.push({r:s,phoneValue:e,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return rt.getDeviceTypeByResolution()===Ue.phone}static isTabletDevice(){return rt.getDeviceTypeByResolution()===Ue.tablet}static isLaptopDevice(){return rt.getDeviceTypeByResolution()===Ue.laptop}static setRefValueDependingOnDeviceResolution(e,n,r,s){switch(rt.getDeviceTypeByResolution()){case Ue.phone:e.value=n;break;case Ue.tablet:e.value=r;break;default:e.value=s;break}}static windowResizeHandler(){A.forEach(rt.refsDependingOnDeviceResolution,e=>{rt.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};x(rt,"isInitialized",!1),x(rt,"refsDependingOnDeviceResolution",[]);let bt=rt;const jf=["href"],qf=["src","alt"],Xf={},qa=i.defineComponent({...Xf,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[zf,Df],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(bt.getDeviceTypeByResolution()===Ue.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,h)=>{const u=Wa,m=z.NPopover;return i.openBlock(),i.createBlock(m,{trigger:"manual",show:n.value,class:"sc-image",placement:"top-start",onClickoutside:h[3]||(h[3]=()=>{r.value||(n.value=!1)})},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:"inline-flex",onClick:h[0]||(h[0]=f=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(u)])])]),default:i.withCtx(()=>[i.createVNode(ja,{settings:s.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:h[1]||(h[1]=()=>{r.value=!0}),onAfterClose:h[2]||(h[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.images,(f,g)=>(i.openBlock(),i.createElementBlock("a",{key:g,href:f.image},[i.createElementVNode("img",{src:f.preview,alt:`Изображение #${g+1}`},null,8,qf)],8,jf))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Yf={class:"flex flex-col text-sm"},Uf={},Gf=i.defineComponent({...Uf,__name:"product-stock-count",props:{product:{}},setup(t){return(e,n)=>{const r=Fs,s=z.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",Yf,[(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.quantityUnit),1))),128))])]),_:3})}}}),Kf={class:"flex flex-row justify-between"},Zf={key:0},Qf={class:"ml-2 align-sub"},Jf={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},eg={class:"@container"},tg={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},ng={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},ig={class:"text-sc-dark-grey"},rg={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},sg={class:"text-gray-600"},og={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},ag={key:3,class:"underline decoration-dashed"},lg={key:4,class:"sc-product-pack whitespace-nowrap"},cg={class:"text-gray-600"},dg={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},hg={class:"text-gray-600"},ug={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},fg={key:0},gg={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},mg={},tr=i.defineComponent({...mg,__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(()=>A.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>A.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,u;return(u=(h=n.product)==null?void 0:h.properties)==null?void 0:u.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>A.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return e({showProductImagesPreview:l}),(h,u)=>{var b,_,v,k,S;const m=Wa,f=z.NText,g=Ha,p=Fs,y=z.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",Kf,[i.createVNode(f,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>[i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&t.eventEmitter}),onClick:d},i.toDisplayString(t.product.name),3),t.product.onOrder?(i.openBlock(),i.createElementBlock("span",Zf," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",Qf,[t.product.images&&t.product.images.length>0?(i.openBlock(),i.createBlock(qa,{key:0,ref:"image-gallery",images:t.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",Jf,[i.createVNode(m)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]),_:1}),t.showProductAddToCartButton||t.showProductEditButton||t.showProductRequiredButton||((b=t.productContextButtonsConfig)==null?void 0:b.length)>0?(i.openBlock(),i.createBlock(g,{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",eg,[i.createElementVNode("div",tg,[t.product.supplierSku?(i.openBlock(),i.createElementBlock("div",ng,[u[0]||(u[0]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",ig,i.toDisplayString(t.product.supplierSku),1)])):i.createCommentVNode("",!0),t.showCode?(i.openBlock(),i.createElementBlock("span",rg,[u[1]||(u[1]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",sg,i.toDisplayString(t.product.code),1)])):i.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(i.openBlock(),i.createBlock(Gf,{key:2,product:t.product},{default:i.withCtx(()=>[i.createElementVNode("span",og,[u[2]||(u[2]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(p,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",ag," Нет в наличии ")),(v=(_=t.product)==null?void 0:_.properties)!=null&&v.pack?(i.openBlock(),i.createElementBlock("span",lg,[u[3]||(u[3]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",cg,i.toDisplayString((S=(k=t.product)==null?void 0:k.properties)==null?void 0:S.pack),1)])):i.createCommentVNode("",!0),t.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",dg,[u[4]||(u[4]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",hg,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(y,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",ug,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,B=>(i.openBlock(),i.createBlock(Er,{key:B.coefficient.slug,product:t.product,"cost-field-name":B.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(Er,{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",fg,[i.createElementVNode("ul",gg,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.product.id,slug:t.product.slug},(B,C)=>(i.openBlock(),i.createElementBlock("li",{key:C}," ("+i.toDisplayString(C)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.product.properties,(B,C)=>(i.openBlock(),i.createElementBlock("li",{key:C}," ("+i.toDisplayString(C)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),pg=(t,e,n)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>i.h(Er,{product:r,costFieldName:t,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),yg=(t,e)=>{if(t.length===0)return[];const n=[],r={};switch(A.isNil(e.isProductItemSelected)||n.push({key:"checkbox",title:"",className:"align-top",width:"32",render:s=>{var o,a;return i.h(z.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})}})}}),bt.getDeviceTypeByResolution()){case Ue.phone:case Ue.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(tr,{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(tr,{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&&(A.forEach(t,s=>{A.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),A.forEach(A.sortBy(r,["slug"]),s=>{n.push(pg(s.slug??"",s.name,e))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(Er,{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||!A.isNil(e.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(Ha,{product:s,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return n},bg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _g(t,e){return i.openBlock(),i.createElementBlock("svg",bg,[...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 Xa=i.markRaw({name:"ion-trash",render:_g}),wg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xg(t,e){return i.openBlock(),i.createElementBlock("svg",wg,[...e[0]||(e[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const Ya=i.markRaw({name:"ion-plus",render:xg}),vg={key:0,class:"flex w-fit items-center gap-2"},kg={key:1,class:"flex flex-wrap gap-1"},Cg={key:0},Sg={},nr=i.defineComponent({...Sg,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{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=z.NSpin;return t.isProductSearching?(i.openBlock(),i.createElementBlock("div",vg,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):t.product.isNewRec()?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",kg,[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),1),n.value?(i.openBlock(),i.createElementBlock("div",Cg,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)]))}}}),Bg={class:"flex flex-col gap-4"},Tg={class:"flex flex-col gap-2"},Rg={class:"mt-8 font-bold"},$g={class:"grid grow grid-cols-2 items-start gap-2"},Eg={class:"text-sm"},Ng={class:"font-medium"},Pg={key:0,class:"text-red-500"},Fg={key:2,class:"text-red-500 text-sm mb-2"},Mg={class:"flex flex-col gap-4"},Ag={key:0},Vg={class:"text-lg font-semibold"},Ig={class:"flex gap-3"},Og={},Ua=i.defineComponent({...Og,__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,{emit:e}){const n=t,r=e,s=i.ref(structuredClone(i.toRaw(n.value.configuratorParams))),o=i.ref(!1),a=i.computed(()=>{var y;const{length:m}=s.value,{quantity:f}=n.value,g=((y=n.value.product)==null?void 0:y.costRub)||0;if(!m||!f||g===0)return null;const p=m/100;return(g*f*p).toLocaleString("ru-ru",{minimumFractionDigits:2})}),l=i.computed(()=>A.reduce(s.value.linesWidths,(m,f)=>m+(f||0),0)),c=i.computed(()=>{const m=l.value;return m>=n.settings.stripMinWidth&&m<=n.settings.stripMaxWidth}),d=i.computed(()=>{const m=A.every(s.value.linesWidths,y=>!!(y&&y>0)),f=A.every(s.value.linesAngles,y=>!A.isNil(y)),g=!!(n.value.quantity&&n.value.quantity>0),p=s.value.length>0&&s.value.length>0;return m&&f&&g&&p&&c.value}),h=()=>{d.value&&(r("update:params",s.value),u("configuratorParams",s.value))},u=(m,f)=>{const g=new Y.CartItemBase(n.value);g[m]=f,r("update:value",g)};return i.watch(()=>n.value,m=>{s.value=A.cloneDeep(i.toRaw(m.configuratorParams))}),i.watch(()=>n.value.configuratorParams,m=>{s.value=A.cloneDeep(i.toRaw(m))},{deep:!0}),i.watch(()=>n.previewParams,m=>{s.value.linesWidths=m.linesWidths,s.value.linesAngles=m.linesAngles},{deep:!0}),(m,f)=>{const g=Ya,p=Xa,y=z.NInput;return i.openBlock(),i.createBlock(i.unref(z.NForm),{class:"grid gap-2 md:grid-cols-2 md:gap-6"},{default:i.withCtx(()=>{var b,_,v,k,S,B,C,T,$,E;return[i.createElementVNode("div",Bg,[f[9]||(f[9]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),t.settings.startTailConfigs&&t.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:s.value.startTailType,"onUpdate:value":[f[0]||(f[0]=I=>s.value.startTailType=I),h],options:t.settings.startTailConfigs.map(({label:I},O)=>({label:I,value:O})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Tg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value.linesAngles,(I,O)=>{var V,L,D,ee,N,P;return i.openBlock(),i.createElementBlock("div",{key:O,class:"flex items-start gap-2"},[i.createElementVNode("div",Rg,i.toDisplayString(O+1),1),i.createElementVNode("div",$g,[i.createVNode(i.unref(z.NFormItem),{label:"Ширина, мм",required:!0,feedback:((V=t.validation[`lines_widths[${O+1}]`])==null?void 0:V.feedback)||"","show-feedback":((L=t.validation[`lines_widths[${O+1}]`])==null?void 0:L.showFeedback)||!1,"validation-status":(D=t.validation[`lines_widths[${O+1}]`])==null?void 0:D.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:s.value.linesWidths[O],"onUpdate:value":[H=>s.value.linesWidths[O]=H,h],"show-button":!1,min:s.value.linesWidths.length>1?t.settings.minLineWidth:t.settings.stripMinWidth,max:t.settings.maxLineWidth,step:t.settings.lineWidthStep,validator:H=>!H||H>=(s.value.linesWidths.length>1?t.settings.minLineWidth:t.settings.stripMinWidth)&&H<=t.settings.maxLineWidth&&H%t.settings.lineWidthStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{label:"Угол сгиба, °",required:!0,feedback:((ee=t.validation[`lines_angles[${O+1}]`])==null?void 0:ee.feedback)||"","show-feedback":((N=t.validation[`lines_angles[${O+1}]`])==null?void 0:N.showFeedback)||!1,"validation-status":(P=t.validation[`lines_angles[${O+1}]`])==null?void 0:P.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:s.value.linesAngles[O],"onUpdate:value":[H=>s.value.linesAngles[O]=H,h],"show-button":!1,min:t.settings.minLineAngle,max:t.settings.maxLineAngle,step:t.settings.lineAngleStep,validator:H=>!H||H%t.settings.lineAngleStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"])]),i.createVNode(i.unref(z.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(z.NButton),{key:0,size:"medium",onClick:H=>r("click:add-line",O)},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,disabled:s.value.linesWidths.length===1,size:"medium",class:"ml-2",onClick:H=>r("click:remove-line",O)},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled","onClick"]))]),_:2},1024)])}),128))]),t.settings.endTailConfigs&&t.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:s.value.endTailType,"onUpdate:value":[f[1]||(f[1]=I=>s.value.endTailType=I),h],options:t.settings.endTailConfigs.map(({label:I},O)=>({label:I,value:O})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(nr,{"is-product-searching":t.isProductSearching,product:t.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",Eg,[i.createElementVNode("div",Ng,"Суммарная ширина участков: "+i.toDisplayString(l.value)+" мм",1),c.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Pg," Должна быть от "+i.toDisplayString(t.settings.stripMinWidth)+" до "+i.toDisplayString(t.settings.stripMaxWidth)+" мм ",1))]),d.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Fg," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((b=t.settings.allTemplates)==null?void 0:b.length)-1?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:3,type:"tertiary",class:"self-start",loading:o.value,onClick:f[2]||(f[2]=I=>r("click:save-template"))},{default:i.withCtx(()=>[...f[8]||(f[8]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Mg,[i.createVNode(i.unref(z.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:s.value.colorSide,"onUpdate:value":[f[3]||(f[3]=I=>s.value.colorSide=I),h],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":((_=t.validation.length)==null?void 0:_.showFeedback)||!1,feedback:((v=t.validation.length)==null?void 0:v.feedback)||"","validation-status":(k=t.validation.length)==null?void 0:k.validationStatus,label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:s.value.length,"onUpdate:value":[f[4]||(f[4]=I=>s.value.length=I),h],required:!0,"show-button":!1,max:t.settings.stripMaxLength||void 0,min:t.settings.stripMinLength,step:t.settings.lengthStep,validator:I=>!I||I%t.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]),_:1},8,["show-feedback","feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":((S=t.validation.quantity)==null?void 0:S.showFeedback)||!1,feedback:((B=t.validation.quantity)==null?void 0:B.feedback)||"","validation-status":(C=t.validation.quantity)==null?void 0:C.validationStatus,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,"onUpdate:value":f[5]||(f[5]=I=>t.value.quantity=I),min:1,"show-button":!1,validator:I=>Number.isInteger(I),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{required:!1,"show-feedback":((T=t.validation.marker)==null?void 0:T.showFeedback)||!1,feedback:(($=t.validation.marker)==null?void 0:$.feedback)||"","validation-status":(E=t.validation.marker)==null?void 0:E.validationStatus,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(y,{value:t.value.marker,"onUpdate:value":f[6]||(f[6]=I=>t.value.marker=I),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["show-feedback","feedback","validation-status"]),a.value?(i.openBlock(),i.createElementBlock("div",Ag,[f[10]||(f[10]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Vg,i.toDisplayString(a.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",Ig,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!d.value,type:"primary",class:"self-start",onClick:f[7]||(f[7]=I=>r("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1})}}});var Ga=Object.defineProperty,zg=Object.defineProperties,Lg=Object.getOwnPropertyDescriptors,Ka=Object.getOwnPropertySymbols,Dg=Object.prototype.hasOwnProperty,Hg=Object.prototype.propertyIsEnumerable,Za=t=>{throw TypeError(t)},As=(t,e,n)=>e in t?Ga(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Vs=(t,e)=>{for(var n in e||(e={}))Dg.call(e,n)&&As(t,n,e[n]);if(Ka)for(var n of Ka(e))Hg.call(e,n)&&As(t,n,e[n]);return t},Is=(t,e)=>zg(t,Lg(e)),Qa=(t,e)=>{for(var n in e)Ga(t,n,{get:e[n],enumerable:!0})},w=(t,e,n)=>As(t,typeof e!="symbol"?e+"":e,n),Ja=(t,e,n)=>e.has(t)||Za("Cannot "+n),Tt=(t,e,n)=>(Ja(t,e,"read from private field"),n?n.call(t):e.get(t)),el=(t,e,n)=>e.has(t)?Za("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Wg=(t,e,n,r)=>(Ja(t,e,"write to private field"),e.set(t,n),n),_t={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 _t.shim(t),typeof e<"u"&&(_t.Image=e),_t.isHeadless=!0,t}},tl={};Qa(tl,{Curve:()=>Ei,getAnchorsFromArcData:()=>Xg,getComponentOnCubicBezier:()=>ir,getControlPoints:()=>ul,getCurveBoundingBox:()=>cl,getCurveFromPoints:()=>hl,getCurveLength:()=>ll,getReflection:()=>Ds,integrate:()=>dl,subdivide:()=>Ls});var nl={};Qa(nl,{HALF_PI:()=>Ze,NumArray:()=>nn,TWO_PI:()=>at,decomposeMatrix:()=>Qn,getComputedMatrix:()=>Os,getEffectiveStrokeWidth:()=>rn,getPoT:()=>sl,lerp:()=>Nt,mod:()=>Pt,setMatrix:()=>rl,toFixed:()=>Ne});var He;typeof window<"u"?He=window:typeof global<"u"?He=global:typeof self<"u"&&(He=self);var il,at=Math.PI*2,Ze=Math.PI*.5;function Qn(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 rl(t){il=t}function Os(t,e){e=e&&e.identity()||new il;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 Nt(t,e,n){return n*(e-t)+t}var zs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function sl(t){let e=0;for(;zs[e]&&zs[e]<t;)e++;return zs[e]}function Pt(t,e){for(;t<0;)t+=e;return t%e}var nn=He.Float32Array||Array,jg=Math.floor;function Ne(t){return jg(t*1e6)/1e6}function rn(t,e){const n=t._linewidth;if(t.strokeAttenuation)return n;e||(e=t.worldMatrix||Os(t));const r=Qn(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 te={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},X=class{constructor(){w(this,"_events",{}),w(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 h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}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}};w(X,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),w(X,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var ol={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(X.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(X.Types.change))}}},qt=class Zi extends X{constructor(e=0,n=0){super(),w(this,"_x",0),w(this,"_y",0);for(let r in ol)Object.defineProperty(this,r,ol[r]);this.x=e,this.y=n}static add(e,n){return new Zi(e.x+n.x,e.y+n.y)}static sub(e,n){return new Zi(e.x-n.x,e.y-n.y)}static subtract(e,n){return Zi.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(Zi.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 Zi(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:Ne(this.x),y:Ne(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}};w(qt,"zero",new qt),w(qt,"left",new qt(-1,0)),w(qt,"right",new qt(1,0)),w(qt,"up",new qt(0,-1)),w(qt,"down",new qt(0,1));var Q=qt,ve=class Ns extends Q{constructor(e=0,n=0,r=0,s=0,o=0,a=0,l=te.move){super(e,n),w(this,"controls",{left:new Q,right:new Q}),w(this,"_command",te.move),w(this,"_relative",!0),w(this,"_rx",0),w(this,"_ry",0),w(this,"_xAxisRotation",0),w(this,"_largeArcFlag",0),w(this,"_sweepFlag",1);for(let d in al)Object.defineProperty(this,d,al[d]);this.command=l,this.relative=!0;const c=Ns.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(X.Types.change,c),this.controls.right.set(o,a).addEventListener(X.Types.change,c)}static makeBroadcast(e){return n;function n(){e._bound&&e.dispatchEvent(X.Types.change)}}static fromObject(e){return new Ns().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 Ns().copy(this)}toObject(){return{x:Ne(this.x),y:Ne(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Ne(this.rx),ry:Ne(this.ry),xAxisRotation:Ne(this.xAxisRotation),largeArcFlag:Ne(this.largeArcFlag),sweepFlag:Ne(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},al={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(X.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(X.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(X.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(X.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(X.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(X.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(X.Types.change))}}},qg=0,wt={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 qg++}},Ei={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 ir(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 Ls(t,e,n,r,s,o,a,l,c){c=c||Ei.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new ve(a,l)];const h=[];for(let u=0;u<d;u++){const m=u/d,f=ir(m,t,n,s,a),g=ir(m,e,r,o,l);h.push(new ve(f,g))}return h}function ll(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const y=a-t,b=l-e;return Math.sqrt(y*y+b*b)}const d=9*(n-s)+3*(a-t),h=6*(t+s)-12*n,u=3*(n-t),m=9*(r-o)+3*(l-e),f=6*(e+o)-12*r,g=3*(r-e);function p(y){const b=(d*y+h)*y+u,_=(m*y+f)*y+g;return Math.sqrt(b*b+_*_)}return dl(p,0,1,c||Ei.RecursionLimit)}function cl(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,m,f,g,p,y,b;for(let S=0;S<2;++S){if(S===0?(u=6*t-12*n+6*s,h=-3*t+9*n-9*s+3*a,m=3*n-3*t):(u=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(h)<.001){if(Math.abs(u)<.001)continue;f=-m/u,0<f&&f<1&&c.push(f);continue}y=u*u-4*m*h,b=Math.sqrt(y),!(y<0)&&(g=(-u+b)/(2*h),0<g&&g<1&&c.push(g),p=(-u-b)/(2*h),0<p&&p<1&&c.push(p))}let _=c.length,v=_,k;for(;_--;)f=c[_],k=1-f,d[0][_]=k*k*k*t+3*k*k*f*n+3*k*f*f*s+f*f*f*a,d[1][_]=k*k*k*e+3*k*k*f*r+3*k*f*f*o+f*f*f*l;return d[0][v]=t,d[1][v]=e,d[0][v+1]=a,d[1][v+1]=l,d[0].length=d[1].length=v+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 dl(t,e,n,r){let s=Ei.abscissas[r-2],o=Ei.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,h=r&1?o[c++]*t(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(t(l+u)+t(l-u))}return a*h}function hl(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Pt(s-1,n):Math.max(s-1,0),l=e?Pt(s+1,n):Math.min(s+1,r),c=t[a],d=o,h=t[l];ul(c,d,h),d.command=s===0?te.move:te.curve}}function ul(t,e,n){const r=Q.angleBetween(t,e),s=Q.angleBetween(n,e);let o=Q.distanceBetween(t,e),a=Q.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+=Ze:l-=Ze,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 Ds(t,e,n){return new Q(2*t.x-(e.x+t.x)-(n?t.x:0),2*t.y-(e.y+t.y)-(n?t.y:0))}function Xg(t,e,n,r,s,o,a){const l=wt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,u=n*Math.cos(h),m=r*Math.sin(h),f=new ve(u,m);f.command=te.line}}var fl=Array.prototype.slice;function Yg(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var K={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=fl.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=fl.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=!Yg(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:He.performance&&He.performance.now?He.performance:Date},Ft={hasEventListeners:typeof He.addEventListener=="function",bind:function(t,e,n,r){return this.hasEventListeners?t.addEventListener(e,n,!!r):t.attachEvent("on"+e,n),Ft},unbind:function(t,e,n,r){return Ft.hasEventListeners?t.removeEventListeners(e,n,!!r):t.detachEvent("on"+e,n),Ft},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,n=He.requestAnimationFrame;if(!n){for(let s=0;s<t.length;s++)n=He[t[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=He.setTimeout(d,l);e=a+l;function d(){s(a+l)}return c}return n}},Ni=He.document?He.document.createElement("div"):{};Ni.id="help-two-load",Object.defineProperty(Ft,"temp",{enumerable:!0,get:function(){return K.isElement(Ni)&&!He.document.head.contains(Ni)&&(Ni.style.display="none",He.document.head.appendChild(Ni)),Ni}});var Rt=class extends Error{constructor(e){super(),w(this,"name","Two.js"),w(this,"message"),this.message=e}},Ug=He.devicePixelRatio||1;function Gg(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function Hs(t){return Ug/Gg(t)}var Fr=class{constructor(){w(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}},lt,An=class extends Array{constructor(){super(),el(this,lt,new X),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 Tt(this,lt)}set _events(e){Wg(this,lt,e)}get _bound(){return Tt(this,lt)._bound}set _bound(e){Tt(this,lt)._bound=e}addEventListener(){return Tt(this,lt).addEventListener.apply(this,arguments)}on(){return Tt(this,lt).on.apply(this,arguments)}bind(){return Tt(this,lt).bind.apply(this,arguments)}removeEventListener(){return Tt(this,lt).removeEventListener.apply(this,arguments)}off(){return Tt(this,lt).off.apply(this,arguments)}unbind(){return Tt(this,lt).unbind.apply(this,arguments)}dispatchEvent(){return Tt(this,lt).dispatchEvent.apply(this,arguments)}trigger(){return Tt(this,lt).trigger.apply(this,arguments)}listen(){return Tt(this,lt).listen.apply(this,arguments)}ignore(){return Tt(this,lt).ignore.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(X.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(X.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(X.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(X.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(X.Types.remove,e),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(X.Types.insert,n),this.trigger(X.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(X.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(X.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}};lt=new WeakMap;var gl=class Mu extends X{constructor(){super(),w(this,"_flagId",!1),w(this,"_flagClassName",!1),w(this,"_renderer",{}),w(this,"_id",wt.Identifier+wt.uniqueId()),w(this,"_className",""),w(this,"classList",[]);for(let e in ml)Object.defineProperty(this,e,ml[e])}static fromObject(e){const n=new Mu().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}};w(gl,"Properties",["renderer","id","className"]);var Pi=gl,ml={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)}}},Mr,pl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};He.document&&(Mr=document.createElement("a"));var Xt=class Vt extends Pi{constructor(e,n){super(),w(this,"_flagSrc",!1),w(this,"_flagImage",!1),w(this,"_flagVideo",!1),w(this,"_flagLoaded",!1),w(this,"_flagRepeat",!1),w(this,"_flagOffset",!1),w(this,"_flagScale",!1),w(this,"_src",""),w(this,"_image",null),w(this,"_loaded",!1),w(this,"_repeat","no-repeat"),w(this,"_scale",1),w(this,"_offset",null);for(let r in yl)Object.defineProperty(this,r,yl[r]);if(this._renderer.type="texture",this._renderer.flagOffset=Kg.bind(this),this._renderer.flagScale=Zg.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new Q,typeof n=="function"){const r=(function(){this.unbind(X.Types.load,r),typeof n=="function"&&n()}).bind(this);this.bind(X.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 Vt().copy(e);return"id"in e&&(n.id=e.id),n}static getAbsoluteURL(e){return Mr?(Mr.href=e,Mr.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=Vt.getAbsoluteURL(e);if(Vt.ImageRegistry.contains(n))return Vt.ImageRegistry.get(n);let r;return _t.Image?(r=new _t.Image,_t.shim(r,"img")):He.document?pl.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=Vt.getTag(r);e._flagImage&&(/canvas/i.test(s)?Vt.Register.canvas(e,n):(e._src=!_t.isHeadless&&r.getAttribute("two-src")||r.src,Vt.Register[s](e,n))),e._flagSrc&&(r||(r=Vt.getImage(e.src),e.image=r),s=Vt.getTag(r),Vt.Register[s](e,n))}clone(){const e=new Vt(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 Q?e.offset:new Q().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof Q?e.scale:new Q().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(X.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Vt.load(this,(function(){this.loaded=!0,this.trigger(X.Types.change).trigger(X.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}};w(Xt,"Properties",["src","loaded","repeat","scale","offset","image"]),w(Xt,"RegularExpressions",pl),w(Xt,"ImageRegistry",new Fr),w(Xt,"Register",{canvas:function(t,e){t._src="#"+t.id,Xt.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const n=t.image,r=function(o){!_t.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!_t.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new Rt("unable to load "+t.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!_t.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),t._src=Xt.getAbsoluteURL(t._src),!(!_t.isHeadless&&n&&n.getAttribute("two-src"))&&(_t.isHeadless||n.setAttribute("two-src",t.src),Xt.ImageRegistry.add(t.src,n),_t.isHeadless?Xt.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(_t.isHeadless)throw new Rt("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 Rt("unable to load "+t.src)};t._src=Xt.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),Xt.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 Pe=Xt,yl={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=Pe.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Pe.ImageRegistry.contains(n)?this._image=Pe.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(X.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(X.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof Q&&this._scale.unbind(X.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof Q&&this._scale.bind(X.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Kg(){this._flagOffset=!0}function Zg(){this._flagScale=!0}var Ws=class tn extends Pi{constructor(e,n,r){super(),w(this,"_flagOffset",!0),w(this,"_flagOpacity",!0),w(this,"_flagColor",!0),w(this,"_offset",0),w(this,"_opacity",1),w(this,"_color","#fff");for(let s in bl)Object.defineProperty(this,s,bl[s]);this._renderer.type="stop",this.offset=typeof e=="number"?e:tn.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof n=="string"?n:tn.Index<=0?"#fff":"#000",tn.Index=(tn.Index+1)%2}static fromObject(e){const n=new tn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<tn.Properties.length;n++){const r=tn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new tn;return K.each(tn.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",K.each(tn.Properties,n=>{e[n]=this[n]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};w(Ws,"Index",0),w(Ws,"Properties",["offset","opacity","color"]);var Vn=Ws,bl={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)}}},js=class vi extends Pi{constructor(e){super(),w(this,"_flagStops",!1),w(this,"_flagSpread",!1),w(this,"_flagUnits",!1),w(this,"_spread",""),w(this,"_units","");for(let n in _l)Object.defineProperty(this,n,_l[n]);this._renderer.type="gradient",this._renderer.flagStops=Qg.bind(this),this._renderer.bindStops=Jg.bind(this),this._renderer.unbindStops=em.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 Vn?s:new Vn().copy(s)));const r=new vi(n).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const n=this.stops.map(s=>s.clone()),r=new vi(n);return K.each(vi.Properties,s=>{r[s]=this[s]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let n=0;n<vi.Properties.length;n++){const r=vi.Properties[n];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(n=>n.toObject())};return K.each(vi.Properties,n=>{e[n]=this[n]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(X.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}};w(js,"Stop",Vn),w(js,"Properties",["spread","stops","units"]);var Qe=js,_l={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(X.Types.insert,e).unbind(X.Types.remove,n),this._stops=new An((t||[]).slice(0)),this._stops.bind(X.Types.insert,e).bind(X.Types.remove,n),e(this._stops)}}};function Qg(){this._flagStops=!0}function Jg(t){let e=t.length;for(;e--;)t[e].bind(X.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function em(t){let e=t.length;for(;e--;)t[e].unbind(X.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var qs=class Sr extends Qe{constructor(e,n,r,s,o){super(o),w(this,"_flagEndPoints",!1),w(this,"_left",null),w(this,"_right",null);for(let a in wl)Object.defineProperty(this,a,wl[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=tm.bind(this),this.left=new Q,this.right=new Q,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 Sr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Sr.Properties.length;n++){const r=Sr.Properties[n];r in e&&(this[r]=e[r]instanceof Q?e[r]:new Q().copy(e[r]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new Sr(this.left._x,this.left._y,this.right._x,this.right._y,n);return K.each(Qe.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(X.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};w(qs,"Stop",Vn),w(qs,"Properties",["left","right"]);var We=qs,wl={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof Q&&this._left.unbind(X.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(X.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof Q&&this._right.unbind(X.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(X.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function tm(){this._flagEndPoints=!0}var Xs=class ki extends Qe{constructor(e,n,r,s,o,a){super(s),w(this,"_flagRadius",!1),w(this,"_flagCenter",!1),w(this,"_flagFocal",!1),w(this,"_radius",0),w(this,"_center",null),w(this,"_focal",null);for(let l in xl)Object.defineProperty(this,l,xl[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=nm.bind(this),this._renderer.flagFocal=im.bind(this),this.center=new Q,this.radius=typeof r=="number"?r:1,this.focal=new Q,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 ki().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<ki.Properties.length;n++){const r=ki.Properties[n];r in e&&(/(center|focal)i/.test(r)?this[r]=e[r]instanceof Q?e[r]:new Q().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 ki(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return K.each(Qe.Properties.concat(ki.Properties),function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return K.each(ki.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(X.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};w(Xs,"Stop",Vn),w(Xs,"Properties",["center","radius","focal"]);var je=Xs,xl={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(X.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(X.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(X.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(X.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function nm(){this._flagCenter=!0}function im(){this._flagFocal=!0}function vl(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 Ar(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 kl(t,e,n){let r,s,o,a,l,c,d,h;const u=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(u||e).x,c=(u||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,u&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),ll(r,l,s,c,o,d,a,h,n)}function Cl(t,e,n){let r,s,o,a,l,c,d,h;const u=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(u||e).x,c=(u||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,u&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),Ls(r,l,s,c,o,d,a,h,n)}function Jn(t){switch(t.renderer.type){case"texture":return Pe.fromObject(t);case"gradient":return Qe.fromObject(t);case"linear-gradient":return We.fromObject(t);case"radial-gradient":return je.fromObject(t)}return t}var rm=Math.cos,sm=Math.sin,Sl=Math.tan,Ys=[],Bl=class It extends X{constructor(e,n,r,s,o,a){super(),w(this,"elements",new nn(9)),w(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 B=e;let C,T,$;const E=n[0]||0,I=n[1]||0,O=n[2]||0;return C=B[0]*E+B[1]*I+B[2]*O,T=B[3]*E+B[4]*I+B[5]*O,$=B[6]*E+B[7]*I+B[8]*O,[C,T,$]}const s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],h=e[6],u=e[7],m=e[8],f=n[0],g=n[1],p=n[2],y=n[3],b=n[4],_=n[5],v=n[6],k=n[7],S=n[8];return r=r||new nn(9),r[0]=s*f+o*y+a*v,r[1]=s*g+o*b+a*k,r[2]=s*p+o*_+a*S,r[3]=l*f+c*y+d*v,r[4]=l*g+c*b+d*k,r[5]=l*p+c*_+d*S,r[6]=h*f+u*y+m*v,r[7]=h*g+u*b+m*k,r[8]=h*p+u*_+m*S,r}static fromObject(e){return new It().copy(e)}set(e,n,r,s,o,a,l,c,d){if(typeof n>"u"){const h=e;e=h[0],n=h[1],r=h[2],s=h[3],o=h[4],a=h[5],l=h[6],c=h[7],d=h[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(X.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(X.Types.change)}identity(){return this.elements[0]=It.Identity[0],this.elements[1]=It.Identity[1],this.elements[2]=It.Identity[2],this.elements[3]=It.Identity[3],this.elements[4]=It.Identity[4],this.elements[5]=It.Identity[5],this.elements[6]=It.Identity[6],this.elements[7]=It.Identity[7],this.elements[8]=It.Identity[8],this.trigger(X.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(X.Types.change);if(typeof r>"u"&&(r=1),typeof s>"u"){e=e||0,n=n||0,r=r||0,o=this.elements;const L=o[0]*e+o[1]*n+o[2]*r,D=o[3]*e+o[4]*n+o[5]*r,ee=o[6]*e+o[7]*n+o[8]*r;return[L,D,ee]}const h=this.elements,u=[e,n,r,s,o,a,l,c,d],m=h[0],f=h[1],g=h[2],p=h[3],y=h[4],b=h[5],_=h[6],v=h[7],k=h[8],S=u[0],B=u[1],C=u[2],T=u[3],$=u[4],E=u[5],I=u[6],O=u[7],V=u[8];return this.elements[0]=m*S+f*T+g*I,this.elements[1]=m*B+f*$+g*O,this.elements[2]=m*C+f*E+g*V,this.elements[3]=p*S+y*T+b*I,this.elements[4]=p*B+y*$+b*O,this.elements[5]=p*C+y*E+b*V,this.elements[6]=_*S+v*T+k*I,this.elements[7]=_*B+v*$+k*O,this.elements[8]=_*C+v*E+k*V,this.trigger(X.Types.change)}inverse(e){const n=this.elements;e=e||new It;const r=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],d=n[6],h=n[7],u=n[8],m=u*l-c*h,f=-u*a+c*d,g=h*a-l*d;let p=r*m+s*f+o*g;return p?(p=1/p,e.elements[0]=m*p,e.elements[1]=(-u*s+o*h)*p,e.elements[2]=(c*s-o*l)*p,e.elements[3]=f*p,e.elements[4]=(u*r-o*d)*p,e.elements[5]=(-c*r+o*a)*p,e.elements[6]=g*p,e.elements[7]=(-h*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=rm(e),r=sm(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=Sl(e);return this.multiply(1,n,0,0,1,0,0,0,1)}skewY(e){const n=Sl(e);return this.multiply(1,0,0,n,1,0,0,0,1)}toString(e){return Ys.length=0,this.toTransformArray(e,Ys),Ys.map(Ne).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],h=r[5];if(e){const u=r[6],m=r[7],f=r[8];if(s){n[0]=o,n[1]=c,n[2]=u,n[3]=a,n[4]=d,n[5]=m,n[6]=l,n[7]=h,n[8]=f;return}return[o,c,u,a,d,m,l,h,f]}if(s){n[0]=o,n[1]=c,n[2]=a,n[3]=d,n[4]=l,n[5]=h;return}return[o,c,a,d,l,h]}toArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],h=r[5];if(e){const u=r[6],m=r[7],f=r[8];if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=h,n[6]=u,n[7]=m,n[8]=f;return}return[o,a,l,c,d,h,u,m,f]}if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=h;return}return[o,a,l,c,d,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new It().copy(this)}};w(Bl,"Identity",[1,0,0,0,1,0,0,0,1]);var Fi=Bl;rl(Fi);var Tl=class Va extends Pi{constructor(){super(),w(this,"_flagMatrix",!0),w(this,"_flagScale",!1),w(this,"_matrix",null),w(this,"_worldMatrix",null),w(this,"_position",null),w(this,"_rotation",0),w(this,"_scale",1),w(this,"_skewX",0),w(this,"_skewY",0);for(let e in Vr)Object.defineProperty(this,e,Vr[e]);this._renderer.flagMatrix=Rl.bind(this),this.isShape=!0,this.matrix=new Fi,this.worldMatrix=new Fi,this.position=new Q,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const n=new Va().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 Vr.position.get.apply(this,arguments)}set translation(e){Vr.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 Q?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 Q?e.scale:new Q(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 Va;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 Q?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 Q?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}};w(Tl,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var In=Tl,Vr={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(X.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(X.Types.change,this._renderer.flagMatrix),Rl.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 Q&&this._scale.unbind(X.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof Q&&this._scale.bind(X.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 Os(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Rl(){this._flagMatrix=!0}var Mi=Math.min,Ai=Math.max,om=Math.ceil,am=Math.floor,lm=new Q,Us=class Yn extends In{constructor(e,n,r,s){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagCap",!0),w(this,"_flagJoin",!0),w(this,"_flagMiter",!0),w(this,"_flagStrokeAttenuation",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null),w(this,"_strokeAttenuation",!0);for(let o in $l)Object.defineProperty(this,o,$l[o]);this._renderer.type="path",this._renderer.flagVertices=El.bind(this),this._renderer.bindVertices=Nl.bind(this),this._renderer.unbindVertices=Pl.bind(this),this._renderer.flagFill=Fl.bind(this),this._renderer.flagStroke=Ml.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:Jn(e.fill),r=typeof e.stroke=="string"?e.stroke:Jn(e.stroke),s=new Yn().copy(Is(Vs({},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<Yn.Properties.length;n++){const r=Yn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Yn;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<Yn.Properties.length;r++){const s=Yn.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()),K.each(Yn.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,h=1/0,u=-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:f}=Qn(n.elements[0],n.elements[3],n.elements[1],n.elements[4],n.elements[2],n.elements[5]);typeof m=="number"&&typeof f=="number"&&(r=Math.max(m,f)*(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,f]=n.multiply(a.x,a.y),[g,p]=n.multiply(l.x,l.y);if(a.controls&&l.controls){let y=a.controls.right.x,b=a.controls.right.y;a.relative&&(y+=a.x,b+=a.y);let[_,v]=n.multiply(y,b),k=l.controls.left.x,S=l.controls.left.y;l.relative&&(k+=l.x,S+=l.y);let[B,C]=n.multiply(k,S);const T=cl(m,f,_,v,B,C,g,p);h=Mi(T.min.y-r,h),c=Mi(T.min.x-r,c),d=Ai(T.max.x+r,d),u=Ai(T.max.y+r,u)}else o<=1&&(h=Mi(f-r,h),c=Mi(m-r,c),d=Ai(m+r,d),u=Ai(f+r,u)),h=Mi(p-r,h),c=Mi(g-r,c),d=Ai(g+r,d),u=Ai(p+r,u)}return{top:h,left:c,right:d,bottom:u,width:d-c,height:u-h}}getPointAt(e,n){let r,s,o,a,l,c,d,h,u,m,f,g,p,y,b,_=this.length*Math.min(Math.max(e,0),1);const v=this.vertices.length,k=v-1;let S=null,B=null;for(let N=0,P=this._lengths.length,H=0;N<P;N++){if(H+this._lengths[N]>=_){this._closed?(r=Pt(N,v),s=Pt(N-1,v),N===0&&(r=s,s=N)):(r=N,s=Math.min(Math.max(N-1,0),k)),S=this.vertices[r],B=this.vertices[s],_-=H,this._lengths[N]!==0?e=_/this._lengths[N]:e=0;break}H+=this._lengths[N]}if(S===null||B===null)return null;if(S){if(!B)return S}else return B;b=B.controls&&B.controls.right,y=S.controls&&S.controls.left,l=B.x,m=B.y,c=(b||B).x,f=(b||B).y,d=(y||S).x,g=(y||S).y,h=S.x,p=S.y,b&&B.relative&&(c+=B.x,f+=B.y),y&&S.relative&&(d+=S.x,g+=S.y),a=ir(e,l,c,d,h),u=ir(e,m,f,g,p);const C=Nt(l,c,e),T=Nt(m,f,e),$=Nt(c,d,e),E=Nt(f,g,e),I=Nt(d,h,e),O=Nt(g,p,e),V=Nt(C,$,e),L=Nt(T,E,e),D=Nt($,I,e),ee=Nt(E,O,e);return K.isObject(n)?(n.x=a,n.y=u,n instanceof ve&&(n.controls.left.x=V,n.controls.left.y=L,n.controls.right.x=D,n.controls.right.y=ee,(typeof n.relative!="boolean"||n.relative)&&(n.controls.left.x-=a,n.controls.left.y-=u,n.controls.right.x-=a,n.controls.right.y-=u)),n.t=e,n):(o=new ve(a,u,V-a,L-u,D-a,ee-u,this._curved?te.curve:te.line),o.t=e,o)}plot(){if(this.curved)return hl(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?te.move:te.line;return this}subdivide(e){this._update();const n=this.vertices.length-1,r=this._closed||this.vertices[n]._command===te.close;let s=this.vertices[n],o=[],a;return K.each(this.vertices,function(l,c){if(c<=0&&!r){s=l;return}if(l.command===te.move){o.push(new ve(s.x,s.y)),c>0&&(o[o.length-1].command=te.line),s=l;return}a=Cl(l,s,e),o=o.concat(a),K.each(a,function(d,h){h<=0&&s.command===te.move?d.command=te.move:d.command=te.line}),c>=n&&(this._closed&&this._automatic&&(s=l,a=Cl(l,s,e),o=o.concat(a),K.each(a,function(d,h){h<=0&&s.command===te.move?d.command=te.move:d.command=te.line})),o.push(new ve(l.x,l.y)),o[o.length-1].command=r?te.close:te.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=[]),K.each(this.vertices,function(l,c){if(c<=0||l.command===te.move){o=l,this._lengths[c]=0;return}this._lengths[c]=kl(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=Ar(this,r*this._length),a=Ar(this,s*this._length),l=om(o),c=am(a);let d,h,u,m,f,g;for(this._renderer.vertices.length=0,g=0;g<e;g++)this._renderer.collection.length<=g&&this._renderer.collection.push(new ve),g>c&&!h?(f=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(s,f),f.command=this._renderer.collection[g].command,this._renderer.vertices.push(f),h=f,u=this._collection[g-1],u&&u.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f),u.relative?this._renderer.collection[g-1].controls.right.copy(u.controls.right).lerp(Q.zero,1-f.t):this._renderer.collection[g-1].controls.right.copy(u.controls.right).lerp(u,1-f.t))):g>=l&&g<=c&&(f=this._renderer.collection[g].copy(this._collection[g]),this._renderer.vertices.push(f),g===c&&vl(this,s)?(h=f,!n&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):g===l&&vl(this,r)&&(d=f,d.command=te.move,!n&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(g=l-1,f=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(r,f),f.command=te.move,this._renderer.vertices.unshift(f),m=this._collection[g+1],m&&m.controls&&(f.controls.left.clear(),m.relative?this._renderer.collection[g+1].controls.left.copy(m.controls.left).lerp(Q.zero,f.t):(lm.copy(m),this._renderer.collection[g+1].controls.left.copy(m.controls.left).lerp(m,f.t))))}return In.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,In.prototype.flagReset.call(this),this}};w(Us,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),w(Us,"Utils",{getCurveLength:kl});var Se=Us,$l={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 Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.bind(X.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";K.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(X.Types.insert,e).unbind(X.Types.remove,n),t instanceof An?this._collection=t:this._collection=new An(t||[]),this._collection.bind(X.Types.insert,e).bind(X.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,K.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 El(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Nl(t){let e=t.length;for(;e--;)t[e].bind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Pl(t){let e=t.length;for(;e--;)t[e].unbind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Fl(){this._flagFill=!0}function Ml(){this._flagStroke=!0}var Al=class Br extends Se{constructor(e,n,r,s){const o=[new ve,new ve,new ve,new ve];super(o,!0,!1,!0),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_width",0),w(this,"_height",0),w(this,"_origin",null),this._renderer.type="rectangle";for(let a in Vl)Object.defineProperty(this,a,Vl[a]);this.width=typeof r=="number"?r:1,this.height=typeof s=="number"?s:1,this.origin=new Q,typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n),this._update()}static fromObject(e){const n=new Br().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Br.Properties.length;n++){const r=Br.Properties[n];r in e&&(typeof e[r]=="number"?this[r]=e[r]:this[r]instanceof Q&&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=te.move,this.vertices[1].set(e,-n).sub(this._origin).command=te.line,this.vertices[2].set(e,n).sub(this._origin).command=te.line,this.vertices[3].set(-e,n).sub(this._origin).command=te.line,this.vertices[4]&&(this.vertices[4].set(-e,-n).sub(this._origin).command=te.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=new Br(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<Se.Properties.length;r++){const s=Se.Properties[r];n[s]instanceof Q?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}};w(Al,"Properties",["width","height","origin"]);var On=Al,Vl={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(X.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(X.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Il=class Tr extends On{constructor(e,n,r,s,o,a){super(n,r,0,0),w(this,"_flagTexture",!1),w(this,"_flagColumns",!1),w(this,"_flagRows",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_texture",null),w(this,"_columns",1),w(this,"_rows",1),w(this,"_frameRate",0),w(this,"_index",0),w(this,"_origin",null),this._renderer.type="sprite";for(let l in Ol)Object.defineProperty(this,l,Ol[l]);this.noStroke(),this.noFill(),e instanceof Pe?this.texture=e:typeof e=="string"&&(this.texture=new Pe(e)),this.origin=new Q,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 Tr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Tr.Properties.length;n++){const r=Tr.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=K.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 Tr(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,h,u,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)){h=e.image.width,u=e.image.height,s=h/n,o=u/r,l=this._amount,this.width!==s&&(this.width=s),this.height!==o&&(this.height=o),this._playing&&this._frameRate>0&&(K.isNaN(this._lastFrame)&&(this._lastFrame=l-1),a=K.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=Nt(this._firstFrame,m,a/c),d=Math.floor(d),d!==this._index&&(this._index=d,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const f=this._index%n,g=Math.floor(this._index/n),p=-s*f+(h-s)/2,y=-o*g+(u-o)/2;p!==e.offset.x&&(e.offset.x=p),y!==e.offset.y&&(e.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}};w(Il,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var Ir=Il,Ol={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}}},Gs,zl=class extends An{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),el(this,Gs,{}),this.attach(e),this.on(X.Types.insert,this.attach),this.on(X.Types.remove,this.detach)}get ids(){return Tt(this,Gs)}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}};Gs=new WeakMap;var Ll=class Ci extends Se{constructor(e,n,r,s,o,a,l){const c=l||wt.Resolution*3,d=[];for(let h=0;h<c;h++)d.push(new ve);super(d,!0,!1,!0),w(this,"_flagStartAngle",!1),w(this,"_flagEndAngle",!1),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_startAngle",0),w(this,"_endAngle",at),w(this,"_innerRadius",0),w(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let h in Dl)Object.defineProperty(this,h,Dl[h]);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 Ci().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ci.Properties.length;n++){const r=Ci.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=Pt(e,at)===Pt(n,at),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,h=0,u,m,f,g,p,y,b,_,v;for(o?c--:a||(c-=2),u=0,m=c-1;u<c;u++){switch(f=u/m,g=l[h],p=f*(n-e)+e,y=(n-e)/c,b=s*Math.cos(p),_=s*Math.sin(p),u){case 0:d=te.move;break;default:d=te.curve}g.command=d,g.x=b,g.y=_,g.controls.left.clear(),g.controls.right.clear(),g.command===te.curve&&(v=s*y/Math.PI,g.controls.left.x=v*Math.cos(p-Ze),g.controls.left.y=v*Math.sin(p-Ze),g.controls.right.x=v*Math.cos(p+Ze),g.controls.right.y=v*Math.sin(p+Ze),u===1&&g.controls.left.multiplyScalar(2),u===m&&g.controls.right.multiplyScalar(2)),h++}if(a){for(o?(l[h].command=te.close,h++):(c--,m=c-1),u=0;u<c;u++)f=u/m,g=l[h],p=(1-f)*(n-e)+e,y=(n-e)/c,b=r*Math.cos(p),_=r*Math.sin(p),d=te.curve,u<=0&&(d=o?te.move:te.line),g.command=d,g.x=b,g.y=_,g.controls.left.clear(),g.controls.right.clear(),g.command===te.curve&&(v=r*y/Math.PI,g.controls.left.x=v*Math.cos(p+Ze),g.controls.left.y=v*Math.sin(p+Ze),g.controls.right.x=v*Math.cos(p-Ze),g.controls.right.y=v*Math.sin(p-Ze),u===1&&g.controls.left.multiplyScalar(2),u===m&&g.controls.right.multiplyScalar(2)),h++;l[h].copy(l[0]),l[h].command=te.line}else o||(l[h].command=te.line,l[h].x=0,l[h].y=0,h++,l[h].copy(l[0]),l[h].command=te.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 Ci(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<Se.Properties.length;c++){const d=Se.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<Ci.Properties.length;n++){const r=Ci.Properties[n];e[r]=this[r]}return e}};w(Ll,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var Ks=Ll,Dl={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}}},Zs=Math.cos,Qs=Math.sin,Hl=class Si extends Se{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),w(this,"_flagRadius",!1),w(this,"_radius",0),this._renderer.type="circle";for(let l in Wl)Object.defineProperty(this,l,Wl[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 Si().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Si.Properties.length;n++){const r=Si.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*at,c=r*Zs(l),d=r*Qs(l),h=s*Zs(l-Ze),u=s*Qs(l-Ze),m=s*Zs(l+Ze),f=s*Qs(l+Ze),g=this.vertices[o];g.command=o===0?te.move:te.curve,g.set(c,d),g.controls.left.set(h,u),g.controls.right.set(m,f)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=new Si(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<Se.Properties.length;r++){const s=Se.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<Si.Properties.length;n++){const r=Si.Properties[n];e[r]=this[r]}return e}};w(Hl,"Properties",["radius"]);var Or=Hl,Wl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},Js=Math.cos,eo=Math.sin,jl=class Bi extends Se{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),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_width",0),w(this,"_height",0),this._renderer.type="ellipse";for(let c in ql)Object.defineProperty(this,c,ql[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 Bi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Bi.Properties.length;n++){const r=Bi.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*at,c=r*Js(l),d=s*eo(l),h=r*n*Js(l-Ze),u=s*n*eo(l-Ze),m=r*n*Js(l+Ze),f=s*n*eo(l+Ze),g=this.vertices[o];g.command=o===0?te.move:te.curve,g.set(c,d),g.controls.left.set(h,u),g.controls.right.set(m,f)}}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 Bi(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<Se.Properties.length;a++){const l=Se.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<Bi.Properties.length;n++){const r=Bi.Properties[n];e[r]=this[r]}return e}};w(jl,"Properties",["width","height"]);var zr=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}}},cm=Math.ceil,dm=Math.floor,Xl=class Un extends In{constructor(e){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagSize",!0),w(this,"_flagSizeAttenuation",!0),w(this,"_flagStrokeAttenuation",!0),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_size",1),w(this,"_sizeAttenuation",!1),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_dashes",null),w(this,"_strokeAttenuation",!0),w(this,"noFill",Se.prototype.noFill),w(this,"noStroke",Se.prototype.noStroke),w(this,"corner",Se.prototype.corner),w(this,"center",Se.prototype.center),w(this,"getBoundingClientRect",Se.prototype.getBoundingClientRect),w(this,"_updateLength",Se.prototype._updateLength);for(let n in Yl)Object.defineProperty(this,n,Yl[n]);this._renderer.type="points",this._renderer.flagVertices=El.bind(this),this._renderer.bindVertices=Nl.bind(this),this._renderer.unbindVertices=Pl.bind(this),this._renderer.flagFill=Fl.bind(this),this._renderer.flagStroke=Ml.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:Jn(e.fill),r=typeof e.stroke=="string"?e.stroke:Jn(e.stroke),s=new Un().copy(Is(Vs({},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<Un.Properties.length;n++){const r=Un.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Un;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<Un.Properties.length;r++){const s=Un.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()),K.each(Un.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,h=Ls(a,l,a,l,c,d,c,d,e);n=n.concat(h)}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=Ar(this,e*this._length),s=Ar(this,n*this._length),o=cm(r),a=dm(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}};w(Xl,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var to=Xl,Yl={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 Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.bind(X.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(X.Types.insert,e).unbind(X.Types.remove,n),t instanceof An?this._collection=t:this._collection=new An(t||[]),this._collection.bind(X.Types.insert,e).bind(X.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}}},hm=Math.cos,um=Math.sin,Ul=class Ti extends Se{constructor(e,n,r,s){s=Math.max(s||0,3),super(),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagSides",!1),w(this,"_radius",0),w(this,"_width",0),w(this,"_height",0),w(this,"_sides",0),this._renderer.type="polygon";for(let o in Gl)Object.defineProperty(this,o,Gl[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 Ti().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ti.Properties.length;n++){const r=Ti.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=at*o+Math.PI/2,l=this._width*hm(a)/2,c=this._height*um(a)/2;s>=r?this.vertices.push(new ve(l,c)):this.vertices[s].set(l,c),this.vertices[s].command=s===0?te.move:te.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 Ti(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<Se.Properties.length;r++){const s=Se.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<Ti.Properties.length;n++){const r=Ti.Properties[n];e[r]=this[r]}return e}};w(Ul,"Properties",["width","height","sides"]);var no=Ul,Gl={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}}},Kl=class Ri extends Se{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?te.move:te.curve));super(a),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagRadius",!1),w(this,"_width",0),w(this,"_height",0),w(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let l in Zl)Object.defineProperty(this,l,Zl[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=fm.bind(this),typeof r=="number"&&(this.width=r),typeof s=="number"&&(this.height=s),(typeof o=="number"||o instanceof Q)&&(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 Ri().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ri.Properties.length;n++){const r=Ri.Properties[n];if(r in e){const s=e[r];/radius/i.test(r)?this[r]=typeof s=="number"||s instanceof Q?s:new Q().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 Q?(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 Ri(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<Se.Properties.length;a++){const l=Se.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<Ri.Properties.length;n++){const r=Ri.Properties[n];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};w(Kl,"Properties",["width","height","radius"]);var Lr=Kl,Zl={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 Q&&this._radius.unbind(X.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof Q&&this._radius.bind(X.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function fm(){this._flagRadius=!0}var gm=Math.cos,mm=Math.sin,Ql=class $i extends Se{constructor(e,n,r,s,o){arguments.length<=3&&(s=r,r=s/2),(typeof o!="number"||o<=0)&&(o=5),super(),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_flagSides",!1),w(this,"_innerRadius",0),w(this,"_outerRadius",0),w(this,"_sides",0),this._renderer.type="star";for(let a in Jl)Object.defineProperty(this,a,Jl[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 $i().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<$i.Properties.length;n++){const r=$i.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=at*o,l=(s%2?this._outerRadius:this._innerRadius)/2,c=l*gm(a),d=l*mm(a);s>=r?this.vertices.push(new ve(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?te.move:te.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 $i(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<Se.Properties.length;a++){const l=Se.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<$i.Properties.length;n++){const r=$i.Properties[n];e[r]=this[r]}return e}};w(Ql,"Properties",["innerRadius","outerRadius","sides"]);var io=Ql,Jl={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}}},ro,ec=Math.min,tc=Math.max;He.document&&(ro=document.createElement("canvas"));var so=class Ot extends In{constructor(e,n,r,s){super(),w(this,"_flagValue",!0),w(this,"_flagFamily",!0),w(this,"_flagSize",!0),w(this,"_flagLeading",!0),w(this,"_flagAlignment",!0),w(this,"_flagBaseline",!0),w(this,"_flagStyle",!0),w(this,"_flagWeight",!0),w(this,"_flagDecoration",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_flagDirection",!0),w(this,"_flagStrokeAttenuation",!0),w(this,"_value",""),w(this,"_family","sans-serif"),w(this,"_size",13),w(this,"_leading",17),w(this,"_alignment","center"),w(this,"_baseline","middle"),w(this,"_style","normal"),w(this,"_weight",500),w(this,"_decoration","none"),w(this,"_direction","ltr"),w(this,"_fill","#000"),w(this,"_stroke","none"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null),w(this,"_strokeAttenuation",!0);for(let o in nc)Object.defineProperty(this,o,nc[o]);if(this._renderer.type="text",this._renderer.flagFill=pm.bind(this),this._renderer.flagStroke=ym.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,!K.isObject(s))return this;for(let o=0;o<Ot.Properties.length;o++){const a=Ot.Properties[o];a in s&&(this[a]=s[a])}}static Measure(e){if(ro){const n=ro.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*Ot.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:Jn(e.fill),r=typeof e.stroke=="string"?e.stroke:Jn(e.stroke),s=new Ot().copy(Is(Vs({},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<Ot.Properties.length;n++){const r=Ot.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Ot(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let r=0;r<Ot.Properties.length;r++){const s=Ot.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<Ot.Properties.length;n++){const r=Ot.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}=Ot.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[h,u]=n.multiply(r,o),[m,f]=n.multiply(r,a),[g,p]=n.multiply(s,o),[y,b]=n.multiply(s,a);return o=ec(u,f,p,b),r=ec(h,m,g,y),s=tc(h,m,g,y),a=tc(u,f,p,b),{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}};w(so,"Ratio",.6),w(so,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var sn=so,nc={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 Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,K.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 pm(){this._flagFill=!0}function ym(){this._flagStroke=!0}var oo=class Qi extends On{constructor(e,n,r,s){super(n,r,0,0),w(this,"_flagTextures",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_index",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_textures",null),w(this,"_frameRate",0),w(this,"_origin",null),this._renderer.type="image-sequence";for(let o in ic)Object.defineProperty(this,o,ic[o]);this._renderer.flagTextures=bm.bind(this),this._renderer.bindTextures=_m.bind(this),this._renderer.unbindTextures=wm.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(rc.bind(this)):typeof e=="string"&&(this.textures=[rc(e)]),this.origin=new Q,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=Qi.DefaultFrameRate,this.index=0}static fromObject(e){const n=new Qi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Qi.Properties.length;n++){const r=Qi.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=K.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 Qi(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,K.isNaN(this._lastFrame)&&(this._lastFrame=o-1),s=K.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=Nt(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 Pe))&&(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}};w(oo,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),w(oo,"DefaultFrameRate",30);var ao=oo,ic={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(X.Types.insert,e).unbind(X.Types.remove,n),this._textures=new An((t||[]).slice(0)),this._textures.bind(X.Types.insert,e).bind(X.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 bm(){this._flagTextures=!0}function _m(t){let e=t.length;for(;e--;)t[e].bind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function wm(t){let e=t.length;for(;e--;)t[e].unbind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function rc(t){if(t instanceof Pe)return t;if(typeof t=="string")return new Pe(t)}var Dr=Math.min,Hr=Math.max,lo=class Gn extends In{constructor(e){super(),w(this,"_flagAdditions",!1),w(this,"_flagSubtractions",!1),w(this,"_flagOrder",!1),w(this,"_flagOpacity",!0),w(this,"_flagBeginning",!1),w(this,"_flagEnding",!1),w(this,"_flagLength",!1),w(this,"_flagMask",!1),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_length",0),w(this,"_mask",null),w(this,"_strokeAttenuation",!0);for(let n in sc)Object.defineProperty(this,n,sc[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++)oc.call(this,e[n],this)}static RemoveChildren(e){for(let n=0;n<e.length;n++)oc.call(this,e[n])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const n=new Gn;for(let s=0;s<Gn.Properties.length;s++){const o=Gn.Properties[s];o in e&&(/(fill|stroke)/i.test(o)?n[o]=typeof e[o]=="string"?e[o]:Jn(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 Ks.fromObject(s);case"circle":return Or.fromObject(s);case"element":return Pi.fromObject(s);case"ellipse":return zr.fromObject(s);case"group":return Gn.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return ao.fromObject(s);case"path":return Se.fromObject(s);case"points":return to.fromObject(s);case"polygon":return no.fromObject(s);case"rectangle":return On.fromObject(s);case"rounded-rectangle":return Lr.fromObject(s);case"shape":return In.fromObject(s);case"sprite":return Ir.fromObject(s);case"star":return io.fromObject(s);case"text":return sn.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<Gn.Properties.length;n++){const r=Gn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Gn,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,K.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,h=1/0,u=-1/0;const m=/texture|gradient/i;r=e?this.matrix:this.worldMatrix;for(let f=0;f<this.children.length;f++){const g=this.children[f];if(!(!g.visible||m.test(g._renderer.type))&&(n=g.getBoundingClientRect(e),s=typeof n.top!="number"||K.isNaN(n.top)||!isFinite(n.top),o=typeof n.left!="number"||K.isNaN(n.left)||!isFinite(n.left),a=typeof n.right!="number"||K.isNaN(n.right)||!isFinite(n.right),l=typeof n.bottom!="number"||K.isNaN(n.bottom)||!isFinite(n.bottom),!(s||o||a||l)))if(e){const[p,y]=r.multiply(n.left,n.top),[b,_]=r.multiply(n.right,n.top),[v,k]=r.multiply(n.left,n.bottom),[S,B]=r.multiply(n.right,n.bottom);h=Dr(y,_,k,B,h),c=Dr(p,b,v,S,c),d=Hr(p,b,v,S,d),u=Hr(y,_,k,B,u)}else h=Dr(n.top,h),c=Dr(n.left,c),d=Hr(n.right,d),u=Hr(n.bottom,u)}return{top:h,left:c,right:d,bottom:u,width:d-c,height:u-h}}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}};w(lo,"Children",zl),w(lo,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var nt=lo,sc={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=nt.InsertChildren.bind(this),n=nt.RemoveChildren.bind(this),r=nt.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new zl(t),this._children.bind(X.Types.insert,e),this._children.bind(X.Types.remove,n),this._children.bind(X.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,K.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 oc(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 Wr=class extends Se{constructor(e,n,r,s){const o=[new ve(e,n),new ve(r,s)];super(o);for(let a in ac)Object.defineProperty(this,a,ac[a]);this.vertices[0].command=te.move,this.vertices[1].command=te.line,this.automatic=!1}};w(Wr,"Properties",["left","right"]);var ac={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(K.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=te.move;else{const e=new Rt("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(K.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=te.line;else{const e=new Rt("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},on={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},xm={start:"left",middle:"center",end:"right"},lc=["id","class","transform","xmlns","viewBox"],vm=["x","y","width","height","href","xlink:href"];function km(t){return xm[t]}function Cm(t){const e=t.getAttribute("dominant-baseline"),n=t.getAttribute("alignment-baseline");return e||n}function rr(t){return t.replace(/svg:/gi,"").toLowerCase()}function cc(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 Sm(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 Bm(t){const e={},n=Tm(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 Tm(t){const e=t.getAttributeNames();for(let n=0;n<lc.length;n++){const r=lc[n],s=Array.prototype.indexOf.call(e,r);s>=0&&e.splice(s,1)}return e}function Rm(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 u=0;u<t.children.length;u++){const m=t.children[u];"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",h=typeof t.height=="number";return l&&(t.translation.x+=t.x),c&&(t.translation.y+=t.y),(d||h)&&(t.scale=new Q(1,1)),d&&(t.scale.x=t.width/o),h&&(t.scale.y=t.height/a),t.mask=new On(0,0,o,a),t.mask.origin.set(-o/2,-a/2),t}function Lt(t,e,n){const r={},s={},o={};let a,l,c,d,h,u,m,f,g,p,y,b,_,v,k,S,B;if(t===null)return r;if(He.getComputedStyle){const C=He.getComputedStyle(t);for(a=C.length;a--;)c=C[a],d=C[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<t.attributes.length;a++)u=t.attributes[a],/style/i.test(u.nodeName)?Sm(u.value,o):s[u.nodeName]=u.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&K.defaults(r,n),K.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=Qn(l),e._renderer.type){case"linear-gradient":cc(m,e.left),cc(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=Qn(l),e.translation.set(m.translateX,m.translateY),e.rotation=Math.PI*(m.rotation/180),e.scale=new Q(m.scaleX,m.scaleY),f=parseFloat((r.x+"").replace("px")),g=parseFloat((r.y+"").replace("px")),f&&(e.translation.x=f),g&&(e.translation.y=g);break;case"visible":if(e instanceof nt){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof nt){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof nt){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof nt){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof nt){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof nt){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(on.cssBackgroundImage.test(d)&&(p=d.replace(on.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(p)&&(b=ze.defs.current.get(p),b&&b.childNodes.length>0)))switch(b=b.childNodes[0],_=rr(b.nodeName),e.mask=ze[_].call(this,b,{}),e._renderer.type){case"text":case"path":e.position.add(e.mask.position),e.mask.position.clear();break}break;case"fill":case"stroke":h=(e instanceof nt?"_":"")+c,on.cssBackgroundImage.test(d)?(p=d.replace(on.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(p)?(b=ze.defs.current.get(p),b.object||(_=rr(b.nodeName),b.object=ze[_].call(this,b,{})),b=b.object):(y=Em(this),b=y.getById(p)),e[h]=b):e[h]=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(v=e instanceof Qe,k=e instanceof We,S=e instanceof je,v||k||S)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Rt("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof sn&&(e.family=d);break;case"font-size":e instanceof sn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Rt("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof sn&&(e.weight=d);break;case"font-style":e instanceof sn&&(e.style=d);break;case"text-decoration":e instanceof sn&&(e.decoration=d);break;case"line-height":e instanceof sn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function $m(t,e){for(let n=0,r=t.childNodes.length;n<r;n++){const s=t.childNodes[n];!s.id||rr(t.nodeName)==="#text"||e.add(s.id,s)}}function Em(t){for(;t.parent;)t=t.parent;return t.scene}var ze={svg:function(t){const e=ze.defs.current=new Fr,n=t.getElementsByTagName("defs");for(let g=0;g<n.length;g++)$m(n[g],e);const r=ze.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,h=o!==null,u=a!==null,m=l!==null,f=c!==null;return h&&(r.x=parseFloat(o.replace(on.unitSuffix,""))),u&&(r.y=parseFloat(a.replace(on.unitSuffix,""))),m&&(r.width=parseFloat(l.replace(on.unitSuffix,""))),f&&(r.height=parseFloat(c.replace(on.unitSuffix,""))),d&&Rm(r,s),delete ze.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 Rt("encountered <use /> with no href."),console.warn(n.name,n.message),null;const s=r.slice(1);if(!ze.defs.current.contains(s))return n=new Rt("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=ze.defs.current.get(s).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],h=vm.includes(d.nodeName),u=!a.hasAttribute(d.nodeName);(h||u)&&a.setAttribute(d.nodeName,d.value)}const l=rr(a.nodeName);return ze[l].call(this,a,e)},g:function(t,e){const n=new nt;Lt.call(this,t,n,e),this.add(n);const r=Bm.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=rr(l);if(c in ze){const d=ze[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 Se(r,!0);return s.stroke="none",s.fill="black",Lt.call(this,t,s,e),s},polyline:function(t,e){const n=ze.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,h=n.match(/[a-df-z][^a-df-z]*/gi);const u=h.length-1;K.each(h.slice(0),function(m,f){const g=m.slice(1).trim().match(on.path),p=m[0],y=p.toLowerCase();let b,_,v,k,S;const B=[];switch(f===0&&(h=[]),y){case"h":case"v":g.length>1&&(b=1);break;case"m":case"l":case"t":g.length>2&&(b=2);break;case"s":case"q":g.length>4&&(b=4);break;case"c":g.length>6&&(b=6);break;case"a":g.length>7&&(b=7);break}if(b){for(_=0,v=g.length,S=0;_<v;_+=b){if(k=p,S>0)switch(p){case"m":k="l";break;case"M":k="L";break}B.push(k+g.slice(_,_+b).join(" ")),S++}h=Array.prototype.concat.apply(h,B)}else h.push(m)}),K.each(h,function(m,f){let g,p,y;const b=m[0],_=b.toLowerCase();d=m.slice(1).trim().match(on.path),o=b===_;let v,k,S,B,C,T,$,E,I,O,V,L,D,ee,N,P,H;switch(_){case"z":if(f>=u)s=!0;else{p=l.x,y=l.y,g=new ve(p,y,void 0,void 0,void 0,void 0,te.close);for(let q=r.length-1;q>=0;q--){const U=r[q];if(/m/i.test(U.command)){l=U;break}}}break;case"m":case"l":c=void 0,p=parseFloat(d[0]),y=parseFloat(d[1]),g=new ve(p,y,void 0,void 0,void 0,void 0,/m/i.test(_)?te.move:te.line),o&&g.addSelf(l),l=g;break;case"h":case"v":O=/h/i.test(_)?"x":"y",V=/x/i.test(O)?"y":"x",g=new ve(void 0,void 0,void 0,void 0,void 0,void 0,te.line),g[O]=parseFloat(d[0]),g[V]=l[V],o&&(g[O]+=l[O]),l=g;break;case"c":case"s":v=l.x,k=l.y,c||(c=new Q),/c/i.test(_)?(S=parseFloat(d[0]),B=parseFloat(d[1]),C=parseFloat(d[2]),T=parseFloat(d[3]),$=parseFloat(d[4]),E=parseFloat(d[5])):(I=Ds(l,c,o),S=I.x,B=I.y,C=parseFloat(d[0]),T=parseFloat(d[1]),$=parseFloat(d[2]),E=parseFloat(d[3])),o&&(S+=v,B+=k,C+=v,T+=k,$+=v,E+=k),l.controls.right.set(S-l.x,B-l.y),g=new ve($,E,C-$,T-E,void 0,void 0,te.curve),l=g,c=g.controls.left;break;case"t":case"q":v=l.x,k=l.y,c||(c=new Q),/q/i.test(_)?(S=parseFloat(d[0]),B=parseFloat(d[1]),C=parseFloat(d[0]),T=parseFloat(d[1]),$=parseFloat(d[2]),E=parseFloat(d[3])):(I=Ds(l,c,o),S=I.x,B=I.y,C=I.x,T=I.y,$=parseFloat(d[0]),E=parseFloat(d[1])),o&&(S+=v,B+=k,C+=v,T+=k,$+=v,E+=k),l.controls.right.set((S-l.x)*.33,(B-l.y)*.33),g=new ve($,E,C-$,T-E,void 0,void 0,te.curve),l=g,c=g.controls.left;break;case"a":v=l.x,k=l.y,D=parseFloat(d[0]),ee=parseFloat(d[1]),N=parseFloat(d[2]),P=parseFloat(d[3]),H=parseFloat(d[4]),$=parseFloat(d[5]),E=parseFloat(d[6]),o&&($+=v,E+=k),L=new ve($,E),L.command=te.arc,L.rx=D,L.ry=ee,L.xAxisRotation=N,L.largeArcFlag=P,L.sweepFlag=H,g=L,l=L,c=void 0;break}g&&(Array.isArray(g)?r=r.concat(g):r.push(g))})}n=new Se(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},K.each(n.vertices,function(l){l.subSelf(a.centroid)}),Lt.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 Or(0,0,s);return o.stroke="none",o.fill="black",Lt.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 zr(0,0,s,o);return a.stroke="none",a.fill="black",Lt.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(!K.isNaN(n)||!K.isNaN(r))return ze["rounded-rect"](t);const s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new On(0,0,s,o);return c.stroke="none",c.fill="black",Lt.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 Q(n,r),d=new Lr(0,0,s,o,c);return d.stroke="none",d.fill="black",Lt.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 Wr(n,r,s,o).noFill();return Lt.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 h=[];for(let m=0;m<t.children.length;m++){const f=t.children[m];let g=f.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let p=f.getAttribute("stop-color"),y=f.getAttribute("stop-opacity"),b=f.getAttribute("style"),_;p===null&&(_=b?b.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,p=_&&_.length>1?_[1]:void 0),y===null?(_=b?b.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=_&&_.length>1?parseFloat(_[1]):1):y=parseFloat(y),h.push(new Vn(g,p,y))}const u=new We(s,o,a,l,h);return u.spread=r,u.units=n,Lt.call(this,t,u,e),u},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"));K.isNaN(l)&&(l=s),K.isNaN(c)&&(c=o);const d=Math.abs(s+l)/2,h=Math.abs(o+c)/2;/userSpaceOnUse/i.test(n)&&(s-=d,o-=h,l-=d,c-=h);const u=[];for(let f=0;f<t.children.length;f++){const g=t.children[f];let p=g.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let y=g.getAttribute("stop-color"),b=g.getAttribute("stop-opacity"),_=g.getAttribute("style"),v;y===null&&(v=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,y=v&&v.length>1?v[1]:void 0),b===null?(v=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=v&&v.length>1?parseFloat(v[1]):1):b=parseFloat(b),u.push(new Vn(p,y,b))}const m=new je(s,o,a,u,l,c);return m.spread=r,m.units=n,Lt.call(this,t,m,e),m},text:function(t,e){const n=km(t.getAttribute("text-anchor"))||"left",r=Cm(t)||"baseline";let s="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?s=t.childNodes[0].textContent:s=t.textContent;const o=new sn(s);return Lt.call(this,t,o,e),o.alignment=n,o.baseline=r,o},clippath:function(t,e){return ze.defs.current&&!ze.defs.current.contains(t.id)&&ze.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 Rt("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 Ir(r,s,o);return K.isNaN(a)||(c.width=a),K.isNaN(l)||(c.height=l),Lt.call(this,t,c,e),c}};function dc(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 co=class bn extends On{constructor(e,n,r,s,o,a){super(n,r,s||1,o||1),w(this,"_flagTexture",!1),w(this,"_flagMode",!1),w(this,"_texture",null),w(this,"_mode","fill"),this._renderer.type="image";for(let l in uc)Object.defineProperty(this,l,uc[l]);this.noStroke(),this.noFill(),e instanceof Pe?this.texture=e:typeof e=="string"&&(this.texture=new Pe(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 Q(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}};w(co,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),w(co,"Properties",["texture","mode"]);var hc=co,uc={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}}},ho=[],uo=Math.max,Nm=Math.min,fc=Math.abs,jr=Math.sin,qr=Math.cos,Pm=Math.acos,Xr=Math.sqrt,Te={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 Te?t:"path"},group:{renderChild:function(t){const e=Te.getRendererType(t._renderer.type);Te[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;K.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=Yr(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=Te.getRendererType(r._renderer.type);Te[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=Te.getRendererType(l._renderer.type);Te[c].render.call(l,t)}return o&&t.restore(),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t,e,n){let r,s,o,a,l,c,d,h,u,m,f,g,p,y,b,_,v,k,S,B,C,T,$,E,I,O,V,L,D,ee,N,P,H,q;if(q=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,D=this._mask,ee=this._clip,l=this._opacity*(q||1),c=this._visible,!e&&(!c||ee||l===0))return this;if(K.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,h=this._join,u=this._miter,m=this._closed,f=this._renderer.vertices,g=f.length,p=g-1,N=Yr(r),H=this.dashes,N||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),D){const re=Te.getRendererType(D._renderer.type);Te[re].render.call(D,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const re=Te.getRendererType(a._renderer.type);Te[re].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const re=Te.getRendererType(s._renderer.type);Te[re].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=rn(this)),u&&(t.miterLimit=u),h&&(t.lineJoin=h),!m&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),H&&H.length>0&&(t.lineDashOffset=H.offset||0,t.setLineDash(H)),t.beginPath();let U,F,M,Z,fe,ie,me;for(let re=0;re<g;re++)switch(_=f[re],V=_.x,L=_.y,_.command){case te.close:t.closePath();break;case te.arc:U=_.rx,F=_.ry,M=_.xAxisRotation,Z=_.largeArcFlag,fe=_.sweepFlag,y=m?Pt(re-1,g):uo(re-1,0),b=f[y],ie=b.x,me=b.y,Te.renderSvgArcCommand(t,ie,me,U,F,Z,fe,M,V,L);break;case te.curve:y=m?Pt(re-1,g):Math.max(re-1,0),b=f[y],$=b.controls&&b.controls.right||Q.zero,E=_.controls&&_.controls.left||Q.zero,b._relative?(C=$.x+b.x,T=$.y+b.y):(C=$.x,T=$.y),_._relative?(S=E.x+_.x,B=E.y+_.y):(S=E.x,B=E.y),t.bezierCurveTo(C,T,S,B,V,L),re>=p&&m&&(v=k,I=_.controls&&_.controls.right||Q.zero,O=v.controls&&v.controls.left||Q.zero,_._relative?(C=I.x+_.x,T=I.y+_.y):(C=I.x,T=I.y),v._relative?(S=O.x+v.x,B=O.y+v.y):(S=O.x,B=O.y),V=v.x,L=v.y,t.bezierCurveTo(C,T,S,B,V,L));break;case te.line:t.lineTo(V,L);break;case te.move:k=_,t.moveTo(V,L);break}return m&&t.closePath(),!ee&&!n&&(Te.isHidden.test(a)||(P=a._renderer&&a._renderer.offset,P&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),P&&t.restore()),Te.isHidden.test(s)||(P=s._renderer&&s._renderer.offset,P&&(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(),P&&t.restore())),N||t.restore(),ee&&!n&&t.clip(),H&&H.length>0&&t.setLineDash(ho),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,n){let r,s,o,a,l,c,d,h,u,m,f,g,p,y,b,_;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(K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,h=this._renderer.collection,u=h.length,p=Yr(r),b=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 S=Te.getRendererType(a._renderer.type);Te[S].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const S=Te.getRendererType(s._renderer.type);Te[S].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=rn(this))}typeof l=="number"&&(t.globalAlpha=l),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),t.beginPath();let v=d*.5,k;this._sizeAttenuation||(k=this.worldMatrix.elements,k=Qn(k[0],k[3],k[1],k[4],k[2],k[5]),v/=Math.max(k.scaleX,k.scaleY));for(let S=0;S<u;S++)m=h[S],f=m.x,g=m.y,t.moveTo(f+v,g),t.arc(f,g,v,0,at);return n||(Te.isHidden.test(a)||(y=a._renderer&&a._renderer.offset,y&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),y&&t.restore()),Te.isHidden.test(s)||(y=s._renderer&&s._renderer.offset,y&&(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(),y&&t.restore())),p||t.restore(),b&&b.length>0&&t.setLineDash(ho),K.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;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,h=this._linewidth,u=this._fill,m=this._decoration,f=this._direction,g=Yr(c),p=u._renderer&&u._renderer.offset&&d._renderer&&d._renderer.offset,y=this.dashes,b=Te.alignments[this._alignment]||this._alignment,_=Te.baselines[this._baseline]||this._baseline;let v,k,S,B,C,T,$,E,I,O,V;if(g||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const L=Te.getRendererType(a._renderer.type);Te[L].render.call(a,t,!0)}if(p||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=b,t.textBaseline=_,t.direction=f,u)if(typeof u=="string")t.fillStyle=u;else{const L=Te.getRendererType(u._renderer.type);Te[L].render.call(u,t,this),t.fillStyle=u._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const L=Te.getRendererType(d._renderer.type);Te[L].render.call(d,t,this),t.strokeStyle=d._renderer.effect}h&&(t.lineWidth=rn(this))}if(typeof s=="number"&&(t.globalAlpha=s),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),!l&&!n&&(Te.isHidden.test(u)||(u._renderer&&u._renderer.offset?(T=u._renderer.scale.x,$=u._renderer.scale.y,t.save(),t.translate(-u._renderer.offset.x,-u._renderer.offset.y),t.scale(T,$),v=this._size/u._renderer.scale.y,k=this._leading/u._renderer.scale.y,t.font=[this._style,this._weight,v+"px/",k+"px",this._family].join(" "),S=u._renderer.offset.x/u._renderer.scale.x,B=u._renderer.offset.y/u._renderer.scale.y,t.fillText(this.value,S,B),t.restore()):t.fillText(this.value,0,0)),Te.isHidden.test(d)||(d._renderer&&d._renderer.offset?(T=d._renderer.scale.x,$=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(T,$),v=this._size/d._renderer.scale.y,k=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,v+"px/",k+"px",this._family].join(" "),S=d._renderer.offset.x/d._renderer.scale.x,B=d._renderer.offset.y/d._renderer.scale.y,C=h/d._renderer.scale.x,t.lineWidth=C,t.strokeText(this.value,S,B),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(m)){const L=t.measureText(this.value);let D=1;switch(m){case"underline":I=L.actualBoundingBoxDescent,V=L.actualBoundingBoxDescent;break;case"strikethrough":I=0,V=0,D=.5;break}switch(_){case"top":I+=this._size*D,V+=this._size*D;break;case"baseline":case"bottom":I-=this._size*D,V-=this._size*D;break}switch(b){case"left":case"start":E=0,O=L.width;break;case"right":case"end":E=-L.width,O=0;break;default:E=-L.width/2,O=L.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo(E,I),t.lineTo(O,V),t.stroke()}return g||t.restore(),l&&!n&&t.clip(),y&&y.length>0&&t.setLineDash(ho),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(K.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 K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(K.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 K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){K.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 Q||(this._renderer.offset=new Q),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 Q?(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 Q||(this._renderer.scale=new Q),this._scale instanceof Q?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),K.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=fc(r),s=fc(s);const h=(e-c)/2,u=(n-d)/2,m=qr(l)*h+jr(l)*u,f=-jr(l)*h+qr(l)*u,g=m*m,p=f*f;let y=r*r,b=s*s;const _=g/y+p/b;if(_>1){const L=Xr(_);r=L*r,s=L*s,y=r*r,b=s*s}const v=y*p+b*g,k=(y*b-v)/v;let S=Xr(uo(0,k));o===a&&(S=-S);const B=S*r*f/s,C=-S*s*m/r,T=qr(l)*B-jr(l)*C+(e+c)/2,$=jr(l)*B+qr(l)*C+(n+d)/2,E=gc(1,0,(m-B)/r,(f-C)/s),I=gc((m-B)/r,(f-C)/s,(-m-B)/r,(-f-C)/s)%at,O=E+I;Fm(t,T,$,r,s,E,O,a===0,l)}},ct=class extends X{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 nt,this.scene.parent=this}setSize(t,e,n){return this.width=t,this.height=e,this.ratio=typeof n>"u"?Hs(this.ctx):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&K.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(X.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),Te.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};w(ct,"Utils",Te);function Fm(t,e,n,r,s,o,a,l,c){const d=a-o,h=Ei.Tolerance.epsilon,u=Math.abs(d)<h;let m=Pt(d,at);m<h&&(u?m=0:m=at),l===!0&&!u&&(m===at?m=-at:m=m-at);for(let f=0;f<wt.Resolution;f++){const g=f/(wt.Resolution-1),p=o+g*m;let y=e+r*Math.cos(p),b=n+s*Math.sin(p);if(c!==0){const _=Math.cos(c),v=Math.sin(c),k=y-e,S=b-n;y=k*_-S*v+e,b=k*v+S*_+n}t.lineTo(y,b)}}function gc(t,e,n,r){const s=t*n+e*r,o=Xr(t*t+e*e)*Xr(n*n+r*r);let a=Pm(uo(-1,Nm(1,s/o)));return t*r-e*n<0&&(a=-a),a}function Yr(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var oe={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(oe.ns,n);return n==="svg"&&(e=K.defaults(e||{},{version:oe.version})),e&&Object.keys(e).length>0&&oe.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(oe.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?Pt(a-1,n):Math.max(a-1,0),d=t[c];let h,u,m,f,g,p,y,b,_,v,k,S,B,C,T,$=Ne(l.x),E=Ne(l.y);switch(l.command){case te.close:h=te.close;break;case te.arc:k=l.rx,S=l.ry,B=l.xAxisRotation,C=l.largeArcFlag,T=l.sweepFlag,h=te.arc+" "+k+" "+S+" "+B+" "+C+" "+T+" "+$+" "+E;break;case te.curve:y=d.controls&&d.controls.right||Q.zero,b=l.controls&&l.controls.left||Q.zero,d.relative?(m=Ne(y.x+d.x),f=Ne(y.y+d.y)):(m=Ne(y.x),f=Ne(y.y)),l.relative?(g=Ne(b.x+l.x),p=Ne(b.y+l.y)):(g=Ne(b.x),p=Ne(b.y)),h=(a===0?te.move:te.curve)+" "+m+" "+f+" "+g+" "+p+" "+$+" "+E;break;case te.move:s=l,h=te.move+" "+$+" "+E;break;default:h=l.command+" "+$+" "+E}a>=r&&e&&(l.command===te.curve&&(u=s,_=l.controls&&l.controls.right||l,v=u.controls&&u.controls.left||u,l.relative?(m=Ne(_.x+l.x),f=Ne(_.y+l.y)):(m=Ne(_.x),f=Ne(_.y)),u.relative?(g=Ne(v.x+u.x),p=Ne(v.y+u.y)):(g=Ne(v.x),p=Ne(v.y)),$=Ne(u.x),E=Ne(u.y),h+=" C "+m+" "+f+" "+g+" "+p+" "+$+" "+E),l.command!==te.close&&(h+=" Z")),o+=h+" "}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+=te.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=oe.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&e.defs.appendChild(n),n},getRendererType:function(t){return t in oe?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=oe.getRendererType(t._renderer.type);oe[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=oe.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=oe.getRendererType(s._renderer.type);oe[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(oe.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(oe.group.removeChild,n),this._flagOrder&&this.children.forEach(oe.group.orderChild,n),this._flagMask)if(this._mask){const r=oe.getRendererType(this._mask._renderer.type);oe[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),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;K.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=oe.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=oe.getRendererType(this._fill._renderer.type);oe[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=oe.getRendererType(this._stroke._renderer.type);oe[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"]=rn(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?oe.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=oe.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=oe.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=oe.getRendererType(this._mask._renderer.type);oe[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;K.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=Qn(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=oe.pointsToString(this._renderer.collection,r);e.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=oe.getRendererType(this._fill._renderer.type);oe[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=oe.getRendererType(this._stroke._renderer.type);oe[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"]=rn(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?oe.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=oe.createElement("path",e),t.appendChild(this._renderer.elem)),K.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"]=oe.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=oe.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=oe.getRendererType(this._fill._renderer.type);oe[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=oe.getRendererType(this._stroke._renderer.type);oe[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"]=rn(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?oe.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=oe.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=oe.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=oe.getRendererType(this._mask._renderer.type);oe[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){K.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?oe.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=oe.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?oe.setAttributes(o._renderer.elem,a):o._renderer.elem=oe.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){K.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?oe.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=oe.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?oe.setAttributes(o._renderer.elem,a):o._renderer.elem=oe.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){K.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 Q?(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 Q?(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?oe.setAttributes(this._renderer.image,r):this._renderer.image=oe.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&oe.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=oe.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),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},mc=class extends X{constructor(t){super(),this.domElement=t.domElement||oe.createElement("svg"),this.scene=new nt,this.scene.parent=this,this.defs=oe.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,oe.setAttributes(this.domElement,{width:t,height:e}),this.trigger(X.Types.resize,t,e)}render(){return oe.group.render.call(this.scene,this.domElement),oe.defs.update(this.domElement),this}};w(mc,"Utils",oe);var Dt={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 Rt("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
|
-
`}},Ur=Fi.Multiply,Mm=[1,0,0,0,1,0,0,0,1],zn=new nn(9),Am=ct.Utils,pc=new Q,fo=new nn([0,0,1,0,0,1,0,1,1,0,1,1]),be={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:He.document?He.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Fi,group:{removeChild:function(t,e){if(t.children)for(let n=0;n<t.children.length;n++)be.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;K.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 nn(9)),this._matrix.toTransformArray(!0,zn),Ur(zn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q),this._scale instanceof Q?(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=ct.Utils.getRendererType(this._mask._renderer.type);be[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++)be.group.removeChild(this.subtractions[o],t);for(o=0;o<this.children.length;o++){const a=this.children[o],l=ct.Utils.getRendererType(a._renderer.type);be[l].render.call(a,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let n,r,s,o,a,l,c,d,h,u,m,f,g,p;const y=e._renderer.vertices,b=this.canvas,_=this.ctx,v=t.renderer.ratio,k=pc.copy(e._renderer.scale).multiply(v),C=e._stroke,B=e._linewidth,S=e._fill,T=e._renderer.opacity||e._opacity,$=e._cap,E=e._join,O=e._miter,I=e._closed,A=e.dashes,L=y.length,D=L-1;b.width=Math.max(Math.ceil(e._renderer.rect.width*k.x),1),b.height=Math.max(Math.ceil(e._renderer.rect.height*k.y),1);const ee=e._renderer.rect.centroid,N=ee.x,P=ee.y;if(_.clearRect(0,0,b.width,b.height),S)if(typeof S=="string")_.fillStyle=S;else{const me=ct.Utils.getRendererType(S._renderer.type);be[me].render.call(S,_,e),_.fillStyle=S._renderer.effect}if(C){if(typeof C=="string")_.strokeStyle=C;else{const me=ct.Utils.getRendererType(C._renderer.type);be[me].render.call(C,_,e),_.strokeStyle=C._renderer.effect}B&&(_.lineWidth=rn(e)),O&&(_.miterLimit=O),E&&(_.lineJoin=E),!I&&$&&(_.lineCap=$)}typeof T=="number"&&(_.globalAlpha=T),A&&A.length>0&&(_.lineDashOffset=A.offset||0,_.setLineDash(A));let H,q,Y,F,M,Z,fe,ie;_.save(),_.scale(k.x,k.y),_.translate(N,P),_.beginPath();for(let me=0;me<y.length;me++){const re=y[me];switch(f=re.x,g=re.y,re.command){case te.close:_.closePath();break;case te.arc:q=re.rx,Y=re.ry,F=re.xAxisRotation,M=re.largeArcFlag,Z=re.sweepFlag,n=I?Pt(me-1,L):Math.max(me-1,0),r=y[n],fe=r.x,ie=r.y,Am.renderSvgArcCommand(_,fe,ie,q,Y,M,Z,F,f,g);break;case te.curve:n=I?Pt(me-1,L):Math.max(me-1,0),r=y[n],d=r.controls&&r.controls.right||Q.zero,h=re.controls&&re.controls.left||Q.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),re._relative?(o=h.x+re.x,a=h.y+re.y):(o=h.x,a=h.y),_.bezierCurveTo(l,c,o,a,f,g),me>=D&&I&&(s=H,u=re.controls&&re.controls.right||Q.zero,m=s.controls&&s.controls.left||Q.zero,re._relative?(l=u.x+re.x,c=u.y+re.y):(l=u.x,c=u.y),s._relative?(o=m.x+s.x,a=m.y+s.y):(o=m.x,a=m.y),f=s.x,g=s.y,_.bezierCurveTo(l,c,o,a,f,g));break;case te.line:_.lineTo(f,g);break;case te.move:H=re,_.moveTo(f,g);break}}I&&_.closePath(),be.isHidden.test(S)||(p=S._renderer&&S._renderer.offset,p&&(_.save(),_.translate(-S._renderer.offset.x,-S._renderer.offset.y),_.scale(S._renderer.scale.x,S._renderer.scale.y)),_.fill(),p&&_.restore()),be.isHidden.test(C)||(p=C._renderer&&C._renderer.offset,p&&(_.save(),_.translate(-C._renderer.offset.x,-C._renderer.offset.y),_.scale(C._renderer.scale.x,C._renderer.scale.y),_.lineWidth=B/C._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 h=d.x,u=d.y,m=d.controls;let f,g,p,y,b,_;o=Math.min(u,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(u,a),d.controls&&(b=m.left,_=m.right,!(!b||!_)&&(f=d._relative?b.x+h:b.x,g=d._relative?b.y+u:b.y,p=d._relative?_.x+h:_.x,y=d._relative?_.y+u:_.y,!(!f||!g||!p||!y)&&(o=Math.min(g,y,o),r=Math.min(f,p,r),s=Math.max(f,p,s),a=Math.max(g,y,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;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=ct.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 We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof je&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Pe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof je&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Pe&&(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 nn(9)),this._matrix.toTransformArray(!0,zn),Ur(zn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let u,m;this._scale instanceof Q?(u=this._scale.x*r._renderer.scale.x,m=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,m=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,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 u=ct.Utils.getRendererType(this._mask._renderer.type);be[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(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,be.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),be.updateTexture.call(be,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,fo,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 h=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,h.left,h.top,h.right,h.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),K.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,h=e.dashes,u=e._size*o;let m=u;be.isHidden.test(a)||(m+=l),r.width=sl(m),r.height=r.width;const f=m/r.width,g=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 y=ct.Utils.getRendererType(c._renderer.type);be[y].render.call(c,s,e),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const y=ct.Utils.getRendererType(a._renderer.type);be[y].render.call(a,s,e),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=rn(e)/f)}typeof d=="number"&&(s.globalAlpha=d),h&&h.length>0&&(s.lineDashOffset=h.offset||0,s.setLineDash(h)),s.save(),s.translate(g,p),s.scale(be.precision,be.precision),s.beginPath(),s.arc(0,0,u/f*.5,0,at),s.restore(),closed&&s.closePath(),be.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()),be.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;K.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,h=this._matrix.manual||this._flagMatrix,u=this._renderer.parent!==s,m=this._renderer.vertices,f=this._renderer.collection.length,g=this._flagVertices,p=this._flagFill||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof je&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Pe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof je&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Pe&&(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||h||u){this._renderer.matrix||(this._renderer.matrix=new nn(9)),this._matrix.toTransformArray(!0,zn),Ur(zn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let y,b;this._scale instanceof Q?(y=this._scale.x*s._renderer.scale.x,b=this._scale.y*s._renderer.scale.y):(y=this._scale*s._renderer.scale.x,b=this._scale*s._renderer.scale.y),this._renderer.scale.x=y<0?-y:y,this._renderer.scale.y=b<0?-b:b,u&&(this._renderer.parent=s)}if(g){const y=this._renderer.positionBuffer;y&&t.deleteBuffer(y),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,be.updateTexture.call(be,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:(be.isHidden.test(l)||(r+=c),r/=be.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,f),K.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=pc.copy(e._renderer.scale).multiply(s),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,h=e.dashes,u=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 f=e._renderer.rect.centroid,g=f.x,p=f.y;let y,b,_,v,k,C,B,S,T,$,E;const O=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),O||(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 I=ct.Utils.getRendererType(c._renderer.type);be[I].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const I=ct.Utils.getRendererType(a._renderer.type);be[I].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=rn(e))}if(typeof d=="number"&&(r.globalAlpha=d),h&&h.length>0&&(r.lineDashOffset=h.offset||0,r.setLineDash(h)),r.save(),r.scale(o.x,o.y),r.translate(g,p),be.isHidden.test(c)||(c._renderer&&c._renderer.offset?(C=c._renderer.scale.x,B=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(C,B),y=e._size/c._renderer.scale.y,b=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,y+"px/",b+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,v=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,v),r.restore()):r.fillText(e.value,0,0)),be.isHidden.test(a)||(a._renderer&&a._renderer.offset?(C=a._renderer.scale.x,B=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(C,B),y=e._size/a._renderer.scale.y,b=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,y+"px/",b+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,v=a._renderer.offset.y/a._renderer.scale.y,k=l/a._renderer.scale.x,r.lineWidth=k,r.strokeText(e.value,_,v),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(u)){const I=r.measureText(e.value);switch(u){case"underline":T=I.actualBoundingBoxDescent,E=I.actualBoundingBoxDescent;break;case"strikethrough":T=0,E=0;break}S=-I.width/2,$=I.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(S,T),r.lineTo($,E),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const n=be.ctx;n.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),n.textAlign="center",n.textBaseline=ct.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&&!be.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(be.alignments[t._alignment]||t._alignment){case be.alignments.left:t.direction==="ltr"?(e.left=0,e.right=s):(e.left=-s,e.right=0);break;case be.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;K.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 We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof je&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Pe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof je&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Pe&&(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 nn(9)),this._matrix.toTransformArray(!0,zn),Ur(zn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let h,u;this._scale instanceof Q?(h=this._scale.x*r._renderer.scale.x,u=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,u=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=u<0?-u:u,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 h=ct.Utils.getRendererType(this._mask._renderer.type);be[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(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,be.text.getBoundingClientRect(this,this._renderer.rect),be.updateTexture.call(be,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,fo,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),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(K.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 K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(K.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 K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;K.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 Q||(this._renderer.offset=new Q),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 Q?(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 Q||(this._renderer.scale=new Q);let r,s;this._scale instanceof Q?(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 K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const n=ct.Utils.getRendererType(e._renderer.type);if(this[n].updateCanvas.call(be,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(),K.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 Rt("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]=be.extensions.get(t,s)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new Fr};be.ctx=be.canvas.getContext("2d");var yc=class extends X{constructor(t){super();let e,n,r,s;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(be.canvas=t.offscreenElement,be.ctx=be.canvas.getContext("2d")),this.scene=new nt,this.scene.parent=this,this._renderer={type:"renderer",matrix:new nn(Mm),scale:1,opacity:1},this._flagMatrix=!0,t=K.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 Rt("unable to create a webgl context. Try using another renderer.");r=Dt.create(e,Dt.path.vertex,Dt.types.vertex),s=Dt.create(e,Dt.path.fragment,Dt.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=be.program.create(e,[r,s]),this.programs.text=this.programs.path,e.extensions=be.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,fo,e.STATIC_DRAW),r=Dt.create(e,Dt.points.vertex,Dt.types.vertex),s=Dt.create(e,Dt.points.fragment,Dt.types.fragment),n=this.programs.points=be.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"?Hs(o):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,K.isObject(this.domElement.style)&&K.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(X.Types.resize,t,e,n)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),be.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};w(yc,"Utils",be);var Vm=K.extend({Error:Rt,getRatio:Hs,read:ze,xhr:dc},K,_t,tl,nl),we=class Rr{constructor(e){w(this,"_events",new X),w(this,"type",""),w(this,"renderer",null),w(this,"scene",null),w(this,"width",0),w(this,"height",0),w(this,"frameCount",0),w(this,"timeDelta",0),w(this,"playing",!1);const n=K.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Rr.Types.svg,autostart:!1});if(K.each(n,function(r,s){/fullscreen/i.test(s)||/autostart/i.test(s)||(this[s]=r)},this),K.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Rr.Types[r])}this.renderer=new Rr[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=Om.bind(this),this.fit.domElement=window,this.fit.attached=!0,K.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),K.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Ft.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=Im.bind(this),K.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(X.Types.resize,zm.bind(this)),this.scene=this.renderer.scene,Rr.Instances.push(this),n.autostart&&sr.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,sr.init(),this.trigger(X.Types.play)}pause(){return this.playing=!1,this.trigger(X.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=K.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Ft.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(X.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(X.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 Wr(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,te.move),new ve(r,s,void 0,void 0,void 0,void 0,te.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,te.line),new ve(r,s,void 0,void 0,void 0,void 0,te.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,te.line)],d=new Se(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 In(e,n,r,s);return this.scene.add(o),o}makeRoundedRectangle(e,n,r,s,o){const a=new Lr(e,n,r,s,o);return this.scene.add(a),a}makeCircle(e,n,r,s){const o=new Ir(e,n,r,s);return this.scene.add(o),o}makeEllipse(e,n,r,s,o){const a=new zr(e,n,r,s,o);return this.scene.add(a),a}makeStar(e,n,r,s,o){const a=new io(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 Se(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 no(e,n,r,s);return this.scene.add(o),o}makeArcSegment(e,n,r,s,o,a,l){const c=new Ks(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 Q(a,l))}}const s=new to(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 Se(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 sn(e,n,r,s);return this.add(o),o}makeLinearGradient(e,n,r,s){const o=Array.prototype.slice.call(arguments,4),a=new We(e,n,r,s,o);return this.add(a),a}makeRadialGradient(e,n,r){const s=Array.prototype.slice.call(arguments,3),o=new je(e,n,r,s);return this.add(o),o}makeSprite(e,n,r,s,o,a,l){const c=new Or(e,n,r,s,o,a);return l&&c.play(),this.add(c),c}makeImage(e,n,r,s,o,a){const l=new hc(e,n,r,s,o,a);return this.add(l),l}makeImageSequence(e,n,r,s,o){const a=new ao(e,n,r,s);return o&&a.play(),this.add(a),a}makeTexture(e,n){return new Pe(e,n)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const n=new nt;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 ze))return null;const o=ze[s].call(this,e);return r?this.add(n&&o instanceof nt?o.children:o):o.parent&&o.remove(),o}load(e,n){const r=new nt;let s,o,a;const l=(function(c){for(Ft.temp.innerHTML=c,o=0;o<Ft.temp.children.length;o++)s=Ft.temp.children[o],a=this.interpret(s,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Ft.temp.children.length<=1?Ft.temp.children[0]:Ft.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(dc(e,l),r):(l(e),r)}};w(we,"NextFrameId",wt.NextFrameId),w(we,"Types",wt.Types),w(we,"Version",wt.Version),w(we,"PublishDate",wt.PublishDate),w(we,"Identifier",wt.Identifier),w(we,"Resolution",wt.Resolution),w(we,"AutoCalculateImportedMatrices",wt.AutoCalculateImportedMatrices),w(we,"Instances",wt.Instances),w(we,"uniqueId",wt.uniqueId),w(we,"Anchor",ve),w(we,"Collection",An),w(we,"Events",X),w(we,"Group",nt),w(we,"Matrix",Fi),w(we,"Path",Se),w(we,"Registry",Fr),w(we,"Element",Pi),w(we,"Shape",On),w(we,"Text",sn),w(we,"Vector",Q),w(we,"Gradient",Qe),w(we,"Image",hc),w(we,"ImageSequence",ao),w(we,"LinearGradient",We),w(we,"RadialGradient",je),w(we,"Sprite",Or),w(we,"Stop",Vn),w(we,"Texture",Pe),w(we,"ArcSegment",Ks),w(we,"Circle",Ir),w(we,"Ellipse",zr),w(we,"Line",Wr),w(we,"Points",to),w(we,"Polygon",no),w(we,"Rectangle",In),w(we,"RoundedRectangle",Lr),w(we,"Star",io),w(we,"CanvasRenderer",ct),w(we,"SVGRenderer",mc),w(we,"WebGLRenderer",yc),w(we,"Commands",te),w(we,"Utils",Vm);var an=we;function Om(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function Im(){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 zm(t,e){this.width=t,this.height=e,this.trigger(X.Types.resize,t,e)}var sr=Ft.getRequestAnimationFrame();function bc(){for(let t=0;t<an.Instances.length;t++){const e=an.Instances[t];e.playing&&e.update()}an.NextFrameId=sr(bc)}sr.init=function(){bc(),sr.init=function(){}};let ln;typeof window<"u"?ln=window:typeof global<"u"?ln=global:typeof self<"u"&&(ln=self);let _c;const ei=Math.PI*2,it=Math.PI*.5;function Lm(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 Dm(t){_c=t}function Hm(t,e){e=e&&e.identity()||new _c;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 Ht(t,e,n){return n*(e-t)+t}function Vi(t,e){for(;t<0;)t+=e;return t%e}const wc=ln.Float32Array||Array,Wm=Math.floor;function cn(t){return Wm(t*1e6)/1e6}const he={move:"M",line:"L",curve:"C",close:"Z"};class G{constructor(){x(this,"_events",{});x(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 h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}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}}x(G,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),x(G,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const xc={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(G.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(G.Types.change))}}},st=class st extends G{constructor(n=0,r=0){super();x(this,"_x",0);x(this,"_y",0);for(let s in xc)Object.defineProperty(this,s,xc[s]);this.x=n,this.y=r}static add(n,r){return new st(n.x+r.x,n.y+r.y)}static sub(n,r){return new st(n.x-r.x,n.y-r.y)}static subtract(n,r){return st.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(st.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 st(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:cn(this.x),y:cn(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}};x(st,"zero",new st),x(st,"left",new st(-1,0)),x(st,"right",new st(1,0)),x(st,"up",new st(0,-1)),x(st,"down",new st(0,1));let ge=st;class Re extends ge{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=he.move){super(n,r);x(this,"controls",{left:new ge,right:new ge});x(this,"_command",he.move);x(this,"_relative",!0);x(this,"_rx",0);x(this,"_ry",0);x(this,"_xAxisRotation",0);x(this,"_largeArcFlag",0);x(this,"_sweepFlag",1);for(let h in vc)Object.defineProperty(this,h,vc[h]);this.command=c,this.relative=!0;const d=Re.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(G.Types.change,d),this.controls.right.set(a,l).addEventListener(G.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(G.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:cn(this.x),y:cn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:cn(this.rx),ry:cn(this.ry),xAxisRotation:cn(this.xAxisRotation),largeArcFlag:cn(this.largeArcFlag),sweepFlag:cn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const vc={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(G.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(G.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(G.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(G.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(G.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(G.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(G.Types.change))}}};let jm=0;const go={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return jm++}},Gr={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 Kr(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 kc(t,e,n,r,s,o,a,l,c){c=c||Gr.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Re(a,l)];const h=[];for(let u=0;u<d;u++){const m=u/d,f=Kr(m,t,n,s,a),g=Kr(m,e,r,o,l);h.push(new Re(f,g))}return h}function qm(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const y=a-t,b=l-e;return Math.sqrt(y*y+b*b)}const d=9*(n-s)+3*(a-t),h=6*(t+s)-12*n,u=3*(n-t),m=9*(r-o)+3*(l-e),f=6*(e+o)-12*r,g=3*(r-e);function p(y){const b=(d*y+h)*y+u,_=(m*y+f)*y+g;return Math.sqrt(b*b+_*_)}return Ym(p,0,1,c||Gr.RecursionLimit)}function Xm(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,m,f,g,p,y,b;for(let C=0;C<2;++C){if(C===0?(u=6*t-12*n+6*s,h=-3*t+9*n-9*s+3*a,m=3*n-3*t):(u=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(h)<.001){if(Math.abs(u)<.001)continue;f=-m/u,0<f&&f<1&&c.push(f);continue}y=u*u-4*m*h,b=Math.sqrt(y),!(y<0)&&(g=(-u+b)/(2*h),0<g&&g<1&&c.push(g),p=(-u-b)/(2*h),0<p&&p<1&&c.push(p))}let _=c.length,v=_,k;for(;_--;)f=c[_],k=1-f,d[0][_]=k*k*k*t+3*k*k*f*n+3*k*f*f*s+f*f*f*a,d[1][_]=k*k*k*e+3*k*k*f*r+3*k*f*f*o+f*f*f*l;return d[0][v]=t,d[1][v]=e,d[0][v+1]=a,d[1][v+1]=l,d[0].length=d[1].length=v+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 Ym(t,e,n,r){let s=Gr.abscissas[r-2],o=Gr.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,h=r&1?o[c++]*t(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(t(l+u)+t(l-u))}return a*h}function Um(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Vi(s-1,n):Math.max(s-1,0),l=e?Vi(s+1,n):Math.min(s+1,r),c=t[a],d=o,h=t[l];Gm(c,d,h),d.command=s===0?he.move:he.curve}}function Gm(t,e,n){const r=ge.angleBetween(t,e),s=ge.angleBetween(n,e);let o=ge.distanceBetween(t,e),a=ge.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+=it:l-=it,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 or=(yi=class extends G{constructor(){super();x(this,"_flagId",!1);x(this,"_flagClassName",!1);x(this,"_renderer",{});x(this,"_id",go.Identifier+go.uniqueId());x(this,"_className","");x(this,"classList",[]);for(let n in Cc)Object.defineProperty(this,n,Cc[n])}static fromObject(n){const r=new yi().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}},x(yi,"Properties",["renderer","id","className"]),yi);const Cc={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 Zr extends Error{constructor(n){super();x(this,"name","Two.js");x(this,"message");this.message=n}}class Km{constructor(){x(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 Qr;const Sc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};ln.document&&(Qr=document.createElement("a"));const Xe=class Xe extends or{constructor(n,r){super();x(this,"_flagSrc",!1);x(this,"_flagImage",!1);x(this,"_flagVideo",!1);x(this,"_flagLoaded",!1);x(this,"_flagRepeat",!1);x(this,"_flagOffset",!1);x(this,"_flagScale",!1);x(this,"_src","");x(this,"_image",null);x(this,"_loaded",!1);x(this,"_repeat","no-repeat");x(this,"_scale",1);x(this,"_offset",null);for(let s in Bc)Object.defineProperty(this,s,Bc[s]);if(this._renderer.type="texture",this._renderer.flagOffset=Zm.bind(this),this._renderer.flagScale=Qm.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new ge,typeof r=="function"){const s=(function(){this.unbind(G.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(G.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 Xe().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return Qr?(Qr.href=n,Qr.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=Xe.getAbsoluteURL(n);if(Xe.ImageRegistry.contains(r))return Xe.ImageRegistry.get(r);let s;return ln.document?Sc.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=Xe.getTag(s);n._flagImage&&(/canvas/i.test(o)?Xe.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,Xe.Register[o](n,r))),n._flagSrc&&(s||(s=Xe.getImage(n.src),n.image=s),o=Xe.getTag(s),Xe.Register[o](n,r))}clone(){const n=new Xe(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 ge?n.offset:new ge().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof ge?n.scale:new ge().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(G.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Xe.load(this,(function(){this.loaded=!0,this.trigger(G.Types.change).trigger(G.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}};x(Xe,"Properties",["src","loaded","repeat","scale","offset","image"]),x(Xe,"RegularExpressions",Sc),x(Xe,"ImageRegistry",new Km),x(Xe,"Register",{canvas:function(n,r){n._src="#"+n.id,Xe.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 Zr("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=Xe.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),Xe.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 Zr("unable to load "+n.src)};n._src=Xe.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),Xe.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 qe=Xe;const Bc={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=qe.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}qe.ImageRegistry.contains(n)?this._image=qe.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(G.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(G.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof ge&&this._scale.unbind(G.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof ge&&this._scale.bind(G.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Zm(){this._flagOffset=!0}function Qm(){this._flagScale=!0}class ti extends Array{constructor(){super();Aa(this,ot,new G);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 Bt(this,ot)}set _events(n){Fu(this,ot,n)}get _bound(){return Bt(this,ot)._bound}set _bound(n){Bt(this,ot)._bound=n}addEventListener(){return Bt(this,ot).addEventListener.apply(this,arguments)}on(){return Bt(this,ot).on.apply(this,arguments)}bind(){return Bt(this,ot).bind.apply(this,arguments)}removeEventListener(){return Bt(this,ot).removeEventListener.apply(this,arguments)}off(){return Bt(this,ot).off.apply(this,arguments)}unbind(){return Bt(this,ot).unbind.apply(this,arguments)}dispatchEvent(){return Bt(this,ot).dispatchEvent.apply(this,arguments)}trigger(){return Bt(this,ot).trigger.apply(this,arguments)}listen(){return Bt(this,ot).listen.apply(this,arguments)}ignore(){return Bt(this,ot).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(G.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(G.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(G.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(G.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(G.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(G.Types.insert,r),this.trigger(G.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(G.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(G.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}}ot=new WeakMap;const Tc=Array.prototype.slice;function Jm(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const $e={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=Tc.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=Tc.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=!Jm(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:ln.performance&&ln.performance.now?ln.performance:Date},Et=class Et extends or{constructor(n,r,s){super();x(this,"_flagOffset",!0);x(this,"_flagOpacity",!0);x(this,"_flagColor",!0);x(this,"_offset",0);x(this,"_opacity",1);x(this,"_color","#fff");for(let o in Rc)Object.defineProperty(this,o,Rc[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Et.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Et.Index<=0?"#fff":"#000",Et.Index=(Et.Index+1)%2}static fromObject(n){const r=new Et().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Et.Properties.length;r++){const s=Et.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Et;return $e.each(Et.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",$e.each(Et.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};x(Et,"Index",0),x(Et,"Properties",["offset","opacity","color"]);let ni=Et;const Rc={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)}}},fn=class fn extends or{constructor(n){super();x(this,"_flagStops",!1);x(this,"_flagSpread",!1);x(this,"_flagUnits",!1);x(this,"_spread","");x(this,"_units","");for(let r in $c)Object.defineProperty(this,r,$c[r]);this._renderer.type="gradient",this._renderer.flagStops=ep.bind(this),this._renderer.bindStops=tp.bind(this),this._renderer.unbindStops=np.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 ni?o:new ni().copy(o)));const s=new fn(r).copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new fn(r);return $e.each(fn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<fn.Properties.length;r++){const s=fn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return $e.each(fn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(G.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}};x(fn,"Stop",ni),x(fn,"Properties",["spread","stops","units"]);let Je=fn;const $c={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(G.Types.insert,e).unbind(G.Types.remove,n),this._stops=new ti((t||[]).slice(0)),this._stops.bind(G.Types.insert,e).bind(G.Types.remove,n),e(this._stops)}}};function ep(){this._flagStops=!0}function tp(t){let e=t.length;for(;e--;)t[e].bind(G.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function np(t){let e=t.length;for(;e--;)t[e].unbind(G.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const qn=class qn extends Je{constructor(n,r,s,o,a){super(a);x(this,"_flagEndPoints",!1);x(this,"_left",null);x(this,"_right",null);for(let l in Ec)Object.defineProperty(this,l,Ec[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=ip.bind(this),this.left=new ge,this.right=new ge,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 qn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<qn.Properties.length;r++){const s=qn.Properties[r];s in n&&(this[s]=n[s]instanceof ge?n[s]:new ge().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new qn(this.left._x,this.left._y,this.right._x,this.right._y,r);return $e.each(Je.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(G.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};x(qn,"Stop",ni),x(qn,"Properties",["left","right"]);let xt=qn;const Ec={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof ge&&this._left.unbind(G.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(G.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof ge&&this._right.unbind(G.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(G.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function ip(){this._flagEndPoints=!0}const gn=class gn extends Je{constructor(n,r,s,o,a,l){super(o);x(this,"_flagRadius",!1);x(this,"_flagCenter",!1);x(this,"_flagFocal",!1);x(this,"_radius",0);x(this,"_center",null);x(this,"_focal",null);for(let c in Nc)Object.defineProperty(this,c,Nc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=rp.bind(this),this._renderer.flagFocal=sp.bind(this),this.center=new ge,this.radius=typeof s=="number"?s:1,this.focal=new ge,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 gn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<gn.Properties.length;r++){const s=gn.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof ge?n[s]:new ge().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 gn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return $e.each(Je.Properties.concat(gn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return $e.each(gn.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(G.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};x(gn,"Stop",ni),x(gn,"Properties",["center","radius","focal"]);let vt=gn;const Nc={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(G.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(G.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(G.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(G.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function rp(){this._flagCenter=!0}function sp(){this._flagFocal=!0}function Pc(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 Jr(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 Fc(t,e,n){let r,s,o,a,l,c,d,h;const u=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(u||e).x,c=(u||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,u&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),qm(r,l,s,c,o,d,a,h,n)}function Mc(t,e,n){let r,s,o,a,l,c,d,h;const u=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(u||e).x,c=(u||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,u&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),kc(r,l,s,c,o,d,a,h,n)}function ii(t){switch(t.renderer.type){case"texture":return qe.fromObject(t);case"gradient":return Je.fromObject(t);case"linear-gradient":return xt.fromObject(t);case"radial-gradient":return vt.fromObject(t)}return t}const op=Math.cos,ap=Math.sin,Ac=Math.tan,mo=[],Ct=class Ct extends G{constructor(n,r,s,o,a,l){super();x(this,"elements",new wc(9));x(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 S=n;let T,$,E;const O=r[0]||0,I=r[1]||0,A=r[2]||0;return T=S[0]*O+S[1]*I+S[2]*A,$=S[3]*O+S[4]*I+S[5]*A,E=S[6]*O+S[7]*I+S[8]*A,[T,$,E]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],u=n[6],m=n[7],f=n[8],g=r[0],p=r[1],y=r[2],b=r[3],_=r[4],v=r[5],k=r[6],C=r[7],B=r[8];return s=s||new wc(9),s[0]=o*g+a*b+l*k,s[1]=o*p+a*_+l*C,s[2]=o*y+a*v+l*B,s[3]=c*g+d*b+h*k,s[4]=c*p+d*_+h*C,s[5]=c*y+d*v+h*B,s[6]=u*g+m*b+f*k,s[7]=u*p+m*_+f*C,s[8]=u*y+m*v+f*B,s}static fromObject(n){return new Ct().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const u=n;n=u[0],r=u[1],s=u[2],o=u[3],a=u[4],l=u[5],c=u[6],d=u[7],h=u[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]=h,this.trigger(G.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(G.Types.change)}identity(){return this.elements[0]=Ct.Identity[0],this.elements[1]=Ct.Identity[1],this.elements[2]=Ct.Identity[2],this.elements[3]=Ct.Identity[3],this.elements[4]=Ct.Identity[4],this.elements[5]=Ct.Identity[5],this.elements[6]=Ct.Identity[6],this.elements[7]=Ct.Identity[7],this.elements[8]=Ct.Identity[8],this.trigger(G.Types.change)}multiply(n,r,s,o,a,l,c,d,h){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(G.Types.change);if(typeof s>"u"&&(s=1),typeof o>"u"){n=n||0,r=r||0,s=s||0,a=this.elements;const D=a[0]*n+a[1]*r+a[2]*s,ee=a[3]*n+a[4]*r+a[5]*s,N=a[6]*n+a[7]*r+a[8]*s;return[D,ee,N]}const u=this.elements,m=[n,r,s,o,a,l,c,d,h],f=u[0],g=u[1],p=u[2],y=u[3],b=u[4],_=u[5],v=u[6],k=u[7],C=u[8],B=m[0],S=m[1],T=m[2],$=m[3],E=m[4],O=m[5],I=m[6],A=m[7],L=m[8];return this.elements[0]=f*B+g*$+p*I,this.elements[1]=f*S+g*E+p*A,this.elements[2]=f*T+g*O+p*L,this.elements[3]=y*B+b*$+_*I,this.elements[4]=y*S+b*E+_*A,this.elements[5]=y*T+b*O+_*L,this.elements[6]=v*B+k*$+C*I,this.elements[7]=v*S+k*E+C*A,this.elements[8]=v*T+k*O+C*L,this.trigger(G.Types.change)}inverse(n){const r=this.elements;n=n||new Ct;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],u=r[7],m=r[8],f=m*c-d*u,g=-m*l+d*h,p=u*l-c*h;let y=s*f+o*g+a*p;return y?(y=1/y,n.elements[0]=f*y,n.elements[1]=(-m*o+a*u)*y,n.elements[2]=(d*o-a*c)*y,n.elements[3]=g*y,n.elements[4]=(m*s-a*h)*y,n.elements[5]=(-d*s+a*l)*y,n.elements[6]=p*y,n.elements[7]=(-u*s+o*h)*y,n.elements[8]=(c*s-o*l)*y,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=op(n),s=ap(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=Ac(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=Ac(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return mo.length=0,this.toTransformArray(n,mo),mo.map(cn).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const m=s[6],f=s[7],g=s[8];if(o){r[0]=a,r[1]=d,r[2]=m,r[3]=l,r[4]=h,r[5]=f,r[6]=c,r[7]=u,r[8]=g;return}return[a,d,m,l,h,f,c,u,g]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=u;return}return[a,d,l,h,c,u]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const m=s[6],f=s[7],g=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u,r[6]=m,r[7]=f,r[8]=g;return}return[a,l,c,d,h,u,m,f,g]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u;return}return[a,l,c,d,h,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Ct().copy(this)}};x(Ct,"Identity",[1,0,0,0,1,0,0,0,1]);let ar=Ct;Dm(ar);const Cr=class Cr extends or{constructor(){super();x(this,"_flagMatrix",!0);x(this,"_flagScale",!1);x(this,"_matrix",null);x(this,"_worldMatrix",null);x(this,"_position",null);x(this,"_rotation",0);x(this,"_scale",1);x(this,"_skewX",0);x(this,"_skewY",0);for(let n in es)Object.defineProperty(this,n,es[n]);this._renderer.flagMatrix=Vc.bind(this),this.isShape=!0,this.matrix=new ar,this.worldMatrix=new ar,this.position=new ge,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new Cr().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 es.position.get.apply(this,arguments)}set translation(n){es.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 ge?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 ge?n.scale:new ge(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 Cr;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 ge?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 ge?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}};x(Cr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let wn=Cr;const es={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(G.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(G.Types.change,this._renderer.flagMatrix),Vc.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 ge&&this._scale.unbind(G.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof ge&&this._scale.bind(G.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 Hm(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Vc(){this._flagMatrix=!0}const Oi=Math.min,Ii=Math.max,lp=Math.ceil,cp=Math.floor,dp=new ge,Gt=class Gt extends wn{constructor(n,r,s,o){super();x(this,"_flagVertices",!0);x(this,"_flagLength",!0);x(this,"_flagFill",!0);x(this,"_flagStroke",!0);x(this,"_flagLinewidth",!0);x(this,"_flagOpacity",!0);x(this,"_flagVisible",!0);x(this,"_flagCap",!0);x(this,"_flagJoin",!0);x(this,"_flagMiter",!0);x(this,"_flagStrokeAttenuation",!0);x(this,"_flagMask",!1);x(this,"_flagClip",!1);x(this,"_length",0);x(this,"_fill","#fff");x(this,"_stroke","#000");x(this,"_linewidth",1);x(this,"_opacity",1);x(this,"_visible",!0);x(this,"_cap","round");x(this,"_join","round");x(this,"_miter",4);x(this,"_closed",!0);x(this,"_curved",!1);x(this,"_automatic",!0);x(this,"_beginning",0);x(this,"_ending",1);x(this,"_mask",null);x(this,"_clip",!1);x(this,"_dashes",null);x(this,"_strokeAttenuation",!0);for(let a in Oc)Object.defineProperty(this,a,Oc[a]);this._renderer.type="path",this._renderer.flagVertices=Ic.bind(this),this._renderer.bindVertices=zc.bind(this),this._renderer.unbindVertices=Lc.bind(this),this._renderer.flagFill=Dc.bind(this),this._renderer.flagStroke=Hc.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:ii(n.fill),s=typeof n.stroke=="string"?n.stroke:ii(n.stroke),o=new Gt().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<Gt.Properties.length;r++){const s=Gt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Gt;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<Gt.Properties.length;s++){const o=Gt.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()),$e.each(Gt.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,h=-1/0,u=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:f,scaleY:g}=Lm(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof f=="number"&&typeof g=="number"&&(s=Math.max(f,g)*(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[f,g]=r.multiply(l.x,l.y),[p,y]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let b=l.controls.right.x,_=l.controls.right.y;l.relative&&(b+=l.x,_+=l.y);let[v,k]=r.multiply(b,_),C=c.controls.left.x,B=c.controls.left.y;c.relative&&(C+=c.x,B+=c.y);let[S,T]=r.multiply(C,B);const $=Xm(f,g,v,k,S,T,p,y);u=Oi($.min.y-s,u),d=Oi($.min.x-s,d),h=Ii($.max.x+s,h),m=Ii($.max.y+s,m)}else a<=1&&(u=Oi(g-s,u),d=Oi(f-s,d),h=Ii(f+s,h),m=Ii(g+s,m)),u=Oi(y-s,u),d=Oi(p-s,d),h=Ii(p+s,h),m=Ii(y+s,m)}return{top:u,left:d,right:h,bottom:m,width:h-d,height:m-u}}getPointAt(n,r){let s,o,a,l,c,d,h,u,m,f,g,p,y,b,_,v=this.length*Math.min(Math.max(n,0),1);const k=this.vertices.length,C=k-1;let B=null,S=null;for(let P=0,H=this._lengths.length,q=0;P<H;P++){if(q+this._lengths[P]>=v){this._closed?(s=Vi(P,k),o=Vi(P-1,k),P===0&&(s=o,o=P)):(s=P,o=Math.min(Math.max(P-1,0),C)),B=this.vertices[s],S=this.vertices[o],v-=q,this._lengths[P]!==0?n=v/this._lengths[P]:n=0;break}q+=this._lengths[P]}if(B===null||S===null)return null;if(B){if(!S)return B}else return S;_=S.controls&&S.controls.right,b=B.controls&&B.controls.left,c=S.x,f=S.y,d=(_||S).x,g=(_||S).y,h=(b||B).x,p=(b||B).y,u=B.x,y=B.y,_&&S.relative&&(d+=S.x,g+=S.y),b&&B.relative&&(h+=B.x,p+=B.y),l=Kr(n,c,d,h,u),m=Kr(n,f,g,p,y);const T=Ht(c,d,n),$=Ht(f,g,n),E=Ht(d,h,n),O=Ht(g,p,n),I=Ht(h,u,n),A=Ht(p,y,n),L=Ht(T,E,n),D=Ht($,O,n),ee=Ht(E,I,n),N=Ht(O,A,n);return $e.isObject(r)?(r.x=l,r.y=m,r instanceof Re&&(r.controls.left.x=L,r.controls.left.y=D,r.controls.right.x=ee,r.controls.right.y=N,(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,L-l,D-m,ee-l,N-m,this._curved?he.curve:he.line),a.t=n,a)}plot(){if(this.curved)return Um(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?he.move:he.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===he.close;let o=this.vertices[r],a=[],l;return $e.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===he.move){a.push(new Re(o.x,o.y)),d>0&&(a[a.length-1].command=he.line),o=c;return}l=Mc(c,o,n),a=a.concat(l),$e.each(l,function(h,u){u<=0&&o.command===he.move?h.command=he.move:h.command=he.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=Mc(c,o,n),a=a.concat(l),$e.each(l,function(h,u){u<=0&&o.command===he.move?h.command=he.move:h.command=he.line})),a.push(new Re(c.x,c.y)),a[a.length-1].command=s?he.close:he.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=[]),$e.each(this.vertices,function(c,d){if(d<=0||c.command===he.move){a=c,this._lengths[d]=0;return}this._lengths[d]=Fc(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=Jr(this,s*this._length),l=Jr(this,o*this._length),c=lp(a),d=cp(l);let h,u,m,f,g,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&&!u?(g=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,g),g.command=this._renderer.collection[p].command,this._renderer.vertices.push(g),u=g,m=this._collection[p-1],m&&m.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),m.relative?this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(ge.zero,1-g.t):this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(m,1-g.t))):p>=c&&p<=d&&(g=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(g),p===d&&Pc(this,o)?(u=g,!r&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):p===c&&Pc(this,s)&&(h=g,h.command=he.move,!r&&h.controls&&(h.relative?h.controls.left.clear():h.controls.left.copy(h))));c>0&&!h&&(p=c-1,g=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(s,g),g.command=he.move,this._renderer.vertices.unshift(g),f=this._collection[p+1],f&&f.controls&&(g.controls.left.clear(),f.relative?this._renderer.collection[p+1].controls.left.copy(f.controls.left).lerp(ge.zero,g.t):(dp.copy(f),this._renderer.collection[p+1].controls.left.copy(f.controls.left).lerp(f,g.t))))}return wn.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,wn.prototype.flagReset.call(this),this}};x(Gt,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),x(Gt,"Utils",{getCurveLength:Fc});let Ee=Gt;const Oc={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 Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.bind(G.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";$e.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(G.Types.insert,e).unbind(G.Types.remove,n),t instanceof ti?this._collection=t:this._collection=new ti(t||[]),this._collection.bind(G.Types.insert,e).bind(G.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,$e.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 Ic(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function zc(t){let e=t.length;for(;e--;)t[e].bind(G.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Lc(t){let e=t.length;for(;e--;)t[e].unbind(G.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Dc(){this._flagFill=!0}function Hc(){this._flagStroke=!0}const hp=Math.ceil,up=Math.floor,mn=class mn extends wn{constructor(n){super();x(this,"_flagVertices",!0);x(this,"_flagLength",!0);x(this,"_flagFill",!0);x(this,"_flagStroke",!0);x(this,"_flagLinewidth",!0);x(this,"_flagOpacity",!0);x(this,"_flagVisible",!0);x(this,"_flagSize",!0);x(this,"_flagSizeAttenuation",!0);x(this,"_flagStrokeAttenuation",!0);x(this,"_length",0);x(this,"_fill","#fff");x(this,"_stroke","#000");x(this,"_linewidth",1);x(this,"_opacity",1);x(this,"_visible",!0);x(this,"_size",1);x(this,"_sizeAttenuation",!1);x(this,"_beginning",0);x(this,"_ending",1);x(this,"_dashes",null);x(this,"_strokeAttenuation",!0);x(this,"noFill",Ee.prototype.noFill);x(this,"noStroke",Ee.prototype.noStroke);x(this,"corner",Ee.prototype.corner);x(this,"center",Ee.prototype.center);x(this,"getBoundingClientRect",Ee.prototype.getBoundingClientRect);x(this,"_updateLength",Ee.prototype._updateLength);for(let r in Wc)Object.defineProperty(this,r,Wc[r]);this._renderer.type="points",this._renderer.flagVertices=Ic.bind(this),this._renderer.bindVertices=zc.bind(this),this._renderer.unbindVertices=Lc.bind(this),this._renderer.flagFill=Dc.bind(this),this._renderer.flagStroke=Hc.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:ii(n.fill),s=typeof n.stroke=="string"?n.stroke:ii(n.stroke),o=new mn().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<mn.Properties.length;r++){const s=mn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new mn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<mn.Properties.length;s++){const o=mn.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()),$e.each(mn.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,h=a.y,u=kc(l,c,l,c,d,h,d,h,n);r=r.concat(u)}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=Jr(this,n*this._length),o=Jr(this,r*this._length),a=hp(s),l=up(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let h=0;h<this._collection.length;h++)h>=a&&h<=l&&(d=this._collection[h],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}};x(mn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let ts=mn;const Wc={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 Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.bind(G.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(G.Types.insert,e).unbind(G.Types.remove,n),t instanceof ti?this._collection=t:this._collection=new ti(t||[]),this._collection.bind(G.Types.insert,e).bind(G.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 ti{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);Aa(this,Rs,{});this.attach(n),this.on(G.Types.insert,this.attach),this.on(G.Types.remove,this.detach)}get ids(){return Bt(this,Rs)}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}}Rs=new WeakMap;const Sn=class Sn extends Ee{constructor(n,r,s,o,a,l,c){const d=c||go.Resolution*3,h=[];for(let u=0;u<d;u++)h.push(new Re);super(h,!0,!1,!0);x(this,"_flagStartAngle",!1);x(this,"_flagEndAngle",!1);x(this,"_flagInnerRadius",!1);x(this,"_flagOuterRadius",!1);x(this,"_startAngle",0);x(this,"_endAngle",ei);x(this,"_innerRadius",0);x(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let u in qc)Object.defineProperty(this,u,qc[u]);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 Sn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Sn.Properties.length;r++){const s=Sn.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=Vi(n,ei)===Vi(r,ei),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,u=0,m,f,g,p,y,b,_,v,k;for(a?d--:l||(d-=2),m=0,f=d-1;m<d;m++){switch(g=m/f,p=c[u],y=g*(r-n)+n,b=(r-n)/d,_=o*Math.cos(y),v=o*Math.sin(y),m){case 0:h=he.move;break;default:h=he.curve}p.command=h,p.x=_,p.y=v,p.controls.left.clear(),p.controls.right.clear(),p.command===he.curve&&(k=o*b/Math.PI,p.controls.left.x=k*Math.cos(y-it),p.controls.left.y=k*Math.sin(y-it),p.controls.right.x=k*Math.cos(y+it),p.controls.right.y=k*Math.sin(y+it),m===1&&p.controls.left.multiplyScalar(2),m===f&&p.controls.right.multiplyScalar(2)),u++}if(l){for(a?(c[u].command=he.close,u++):(d--,f=d-1),m=0;m<d;m++)g=m/f,p=c[u],y=(1-g)*(r-n)+n,b=(r-n)/d,_=s*Math.cos(y),v=s*Math.sin(y),h=he.curve,m<=0&&(h=a?he.move:he.line),p.command=h,p.x=_,p.y=v,p.controls.left.clear(),p.controls.right.clear(),p.command===he.curve&&(k=s*b/Math.PI,p.controls.left.x=k*Math.cos(y+it),p.controls.left.y=k*Math.sin(y+it),p.controls.right.x=k*Math.cos(y-it),p.controls.right.y=k*Math.sin(y-it),m===1&&p.controls.left.multiplyScalar(2),m===f&&p.controls.right.multiplyScalar(2)),u++;c[u].copy(c[0]),c[u].command=he.line}else a||(c[u].command=he.line,c[u].x=0,c[u].y=0,u++,c[u].copy(c[0]),c[u].command=he.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 Sn(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<Ee.Properties.length;d++){const h=Ee.Properties[d];c[h]=this[h]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<Sn.Properties.length;r++){const s=Sn.Properties[r];n[s]=this[s]}return n}};x(Sn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let po=Sn;const qc={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}}},yo=Math.cos,bo=Math.sin,Bn=class Bn extends Ee{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);x(this,"_flagRadius",!1);x(this,"_radius",0);this._renderer.type="circle";for(let c in Xc)Object.defineProperty(this,c,Xc[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 Bn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Bn.Properties.length;r++){const s=Bn.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*ei,d=s*yo(c),h=s*bo(c),u=o*yo(c-it),m=o*bo(c-it),f=o*yo(c+it),g=o*bo(c+it),p=this.vertices[a];p.command=a===0?he.move:he.curve,p.set(d,h),p.controls.left.set(u,m),p.controls.right.set(f,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new Bn(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<Ee.Properties.length;s++){const o=Ee.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<Bn.Properties.length;r++){const s=Bn.Properties[r];n[s]=this[s]}return n}};x(Bn,"Properties",["radius"]);let _o=Bn;const Xc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},wo=Math.cos,xo=Math.sin,Tn=class Tn extends Ee{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);x(this,"_flagWidth",!1);x(this,"_flagHeight",!1);x(this,"_width",0);x(this,"_height",0);this._renderer.type="ellipse";for(let d in Yc)Object.defineProperty(this,d,Yc[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 Tn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Tn.Properties.length;r++){const s=Tn.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*ei,d=s*wo(c),h=o*xo(c),u=s*r*wo(c-it),m=o*r*xo(c-it),f=s*r*wo(c+it),g=o*r*xo(c+it),p=this.vertices[a];p.command=a===0?he.move:he.curve,p.set(d,h),p.controls.left.set(u,m),p.controls.right.set(f,g)}}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 Tn(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<Ee.Properties.length;l++){const c=Ee.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<Tn.Properties.length;r++){const s=Tn.Properties[r];n[s]=this[s]}return n}};x(Tn,"Properties",["width","height"]);let vo=Tn;const Yc={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,gp=Math.sin,Rn=class Rn extends Ee{constructor(n,r,s,o){o=Math.max(o||0,3);super();x(this,"_flagWidth",!1);x(this,"_flagHeight",!1);x(this,"_flagSides",!1);x(this,"_radius",0);x(this,"_width",0);x(this,"_height",0);x(this,"_sides",0);this._renderer.type="polygon";for(let a in Uc)Object.defineProperty(this,a,Uc[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 Rn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Rn.Properties.length;r++){const s=Rn.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=ei*a+Math.PI/2,c=this._width*fp(l)/2,d=this._height*gp(l)/2;o>=s?this.vertices.push(new Re(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?he.move:he.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 Rn(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<Ee.Properties.length;s++){const o=Ee.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<Rn.Properties.length;r++){const s=Rn.Properties[r];n[s]=this[s]}return n}};x(Rn,"Properties",["width","height","sides"]);let ko=Rn;const Uc={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}}},bi=class bi extends Ee{constructor(n,r,s,o){const a=[new Re,new Re,new Re,new Re];super(a,!0,!1,!0);x(this,"_flagWidth",!1);x(this,"_flagHeight",!1);x(this,"_width",0);x(this,"_height",0);x(this,"_origin",null);this._renderer.type="rectangle";for(let l in Gc)Object.defineProperty(this,l,Gc[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new ge,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new bi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<bi.Properties.length;r++){const s=bi.Properties[r];s in n&&(typeof n[s]=="number"?this[s]=n[s]:this[s]instanceof ge&&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=he.move,this.vertices[1].set(n,-r).sub(this._origin).command=he.line,this.vertices[2].set(n,r).sub(this._origin).command=he.line,this.vertices[3].set(-n,r).sub(this._origin).command=he.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=he.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new bi(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<Ee.Properties.length;s++){const o=Ee.Properties[s];r[o]instanceof ge?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}};x(bi,"Properties",["width","height","origin"]);let lr=bi;const Gc={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(G.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(G.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},$n=class $n extends Ee{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?he.move:he.curve));super(l);x(this,"_flagWidth",!1);x(this,"_flagHeight",!1);x(this,"_flagRadius",!1);x(this,"_width",0);x(this,"_height",0);x(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in Kc)Object.defineProperty(this,c,Kc[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 ge)&&(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 $n().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<$n.Properties.length;r++){const s=$n.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof ge?o:new ge().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 ge?(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 $n(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<Ee.Properties.length;l++){const c=Ee.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<$n.Properties.length;r++){const s=$n.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};x($n,"Properties",["width","height","radius"]);let Co=$n;const Kc={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 ge&&this._radius.unbind(G.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof ge&&this._radius.bind(G.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function mp(){this._flagRadius=!0}const pp=Math.cos,yp=Math.sin,En=class En extends Ee{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();x(this,"_flagInnerRadius",!1);x(this,"_flagOuterRadius",!1);x(this,"_flagSides",!1);x(this,"_innerRadius",0);x(this,"_outerRadius",0);x(this,"_sides",0);this._renderer.type="star";for(let l in Zc)Object.defineProperty(this,l,Zc[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 En().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<En.Properties.length;r++){const s=En.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=ei*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*pp(l),h=c*yp(l);o>=s?this.vertices.push(new Re(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?he.move:he.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 En(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<Ee.Properties.length;l++){const c=Ee.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<En.Properties.length;r++){const s=En.Properties[r];n[s]=this[s]}return n}};x(En,"Properties",["innerRadius","outerRadius","sides"]);let So=En;const Zc={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 Bo;const Qc=Math.min,Jc=Math.max;ln.document&&(Bo=document.createElement("canvas"));const gt=class gt extends wn{constructor(n,r,s,o){super();x(this,"_flagValue",!0);x(this,"_flagFamily",!0);x(this,"_flagSize",!0);x(this,"_flagLeading",!0);x(this,"_flagAlignment",!0);x(this,"_flagBaseline",!0);x(this,"_flagStyle",!0);x(this,"_flagWeight",!0);x(this,"_flagDecoration",!0);x(this,"_flagFill",!0);x(this,"_flagStroke",!0);x(this,"_flagLinewidth",!0);x(this,"_flagOpacity",!0);x(this,"_flagVisible",!0);x(this,"_flagMask",!1);x(this,"_flagClip",!1);x(this,"_flagDirection",!0);x(this,"_flagStrokeAttenuation",!0);x(this,"_value","");x(this,"_family","sans-serif");x(this,"_size",13);x(this,"_leading",17);x(this,"_alignment","center");x(this,"_baseline","middle");x(this,"_style","normal");x(this,"_weight",500);x(this,"_decoration","none");x(this,"_direction","ltr");x(this,"_fill","#000");x(this,"_stroke","none");x(this,"_linewidth",1);x(this,"_opacity",1);x(this,"_visible",!0);x(this,"_mask",null);x(this,"_clip",!1);x(this,"_dashes",null);x(this,"_strokeAttenuation",!0);for(let a in ed)Object.defineProperty(this,a,ed[a]);if(this._renderer.type="text",this._renderer.flagFill=bp.bind(this),this._renderer.flagStroke=_p.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,!$e.isObject(o))return this;for(let a=0;a<gt.Properties.length;a++){const l=gt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(Bo){const r=Bo.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*gt.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:ii(n.fill),s=typeof n.stroke=="string"?n.stroke:ii(n.stroke),o=new gt().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<gt.Properties.length;r++){const s=gt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new gt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<gt.Properties.length;s++){const o=gt.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<gt.Properties.length;r++){const s=gt.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}=gt.Measure(this),h=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-h,o=c+h;break;case"right":s=-(c+h),o=h;break;default:s=-(c/2+h),o=c/2+h}switch(this.baseline){case"middle":a=-(d/2+h),l=d/2+h;break;default:a=-(d+h),l=h}const[u,m]=r.multiply(s,a),[f,g]=r.multiply(s,l),[p,y]=r.multiply(o,a),[b,_]=r.multiply(o,l);return a=Qc(m,g,y,_),s=Qc(u,f,p,b),o=Jc(u,f,p,b),l=Jc(m,g,y,_),{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}};x(gt,"Ratio",.6),x(gt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let zi=gt;const ed={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 Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.bind(G.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,$e.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 bp(){this._flagFill=!0}function _p(){this._flagStroke=!0}const Nn=class Nn extends lr{constructor(n,r,s,o){super(r,s,0,0);x(this,"_flagTextures",!1);x(this,"_flagFrameRate",!1);x(this,"_flagIndex",!1);x(this,"_amount",1);x(this,"_duration",0);x(this,"_index",0);x(this,"_startTime",0);x(this,"_playing",!1);x(this,"_firstFrame",0);x(this,"_lastFrame",0);x(this,"_loop",!0);x(this,"_textures",null);x(this,"_frameRate",0);x(this,"_origin",null);this._renderer.type="image-sequence";for(let a in td)Object.defineProperty(this,a,td[a]);this._renderer.flagTextures=wp.bind(this),this._renderer.bindTextures=xp.bind(this),this._renderer.unbindTextures=vp.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(nd.bind(this)):typeof n=="string"&&(this.textures=[nd(n)]),this.origin=new ge,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=Nn.DefaultFrameRate,this.index=0}static fromObject(n){const r=new Nn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Nn.Properties.length;r++){const s=Nn.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=$e.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 Nn(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,h;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,$e.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=$e.performance.now()-this._startTime,h=this._lastFrame+1,l=1e3*(h-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),d=Ht(this._firstFrame,h,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 qe))&&(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}};x(Nn,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),x(Nn,"DefaultFrameRate",30);let To=Nn;const td={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(G.Types.insert,e).unbind(G.Types.remove,n),this._textures=new ti((t||[]).slice(0)),this._textures.bind(G.Types.insert,e).bind(G.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 wp(){this._flagTextures=!0}function xp(t){let e=t.length;for(;e--;)t[e].bind(G.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function vp(t){let e=t.length;for(;e--;)t[e].unbind(G.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function nd(t){if(t instanceof qe)return t;if(typeof t=="string")return new qe(t)}const _i=class _i extends lr{constructor(n,r,s,o,a,l){super(r,s,0,0);x(this,"_flagTexture",!1);x(this,"_flagColumns",!1);x(this,"_flagRows",!1);x(this,"_flagFrameRate",!1);x(this,"_flagIndex",!1);x(this,"_amount",1);x(this,"_duration",0);x(this,"_startTime",0);x(this,"_playing",!1);x(this,"_firstFrame",0);x(this,"_lastFrame",0);x(this,"_loop",!0);x(this,"_texture",null);x(this,"_columns",1);x(this,"_rows",1);x(this,"_frameRate",0);x(this,"_index",0);x(this,"_origin",null);this._renderer.type="sprite";for(let c in id)Object.defineProperty(this,c,id[c]);this.noStroke(),this.noFill(),n instanceof qe?this.texture=n:typeof n=="string"&&(this.texture=new qe(n)),this.origin=new ge,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 _i().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<_i.Properties.length;r++){const s=_i.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=$e.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 _i(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,h,u,m,f;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)){u=n.image.width,m=n.image.height,o=u/r,a=m/s,c=this._amount,this.width!==o&&(this.width=o),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&($e.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=$e.performance.now()-this._startTime,f=this._lastFrame+1,d=1e3*(f-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),h=Ht(this._firstFrame,f,l/d),h=Math.floor(h),h!==this._index&&(this._index=h,h>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const g=this._index%r,p=Math.floor(this._index/r),y=-o*g+(u-o)/2,b=-a*p+(m-a)/2;y!==n.offset.x&&(n.offset.x=y),b!==n.offset.y&&(n.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}};x(_i,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let Ro=_i;const id={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}}},ns=Math.min,is=Math.max,Kt=class Kt extends wn{constructor(n){super();x(this,"_flagAdditions",!1);x(this,"_flagSubtractions",!1);x(this,"_flagOrder",!1);x(this,"_flagOpacity",!0);x(this,"_flagBeginning",!1);x(this,"_flagEnding",!1);x(this,"_flagLength",!1);x(this,"_flagMask",!1);x(this,"_fill","#fff");x(this,"_stroke","#000");x(this,"_linewidth",1);x(this,"_opacity",1);x(this,"_visible",!0);x(this,"_cap","round");x(this,"_join","round");x(this,"_miter",4);x(this,"_closed",!0);x(this,"_curved",!1);x(this,"_automatic",!0);x(this,"_beginning",0);x(this,"_ending",1);x(this,"_length",0);x(this,"_mask",null);x(this,"_strokeAttenuation",!0);for(let r in rd)Object.defineProperty(this,r,rd[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++)sd.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)sd.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new Kt;for(let o=0;o<Kt.Properties.length;o++){const a=Kt.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:ii(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 po.fromObject(o);case"circle":return _o.fromObject(o);case"element":return or.fromObject(o);case"ellipse":return vo.fromObject(o);case"group":return Kt.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return To.fromObject(o);case"path":return Ee.fromObject(o);case"points":return ts.fromObject(o);case"polygon":return ko.fromObject(o);case"rectangle":return lr.fromObject(o);case"rounded-rectangle":return Co.fromObject(o);case"shape":return wn.fromObject(o);case"sprite":return Ro.fromObject(o);case"star":return So.fromObject(o);case"text":return zi.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<Kt.Properties.length;r++){const s=Kt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Kt,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,$e.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,h=-1/0,u=1/0,m=-1/0;const f=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const p=this.children[g];if(!(!p.visible||f.test(p._renderer.type))&&(r=p.getBoundingClientRect(n),o=typeof r.top!="number"||$e.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||$e.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||$e.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||$e.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[y,b]=s.multiply(r.left,r.top),[_,v]=s.multiply(r.right,r.top),[k,C]=s.multiply(r.left,r.bottom),[B,S]=s.multiply(r.right,r.bottom);u=ns(b,v,C,S,u),d=ns(y,_,k,B,d),h=is(y,_,k,B,h),m=is(b,v,C,S,m)}else u=ns(r.top,u),d=ns(r.left,d),h=is(r.right,h),m=is(r.bottom,m)}return{top:u,left:d,right:h,bottom:m,width:h-d,height:m-u}}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,h=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):h<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):h>c&&h<c+r?(s.beginning=0,s.ending=(h-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}};x(Kt,"Children",jc),x(Kt,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let xn=Kt;const rd={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=xn.InsertChildren.bind(this),n=xn.RemoveChildren.bind(this),r=xn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new jc(t),this._children.bind(G.Types.insert,e),this._children.bind(G.Types.remove,n),this._children.bind(G.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,$e.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 sd(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 rs extends Ee{constructor(e,n,r,s){const o=[new Re(e,n),new Re(r,s)];super(o);for(let a in od)Object.defineProperty(this,a,od[a]);this.vertices[0].command=he.move,this.vertices[1].command=he.line,this.automatic=!1}}x(rs,"Properties",["left","right"]);const od={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if($e.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=he.move;else{const e=new Zr("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($e.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=he.line;else{const e=new Zr("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class $o{constructor(e=0,n=0){this.x=e,this.y=n}}class ri{constructor(e=10,n=0,r="A"){x(this,"start",new $o);x(this,"end",new $o);this.width=e,this.angle=n,this.label=r}}const Ve={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"}},kp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Cp(t,e){return i.openBlock(),i.createElementBlock("svg",kp,[...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 ss=i.markRaw({name:"ion-close",render:Cp}),Sp={class:"mr-3 flex flex-col gap-2"},Bp=["onClick"],Tp={class:"h-full p-2"},Rp={},$p=i.defineComponent({...Rp,__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.useTemplateRef("drawing-template-containers"),s=e;return i.onMounted(()=>{var o;(o=n.settings.allTemplates)==null||o.forEach((a,l)=>{var d;const c=(d=r.value)==null?void 0:d.at(l);c&&s("init-draw-template",c,a)})}),i.watch(()=>n.settings.allTemplates,(o,a)=>{i.nextTick(()=>{o.forEach((l,c)=>{var d;if(!a.includes(l)){const h=(d=r.value)==null?void 0:d.at(c);h&&s("init-draw-template",h,l)}})})},{deep:!0}),(o,a)=>{const l=ss;return i.openBlock(),i.createBlock(i.unref(z.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",Sp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.settings.allTemplates,(c,d)=>(i.openBlock(),i.createElementBlock("div",{key:d,class:"group relative"},[i.createVNode(i.unref(z.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":d===t.selectTemplateIndex}]),onClick:h=>s("template:select",d)},[i.createElementVNode("div",Tp,[i.createElementVNode("div",{ref_for:!0,ref:"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Bp)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.label),1)]),_:2},1024),c.isCustom&&!c.isNewRec()?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,size:"tiny",quaternary:"",circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:h=>s("remove-custom-template",d)},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),ad=Zn($p,[["__scopeId","data-v-cf2c29de"]]),Ep={class:"flex gap-3"},Np={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},Pp={ref:"drawing-container",class:"size-full"},Fp={},ld=i.defineComponent({...Fp,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,h=i.computed(()=>n.value.configuratorParams.linesAngles.map((N,P)=>new ri(n.value.configuratorParams.linesWidths[P],N,`A-${P+1}`))),u=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),m=i.computed(()=>{var N,P;return n.value.configuratorParams.startTailType&&((N=n.settings.startTailConfigs)!=null&&N[n.value.configuratorParams.startTailType])?(P=n.settings.startTailConfigs)==null?void 0:P[n.value.configuratorParams.startTailType].points:[]}),f=i.computed(()=>{var N,P;return n.value.configuratorParams.endTailType&&((N=n.settings.endTailConfigs)!=null&&N[n.value.configuratorParams.endTailType])?(P=n.settings.endTailConfigs)==null?void 0:P[n.value.configuratorParams.endTailType].points:[]}),g=(N,P=!1)=>{N[0].start.x=0,N[0].start.y=0;let H=0;for(let q=0;q<N.length;q++){const Y=N[q],F=N[q-1]??new ri(0,H);H+=!P||q>1?F.angle:0;const M=(!P||q>0?Y.angle:0)+H;if(N[q].end.x=Y.width*Math.cos(M*Math.PI/180)+N[q].start.x,N[q].end.y=Y.width*Math.sin(M*Math.PI/180)+N[q].start.y,q<N.length-1){const Z=q+1;N[Z].start.x=N[q].end.x,N[Z].start.y=N[q].end.y}}return N},p=(N,P,H,q,Y=!1)=>{let F=g([...H,...q]);P.length>0&&(F=[...g(P),...F]);let M=0,Z=0,fe=0,ie=0;F.forEach(Ae=>{M=Math.min(M,Ae.start.x,Ae.end.x),Z=Math.min(Z,Ae.start.y,Ae.end.y),fe=Math.max(fe,Ae.start.x,Ae.end.x),ie=Math.max(ie,Ae.start.y,Ae.end.y)});let me,re;M===0&&Z===0&&fe===0&&ie===0?(me=1,re=1):(me=N.width/Math.abs(fe-M),re=(Y?N.height:N.height-Ve.colorSideLabel.size)/Math.abs(ie-Z));const Me=Math.min(me,re);return M=M<0?-M*Me:0,Z=Z<0?-Z*Me:0,[Me,M,Z]},y=N=>{const P=new ts([N]);return P._size=Ve.anchorPoint.size,P.fill=Ve.anchorPoint.color,P.stroke="transparent",P._linewidth=Ve.anchorPoint.strokeSize,l.push(P),P},b=(N,P)=>{if(l=[],n.settings.allowChangeFirstPoint){const H=N[0],q=new ge(H.vertices[0].x,H.vertices[0].y);q.bind(G.Types.change,()=>{H.vertices[0].copy(q)});const Y=y(q);P.add(Y)}N.forEach((H,q)=>{const Y=N[q+1],F=new ge(H.vertices[1].x,H.vertices[1].y);F.bind(G.Types.change,()=>{H.vertices[1].copy(F),Y!==void 0&&Y.vertices[0].copy(F)});const M=y(F);P.add(M)})},_=N=>N*(Math.PI/180),v=(N,P,H)=>{const q=P.vertices.length-1;N.position.x=P.vertices[q].x,N.position.y=P.vertices[q].y;const Y=Math.atan2(P.vertices[q].y-P.vertices[0].y,P.vertices[q].x-P.vertices[0].x);N.rotation=_(H)+Y},k=(N,P,H)=>{if(P.vertices[0]===void 0)return;N.position.x=P.vertices[0].x,N.position.y=P.vertices[0].y;const q=P.vertices.length-1,Y=Math.atan2(P.vertices[q].y-P.vertices[0].y,P.vertices[q].x-P.vertices[0].x);N.rotation=_(H)+Y},C=(N,P,H)=>{const q=new xn;if(N.length===0)return q;const Y=[];return[...N].reverse().forEach((F,M)=>{M!==0&&F.angle>0&&(F.angle*=-1),Y.push(F)}),N=g(Y,!0),k(q,P,N[0].angle),[P.vertices[0],P.vertices[1]].forEach(F=>{F.bind(G.Types.change,()=>{k(q,P,N[0].angle)})}),N.forEach(F=>{const M=F.start.x*H,Z=F.end.x*H,fe=F.start.y*H,ie=F.end.y*H,me=new rs(M,fe,Z,ie);me.linewidth=Ve.line.size,me.stroke=Ve.line.color,q.add(me)}),q},B=(N,P,H)=>{const q=new xn;return N.length===0||(N=g(N,!0),v(q,P,N[0].angle),[P.vertices[0],P.vertices[1]].forEach(Y=>{Y.bind(G.Types.change,()=>{v(q,P,N[0].angle)})}),N.forEach(Y=>{const F=Y.start.x*H,M=Y.end.x*H,Z=Y.start.y*H,fe=Y.end.y*H,ie=new rs(F,Z,M,fe);ie.linewidth=Ve.line.size,ie.stroke=Ve.line.color,q.add(ie)})),q},S=(N,P,H,q)=>{const Y=P.vertices[0].x+(P.vertices[1].x-P.vertices[0].x)/2-8*Math.sin(N.angle*Math.PI/180),F=P.vertices[0].y+(P.vertices[1].y-P.vertices[0].y)/2-8*Math.cos(N.angle*Math.PI/180),M=new zi(N.label,Y+10,F-10);let Z;M.size=Ve.lineLabel.size,M.weight=600,M.fill=Ve.lineLabel.color,M.id+=1,M.rotation=Ve.lineLabel.rotation,q>0&&(Z=new zi(`${N.angle}°`,P.vertices[0].x+25,P.vertices[0].y-25),Z.size=Ve.angleLabel.size,Z.weight=600,Z.fill=Ve.angleLabel.color,Z.rotation=Ve.angleLabel.rotation,Z.id+=q,o.push(Z),H.add(Z)),H.add(M),$(M,P,0,Z),$(M,P,1)},T=()=>{const{size:N}=Ve.colorSideLabel,P=0,H=0,q=u.value?N/2:N/2-N,Y=u.value?N/2-N:N/2,F=new xn;if(!c)return F;const M=5,Z=Math.atan2(Y-q,H-P),fe=[new Re(P,q,0,0,0,0,an.Commands.move),new Re(H,Y,0,0,0,0,an.Commands.line),new Re(H-M*Math.cos(Z-Math.PI/4),Y-M*Math.sin(Z-Math.PI/4),0,0,0,0,an.Commands.line),new Re(H,Y,0,0,0,0,an.Commands.move),new Re(H-M*Math.cos(Z+Math.PI/4),Y-M*Math.sin(Z+Math.PI/4),0,0,0,0,an.Commands.line)],ie=new Ee(fe,!1,!1,!0);ie.noFill(),ie.cap="round",ie.join="round",ie.linewidth=N/7,ie.stroke=Ve.colorSideLabel.color,F.add(ie);const me=new zi(u.value?"Цвет снизу":"Цвет сверху",10,0);me.size=N,me.weight=600,me.fill=Ve.colorSideLabel.color,me.alignment="left",F.add(me);const re=F.getBoundingClientRect();return F.position.x=(c.width-re.width)*d+10,F.position.y=u.value?c.height+re.height*2:re.height/2,F},$=(N,P,H,q)=>{P.vertices[H].bind(G.Types.change,()=>{const Y=P.vertices.length-1,F=Math.atan2(P.vertices[0].y-P.vertices[Y].y,P.vertices[0].x-P.vertices[Y].x)*180/Math.PI,M=P.vertices[0].x+(P.vertices[Y].x-P.vertices[0].x)/2-8*Math.sin(F*Math.PI/180),Z=P.vertices[0].y+(P.vertices[Y].y-P.vertices[0].y)/2-8*Math.cos(F*Math.PI/180);N.position.x=M+10,N.position.y=Z-10,N.rotation=-.5,q&&(q.position.x=P.vertices[0].x+25,q.position.y=P.vertices[0].y-25)})},E=(N,P,H,q,Y=!1)=>{var Oe;if(N.clear(),H.length===0){N.update();return}const F=g(H),[M,Z,fe]=p(N,P,F,q,Y),ie=new xn,me=new Array,re=new Array;Y||(o=[],a=[]),F.forEach((Le,pt)=>{const Zt=Le.start.x*M+Z,Qt=Le.end.x*M+Z,St=Le.start.y*M+fe,At=Le.end.y*M+fe,yt=new rs(Zt,St,Qt,At);yt.linewidth=Y?Ve.previewLine.size:Ve.line.size,yt.stroke=Y?Ve.previewLine.color:Ve.line.color,a.push(yt),me.push(yt),ie.add(yt),!Y&&Le.label!==""&&S(Le,yt,ie,pt)});const Me=me.at(-1);let Ae=ie.getBoundingClientRect();if(!Y){const Le=T();re.push(Le)}if(P.length>0){const Le=C(P,me[0],M);ie.add(Le)}if(q.length>0&&Me){const Le=B(q,Me,M);ie.add(Le)}if(re.push(ie),N.makeGroup(re),Ae=ie.getBoundingClientRect(),ie.position.x=0-Ae.left+(N.width-Ae.width)/(2*(Y?1:d)),ie.position.y=0-Ae.top+(N.height-Ae.height)/(2*(Y?1:d)),N.update(),!Y){const Le=((Oe=n.value.configuratorParams)==null?void 0:Oe.colorSide)==="top";ie.position.y=ie.position.y+Ve.colorSideLabel.size*Number(Le),b(me,ie),N.update()}},O=(N,P)=>{if(N&&!P.isNewRec()){const H=new an({width:N.scrollWidth,height:N.scrollHeight});H.appendTo(N),E(H,[],P.points,[],!0)}},I=()=>{c&&E(c,m.value,h.value,f.value,!1)},A=N=>N*(180/Math.PI),L=(N,P)=>{const H=N[1].x-N[0].x,q=N[1].y-N[0].y,Y=P[1].x-P[0].x,F=P[1].y-P[0].y;let M=Math.atan2(H*F-q*Y,H*Y+q*F);return M=A(M),Math.round(M)*-1},D=N=>{const P=a.map((H,q,Y)=>{const F=Y[q-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let M=Math.ceil(H._length/N/n.settings.lineWidthStep)*n.settings.lineWidthStep;const Z=o[q-1];M<(Y.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(M=Y.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),M>n.settings.maxLineWidth&&(M=n.settings.maxLineWidth);const fe=L(H.vertices,F.vertices);return Z&&(Z.value=`${fe}°`),new ri(M,fe,`A-${q+1}`)});r("pointer:move",P)},ee=N=>{let P=null,H;const q=Z=>{P=l.find(fe=>{const ie=fe.renderer;return(ie==null?void 0:ie.elem)===Z.target}),[H]=p(N,m.value,h.value.map(fe=>fe),f.value)},Y=Z=>{if(P){const fe=P.renderer,ie=fe==null?void 0:fe.elem;if(!ie)return;const me=ie.getBoundingClientRect();P.vertices[0].x-=me.x-(Z instanceof MouseEvent?Z.clientX:Z.targetTouches[0].clientX)+Ve.anchorPoint.size/2,P.vertices[0].y-=me.y-(Z instanceof MouseEvent?Z.clientY:Z.targetTouches[0].clientY)+Ve.anchorPoint.size/2,D(H),N.update()}},F=()=>{P&&r("pointer:up",h.value),P=null},M=s.value;M&&(M.addEventListener("touchstart",q),M.addEventListener("touchend",F),M.addEventListener("mousedown",q),M.addEventListener("mouseup",F),M.addEventListener("mousemove",Y),M.addEventListener("touchmove",Y))};return i.onMounted(()=>{s.value&&(c=new an({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{I()},{deep:!0,immediate:!0}),ee(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(N,P)=>(i.openBlock(),i.createElementBlock("div",Ep,[i.createVNode(ad,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":P[0]||(P[0]=H=>r("template:select",H)),onInitDrawTemplate:O},null,8,["select-template-index","settings"]),i.createElementVNode("div",Np,[i.createElementVNode("div",Pp,null,512)])]))}}),Mp={class:"flex max-w-[50rem] flex-col gap-3"},Ap={},cd=i.defineComponent({...Ap,__name:"kozyrek-configurator",props:{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(n.settings),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),h=i.ref({quantity:{},marker:{},length:{}}),u=i.ref(0),m=(S=0)=>{var $;const T=($=c.value.allTemplates)==null?void 0:$.at(S);T!==void 0&&(u.value=S,l.value.configuratorParams.linesWidths=T.points.map(E=>V.isArray(E)?E[0]:E.width),l.value.configuratorParams.linesAngles=T.points.map(E=>V.isArray(E)?E[1]:E.angle),b()),p(l.value.configuratorParams)},f=async()=>{const S=prompt("Введите название шаблона:");if(!S)return;a.value=!0;const T={label:S,points:l.value.configuratorParams.linesWidths.map(($,E)=>[$,l.value.configuratorParams.linesAngles[E]])};await U.HttpRequester.getInstance(U.ConfiguratorProvider).createTemplate(n.cartItem.category,T,h.value).then(()=>{c.value.addCustomTemplate(T),u.value=c.value.allTemplates.length-1}).catch(()=>{a.value=!1}),a.value=!1},g=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(u.value=c.value.allTemplates.length-1)},p=async S=>{b(),s.value=!0,await U.HttpRequester.getInstance(U.ConfiguratorProvider).searchProduct(n.cartItem.category,S,h.value).then(T=>{l.value.product=T}).catch(()=>{s.value=!1}),s.value=!1},y=()=>{o.value=!0,r("submit",l.value,h.value,()=>{o.value=!1})},b=()=>{const S={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach((T,$)=>{S[`lines_widths[${$+1}]`]={},S[`lines_angles[${$+1}]`]={}}),h.value=S},_=S=>{d.value.linesWidths=S.map(T=>T.width),d.value.linesAngles=S.map(T=>T.angle)},v=S=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,b(),g(),p(l.value.configuratorParams)},k=(S,T)=>{d.value.linesWidths=S,d.value.linesAngles=T},C=S=>{const T=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,$=0;l.value.configuratorParams.linesWidths.splice(S+1,0,T),l.value.configuratorParams.linesAngles.splice(S+1,0,$),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],b(),g(),p(l.value.configuratorParams)},B=S=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(S,1),l.value.configuratorParams.linesAngles.splice(S,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],b(),g(),p(l.value.configuratorParams))};return i.onBeforeMount(()=>{m()}),(S,T)=>{const $=z.NButton;return i.openBlock(),i.createElementBlock("div",Mp,[t.settings.allowShowTable?(i.openBlock(),i.createBlock($,{key:0,type:"tertiary",class:"self-end",onClick:T[0]||(T[0]=E=>r("click:view-switch"))},{default:i.withCtx(()=>[...T[3]||(T[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(ld,{value:l.value,"select-template-index":u.value,settings:c.value,"onPointer:up":v,"onPointer:move":_,"onTemplate:select":m},null,8,["value","select-template-index","settings"]),i.createVNode(Ua,{value:l.value,"onUpdate:value":T[1]||(T[1]=E=>l.value=E),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":u.value,"onUpdate:params":T[2]||(T[2]=E=>p(E)),"onUpdate:preview":k,onSubmit:y,"onClick:saveTemplate":f,"onClick:addLine":C,"onClick:removeLine":B},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])}}}),Vp={},Li=i.defineComponent({...Vp,__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}},emits:["update:value"],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=V.debounce(()=>s("update:value",o.value),a.value),c=f=>{o.value=f,l()};i.watch(()=>r.value,f=>{o.value=f});const d=i.ref(null);return e({focus:()=>{var f;return(f=d.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=d.value)==null?void 0:f.blur()},select:()=>{var f;return(f=d.value)==null?void 0:f.select()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(z.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value,"onUpdate:value":[g[0]||(g[0]=p=>o.value=p),c],clearable:t.clearable,"show-button":!1,placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,validator:t.validator},{prefix:i.withCtx(()=>[i.renderSlot(f.$slots,"prefix")]),_:3},8,["value","clearable","placeholder","min","max","step","validator"]))}}),Op={key:0,class:"flex items-baseline gap-1"},Ip={key:0,class:"flex items-baseline gap-1"},zp={key:0},Lp={class:"text-lg font-semibold"},Dp={key:1,class:"text-red-500 text-sm mb-2"},Hp={class:"flex gap-3"},Wp={},dd=i.defineComponent({...Wp,__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,{emit:e}){const n=t,r=e,s=i.computed(()=>bt.isPhoneDevice()),o=(()=>{const p=V.cloneDeep(i.toRaw(n.value.configuratorParams)),y=p.mountType,b=n.settings.widthOverlaps[y]??0,_=n.settings.heightOverlaps[y]??0;return p.width&&p.width>0&&(p.width-=b),p.height&&p.height>0&&(p.height-=_),i.ref(p)})(),a=i.computed(()=>n.settings.widthOverlaps[o.value.mountType]??0),l=i.computed(()=>n.settings.heightOverlaps[o.value.mountType]??0),c=i.computed(()=>{const p=o.value.width;return p?p+a.value:void 0}),d=i.computed(()=>{const p=o.value.height;return p?p+l.value:void 0}),h=i.computed(()=>n.settings.maxWidths[o.value.netType]),u=i.computed(()=>n.settings.maxHeights[o.value.netType]),m=i.computed(()=>{var k;const p=c.value,y=d.value,{quantity:b}=n.value,_=((k=n.value.product)==null?void 0:k.costRub)||0;if(!p||!y||!b||_===0)return null;const v=p*y/1e6;return(_*b*v).toLocaleString("ru-ru",{minimumFractionDigits:2})}),f=i.computed(()=>{const p=c.value,y=d.value,b=!!(p&&p>=n.settings.minWidth&&p<=n.settings.maxWidths[o.value.netType]),_=!!(y&&y>=n.settings.minHeight&&y<=n.settings.maxHeights[o.value.netType]),v=!!(n.value.quantity&&n.value.quantity>0);return b&&_&&v}),g=(p,y)=>{p&&p in o.value&&y!==void 0&&(o.value[p]=y);const b={...o.value,width:c.value??0,height:d.value??0};r("update:params",b);const _=new U.CartItemBase(n.value);_.configuratorParams=b,r("update:value",_)};return(p,y)=>{const b=z.NInput;return i.openBlock(),i.createBlock(i.unref(z.NForm),{class:"flex flex-col gap-2 px-4 md:max-w-96"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:i.unref(o).netType,"onUpdate:value":[y[0]||(y[0]=_=>i.unref(o).netType=_),y[1]||(y[1]=_=>g("netType",_))],options:t.settings.netType.map(_=>({label:t.settings.descriptions.net_type[_],value:_}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:i.unref(o).color,"onUpdate:value":[y[2]||(y[2]=_=>i.unref(o).color=_),y[3]||(y[3]=_=>g("color",_))],options:t.settings.color.map(_=>({label:t.settings.descriptions.color[_],value:_}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:i.unref(o).mountType,"onUpdate:value":[y[4]||(y[4]=_=>i.unref(o).mountType=_),y[5]||(y[5]=_=>g("mountType",_))],options:t.settings.mountType.map(_=>({label:t.settings.descriptions.mount_type[_],value:_}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.width.feedback||"","show-feedback":t.validation.width.showFeedback||!!(c.value&&c.value>=t.settings.minWidth&&c.value<=t.settings.maxWidths[i.unref(o).netType]),"validation-status":t.validation.width.validationStatus||void 0,label:`Ширина светового проёма от ${t.settings.minWidth-a.value} ${h.value?" до "+(h.value-a.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&c.value&&c.value>=t.settings.minWidth&&c.value<=t.settings.maxWidths[i.unref(o).netType]?(i.openBlock(),i.createElementBlock("div",Op,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(c.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:y[7]||(y[7]=_=>r("click:instructions-toggle"))},{default:i.withCtx(()=>[...y[14]||(y[14]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Li,{value:i.unref(o).width||void 0,max:h.value-a.value,min:t.settings.minWidth-a.value,placeholder:"Введите ширину светового проёма",class:"w-full","onUpdate:value":y[6]||(y[6]=_=>g("width",_??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.height.feedback||"","show-feedback":t.validation.height.showFeedback||!!(d.value&&d.value>=t.settings.minHeight&&d.value<=t.settings.maxHeights[i.unref(o).netType]),"validation-status":t.validation.height.validationStatus||void 0,label:`Высота светового проёма от ${t.settings.minHeight-l.value} ${u.value?" до "+(u.value-l.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&d.value&&d.value>=t.settings.minHeight&&d.value<=t.settings.maxHeights[i.unref(o).netType]?(i.openBlock(),i.createElementBlock("div",Ip,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(d.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:y[9]||(y[9]=_=>r("click:instructions-toggle"))},{default:i.withCtx(()=>[...y[15]||(y[15]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Li,{value:i.unref(o).height||void 0,max:u.value-l.value,min:t.settings.minHeight-l.value,placeholder:"Введите высоту светового проёма",class:"w-full","onUpdate:value":y[8]||(y[8]=_=>g("height",_??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.quantity.feedback||"","show-feedback":t.validation.quantity.showFeedback||!1,"validation-status":t.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,"onUpdate:value":y[10]||(y[10]=_=>t.value.quantity=_),min:1,"show-button":!1,validator:_=>Number.isInteger(_),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{feedback:t.validation.marker.feedback||"","show-feedback":t.validation.marker.showFeedback||!1,"validation-status":t.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(b,{value:t.value.marker,"onUpdate:value":y[11]||(y[11]=_=>t.value.marker=_),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(nr,{"is-product-searching":t.isProductSearching,product:t.value.product},null,8,["is-product-searching","product"]),m.value?(i.openBlock(),i.createElementBlock("div",zp,[y[16]||(y[16]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Lp,i.toDisplayString(m.value)+" ₽",1)])):i.createCommentVNode("",!0),f.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Dp," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",Hp,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!f.value,type:"primary",class:"self-start",onClick:y[12]||(y[12]=_=>r("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,type:"default",onClick:y[13]||(y[13]=_=>r("click:show-preview-drawer"))},{default:i.withCtx(()=>[...y[17]||(y[17]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1})}}}),jp="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",qp="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",Xp="/img/configurators/mosquitto/measurement-instructions/mount.png",Yp="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",Up="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",Gp={class:"flex flex-col gap-6"},Kp={class:"flex gap-4"},Zp={class:"flex flex-col gap-2"},Qp={class:"flex gap-4"},Jp={class:"flex flex-col gap-2"},e0={class:"flex gap-4"},t0={class:"flex flex-col gap-2"},n0={},hd=i.defineComponent({...n0,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=bt.initRefDependingOnDeviceResolution("small","small","medium"),r=bt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=e;return(a,l)=>{const c=z.NText;return i.openBlock(),i.createBlock(i.unref(z.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",Gp,[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:jp,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:qp,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",Kp,[l[9]||(l[9]=i.createElementVNode("img",{src:Xp,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Zp,[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",Qp,[l[15]||(l[15]=i.createElementVNode("img",{src:Yp,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Jp,[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",e0,[l[21]||(l[21]=i.createElementVNode("img",{src:Up,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",t0,[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"])}}}),i0={class:"flex flex-col items-center justify-between rounded-xl"},r0={class:"img-preview relative flex justify-center"},s0={},o0=i.defineComponent({...s0,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(t,{emit:e}){const n=t,r=i.computed(()=>{const o=V.keys(n.settings.crossbarCount).find(a=>n.settings.crossbarCount[Number(a)]&&(!n.settings.crossbarCount[Number(a)+1]||n.configuratorParams.height<n.settings.crossbarCount[Number(a)+1]));if(o!==void 0)return String(Number(o)+1)}),s=e;return(o,a)=>{const l=z.NButton;return i.openBlock(),i.createElementBlock("div",i0,[i.createElementVNode("div",r0,[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})])}}}),Eo=Zn(o0,[["__scopeId","data-v-f04663ef"]]),a0={class:"grid md:grid-cols-2"},l0={},ud=i.defineComponent({...l0,__name:"mosquito-configurator",props:{settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>bt.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref({width:{},height:{},quantity:{},marker:{}}),d=i.ref(!1),h=i.ref(!1),u=async f=>{f.height>0&&f.width>0?(d.value=!0,await U.HttpRequester.getInstance(U.ConfiguratorProvider).searchProduct(n.cartItem.category,f,c.value).then(g=>{l.value.product=g}).catch(()=>{d.value=!1}),d.value=!1):l.value.product=new U.Product},m=()=>{h.value=!0,r("submit",l.value,c.value,()=>{h.value=!1})};return(f,g)=>{const p=ss;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(hd,{show:a.value,"onUpdate:show":g[0]||(g[0]=y=>a.value=y),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",a0,[s.value?(i.openBlock(),i.createBlock(i.unref(z.NDrawer),{key:1,show:o.value,"onUpdate:show":g[4]||(g[4]=y=>o.value=y),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(z.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:g[2]||(g[2]=y=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(p)]),_:1})]),default:i.withCtx(()=>[i.createVNode(Eo,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:g[3]||(g[3]=y=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(Eo,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:g[1]||(g[1]=y=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(dd,{value:l.value,"onUpdate:value":g[5]||(g[5]=y=>l.value=y),validation:c.value,settings:t.settings,"is-product-searching":d.value,"is-submit-processing":h.value,"onUpdate:params":g[6]||(g[6]=y=>u(y)),onSubmit:g[7]||(g[7]=y=>m()),"onClick:instructionsToggle":g[8]||(g[8]=y=>a.value=!a.value),"onClick:showPreviewDrawer":g[9]||(g[9]=y=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),c0={key:0},d0={},fd=i.defineComponent({...d0,__name:"strip-configurator-line-item",props:{value:{},index:{},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:{default:()=>({})}},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=d=>{s("update:value",d??0,r.index,a)};i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{c()})});const c=()=>{var d;(d=o.value)==null||d.select()};return e({focusWidthInput:c}),(d,h)=>{var f;const u=Ya,m=Xa;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{label:`Полоса №${t.index+1}, мм`,required:!0,"validation-status":a.value||(f=t.validation)==null?void 0:f.validationStatus},{feedback:i.withCtx(()=>{var g,p;return[(g=t.validation)!=null&&g.showFeedback?(i.openBlock(),i.createElementBlock("span",c0,i.toDisplayString((p=t.validation)==null?void 0:p.feedback),1)):i.createCommentVNode("",!0),i.createVNode(nr,{"is-product-searching":a.value,product:t.product},null,8,["is-product-searching","product"])]}),default:i.withCtx(()=>[i.createVNode(i.unref(z.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:l},{default:i.withCtx(()=>[i.createVNode(Li,{ref:"width-input-element",value:t.value,class:"w-full",min:t.settings.minLineWidth,step:t.settings.lineWidthStep,validator:g=>!!g&&g>=t.settings.minLineWidth&&g%t.settings.lineWidthStep===0,placeholder:"Введите ширину","onUpdate:value":l},null,8,["value","min","step","validator"])]),_:1},8,["options"]),i.createVNode(i.unref(z.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[0]||(h[0]=g=>s("click:add-line",t.index))},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[1]||(h[1]=g=>s("click:remove-line",t.index))},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled"])]),_:1},8,["label","validation-status"])}}}),h0={class:"my-2 flex w-full flex-col"},u0={key:0},f0={class:"text-lg font-semibold"},g0={class:"flex gap-3"},m0={},gd=i.defineComponent({...m0,__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,{emit:e}){const n=t,r=e,s=i.computed(()=>n.value[0].configuratorParams.linesWidths.reduce((u,m)=>(u??0)+(m??0),0)),o=i.computed(()=>n.settings.width-s.value),a=i.computed(()=>!n.value.some(({product:u})=>!u)),l=i.computed(()=>o.value===0?void 0:[{label:`${(o.value>0?"Остаток +":"Излишек ")+o.value} мм.`,key:o.value}]),c=i.computed(()=>{const{length:u}=n.value[0];return!u||s.value!==n.settings.width?null:(V.reduce(n.value,(f,g)=>{var y;const p=((y=g.product)==null?void 0:y.costRub)||0;return f+p},0)*n.value[0].quantity*u).toLocaleString("ru-ru",{minimumFractionDigits:2})}),d=(u,m,f)=>{const g=n.value.at(m);if(g)if(u&&u>=n.settings.minLineWidth&&u%n.settings.lineWidthStep===0){const p={linesWidths:g.configuratorParams.linesWidths.toSpliced(m,1,u)};r("update:params",p,m,f),h("configuratorParams",p)}else g.product.id=-1},h=(u,m)=>{const f=n.value.map(g=>new U.CartItemBase(g));f.forEach(g=>{g[u]=m}),r("update:value",f)};return(u,m)=>{const f=z.NInput;return i.openBlock(),i.createBlock(i.unref(z.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>{var g;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.value,(p,y)=>(i.openBlock(),i.createBlock(fd,{key:y,"auto-focus":!0,index:y,value:p.configuratorParams.linesWidths.at(y)??null,product:p.product,settings:t.settings,validation:t.validation[`linesWidths.${y}`],"suggestion-option":l.value,"add-line-button-disabled":o.value<=0||t.value.length>=t.settings.maxLinesCount,"remove-line-button-disabled":t.value.length===1,"onUpdate:value":d,"onClick:addLine":m[0]||(m[0]=b=>r("click:add-line",b)),"onClick:removeLine":m[1]||(m[1]=b=>r("click:remove-line",b))},null,8,["index","value","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled"]))),128)),i.createElementVNode("div",h0,[o.value<0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(t.settings.width),1)]),_:1})):i.createCommentVNode("",!0),a.value&&t.value.length===t.settings.maxLinesCount&&o.value>0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:1,type:"error"},{default:i.withCtx(()=>[...m[7]||(m[7]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[m[8]||(m[8]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(z.NText),{type:o.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(o.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(t.settings.width)+" мм ",1)])]),i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!a.value||o.value<=0||t.value.length>=t.settings.maxLinesCount,type:"primary",class:"self-center",onClick:m[2]||(m[2]=p=>r("click:add-line",t.value.length))},{default:i.withCtx(()=>[...m[9]||(m[9]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["loading","disabled"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.length.feedback||"","show-feedback":t.validation.length.showFeedback||!1,"validation-status":t.validation.length.validationStatus||void 0,label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:n.value[0].length,"show-button":!1,max:t.settings.maxLength||void 0,min:t.settings.minLength,step:t.settings.lengthStep,validator:p=>p%t.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full","onUpdate:value":m[3]||(m[3]=p=>h("length",p??0))},null,8,["value","max","min","step","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.quantity.feedback||"","show-feedback":t.validation.quantity.showFeedback||!1,"validation-status":t.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:n.value[0].quantity,"show-button":!1,min:1,validator:p=>Number.isInteger(p),placeholder:"Введите количество",class:"w-full","onUpdate:value":m[4]||(m[4]=p=>h("quantity",p??0))},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{"show-feedback":!1,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(f,{value:n.value[0].marker,placeholder:"Введите маркировку","onUpdate:value":m[5]||(m[5]=p=>h("marker",p))},null,8,["value"])]),_:1}),c.value?(i.openBlock(),i.createElementBlock("div",u0,[m[10]||(m[10]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",f0,i.toDisplayString(c.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",g0,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!a.value||o.value!=0||!((g=t.value[0])!=null&&g.length)||t.value[0].length>t.settings.maxLength||t.value[0].length<t.settings.minLength||t.value[0].quantity===0,type:"primary",class:"self-start",onClick:m[6]||(m[6]=p=>r("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1})}}}),p0={class:"flex grow flex-col"},y0=["src"],b0={class:"w-full"},_0={},md=i.defineComponent({..._0,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",p0,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,y0),i.createElementVNode("div",b0,[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)])]))}}),w0={class:"flex flex-col gap-2"},x0={class:"w-104 flex grow flex-col px-5"},v0={},pd=i.defineComponent({...v0,__name:"strip-configurator",props:{settings:{},cartItems:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.cartItems),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.computed(()=>s.value[0].configuratorParams.linesWidths.reduce((m,f)=>(m??0)+(f??0),0)),c=m=>{m===void 0&&(m=s.value.length-1);const f=s.value.at(0);if(!f)return;f.configuratorParams.linesWidths=f.configuratorParams.linesWidths.toSpliced(m+1,0,null),s.value.forEach(p=>{p.configuratorParams.linesWidths=f.configuratorParams.linesWidths});const g=new U.CartItemBase({quantity:(f==null?void 0:f.quantity)??1,category:f==null?void 0:f.category,length:(f==null?void 0:f.length)??n.settings.minLength,marker:f==null?void 0:f.marker,configuratorParams:{linesWidths:f==null?void 0:f.configuratorParams.linesWidths}});s.value=s.value.toSpliced(m+1,0,g)},d=m=>{const f=s.value.at(0);f&&(f.configuratorParams.linesWidths=f.configuratorParams.linesWidths.toSpliced(m,1),s.value.forEach(g=>{g.configuratorParams.linesWidths=f.configuratorParams.linesWidths}),s.value=s.value.toSpliced(m,1),delete o[`linesWidths.${m}`],delete o[`linesWidths.${m}`])},h=async(m,f,g)=>{g.value=!0,o.value[`linesWidths.${f}`]={},await U.HttpRequester.getInstance(U.ConfiguratorProvider).searchProduct(s.value[f].category,{linesWidths:m.linesWidths.at(f)},o.value).then(p=>{s.value[f].product=p,f===s.value.length-1&&s.value.length<n.settings.maxLinesCount&&l.value&&l.value<n.settings.width&&c()}).catch(()=>{s.value[f].product=new U.Product,o.value[`linesWidths.${f}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},g.value=!1}),g.value=!1},u=()=>{a.value=!0,r("submit",s.value,o.value,()=>{a.value=!1})};return(m,f)=>{const g=z.NButton;return i.openBlock(),i.createElementBlock("div",w0,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(g,{key:0,type:"tertiary",class:"self-center",onClick:f[0]||(f[0]=p=>r("click:view-switch"))},{default:i.withCtx(()=>[...f[3]||(f[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",x0,[i.createVNode(md,{value:s.value,"onUpdate:value":f[1]||(f[1]=p=>s.value=p),settings:t.settings},null,8,["value","settings"]),i.createVNode(gd,{value:s.value,"onUpdate:value":f[2]||(f[2]=p=>s.value=p),validation:o.value,settings:t.settings,"is-submit-processing":a.value,"onUpdate:params":h,onSubmit:u,"onClick:addLine":c,"onClick:removeLine":d},null,8,["value","validation","settings","is-submit-processing"])])])}}}),k0={class:"flex flex-col gap-3"},C0={},yd=i.defineComponent({...C0,__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,{emit:e}){const n=t,r=e,s=i.useTemplateRef("first-input-element"),o=i.ref(V.cloneDeep(i.toRaw(n.value.configuratorParams))),a=()=>{o.value.length>0&&o.value.width>0&&(r("update:params",o.value),l("configuratorParams",o.value))},l=(c,d)=>{const h=new U.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.onMounted(()=>{n.value.isNewRec()&&i.nextTick(()=>{var c;(c=s.value)==null||c.focus()})}),(c,d)=>{const h=z.NInput;return i.openBlock(),i.createBlock(i.unref(z.NForm),{disabled:t.isSubmitProcessing,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.width.feedback||"","show-feedback":t.validation.width.showFeedback||!1,"validation-status":t.validation.width.validationStatus||void 0,label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(Li,{ref:"first-input-element",value:o.value.width,"onUpdate:value":[d[0]||(d[0]=u=>o.value.width=u),a],class:"w-full",max:t.settings.maxWidth??void 0,min:t.settings.minWidth,validator:u=>!!u&&u>=t.settings.minWidth&&(!t.settings.maxWidth||u<=t.settings.maxWidth),placeholder:"Введите ширину"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.length.feedback||"","show-feedback":t.validation.length.showFeedback||!1,"validation-status":t.validation.length.validationStatus||void 0,label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(Li,{value:o.value.length,"onUpdate:value":[d[1]||(d[1]=u=>o.value.length=u),a],placeholder:"Введите длину",max:t.settings.maxLength,min:t.settings.minLength,validator:u=>u>=t.settings.minLength&&u<=t.settings.maxLength,class:"w-full"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.quantity.feedback||"","show-feedback":t.validation.quantity.showFeedback||!1,"validation-status":t.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество","show-button":!1,min:1,validator:u=>u>0,class:"w-full","onUpdate:value":d[2]||(d[2]=u=>l("quantity",u??0))},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{feedback:t.validation.marker.feedback||"","show-feedback":t.validation.marker.showFeedback||!1,"validation-status":t.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(h,{value:t.value.marker,placeholder:"Введите маркировку","onUpdate:value":d[3]||(d[3]=u=>l("marker",u))},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(nr,{"is-product-searching":t.isProductSearching,product:t.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",k0,[i.createVNode(i.unref(z.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:d[4]||(d[4]=u=>r("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["disabled"])}}}),S0={class:"flex flex-col gap-2"},B0={},bd=i.defineComponent({...B0,__name:"metal-for-doors-configurator",props:{settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.cartItem),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.ref(!1),c=async h=>{a.value=!0,await U.HttpRequester.getInstance(U.ConfiguratorProvider).searchProduct(n.cartItem.category,h,o.value).then(u=>{s.value.product=u}).catch(()=>{a.value=!1}),a.value=!1},d=()=>{l.value=!0,r("submit",s.value,o.value,()=>{l.value=!1})};return(h,u)=>{const m=z.NButton;return i.openBlock(),i.createElementBlock("div",S0,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:u[0]||(u[0]=f=>r("click:view-switch"))},{default:i.withCtx(()=>[...u[4]||(u[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(yd,{value:s.value,"onUpdate:value":u[1]||(u[1]=f=>s.value=f),validation:o.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":u[2]||(u[2]=f=>c(f)),onSubmit:u[3]||(u[3]=f=>d())},null,8,["value","validation","settings","is-submit-processing"])])}}});class Di extends U.Identity{constructor(n,r){super();x(this,"label","");x(this,"points",[]);x(this,"isCustom",!1);x(this,"id",-1);x(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>V.isArray(s)?new ri(s[0],s[1],`A-${o+1}`):new ri(s.width,s.angle,`A-${o+1}`))):(this.label="-- Новая конфигурация --",this.points=[new ri(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class No extends Di{constructor(n){super(n);x(this,"isDefault");this.isDefault=n.isDefault??!1}}class _d{constructor(e){x(this,"minLineWidth");x(this,"maxLineWidth");x(this,"lineWidthStep");x(this,"minLineAngle");x(this,"maxLineAngle");x(this,"lineAngleStep");x(this,"stripMinWidth");x(this,"stripMaxWidth");x(this,"stripMinLength");x(this,"stripMaxLength");x(this,"allowShowTable");x(this,"showOnlyTemplates");x(this,"templates");x(this,"customTemplates",[]);x(this,"startTailConfigs");x(this,"endTailConfigs");x(this,"bendCountForExtended");x(this,"extendedProductCatalog");x(this,"allowChangeFirstPoint");x(this,"allowSaveTemplates");x(this,"userTemplatesPrefix");x(this,"lengthStep");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 Di(s)),this.templates.forEach((s,o)=>{s.id=o}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(s=>new No(s)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(s=>new No(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.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).map(([s,o])=>{const a=new Di(o);return a.isCustom=!0,a.id=+s,a}):[],this.customTemplates.push(new Di))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){var r,s;if(!this.allowSaveTemplates)return;const n=new Di(e);n.isCustom=!0,n.id=(((r=this.customTemplates.at(-1))==null?void 0:r.id)??((s=this.templates.at(-1))==null?void 0:s.id)??0)+1,this.customTemplates.splice(-1,0,n)}removeCustomTemplate(e){if(this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===e);n&&n!==-1&&this.customTemplates.splice(n,1)}}class T0{constructor(e){x(this,"minHeight");x(this,"maxHeights");x(this,"minWidth");x(this,"maxWidths");x(this,"netType");x(this,"color");x(this,"mountType");x(this,"descriptions");x(this,"crossbarCount");x(this,"heightOverlaps");x(this,"widthOverlaps");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=Ps.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=Ps.objectToSnake(e.heightOverlaps),this.widthOverlaps=Ps.objectToSnake(e.widthOverlaps)}}const R0={key:0,class:"flex justify-center p-4"},$0={key:1,class:"p-4 text-center text-red-500"},E0={key:2,class:"!bg-white p-4 m-2 rounded-md justify-self-center"},N0={key:3,class:"p-4 text-center text-gray-500"},wd=i.defineComponent({__name:"dynamic-configurator",props:{eventEmitter:{},category:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=i.ref(null),a=i.ref(null),l=i.computed(()=>{var f;return(f=n.category.properties)==null?void 0:f.configurator}),c=i.ref(null),d=i.ref(null),h=f=>{var p,y;const g={category:n.category,configurator:l.value,quantity:1};switch(l.value){case"kozyrek":{const b=f;c.value=new U.CartItemBase({...g,configuratorParams:{length:b.stripMinLength,linesAngles:[],linesWidths:[],startTailType:V.some(b.startTailConfigs,_=>_.isDefault)?(p=b.startTailConfigs)==null?void 0:p.findIndex(_=>_.isDefault):void 0,endTailType:V.some(b.endTailConfigs,_=>_.isDefault)?(y=b.endTailConfigs)==null?void 0:y.findIndex(_=>_.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const b=f;c.value=new U.CartItemBase({...g,configuratorParams:{width:0,height:0,netType:b.netType[0]||"",color:b.color[0]||"",mountType:b.mountType[0]||""}});break}case"strip":{d.value=[new U.CartItemBase({...g,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const b=f;c.value=new U.CartItemBase({...g,configuratorParams:{width:b.minWidth,length:b.minLength}});break}default:o.value=`Неподдерживаемый тип конфигуратора: ${l.value}.`}},u=async()=>{var f;if(!l.value){o.value="Тип конфигуратора не указан в свойствах категории.";return}s.value=!0,o.value=null;try{const p=await U.HttpRequester.getInstance(U.ConfiguratorProvider).getConfiguratorSettings(n.category);switch((f=n.category.properties)==null?void 0:f.configurator){case"kozyrek":a.value=new _d(p);break;case"mosquitto":a.value=new T0(p);break;default:a.value=p;break}h(a.value)}catch(g){"message"in g&&(g.value=`Ошибка при загрузке настроек конфигуратора: ${V.isError(g)?g.message:"Неизвестная ошибка"}.`)}finally{s.value=!1}},m=(f,g,p)=>{const y=b=>{p==null||p(),b&&h(a.value)};r("submit",V.isArray(f)?f[0]:f,g,y)};return i.onMounted(()=>{u()}),(f,g)=>{const p=z.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[s.value?(i.openBlock(),i.createElementBlock("div",R0,[i.createVNode(p,{size:"large"})])):o.value?(i.openBlock(),i.createElementBlock("div",$0,i.toDisplayString(o.value),1)):i.createCommentVNode("",!0),a.value!==null&&(c.value!==null||d.value!==null)?(i.openBlock(),i.createElementBlock("div",E0,[l.value==="kozyrek"?(i.openBlock(),i.createBlock(cd,{key:0,settings:a.value,"cart-item":c.value,"onClick:viewSwitch":g[0]||(g[0]=y=>r("click:view-switch")),onSubmit:m},null,8,["settings","cart-item"])):l.value==="mosquitto"?(i.openBlock(),i.createBlock(ud,{key:1,settings:a.value,"cart-item":c.value,"onClick:viewSwitch":g[1]||(g[1]=y=>r("click:view-switch")),onSubmit:m},null,8,["settings","cart-item"])):l.value==="strip"?(i.openBlock(),i.createBlock(pd,{key:2,settings:a.value,"cart-items":d.value,"onClick:viewSwitch":g[2]||(g[2]=y=>r("click:view-switch")),onSubmit:m},null,8,["settings","cart-items"])):l.value==="metal_for_doors"?(i.openBlock(),i.createBlock(bd,{key:3,settings:a.value,"cart-item":c.value,"onClick:viewSwitch":g[3]||(g[3]=y=>r("click:view-switch")),onSubmit:m},null,8,["settings","cart-item"])):i.createCommentVNode("",!0)])):(i.openBlock(),i.createElementBlock("div",N0,' Конфигуратор "'+i.toDisplayString(l.value)+'" не поддерживается. ',1))],64)}}}),P0={key:0,class:"pt-0.5"},F0={key:0},M0={class:"line-through"},A0={key:0},V0={key:1},O0={class:"flex flex-row gap-1"},I0={key:0},z0={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},L0={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},D0={key:2,class:"flex flex-col"},H0={},W0=i.defineComponent({...H0,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type: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},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($r,"medium"),r=i.computed(()=>{var F;return(F=e==null?void 0:e.filteredItems)==null?void 0:F[e.categoryItem.id]}),s=i.computed(()=>{var F,M;return V.isArray((F=e.categoryItem)==null?void 0:F.categories)&&((M=e.categoryItem.categories)==null?void 0:M.length)>0}),o=i.computed(()=>{var F;return V.isArray((F=e.categoryItem)==null?void 0:F.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([F,M])=>`${M} руб./${T(F)}`).join(", ")),l=i.computed(()=>V.isUndefined(e.filteredItems)||r.value==="*"?o.value:o.value.filter(F=>{var Z;const M=(Z=r.value)==null?void 0:Z.products;return V.isArray(M)&&M.includes(F.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>V.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),h=i.computed(()=>V.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),u=i.computed(()=>V.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),m=i.computed(()=>V.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),f=i.computed(()=>{var F;return((F=e.categoryItem.properties)==null?void 0:F.configurator)!==void 0&&(V.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)}),g=i.computed(()=>V.isNil(e.categoryContextButtonsConfig)?[]:V.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),p=i.computed(()=>new U.ClientCategory(e.categoryItem)),y=i.ref(!1),b=i.ref(!1),_=i.computed(()=>!V.isUndefined(e.isCategoryItemSelected)),v=i.computed(()=>V.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected),k=i.computed(()=>H.value&&bt.getDeviceTypeByResolution()===Ue.laptop?"auto":"fixed"),C=i.useTemplateRef("collapse-item-reference"),B=i.computed(()=>{var F,M;return(M=(F=e.categoryItem.properties)==null?void 0:F.templateCost)==null?void 0:M.priceCoefficient}),S=i.computed(()=>{var F,M;return(M=(F=e.categoryItem.properties)==null?void 0:F.templateCost)==null?void 0:M.increasePercent}),T=(F,M="ru-RU")=>0 .toLocaleString(M,{style:"currency",currency:F,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),$=F=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:F,target:C.value})},E=(F,M)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:M,isLoadingState:y,target:C.value})},O=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:C.value})},I=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:C.value})},A=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:C.value})},L=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:C.value})},D=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:C.value})},ee=F=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:F,target:C.value})},N=(F,M,Z)=>{e.eventEmitter.emit("configurator:submit",{cartItem:F,target:C.value,callback:Z,validation:M})},P=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem,target:C.value})},H=i.ref(0),q=i.computed(()=>H.value&&o.value.length>0?yg(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}):[]),Y=V.debounce(()=>{H.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",Y)}),window.addEventListener("resize",Y),Y(),(F,M)=>{const Z=z.NCheckbox,fe=sf,ie=z.NTooltip,me=tf,re=z.NTag,Me=Qu,Ae=Gu,Oe=z.NButton,Le=Xu,pt=La,Zt=za,Qt=Ia,St=Oa,At=z.NDropdown,yt=z.NDataTable,pn=z.NAlert,Pn=z.NSpin;return i.openBlock(),i.createBlock(Da,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":E},{"pre-arrow":i.withCtx(()=>{var De,ke;return[_.value?(i.openBlock(),i.createElementBlock("div",P0,[i.createVNode(Z,{checked:v.value,disabled:v.value==="disabled","onUpdate:checked":$},null,8,["checked","disabled"])])):i.createCommentVNode("",!0),!d.value&&((De=p.value)!=null&&De.isDisabled)?(i.openBlock(),i.createBlock(ie,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(fe,{class:"pt-1.5"})]),default:i.withCtx(()=>[M[1]||(M[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((ke=p.value)==null?void 0:ke.isFavorite)??!1?(i.openBlock(),i.createBlock(ie,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(me,{class:"pt-1.5"})]),default:i.withCtx(()=>[M[2]||(M[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var De,ke,Ie,J,se;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":(De=p.value)==null?void 0:De.isDisabled})},[i.createVNode(ie,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[M[3]||(M[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:M[0]||(M[0]=i.withModifiers((...Ce)=>i.unref(V.noop)&&i.unref(V.noop)(...Ce),["prevent","stop"]))},[(ke=t.categoryItem.properties)!=null&&ke.m2Price?(i.openBlock(),i.createBlock(re,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((Ie=t.categoryItem.properties)==null?void 0:Ie.templateCost)&&t.categoryItem.properties.m2PriceRetail&&S.value}),round:""},{default:i.withCtx(()=>{var Ce;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(Ce=t.categoryItem.properties)!=null&&Ce.templateCost&&t.categoryItem.properties.m2PriceRetail&&S.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[S.value?(i.openBlock(),i.createBlock(re,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[S.value?(i.openBlock(),i.createElementBlock("span",F0,i.toDisplayString(S.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(re,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",M0,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"])):(J=t.categoryItem.properties)!=null&&J.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[B.value||S.value?(i.openBlock(),i.createBlock(re,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var Ce;return[B.value?(i.openBlock(),i.createElementBlock("span",A0,i.toDisplayString((Ce=B.value)==null?void 0:Ce.name),1)):i.createCommentVNode("",!0),S.value?(i.openBlock(),i.createElementBlock("span",V0,i.toDisplayString(S.value>0?"+":"")+i.toDisplayString(S.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(re,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),h.value&&((se=p.value)!=null&&se.manager)?(i.openBlock(),i.createBlock(re,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:L},{default:i.withCtx(()=>[i.createVNode(ie,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Ce,Jt;return[i.createElementVNode("span",O0,[i.createVNode(Me),i.createTextVNode(" "+i.toDisplayString((Jt=(Ce=p.value)==null?void 0:Ce.manager)==null?void 0:Jt.name),1)])]}),default:i.withCtx(()=>{var Ce,Jt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((Jt=(Ce=p.value)==null?void 0:Ce.manager)==null?void 0:Jt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",I0,[i.createElementVNode("ul",z0,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(De,ke)=>(i.openBlock(),i.createElementBlock("li",{key:ke}," ("+i.toDisplayString(ke)+"): "+i.toDisplayString(De),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.categoryItem.properties,(De,ke)=>(i.openBlock(),i.createElementBlock("li",{key:ke}," ("+i.toDisplayString(ke)+"): "+i.toDisplayString(De),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var De;return[i.createElementVNode("div",L0,[d.value?(i.openBlock(),i.createBlock(ie,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Oe,{ghost:!0,size:i.unref(n),onClick:O},{default:i.withCtx(()=>{var ke;return[(ke=p.value)!=null&&ke.isDisabled?(i.openBlock(),i.createBlock(fe,{key:1})):(i.openBlock(),i.createBlock(Ae,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var ke;return[(ke=p.value)!=null&&ke.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(p.value.hidingComment?`. Причина: '${p.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),h.value&&!((De=p.value)!=null&&De.manager)?(i.openBlock(),i.createBlock(ie,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Oe,{ghost:!0,size:i.unref(n),onClick:A},{default:i.withCtx(()=>[i.createVNode(Le)]),_:1},8,["size"])]),default:i.withCtx(()=>{var ke,Ie,J;return[(ke=p.value)!=null&&ke.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((J=(Ie=p.value)==null?void 0:Ie.manager)==null?void 0:J.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createBlock(ie,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Oe,{ghost:!0,disabled:u.value==="disabled",size:i.unref(n),onClick:I},{default:i.withCtx(()=>{var ke;return[(ke=p.value)!=null&&ke.isRequired?(i.openBlock(),i.createBlock(Zt,{key:1})):(i.openBlock(),i.createBlock(pt,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[M[4]||(M[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(ie,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Oe,{ghost:!0,size:i.unref(n),type:"primary",onClick:D},{default:i.withCtx(()=>[i.createVNode(Qt)]),_:1},8,["size"])]),default:i.withCtx(()=>[M[5]||(M[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),g.value.length>0?(i.openBlock(),i.createBlock(At,{key:4,options:g.value,size:i.unref(n),trigger:"click",onSelect:ee},{default:i.withCtx(()=>[i.createVNode(Oe,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(St)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(F.$slots,"default",{},()=>{var De,ke;return[s.value?(i.openBlock(),i.createBlock(vd,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((De=r.value)==null?void 0:De.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},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"])):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(wd,{key:1,"event-emitter":t.eventEmitter,category:t.categoryItem,onSubmit:N,"onClick:viewSwitch":P},null,8,["event-emitter","category"])):c.value?(i.openBlock(),i.createElementBlock("div",D0,[((ke=t.categoryItem.properties)==null?void 0:ke.configurator)!==void 0?(i.openBlock(),i.createBlock(Oe,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:P},{default:i.withCtx(()=>[...M[6]||(M[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(yt,{columns:q.value,data:l.value,bordered:!0,loading:y.value,remote:!0,"row-key":Ie=>Ie.id,"table-layout":k.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])])):i.createCommentVNode("",!0),!y.value&&!b.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(pn,{key:3,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),b.value?(i.openBlock(),i.createBlock(pn,{key:4,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createBlock(Pn,{key:5,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...M[7]||(M[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),j0=Zn(W0,[["__scopeId","data-v-8ef5b448"]]),q0={class:"sc-collapse flex w-full flex-col"},X0={},xd=i.defineComponent({...X0,__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",q0,[i.renderSlot(o.$slots,"default")]))}}),Y0={},vd=i.defineComponent({...Y0,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{},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]},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:{},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($r,"medium"),r=i.computed(()=>V.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(o=>{var a;return!!((a=e.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(V.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=z.NSpin,c=z.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(xd,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(j0,{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},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"]))),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)}}}),U0={},kd=i.defineComponent({...U0,__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(()=>V.isArray(r.value)),a=new U.Reference,l=i.computed(()=>{const f=o.value?[]:a,g=V.isUndefined(r.value)?f:r.value;return V.isArray(g)?g.map(p=>p.id):g==null?void 0:g.id}),c=i.computed(()=>zt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue)),d=f=>{var g;if(V.isArray(f)){const p=f.length>0?f.map(y=>{var b;return(b=c.value.find(_=>_.value===y))==null?void 0:b.item}):[];s("update:value",p)}else{const p=f===a.id||(g=c.value.find(y=>y.value===f))==null?void 0:g.item;s("update:value",p)}},h=i.useTemplateRef("select-component");return e({focus:()=>{var f;return(f=h.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=h.value)==null?void 0:f.blur()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(z.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"]))}}),G0={},K0=i.defineComponent({...G0,__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 v,k;const n=t,r=e,s=()=>{const C=U.PriceCoefficient.getRetailPriceCoefficient();return V.unset(C,"isNewRec"),C},o=C=>!C||C.id===s().id,a=i.computed(()=>{var C;return((C=n.catalogItem)==null?void 0:C.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=C=>{var B,S,T,$;return C.id===s().id?(B=l.value)==null?void 0:B.getRetailCost():($=(T=(S=l.value)==null?void 0:S.priceCoefficients)==null?void 0:T.find(E=>E.coefficient.id===C.id))==null?void 0:$.cost},d=i.computed(()=>{var B;const C=[...((B=U.useReferencesStore().priceCoefficientsReference)==null?void 0:B.map(S=>structuredClone(i.toRaw(S))))??[],s()];return a.value&&C.forEach(S=>{var $;const T=c(S);T?S.name+=` (${T} ${($=l.value)==null?void 0:$.currency})`:S.name=""}),C.filter(S=>S.name!=="")}),h=i.ref(n.value.coefficient),u=i.ref(((k=(v=n.value)==null?void 0:v.value)==null?void 0:k.toString())??null),m=i.ref(null),f=i.computed(()=>{var C,B;return(B=(C=l.value)==null?void 0:C.priceCoefficients)==null?void 0:B.find(S=>S.coefficient.slug===U.PriceCoefficientEnum.K0)}),g=i.ref(void 0),p=()=>{var B,S,T;g.value=void 0;let C=Number.parseFloat(((B=u.value)==null?void 0:B.replace(",","."))??"");if(C=Number.isNaN(C)?void 0:C,a.value)if(h.value||u.value){const $=s(),E=c(h.value??$)??0,O=E+E*((C??0)/100);m.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(O),O>(((S=l.value)==null?void 0:S.getRetailCost())??O)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),f.value&&O<(((T=f.value)==null?void 0:T.cost)??0)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else m.value=null;r("update:value",{value:Number.isNaN(C)?void 0:C,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})},y=C=>{V.isArray(C)||(h.value=C,!h.value&&u.value&&(h.value=s()),p())},b=()=>{h.value||(h.value=s()),p()},_=C=>{var S,T,$,E,O,I;const B=Number.parseFloat((C==null?void 0:C.replace(",","."))??"");if(a.value){let A=0;if(B<=0)h.value=void 0,u.value=null;else if(f.value&&B<(((S=f.value)==null?void 0:S.cost)??0))h.value=(T=f.value)==null?void 0:T.coefficient,A=(B-f.value.cost)*100/f.value.cost,g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(B>((($=l.value)==null?void 0:$.getRetailCost())??B)){h.value=s();const L=((E=l.value)==null?void 0:E.getRetailCost())??0;A=(B-L)*100/L,g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const L=(I=(O=l.value)==null?void 0:O.priceCoefficients)==null?void 0:I.filter(D=>D.cost<B);if(L&&L.length>0){const D=L.at(-1);h.value=D==null?void 0:D.coefficient,A=(B-((D==null?void 0:D.cost)??0))*100/((D==null?void 0:D.cost)??1)}g.value={validationStatus:void 0,feedback:void 0}}u.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(A),r("update:value",{value:Number.isNaN(A)?void 0:A,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})}else r("update:value",{value:Number.isNaN(B)?void 0:B,coefficient:void 0})};return i.onMounted(()=>{var C,B,S,T;n.calculationType===U.CalculationTypeEnum.m2Cost?m.value=((B=(C=n.value)==null?void 0:C.value)==null?void 0:B.toString())??null:!((S=n.value)!=null&&S.coefficient)&&((T=n.value)!=null&&T.value)&&(h.value=s()),p()}),(C,B)=>{var $,E,O;const S=z.NInput,T=z.NInputGroup;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{"show-label":!i.unref(V.isNil)(t.label),label:t.label,"show-feedback":!i.unref(V.isNil)((($=g.value)==null?void 0:$.feedback)??t.feedback),feedback:((E=g.value)==null?void 0:E.feedback)??t.feedback,"validation-status":((O=g.value)==null?void 0:O.validationStatus)??t.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==i.unref(U.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==i.unref(U.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(T,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(kd,{class:"w-full min-w-0 flex-1",value:h.value,"reference-list":d.value,clearable:t.clearable,disabled:t.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":y},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(S,{value:u.value,"onUpdate:value":[B[0]||(B[0]=I=>u.value=I),b],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[B[3]||(B[3]=i.createTextVNode("%",-1))]),_:2},[u.value&&!u.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[B[2]||(B[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||t.calculationType===i.unref(U.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(S,{key:1,value:m.value,"onUpdate:value":[B[1]||(B[1]=I=>m.value=I),_],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var I;return[i.createTextVNode(i.toDisplayString((I=l.value)==null?void 0:I.currency),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),Z0={key:0,class:"flex flex-row gap-2.5"},Q0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},J0={},Cd=i.defineComponent({...J0,__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}})},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=bt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=bt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>window.innerWidth*c.value),h=()=>{s("opening"),o.value=!0,s("update:show",o.value)},u=(f="other")=>{if(a.value){s("processing:cancel",b=>{a.value=b});return}let g=!1;s("closing",f,()=>{g=!0}),g||(o.value=!1,s("update:show",o.value))},m=()=>{s("accept",g=>{a.value=g})};return i.watch(()=>r.show,f=>{f?h():u("other")}),i.watch(()=>r.processing,f=>{a.value=f}),e({open:h,close:u}),(f,g)=>{const p=z.NButton,y=z.NModal;return i.openBlock(),i.createBlock(y,{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":f.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:g[1]||(g[1]=b=>u("header")),onEsc:g[2]||(g[2]=b=>u("esc")),onMaskClick:g[3]||(g[3]=b=>u("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(f.$slots,"default")]),_:2},[f.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(f.$slots,"header")]),key:"0"}:void 0,f.$slots.action||f.$slots["extra-action"]||t.acceptButton.show||t.cancelButton.show?{name:"action",fn:i.withCtx(()=>[f.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",Z0,[i.renderSlot(f.$slots,"extra-action")])):i.createCommentVNode("",!0),f.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",Q0,[i.renderSlot(f.$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:g[0]||(g[0]=b=>u("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"])}}}),ey={class:"text-sm"},ty={class:"text-sm"},ny={},iy=i.defineComponent({...ny,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:n}){const r=i.ref(null),s=i.ref(void 0),o=i.ref(null),a=n,l=i.ref({length:{},quantity:{},marker:{}}),c=i.ref(!1),d=i.computed(()=>{var b,_,v;return r.value?((b=r.value.properties)==null?void 0:b.lengthStep)??((_=r.value.properties)!=null&&_.ignoreMinCountCheck?0:((v=r.value.properties)==null?void 0:v.minCount)??0):0}),h=i.computed(()=>{var v,k,C,B,S,T,$,E,O;if(!r.value)return"";const b=((k=(v=r.value)==null?void 0:v.properties)==null?void 0:k.minLength)??((B=(C=r.value)==null?void 0:C.properties)!=null&&B.ignoreMinCountCheck?0:(T=(S=r.value)==null?void 0:S.properties)==null?void 0:T.minCount),_=(E=($=r.value)==null?void 0:$.properties)==null?void 0:E.maxLength;return b||_?`(${b?`от ${b}`:""}${b&&_?" ":""}${_?`до ${_}`:""} ${(O=r.value)==null?void 0:O.unit})`:""}),u=b=>{var B,S;if(!((S=(B=r.value)==null?void 0:B.properties)!=null&&S.isLengthConfigurator)||!o.value||V.isNil(b)||d.value===0)return;const _=b/d.value,v=Math.round(_),k=U.UnitsHelper.getProductMultiplicity(r.value),C=Math.max(v,k);o.value.quantity=C},m=b=>{var C,B,S,T;if(!((B=(C=r.value)==null?void 0:C.properties)!=null&&B.isLengthConfigurator)||!o.value||V.isNil(b)||d.value===0)return;const _=b*d.value,v=((S=r.value.properties)==null?void 0:S.minLength)||U.UnitsHelper.getProductLengthMultiplicity(r.value),k=(T=r.value.properties)==null?void 0:T.maxLength;v!==void 0&&_<v?o.value.length=v:k!==void 0&&_>k?o.value.length=k:o.value.length=_},f=b=>{var v;if(!r.value||!o.value)return;const _=new U.CartItemBase(o.value);U.UnitsHelper.productIsMeasurable(r.value)||delete _.length,U.UnitsHelper.productIsMeasurable(r.value)&&((v=r.value.properties)!=null&&v.isLengthConfigurator)&&d.value&&(_.length=d.value),c.value=!0,a("submit",_,l.value,()=>{c.value=!1,b(!1)})},g=()=>{r.value=null,s.value=void 0,o.value=null,l.value=y()},p=(b,_)=>{var v,k,C,B;if(r.value=b,s.value=_,o.value=new U.CartItemBase(_??new U.CartItemBase({product:b,quantity:1,length:((v=b==null?void 0:b.properties)==null?void 0:v.minLength)||((k=b==null?void 0:b.properties)!=null&&k.ignoreMinCountCheck?0:(C=b==null?void 0:b.properties)==null?void 0:C.minCount)||0})),(B=b==null?void 0:b.properties)!=null&&B.isLengthConfigurator&&o.value&&d.value>0){const S=d.value,T=o.value.quantity||1;o.value.length=T*S}},y=()=>({length:{},quantity:{},marker:{}});return e({show:p,closeDialog:g}),(b,_)=>(i.openBlock(),i.createBlock(Cd,{show:!i.unref(V.isNil)(r.value)&&!i.unref(V.isNil)(o.value),title:`${s.value?"Изменение":"Добавление"} товара в корзину`,"accept-button":{show:!0,text:s.value?"Изменить":"В корзину"},processing:c.value,onAccept:f,onClosing:g},{default:i.withCtx(()=>[r.value&&o.value?(i.openBlock(),i.createBlock(i.unref(z.NForm),{key:0,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.unref(U.UnitsHelper).productIsMeasurable(r.value)?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:0,required:!0,feedback:l.value.length.feedback||"","show-feedback":l.value.length.showFeedback||i.unref(U.UnitsHelper).getProductLengthMultiplicity(r.value)!==.01||!1,"validation-status":l.value.length.validationStatus||void 0,label:"Метраж, "+r.value.unit+h.value+"м."},i.createSlots({default:i.withCtx(()=>{var v,k,C;return[i.createVNode(i.unref(z.NInputNumber),{value:o.value.length,"onUpdate:value":[_[0]||(_[0]=B=>o.value.length=B),u],"show-button":!1,max:((v=r.value.properties)==null?void 0:v.maxLength)||void 0,min:((k=r.value.properties)==null?void 0:k.minLength)||i.unref(U.UnitsHelper).getProductLengthMultiplicity(r.value),step:((C=r.value.properties)==null?void 0:C.lengthStep)||i.unref(U.UnitsHelper).getProductLengthMultiplicity(r.value),validator:B=>{const S=i.unref(U.UnitsHelper).getProductLengthMultiplicity(r.value);return Math.round(B/S)*S===B},placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]}),_:2},[!l.value.length.feedback&&i.unref(U.UnitsHelper).getProductLengthMultiplicity(r.value)!==.01?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",ey,"Метраж должен быть кратен "+i.toDisplayString(i.unref(U.UnitsHelper).getProductLengthMultiplicity(r.value)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status","label"])):i.createCommentVNode("",!0),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:l.value.quantity.feedback||"","show-feedback":l.value.quantity.showFeedback||i.unref(U.UnitsHelper).getProductMultiplicity(r.value)!==1||!1,"validation-status":l.value.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputGroup),null,i.createSlots({default:i.withCtx(()=>{var v;return[i.createVNode(i.unref(z.NInputNumber),{value:o.value.quantity,"onUpdate:value":[_[1]||(_[1]=k=>o.value.quantity=k),m],"show-button":!1,min:i.unref(U.UnitsHelper).getProductMultiplicity(r.value),step:i.unref(U.UnitsHelper).getProductMultiplicity(r.value),validator:k=>k%i.unref(U.UnitsHelper).getProductMultiplicity(r.value)===0,placeholder:"Введите количество",class:"w-full"},null,8,["value","min","step","validator"]),(v=r.value.properties)!=null&&v.isLengthConfigurator?(i.openBlock(),i.createBlock(i.unref(z.NInputGroupLabel),{key:0,class:"bg-orange-100 font-bold"},{default:i.withCtx(()=>[i.createTextVNode(" x "+i.toDisplayString(d.value)+" "+i.toDisplayString(r.value.unit),1)]),_:1})):i.createCommentVNode("",!0)]}),_:2},[!l.value.quantity.feedback&&i.unref(U.UnitsHelper).getProductMultiplicity(r.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",ty,"Количество должно быть кратно "+i.toDisplayString(i.unref(U.UnitsHelper).getProductMultiplicity(r.value)),1)]),key:"0"}:void 0]),1024)]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{feedback:l.value.marker.feedback||"","show-feedback":l.value.marker.showFeedback||!1,"validation-status":l.value.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:o.value.marker,"onUpdate:value":_[2]||(_[2]=v=>o.value.marker=v),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"])]),_:1})):i.createCommentVNode("",!0)]),_:1},8,["show","title","accept-button","processing"]))}}),ry={class:"flex flex-row gap-1"},sy={class:"sc-client-name flex flex-col gap-1 text-base"},oy=["href"],ay={key:1,class:"text-sc-grey"},ly={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},cy={key:0},dy={key:1,class:"text-sm"},hy={},os=i.defineComponent({...hy,__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?Mn.format(n.client.lastLoginAt,U.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{V.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Fs,d=z.NButton,h=z.NPopover;return i.openBlock(),i.createElementBlock("div",ry,[t.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=u=>a.$emit("click:client-info",t.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(V.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",sy,[i.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=u=>o(u))},[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",ay," [ Деактивирован ] "))],8,oy),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",ly," г. "+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",cy,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",dy," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),uy={class:"text-base"},fy={},Sd=i.defineComponent({...fy,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",uy,i.toDisplayString(t.contragent.name),1))}}),gy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function my(t,e){return i.openBlock(),i.createElementBlock("svg",gy,[...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 py=i.markRaw({name:"tabler-mail",render:my}),yy=["href"],by={},_y=i.defineComponent({...by,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=py;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,yy)],2)}}}),wy={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xy(t,e){return i.openBlock(),i.createElementBlock("svg",wy,[...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 Bd=i.markRaw({name:"fa6-brands-viber",render:xy}),vy={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},ky=["id"],Cy=["id"],Sy=["fill"],By=["fill"];function Ty(t,e){return i.openBlock(),i.createElementBlock("svg",vy,[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,ky),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,Cy)]),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,Sy),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,By),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 Td=i.markRaw({name:"logos-whatsapp-icon",render:Ty,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),Ry={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},$y=["id"],Ey=["fill"];function Ny(t,e){return i.openBlock(),i.createElementBlock("svg",Ry,[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,$y)]),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,Ey),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 Rd=i.markRaw({name:"logos-telegram",render:Ny,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),Py={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Fy(t,e){return i.openBlock(),i.createElementBlock("svg",Py,[...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 $d=i.markRaw({name:"ion-call",render:Fy}),My={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ay(t,e){return i.openBlock(),i.createElementBlock("svg",My,[...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 Vy=i.markRaw({name:"tabler-phone-call",render:Ay}),Oy={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},Iy=["href"],zy=["href"],Ly=["href"],Dy=["href"],Hy={},Wy=i.defineComponent({...Hy,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{try{return e.phone?Ji.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=i.computed(()=>{var l;return V.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return V.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return V.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=Vy,h=$d,u=Rd,m=Td,f=Bd;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]=g=>a.value=!a.value),onFocusout:c[1]||(c[1]=g=>a.value=!1),onMouseleave:c[2]||(c[2]=g=>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",Oy,[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(h)],8,Iy)):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(u)],8,zy)):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,Ly)):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(f)],8,Dy)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),jy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qy(t,e){return i.openBlock(),i.createElementBlock("svg",jy,[...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 Xy=i.markRaw({name:"mdi-envelope",render:qy}),Yy={class:"flex flex-col gap-1"},Uy={key:0,class:"mb-2 flex flex-col text-base"},Gy={key:0,class:"text-sc-dark-grey text-sm"},Ky={key:1,class:"whitespace-nowrap text-sm"},Zy={key:2,class:"whitespace-nowrap text-sm"},Qy={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Jy=["href"],eb=["href"],tb=["href"],nb=["href"],ib=["href"],rb={key:0,class:"flex flex-col text-base"},sb={key:0,class:"text-sc-dark-grey text-sm"},ob={key:1,class:"mt-2 text-sm"},ab={key:0,class:"-mt-1"},lb={},cb=i.defineComponent({...lb,__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?Ji.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),r=i.computed(()=>{var c;return V.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return V.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return V.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 y,b;const h=$d,u=Rd,m=Td,f=Bd,g=Xy,p=z.NPopover;return i.openBlock(),i.createElementBlock("div",Yy,[i.createVNode(p,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var _,v,k,C;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]=B=>l.value=!0),onFocusin:d[1]||(d[1]=B=>l.value=!0),onMouseleave:d[2]||(d[2]=B=>l.value=!1),onFocusout:d[3]||(d[3]=B=>l.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(v=t.contact)!=null&&v.position)?(i.openBlock(),i.createElementBlock("div",Uy,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(k=t.contact)!=null&&k.position?(i.openBlock(),i.createElementBlock("span",Gy,i.toDisplayString((C=t.contact)==null?void 0:C.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.contact.phone?(i.openBlock(),i.createElementBlock("div",Ky,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",Zy,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",Qy,[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(h)],8,Jy)):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(u)],8,eb)):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,tb)):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(f)],8,nb)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(g)],8,ib)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var _,v,k,C;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",rb,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(_=t.contact)!=null&&_.position?(i.openBlock(),i.createElementBlock("span",sb,i.toDisplayString((v=t.contact)==null?void 0:v.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(k=t.contact)!=null&&k.comment?(i.openBlock(),i.createElementBlock("div",ob,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((C=t.contact)==null?void 0:C.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((y=t.contact)!=null&&y.comment)?(i.openBlock(),i.createElementBlock("div",ab,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((b=t.contact)==null?void 0:b.comment),1)])):i.createCommentVNode("",!0)])}}}),db={class:"flex flex-wrap gap-2"},hb={class:"flex flex-col"},ub={class:"flex flex-col"},fb={},gb=i.defineComponent({...fb,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>U.AppConfigProvider.getConfig().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 V.forOwn(U.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?Mn.startOfDay(new Date(a)):void 0,to:l?Mn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,u,m,f,g,p;const c=z.NButton,d=z.NDatePicker;return i.openBlock(),i.createElementBlock("div",db,[i.createVNode(d,{value:((u=(h=t.dateRange)==null?void 0:h.from)==null?void 0:u.getTime())??null,clearable:t.clearable,"is-date-disabled":y=>{var b,_;return((b=t.dateRange)==null?void 0:b.to)&&y>((_=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]=y=>{var b,_;return o(y,(_=(b=t.dateRange)==null?void 0:b.to)==null?void 0:_.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",hb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(y,b)=>(i.openBlock(),i.createBlock(c,{key:b,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var v,k;return o((v=y==null?void 0:y.from)==null?void 0:v.getTime(),(k=y==null?void 0:y.to)==null?void 0:k.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(y.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"]),i.createVNode(d,{value:((g=(f=t.dateRange)==null?void 0:f.to)==null?void 0:g.getTime())??null,clearable:t.clearable,"is-date-disabled":y=>{var b,_;return((b=t.dateRange)==null?void 0:b.from)&&y<((_=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]=y=>{var b,_;return o((_=(b=t.dateRange)==null?void 0:b.from)==null?void 0:_.getTime(),y)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",ub,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(y,b)=>(i.openBlock(),i.createBlock(c,{key:b,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var v,k;return o((v=y==null?void 0:y.from)==null?void 0:v.getTime(),(k=y==null?void 0:y.to)==null?void 0:k.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(y.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"])])}}}),mb={class:"sc-lbl-date text-nowrap"},pb={},Po=i.defineComponent({...pb,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>Mn.format(e.date,U.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Mn.format(e.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",mb,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))}}),yb={class:"flex flex-row gap-2.5"},bb={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},_b={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},wb={class:"mb-0.5 sm:mb-0 sm:ml-3"},xb={},vb=i.defineComponent({...xb,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=ss,s=z.NButton,o=z.NPopover;return i.openBlock(),i.createElementBlock("div",yb,[i.createElementVNode("div",bb,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",_b,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",wb,[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)])])])])}}}),kb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Cb(t,e){return i.openBlock(),i.createElementBlock("svg",kb,[...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 Sb=i.markRaw({name:"ion-download-outline",render:Cb}),Bb={},Tb=i.defineComponent({...Bb,__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 h=new FileReader;h.addEventListener("load",()=>{c.content=h.result??"",r("update:file",c)}),h.readAsDataURL(d.file)};return(l,c)=>{const d=Sb;return i.openBlock(),i.createBlock(i.unref(z.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(z.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"])}}}),Rb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $b(t,e){return i.openBlock(),i.createElementBlock("svg",Rb,[...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 Eb=i.markRaw({name:"ion-checkmark-done-sharp",render:$b}),Nb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Pb(t,e){return i.openBlock(),i.createElementBlock("svg",Nb,[...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 Fb=i.markRaw({name:"ion-options-outline",render:Pb}),Mb={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},Ab={class:"flex-auto"},Vb={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"},Ob={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"},Ib={},Fo=i.defineComponent({...Ib,__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 h=Fb,u=z.NButton,m=z.NPopover,f=Eb,g=ss;return i.openBlock(),i.createElementBlock("div",Mb,[i.createElementVNode("div",Ab,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",Vb,[i.createElementVNode("div",Ob,[t.showEditButton?(i.openBlock(),i.createBlock(m,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:t.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(h)]),_: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(u,{disabled:t.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(f)]),_: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(u,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),zb={},Ed=i.defineComponent({...zb,__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(Fo,{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(Fo,{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"]))]))}}),Lb={},Db=i.defineComponent({...Lb,__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=V.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(z.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),Hb={},Wb=i.defineComponent({...Hb,__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=V.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(V.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(V.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof Ji.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 h=Ji.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof Ji.ParseError)s.value=d;else throw h}};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(Au.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=h=>s.value=h),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"]))}}),jb=Zn(Wb,[["__scopeId","data-v-751dbb0e"]]),qb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Xb(t,e){return i.openBlock(),i.createElementBlock("svg",qb,[...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 Yb=i.markRaw({name:"tabler-external-link",render:Xb}),Ub={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},Gb=["href"],Kb={},Zb=i.defineComponent({...Kb,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=Yb,s=z.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(V.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",Ub,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,Gb),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),Qb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jb(t,e){return i.openBlock(),i.createElementBlock("svg",Qb,[...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 e_=i.markRaw({name:"ion-remove-circle-outline",render:Jb});let as=[];const Nd=new WeakMap;function t_(){as.forEach(t=>t(...Nd.get(t))),as=[]}function Pd(t,...e){Nd.set(t,e),!as.includes(t)&&as.push(t)===1&&requestAnimationFrame(t_)}function cr(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function dr(t){return t.composedPath()[0]||null}function hr(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function ur(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function Yt(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 Fd={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 n_(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 i_(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 dn="^\\s*",hn="\\s*$",Ln="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Mt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",si="([0-9A-Fa-f])",oi="([0-9A-Fa-f]{2})",Md=new RegExp(`${dn}hsl\\s*\\(${Mt},${Ln},${Ln}\\)${hn}`),Ad=new RegExp(`${dn}hsv\\s*\\(${Mt},${Ln},${Ln}\\)${hn}`),Vd=new RegExp(`${dn}hsla\\s*\\(${Mt},${Ln},${Ln},${Mt}\\)${hn}`),Od=new RegExp(`${dn}hsva\\s*\\(${Mt},${Ln},${Ln},${Mt}\\)${hn}`),r_=new RegExp(`${dn}rgb\\s*\\(${Mt},${Mt},${Mt}\\)${hn}`),s_=new RegExp(`${dn}rgba\\s*\\(${Mt},${Mt},${Mt},${Mt}\\)${hn}`),o_=new RegExp(`${dn}#${si}${si}${si}${hn}`),a_=new RegExp(`${dn}#${oi}${oi}${oi}${hn}`),l_=new RegExp(`${dn}#${si}${si}${si}${si}${hn}`),c_=new RegExp(`${dn}#${oi}${oi}${oi}${oi}${hn}`);function $t(t){return parseInt(t,16)}function d_(t){try{let e;if(e=Vd.exec(t))return[cs(e[1]),Dn(e[5]),Dn(e[9]),li(e[13])];if(e=Md.exec(t))return[cs(e[1]),Dn(e[5]),Dn(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function h_(t){try{let e;if(e=Od.exec(t))return[cs(e[1]),Dn(e[5]),Dn(e[9]),li(e[13])];if(e=Ad.exec(t))return[cs(e[1]),Dn(e[5]),Dn(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function ai(t){try{let e;if(e=a_.exec(t))return[$t(e[1]),$t(e[2]),$t(e[3]),1];if(e=r_.exec(t))return[dt(e[1]),dt(e[5]),dt(e[9]),1];if(e=s_.exec(t))return[dt(e[1]),dt(e[5]),dt(e[9]),li(e[13])];if(e=o_.exec(t))return[$t(e[1]+e[1]),$t(e[2]+e[2]),$t(e[3]+e[3]),1];if(e=c_.exec(t))return[$t(e[1]),$t(e[2]),$t(e[3]),li($t(e[4])/255)];if(e=l_.exec(t))return[$t(e[1]+e[1]),$t(e[2]+e[2]),$t(e[3]+e[3]),li($t(e[4]+e[4])/255)];if(t in Fd)return ai(Fd[t]);if(Md.test(t)||Vd.test(t)){const[n,r,s,o]=d_(t);return[...i_(n,r,s),o]}else if(Ad.test(t)||Od.test(t)){const[n,r,s,o]=h_(t);return[...n_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function u_(t){return t>1?1:t<0?0:t}function Mo(t,e,n,r){return`rgba(${dt(t)}, ${dt(e)}, ${dt(n)}, ${u_(r)})`}function Ao(t,e,n,r,s){return dt((t*e*(1-r)+n*r)/s)}function f_(t,e){Array.isArray(t)||(t=ai(t)),Array.isArray(e)||(e=ai(e));const n=t[3],r=e[3],s=li(n+r-n*r);return Mo(Ao(t[0],n,e[0],r,s),Ao(t[1],n,e[1],r,s),Ao(t[2],n,e[2],r,s),s)}function Fe(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:ai(t);return typeof e.alpha=="number"?Mo(n,r,s,e.alpha):Mo(n,r,s,o)}function ls(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:ai(t),{lightness:a=1,alpha:l=1}=e;return g_([n*a,r*a,s*a,o*l])}function li(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function cs(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function dt(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Dn(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function g_(t){const[e,n,r]=t;return 3 in t?`rgba(${dt(e)}, ${dt(n)}, ${dt(r)}, ${li(t[3])})`:`rgba(${dt(e)}, ${dt(n)}, ${dt(r)}, 1)`}function m_(t=8){return Math.random().toString(16).slice(2,2+t)}function Id(t){return Array.isArray(t)?t:[t]}const Vo={STOP:"STOP"};function zd(t,e){const n=e(t);t.children!==void 0&&n!==Vo.STOP&&t.children.forEach(r=>zd(r,e))}function p_(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 y_(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function b_(t){return t.children}function __(t){return t.key}function w_(){return!1}function x_(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function v_(t){return t.disabled===!0}function k_(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function C_(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function Oo(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Io(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function S_(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function B_(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function T_(t){return(t==null?void 0:t.type)==="group"}function R_(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 $_ extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function E_(t,e,n,r){return ds(e.concat(t),n,r,!1)}function N_(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 P_(t,e,n,r){const s=ds(e,n,r,!1),o=ds(t,n,r,!0),a=N_(t,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function zo(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:S_(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:B_(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=e;let u;s!==void 0?u=P_(s,n,e,d):r!==void 0?u=E_(r,n,e,d):u=ds(n,e,d,!1);const m=c==="parent",f=c==="child"||l,g=u,p=new Set,y=Math.max.apply(null,Array.from(h.keys()));for(let b=y;b>=0;b-=1){const _=b===0,v=h.get(b);for(const k of v){if(k.isLeaf)continue;const{key:C,shallowLoaded:B}=k;if(f&&B&&k.children.forEach(E=>{!E.disabled&&!E.isLeaf&&E.shallowLoaded&&g.has(E.key)&&g.delete(E.key)}),k.disabled||!B)continue;let S=!0,T=!1,$=!0;for(const E of k.children){const O=E.key;if(!E.disabled){if($&&($=!1),g.has(O))T=!0;else if(p.has(O)){T=!0,S=!1;break}else if(S=!1,T)break}}S&&!$?(m&&k.children.forEach(E=>{!E.disabled&&g.has(E.key)&&g.delete(E.key)}),g.add(C)):T&&p.add(C),_&&f&&g.has(C)&&g.delete(C)}}return{checkedKeys:Array.from(g),indeterminateKeys:Array.from(p)}}function ds(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&&zd(d,h=>{if(h.disabled)return Vo.STOP;const{key:u}=h;if(!a.has(u)&&(a.add(u),l.add(u),k_(h.rawNode,o))){if(r)return Vo.STOP;if(!n)throw new $_}})}),l}function F_(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 M_(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function A_(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 Ld(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const s=e==="prev"?V_:A_,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 h=Lo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const u=O_(d);u!=null&&u.isGroup?c(s(u,n)):n&&c(s(d,!0))}}}}return c(t),l}function V_(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 O_(t){return t.parent}function Lo(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 h=Lo(d,e);if(h!==null)return h}else return d}}return null}const I_={getChild(){return this.ignored?null:Lo(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return Ld(this,"next",t)},getPrev(t={}){return Ld(this,"prev",t)}};function z_(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 L_(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var D_={};function Dd(t,e,n,r,s,o=null,a=0){const l=[];return t.forEach((c,d)=>{var h;D_.NODE_ENV!=="production"&&C_(c,s)&&console.error("[treemate]: node",c,"is invalid");const u=Object.create(r);if(u.rawNode=c,u.siblings=l,u.level=a,u.index=d,u.isFirstChild=d===0,u.isLastChild=d+1===t.length,u.parent=o,!u.ignored){const m=s(c);Array.isArray(m)&&(u.children=Dd(m,e,n,r,s,u,a+1))}l.push(u),e.set(u.key,u),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(u)}),l}function H_(t,e={}){var n;const r=new Map,s=new Map,{getDisabled:o=v_,getIgnored:a=w_,getIsGroup:l=T_,getKey:c=__}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:b_,h=e.ignoreEmptyChildren?k=>{const C=d(k);return Array.isArray(C)?C.length?C:null:C}:d,u=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return y_(this.rawNode,h)},get shallowLoaded(){return x_(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(k){return L_(this,k)}},I_),m=Dd(t,r,s,u,h);function f(k){if(k==null)return null;const C=r.get(k);return C&&!C.isGroup&&!C.ignored?C:null}function g(k){if(k==null)return null;const C=r.get(k);return C&&!C.ignored?C:null}function p(k,C){const B=g(k);return B?B.getPrev(C):null}function y(k,C){const B=g(k);return B?B.getNext(C):null}function b(k){const C=g(k);return C?C.getParent():null}function _(k){const C=g(k);return C?C.getChild():null}const v={treeNodes:m,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(k){return z_(m,k)},getNode:f,getPrev:p,getNext:y,getParent:b,getChild:_,getFirstAvailableNode(){return M_(m)},getPath(k,C={}){return F_(k,C,v)},getCheckedKeys(k,C={}){const{cascade:B=!0,leafOnly:S=!1,checkStrategy:T="all",allowNotLoaded:$=!1}=C;return zo({checkedKeys:Oo(k),indeterminateKeys:Io(k),cascade:B,leafOnly:S,checkStrategy:T,allowNotLoaded:$},v)},check(k,C,B={}){const{cascade:S=!0,leafOnly:T=!1,checkStrategy:$="all",allowNotLoaded:E=!1}=B;return zo({checkedKeys:Oo(C),indeterminateKeys:Io(C),keysToCheck:k==null?[]:Id(k),cascade:S,leafOnly:T,checkStrategy:$,allowNotLoaded:E},v)},uncheck(k,C,B={}){const{cascade:S=!0,leafOnly:T=!1,checkStrategy:$="all",allowNotLoaded:E=!1}=B;return zo({checkedKeys:Oo(C),indeterminateKeys:Io(C),keysToUncheck:k==null?[]:Id(k),cascade:S,leafOnly:T,checkStrategy:$,allowNotLoaded:E},v)},getNonLeafKeys(k={}){return p_(m,k)}};return v}function hs(t){return t.composedPath()[0]}const W_={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function j_(t,e,n){if(t==="mousemoveoutside"){const r=s=>{e.contains(hs(s))||n(s)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const s=a=>{r=!e.contains(hs(a))},o=a=>{r&&(e.contains(hs(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 Hd(t,e,n){const r=W_[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=j_(t,e,n)),o}function q_(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=Hd(t,e,n);return Object.keys(s).forEach(o=>{kt(o,document,s[o],r)}),!0}return!1}function X_(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=Hd(t,e,n);return Object.keys(s).forEach(o=>{et(o,document,s[o],r)}),!0}return!1}function Y_(){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(S,T,$){const E=S[T];return S[T]=function(){return $.apply(S,arguments),E.apply(S,arguments)},S}function o(S,T){S[T]=Event.prototype[T]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var S;return(S=a.get(this))!==null&&S!==void 0?S:null}function d(S,T){l!==void 0&&Object.defineProperty(S,"currentTarget",{configurable:!0,enumerable:!0,get:T??l.get})}const h={bubble:{},capture:{}},u={};function m(){const S=function(T){const{type:$,eventPhase:E,bubbles:O}=T,I=hs(T);if(E===2)return;const A=E===1?"capture":"bubble";let L=I;const D=[];for(;L===null&&(L=window),D.push(L),L!==window;)L=L.parentNode||null;const ee=h.capture[$],N=h.bubble[$];if(s(T,"stopPropagation",n),s(T,"stopImmediatePropagation",r),d(T,c),A==="capture"){if(ee===void 0)return;for(let P=D.length-1;P>=0&&!t.has(T);--P){const H=D[P],q=ee.get(H);if(q!==void 0){a.set(T,H);for(const Y of q){if(e.has(T))break;Y(T)}}if(P===0&&!O&&N!==void 0){const Y=N.get(H);if(Y!==void 0)for(const F of Y){if(e.has(T))break;F(T)}}}}else if(A==="bubble"){if(N===void 0)return;for(let P=0;P<D.length&&!t.has(T);++P){const H=D[P],q=N.get(H);if(q!==void 0){a.set(T,H);for(const Y of q){if(e.has(T))break;Y(T)}}}}o(T,"stopPropagation"),o(T,"stopImmediatePropagation"),d(T)};return S.displayName="evtdUnifiedHandler",S}function f(){const S=function(T){const{type:$,eventPhase:E}=T;if(E!==2)return;const O=u[$];O!==void 0&&O.forEach(I=>I(T))};return S.displayName="evtdUnifiedWindowEventHandler",S}const g=m(),p=f();function y(S,T){const $=h[S];return $[T]===void 0&&($[T]=new Map,window.addEventListener(T,g,S==="capture")),$[T]}function b(S){return u[S]===void 0&&(u[S]=new Set,window.addEventListener(S,p)),u[S]}function _(S,T){let $=S.get(T);return $===void 0&&S.set(T,$=new Set),$}function v(S,T,$,E){const O=h[T][$];if(O!==void 0){const I=O.get(S);if(I!==void 0&&I.has(E))return!0}return!1}function k(S,T){const $=u[S];return!!($!==void 0&&$.has(T))}function C(S,T,$,E){let O;if(typeof E=="object"&&E.once===!0?O=ee=>{B(S,T,O,E),$(ee)}:O=$,q_(S,T,O,E))return;const A=E===!0||typeof E=="object"&&E.capture===!0?"capture":"bubble",L=y(A,S),D=_(L,T);if(D.has(O)||D.add(O),T===window){const ee=b(S);ee.has(O)||ee.add(O)}}function B(S,T,$,E){if(X_(S,T,$,E))return;const I=E===!0||typeof E=="object"&&E.capture===!0,A=I?"capture":"bubble",L=y(A,S),D=_(L,T);if(T===window&&!v(T,I?"bubble":"capture",S,$)&&k(S,$)){const N=u[S];N.delete($),N.size===0&&(window.removeEventListener(S,p),u[S]=void 0)}D.has($)&&D.delete($),D.size===0&&L.delete(T),L.size===0&&(window.removeEventListener(S,g,A==="capture"),h[A][S]=void 0)}return{on:C,off:B}}const{on:kt,off:et}=Y_(),Hi="@@mmoContext",U_={mounted(t,{value:e}){t[Hi]={handler:void 0},typeof e=="function"&&(t[Hi].handler=e,kt("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Hi];typeof e=="function"?n.handler?n.handler!==e&&(et("mousemoveoutside",t,n.handler),n.handler=e,kt("mousemoveoutside",t,e)):(t[Hi].handler=e,kt("mousemoveoutside",t,e)):n.handler&&(et("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Hi];e&&et("mousemoveoutside",t,e),t[Hi].handler=void 0}},Wi="@@coContext",us={mounted(t,{value:e,modifiers:n}){t[Wi]={handler:void 0},typeof e=="function"&&(t[Wi].handler=e,kt("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Wi];typeof e=="function"?r.handler?r.handler!==e&&(et("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,kt("clickoutside",t,e,{capture:n.capture})):(t[Wi].handler=e,kt("clickoutside",t,e,{capture:n.capture})):r.handler&&(et("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Wi];n&&et("clickoutside",t,n,{capture:e.capture}),t[Wi].handler=void 0}};function G_(t,e){console.error(`[vdirs/${t}]: ${e}`)}class K_{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&&G_("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 Do=new K_,ji="@@ziContext",Wd={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n;t[ji]={enabled:!!s,initialized:!1},s&&(Do.ensureZIndex(t,r),t[ji].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n,o=t[ji].enabled;s&&!o&&(Do.ensureZIndex(t,r),t[ji].initialized=!0),t[ji].enabled=!!s},unmounted(t,e){if(!t[ji].initialized)return;const{value:n={}}=e,{zIndex:r}=n;Do.unregister(t,r)}};function Z_(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 Wt(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 Q_=typeof window<"u";let qi,fr;(()=>{var t,e;qi=Q_?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,fr=!1,qi!==void 0?qi.then(()=>{fr=!0}):fr=!0})();function J_(t){if(fr)return;let e=!1;i.onMounted(()=>{fr||qi==null||qi.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Ho(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function fs(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function jd(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 e1=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function t1(){return e1}function Wo(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function jo(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)){jo(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&jo(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function qd(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const s=jo(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let Hn=null;function Xd(){if(Hn===null&&(Hn=document.getElementById("v-binder-view-measurer"),Hn===null)){Hn=document.createElement("div"),Hn.id="v-binder-view-measurer";const{style:t}=Hn;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(Hn)}return Hn.getBoundingClientRect()}function n1(t,e){const n=Xd();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=Xd();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 i1(t){return t.nodeType===9?null:t.parentNode}function Yd(t){if(t===null)return null;const e=i1(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 Yd(e)}const Ud=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=b=>{r.value=b,n&&t.syncTargetWithParent&&n.setTargetRef(b)};let o=[];const a=()=>{let b=r.value;for(;b=Yd(b),b!==null;)o.push(b);for(const _ of o)kt("scroll",_,u,!0)},l=()=>{for(const b of o)et("scroll",b,u,!0);o=[]},c=new Set,d=b=>{c.size===0&&a(),c.has(b)||c.add(b)},h=b=>{c.has(b)&&c.delete(b),c.size===0&&l()},u=()=>{Pd(m)},m=()=>{c.forEach(b=>b())},f=new Set,g=b=>{f.size===0&&kt("resize",window,y),f.has(b)||f.add(b)},p=b=>{f.has(b)&&f.delete(b),f.size===0&&et("resize",window,y)},y=()=>{f.forEach(b=>b())};return i.onBeforeUnmount(()=>{et("resize",window,y),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:g,removeResizeListener:p}},render(){return Wo("binder",this.$slots)}}),Gd=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(qd("follower",this.$slots),[[e]]):qd("follower",this.$slots)}}),r1="@css-render/vue3-ssr";function s1(t,e){return`<style cssr-id="${t}">
|
|
103
|
+
`}},Ur=Fi.Multiply,Mm=[1,0,0,0,1,0,0,0,1],zn=new nn(9),Am=ct.Utils,pc=new Q,fo=new nn([0,0,1,0,0,1,0,1,1,0,1,1]),be={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:He.document?He.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Fi,group:{removeChild:function(t,e){if(t.children)for(let n=0;n<t.children.length;n++)be.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;K.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 nn(9)),this._matrix.toTransformArray(!0,zn),Ur(zn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q),this._scale instanceof Q?(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=ct.Utils.getRendererType(this._mask._renderer.type);be[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++)be.group.removeChild(this.subtractions[o],t);for(o=0;o<this.children.length;o++){const a=this.children[o],l=ct.Utils.getRendererType(a._renderer.type);be[l].render.call(a,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let n,r,s,o,a,l,c,d,h,u,m,f,g,p;const y=e._renderer.vertices,b=this.canvas,_=this.ctx,v=t.renderer.ratio,k=pc.copy(e._renderer.scale).multiply(v),S=e._stroke,B=e._linewidth,C=e._fill,T=e._renderer.opacity||e._opacity,$=e._cap,E=e._join,I=e._miter,O=e._closed,V=e.dashes,L=y.length,D=L-1;b.width=Math.max(Math.ceil(e._renderer.rect.width*k.x),1),b.height=Math.max(Math.ceil(e._renderer.rect.height*k.y),1);const ee=e._renderer.rect.centroid,N=ee.x,P=ee.y;if(_.clearRect(0,0,b.width,b.height),C)if(typeof C=="string")_.fillStyle=C;else{const me=ct.Utils.getRendererType(C._renderer.type);be[me].render.call(C,_,e),_.fillStyle=C._renderer.effect}if(S){if(typeof S=="string")_.strokeStyle=S;else{const me=ct.Utils.getRendererType(S._renderer.type);be[me].render.call(S,_,e),_.strokeStyle=S._renderer.effect}B&&(_.lineWidth=rn(e)),I&&(_.miterLimit=I),E&&(_.lineJoin=E),!O&&$&&(_.lineCap=$)}typeof T=="number"&&(_.globalAlpha=T),V&&V.length>0&&(_.lineDashOffset=V.offset||0,_.setLineDash(V));let H,q,U,F,M,Z,fe,ie;_.save(),_.scale(k.x,k.y),_.translate(N,P),_.beginPath();for(let me=0;me<y.length;me++){const re=y[me];switch(f=re.x,g=re.y,re.command){case te.close:_.closePath();break;case te.arc:q=re.rx,U=re.ry,F=re.xAxisRotation,M=re.largeArcFlag,Z=re.sweepFlag,n=O?Pt(me-1,L):Math.max(me-1,0),r=y[n],fe=r.x,ie=r.y,Am.renderSvgArcCommand(_,fe,ie,q,U,M,Z,F,f,g);break;case te.curve:n=O?Pt(me-1,L):Math.max(me-1,0),r=y[n],d=r.controls&&r.controls.right||Q.zero,h=re.controls&&re.controls.left||Q.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),re._relative?(o=h.x+re.x,a=h.y+re.y):(o=h.x,a=h.y),_.bezierCurveTo(l,c,o,a,f,g),me>=D&&O&&(s=H,u=re.controls&&re.controls.right||Q.zero,m=s.controls&&s.controls.left||Q.zero,re._relative?(l=u.x+re.x,c=u.y+re.y):(l=u.x,c=u.y),s._relative?(o=m.x+s.x,a=m.y+s.y):(o=m.x,a=m.y),f=s.x,g=s.y,_.bezierCurveTo(l,c,o,a,f,g));break;case te.line:_.lineTo(f,g);break;case te.move:H=re,_.moveTo(f,g);break}}O&&_.closePath(),be.isHidden.test(C)||(p=C._renderer&&C._renderer.offset,p&&(_.save(),_.translate(-C._renderer.offset.x,-C._renderer.offset.y),_.scale(C._renderer.scale.x,C._renderer.scale.y)),_.fill(),p&&_.restore()),be.isHidden.test(S)||(p=S._renderer&&S._renderer.offset,p&&(_.save(),_.translate(-S._renderer.offset.x,-S._renderer.offset.y),_.scale(S._renderer.scale.x,S._renderer.scale.y),_.lineWidth=B/S._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 h=d.x,u=d.y,m=d.controls;let f,g,p,y,b,_;o=Math.min(u,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(u,a),d.controls&&(b=m.left,_=m.right,!(!b||!_)&&(f=d._relative?b.x+h:b.x,g=d._relative?b.y+u:b.y,p=d._relative?_.x+h:_.x,y=d._relative?_.y+u:_.y,!(!f||!g||!p||!y)&&(o=Math.min(g,y,o),r=Math.min(f,p,r),s=Math.max(f,p,s),a=Math.max(g,y,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;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=ct.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 We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof je&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Pe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof je&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Pe&&(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 nn(9)),this._matrix.toTransformArray(!0,zn),Ur(zn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let u,m;this._scale instanceof Q?(u=this._scale.x*r._renderer.scale.x,m=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,m=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,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 u=ct.Utils.getRendererType(this._mask._renderer.type);be[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(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,be.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),be.updateTexture.call(be,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,fo,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 h=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,h.left,h.top,h.right,h.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),K.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,h=e.dashes,u=e._size*o;let m=u;be.isHidden.test(a)||(m+=l),r.width=sl(m),r.height=r.width;const f=m/r.width,g=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 y=ct.Utils.getRendererType(c._renderer.type);be[y].render.call(c,s,e),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const y=ct.Utils.getRendererType(a._renderer.type);be[y].render.call(a,s,e),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=rn(e)/f)}typeof d=="number"&&(s.globalAlpha=d),h&&h.length>0&&(s.lineDashOffset=h.offset||0,s.setLineDash(h)),s.save(),s.translate(g,p),s.scale(be.precision,be.precision),s.beginPath(),s.arc(0,0,u/f*.5,0,at),s.restore(),closed&&s.closePath(),be.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()),be.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;K.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,h=this._matrix.manual||this._flagMatrix,u=this._renderer.parent!==s,m=this._renderer.vertices,f=this._renderer.collection.length,g=this._flagVertices,p=this._flagFill||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof je&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Pe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof je&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Pe&&(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||h||u){this._renderer.matrix||(this._renderer.matrix=new nn(9)),this._matrix.toTransformArray(!0,zn),Ur(zn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let y,b;this._scale instanceof Q?(y=this._scale.x*s._renderer.scale.x,b=this._scale.y*s._renderer.scale.y):(y=this._scale*s._renderer.scale.x,b=this._scale*s._renderer.scale.y),this._renderer.scale.x=y<0?-y:y,this._renderer.scale.y=b<0?-b:b,u&&(this._renderer.parent=s)}if(g){const y=this._renderer.positionBuffer;y&&t.deleteBuffer(y),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,be.updateTexture.call(be,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:(be.isHidden.test(l)||(r+=c),r/=be.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,f),K.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=pc.copy(e._renderer.scale).multiply(s),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,h=e.dashes,u=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 f=e._renderer.rect.centroid,g=f.x,p=f.y;let y,b,_,v,k,S,B,C,T,$,E;const I=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),I||(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 O=ct.Utils.getRendererType(c._renderer.type);be[O].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const O=ct.Utils.getRendererType(a._renderer.type);be[O].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=rn(e))}if(typeof d=="number"&&(r.globalAlpha=d),h&&h.length>0&&(r.lineDashOffset=h.offset||0,r.setLineDash(h)),r.save(),r.scale(o.x,o.y),r.translate(g,p),be.isHidden.test(c)||(c._renderer&&c._renderer.offset?(S=c._renderer.scale.x,B=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(S,B),y=e._size/c._renderer.scale.y,b=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,y+"px/",b+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,v=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,v),r.restore()):r.fillText(e.value,0,0)),be.isHidden.test(a)||(a._renderer&&a._renderer.offset?(S=a._renderer.scale.x,B=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(S,B),y=e._size/a._renderer.scale.y,b=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,y+"px/",b+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,v=a._renderer.offset.y/a._renderer.scale.y,k=l/a._renderer.scale.x,r.lineWidth=k,r.strokeText(e.value,_,v),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(u)){const O=r.measureText(e.value);switch(u){case"underline":T=O.actualBoundingBoxDescent,E=O.actualBoundingBoxDescent;break;case"strikethrough":T=0,E=0;break}C=-O.width/2,$=O.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(C,T),r.lineTo($,E),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const n=be.ctx;n.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),n.textAlign="center",n.textBaseline=ct.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&&!be.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(be.alignments[t._alignment]||t._alignment){case be.alignments.left:t.direction==="ltr"?(e.left=0,e.right=s):(e.left=-s,e.right=0);break;case be.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;K.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 We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof je&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Pe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof je&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Pe&&(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 nn(9)),this._matrix.toTransformArray(!0,zn),Ur(zn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let h,u;this._scale instanceof Q?(h=this._scale.x*r._renderer.scale.x,u=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,u=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=u<0?-u:u,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 h=ct.Utils.getRendererType(this._mask._renderer.type);be[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(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,be.text.getBoundingClientRect(this,this._renderer.rect),be.updateTexture.call(be,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,fo,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),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(K.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 K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(K.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 K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;K.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 Q||(this._renderer.offset=new Q),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 Q?(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 Q||(this._renderer.scale=new Q);let r,s;this._scale instanceof Q?(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 K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const n=ct.Utils.getRendererType(e._renderer.type);if(this[n].updateCanvas.call(be,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(),K.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 Rt("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]=be.extensions.get(t,s)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new Fr};be.ctx=be.canvas.getContext("2d");var yc=class extends X{constructor(t){super();let e,n,r,s;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(be.canvas=t.offscreenElement,be.ctx=be.canvas.getContext("2d")),this.scene=new nt,this.scene.parent=this,this._renderer={type:"renderer",matrix:new nn(Mm),scale:1,opacity:1},this._flagMatrix=!0,t=K.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 Rt("unable to create a webgl context. Try using another renderer.");r=Dt.create(e,Dt.path.vertex,Dt.types.vertex),s=Dt.create(e,Dt.path.fragment,Dt.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=be.program.create(e,[r,s]),this.programs.text=this.programs.path,e.extensions=be.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,fo,e.STATIC_DRAW),r=Dt.create(e,Dt.points.vertex,Dt.types.vertex),s=Dt.create(e,Dt.points.fragment,Dt.types.fragment),n=this.programs.points=be.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"?Hs(o):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,K.isObject(this.domElement.style)&&K.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(X.Types.resize,t,e,n)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),be.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};w(yc,"Utils",be);var Vm=K.extend({Error:Rt,getRatio:Hs,read:ze,xhr:dc},K,_t,tl,nl),we=class Rr{constructor(e){w(this,"_events",new X),w(this,"type",""),w(this,"renderer",null),w(this,"scene",null),w(this,"width",0),w(this,"height",0),w(this,"frameCount",0),w(this,"timeDelta",0),w(this,"playing",!1);const n=K.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Rr.Types.svg,autostart:!1});if(K.each(n,function(r,s){/fullscreen/i.test(s)||/autostart/i.test(s)||(this[s]=r)},this),K.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Rr.Types[r])}this.renderer=new Rr[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=Im.bind(this),this.fit.domElement=window,this.fit.attached=!0,K.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),K.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Ft.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=Om.bind(this),K.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(X.Types.resize,zm.bind(this)),this.scene=this.renderer.scene,Rr.Instances.push(this),n.autostart&&sr.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,sr.init(),this.trigger(X.Types.play)}pause(){return this.playing=!1,this.trigger(X.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=K.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Ft.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(X.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(X.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 Wr(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,te.move),new ve(r,s,void 0,void 0,void 0,void 0,te.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,te.line),new ve(r,s,void 0,void 0,void 0,void 0,te.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,te.line)],d=new Se(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 On(e,n,r,s);return this.scene.add(o),o}makeRoundedRectangle(e,n,r,s,o){const a=new Lr(e,n,r,s,o);return this.scene.add(a),a}makeCircle(e,n,r,s){const o=new Or(e,n,r,s);return this.scene.add(o),o}makeEllipse(e,n,r,s,o){const a=new zr(e,n,r,s,o);return this.scene.add(a),a}makeStar(e,n,r,s,o){const a=new io(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 Se(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 no(e,n,r,s);return this.scene.add(o),o}makeArcSegment(e,n,r,s,o,a,l){const c=new Ks(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 Q(a,l))}}const s=new to(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 Se(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 sn(e,n,r,s);return this.add(o),o}makeLinearGradient(e,n,r,s){const o=Array.prototype.slice.call(arguments,4),a=new We(e,n,r,s,o);return this.add(a),a}makeRadialGradient(e,n,r){const s=Array.prototype.slice.call(arguments,3),o=new je(e,n,r,s);return this.add(o),o}makeSprite(e,n,r,s,o,a,l){const c=new Ir(e,n,r,s,o,a);return l&&c.play(),this.add(c),c}makeImage(e,n,r,s,o,a){const l=new hc(e,n,r,s,o,a);return this.add(l),l}makeImageSequence(e,n,r,s,o){const a=new ao(e,n,r,s);return o&&a.play(),this.add(a),a}makeTexture(e,n){return new Pe(e,n)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const n=new nt;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 ze))return null;const o=ze[s].call(this,e);return r?this.add(n&&o instanceof nt?o.children:o):o.parent&&o.remove(),o}load(e,n){const r=new nt;let s,o,a;const l=(function(c){for(Ft.temp.innerHTML=c,o=0;o<Ft.temp.children.length;o++)s=Ft.temp.children[o],a=this.interpret(s,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Ft.temp.children.length<=1?Ft.temp.children[0]:Ft.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(dc(e,l),r):(l(e),r)}};w(we,"NextFrameId",wt.NextFrameId),w(we,"Types",wt.Types),w(we,"Version",wt.Version),w(we,"PublishDate",wt.PublishDate),w(we,"Identifier",wt.Identifier),w(we,"Resolution",wt.Resolution),w(we,"AutoCalculateImportedMatrices",wt.AutoCalculateImportedMatrices),w(we,"Instances",wt.Instances),w(we,"uniqueId",wt.uniqueId),w(we,"Anchor",ve),w(we,"Collection",An),w(we,"Events",X),w(we,"Group",nt),w(we,"Matrix",Fi),w(we,"Path",Se),w(we,"Registry",Fr),w(we,"Element",Pi),w(we,"Shape",In),w(we,"Text",sn),w(we,"Vector",Q),w(we,"Gradient",Qe),w(we,"Image",hc),w(we,"ImageSequence",ao),w(we,"LinearGradient",We),w(we,"RadialGradient",je),w(we,"Sprite",Ir),w(we,"Stop",Vn),w(we,"Texture",Pe),w(we,"ArcSegment",Ks),w(we,"Circle",Or),w(we,"Ellipse",zr),w(we,"Line",Wr),w(we,"Points",to),w(we,"Polygon",no),w(we,"Rectangle",On),w(we,"RoundedRectangle",Lr),w(we,"Star",io),w(we,"CanvasRenderer",ct),w(we,"SVGRenderer",mc),w(we,"WebGLRenderer",yc),w(we,"Commands",te),w(we,"Utils",Vm);var an=we;function Im(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function Om(){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 zm(t,e){this.width=t,this.height=e,this.trigger(X.Types.resize,t,e)}var sr=Ft.getRequestAnimationFrame();function bc(){for(let t=0;t<an.Instances.length;t++){const e=an.Instances[t];e.playing&&e.update()}an.NextFrameId=sr(bc)}sr.init=function(){bc(),sr.init=function(){}};let ln;typeof window<"u"?ln=window:typeof global<"u"?ln=global:typeof self<"u"&&(ln=self);let _c;const ei=Math.PI*2,it=Math.PI*.5;function Lm(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 Dm(t){_c=t}function Hm(t,e){e=e&&e.identity()||new _c;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 Ht(t,e,n){return n*(e-t)+t}function Vi(t,e){for(;t<0;)t+=e;return t%e}const wc=ln.Float32Array||Array,Wm=Math.floor;function cn(t){return Wm(t*1e6)/1e6}const he={move:"M",line:"L",curve:"C",close:"Z"};class G{constructor(){x(this,"_events",{});x(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 h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}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}}x(G,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),x(G,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const xc={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(G.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(G.Types.change))}}},st=class st extends G{constructor(n=0,r=0){super();x(this,"_x",0);x(this,"_y",0);for(let s in xc)Object.defineProperty(this,s,xc[s]);this.x=n,this.y=r}static add(n,r){return new st(n.x+r.x,n.y+r.y)}static sub(n,r){return new st(n.x-r.x,n.y-r.y)}static subtract(n,r){return st.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(st.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 st(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:cn(this.x),y:cn(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}};x(st,"zero",new st),x(st,"left",new st(-1,0)),x(st,"right",new st(1,0)),x(st,"up",new st(0,-1)),x(st,"down",new st(0,1));let ge=st;class Re extends ge{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=he.move){super(n,r);x(this,"controls",{left:new ge,right:new ge});x(this,"_command",he.move);x(this,"_relative",!0);x(this,"_rx",0);x(this,"_ry",0);x(this,"_xAxisRotation",0);x(this,"_largeArcFlag",0);x(this,"_sweepFlag",1);for(let h in vc)Object.defineProperty(this,h,vc[h]);this.command=c,this.relative=!0;const d=Re.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(G.Types.change,d),this.controls.right.set(a,l).addEventListener(G.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(G.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:cn(this.x),y:cn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:cn(this.rx),ry:cn(this.ry),xAxisRotation:cn(this.xAxisRotation),largeArcFlag:cn(this.largeArcFlag),sweepFlag:cn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const vc={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(G.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(G.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(G.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(G.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(G.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(G.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(G.Types.change))}}};let jm=0;const go={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return jm++}},Gr={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 Kr(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 kc(t,e,n,r,s,o,a,l,c){c=c||Gr.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Re(a,l)];const h=[];for(let u=0;u<d;u++){const m=u/d,f=Kr(m,t,n,s,a),g=Kr(m,e,r,o,l);h.push(new Re(f,g))}return h}function qm(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const y=a-t,b=l-e;return Math.sqrt(y*y+b*b)}const d=9*(n-s)+3*(a-t),h=6*(t+s)-12*n,u=3*(n-t),m=9*(r-o)+3*(l-e),f=6*(e+o)-12*r,g=3*(r-e);function p(y){const b=(d*y+h)*y+u,_=(m*y+f)*y+g;return Math.sqrt(b*b+_*_)}return Ym(p,0,1,c||Gr.RecursionLimit)}function Xm(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,m,f,g,p,y,b;for(let S=0;S<2;++S){if(S===0?(u=6*t-12*n+6*s,h=-3*t+9*n-9*s+3*a,m=3*n-3*t):(u=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(h)<.001){if(Math.abs(u)<.001)continue;f=-m/u,0<f&&f<1&&c.push(f);continue}y=u*u-4*m*h,b=Math.sqrt(y),!(y<0)&&(g=(-u+b)/(2*h),0<g&&g<1&&c.push(g),p=(-u-b)/(2*h),0<p&&p<1&&c.push(p))}let _=c.length,v=_,k;for(;_--;)f=c[_],k=1-f,d[0][_]=k*k*k*t+3*k*k*f*n+3*k*f*f*s+f*f*f*a,d[1][_]=k*k*k*e+3*k*k*f*r+3*k*f*f*o+f*f*f*l;return d[0][v]=t,d[1][v]=e,d[0][v+1]=a,d[1][v+1]=l,d[0].length=d[1].length=v+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 Ym(t,e,n,r){let s=Gr.abscissas[r-2],o=Gr.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,h=r&1?o[c++]*t(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(t(l+u)+t(l-u))}return a*h}function Um(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Vi(s-1,n):Math.max(s-1,0),l=e?Vi(s+1,n):Math.min(s+1,r),c=t[a],d=o,h=t[l];Gm(c,d,h),d.command=s===0?he.move:he.curve}}function Gm(t,e,n){const r=ge.angleBetween(t,e),s=ge.angleBetween(n,e);let o=ge.distanceBetween(t,e),a=ge.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+=it:l-=it,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 or=(yi=class extends G{constructor(){super();x(this,"_flagId",!1);x(this,"_flagClassName",!1);x(this,"_renderer",{});x(this,"_id",go.Identifier+go.uniqueId());x(this,"_className","");x(this,"classList",[]);for(let n in Cc)Object.defineProperty(this,n,Cc[n])}static fromObject(n){const r=new yi().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}},x(yi,"Properties",["renderer","id","className"]),yi);const Cc={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 Zr extends Error{constructor(n){super();x(this,"name","Two.js");x(this,"message");this.message=n}}class Km{constructor(){x(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 Qr;const Sc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};ln.document&&(Qr=document.createElement("a"));const Xe=class Xe extends or{constructor(n,r){super();x(this,"_flagSrc",!1);x(this,"_flagImage",!1);x(this,"_flagVideo",!1);x(this,"_flagLoaded",!1);x(this,"_flagRepeat",!1);x(this,"_flagOffset",!1);x(this,"_flagScale",!1);x(this,"_src","");x(this,"_image",null);x(this,"_loaded",!1);x(this,"_repeat","no-repeat");x(this,"_scale",1);x(this,"_offset",null);for(let s in Bc)Object.defineProperty(this,s,Bc[s]);if(this._renderer.type="texture",this._renderer.flagOffset=Zm.bind(this),this._renderer.flagScale=Qm.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new ge,typeof r=="function"){const s=(function(){this.unbind(G.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(G.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 Xe().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return Qr?(Qr.href=n,Qr.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=Xe.getAbsoluteURL(n);if(Xe.ImageRegistry.contains(r))return Xe.ImageRegistry.get(r);let s;return ln.document?Sc.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=Xe.getTag(s);n._flagImage&&(/canvas/i.test(o)?Xe.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,Xe.Register[o](n,r))),n._flagSrc&&(s||(s=Xe.getImage(n.src),n.image=s),o=Xe.getTag(s),Xe.Register[o](n,r))}clone(){const n=new Xe(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 ge?n.offset:new ge().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof ge?n.scale:new ge().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(G.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Xe.load(this,(function(){this.loaded=!0,this.trigger(G.Types.change).trigger(G.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}};x(Xe,"Properties",["src","loaded","repeat","scale","offset","image"]),x(Xe,"RegularExpressions",Sc),x(Xe,"ImageRegistry",new Km),x(Xe,"Register",{canvas:function(n,r){n._src="#"+n.id,Xe.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 Zr("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=Xe.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),Xe.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 Zr("unable to load "+n.src)};n._src=Xe.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),Xe.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 qe=Xe;const Bc={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=qe.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}qe.ImageRegistry.contains(n)?this._image=qe.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(G.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(G.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof ge&&this._scale.unbind(G.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof ge&&this._scale.bind(G.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Zm(){this._flagOffset=!0}function Qm(){this._flagScale=!0}class ti extends Array{constructor(){super();Aa(this,ot,new G);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 Bt(this,ot)}set _events(n){Fu(this,ot,n)}get _bound(){return Bt(this,ot)._bound}set _bound(n){Bt(this,ot)._bound=n}addEventListener(){return Bt(this,ot).addEventListener.apply(this,arguments)}on(){return Bt(this,ot).on.apply(this,arguments)}bind(){return Bt(this,ot).bind.apply(this,arguments)}removeEventListener(){return Bt(this,ot).removeEventListener.apply(this,arguments)}off(){return Bt(this,ot).off.apply(this,arguments)}unbind(){return Bt(this,ot).unbind.apply(this,arguments)}dispatchEvent(){return Bt(this,ot).dispatchEvent.apply(this,arguments)}trigger(){return Bt(this,ot).trigger.apply(this,arguments)}listen(){return Bt(this,ot).listen.apply(this,arguments)}ignore(){return Bt(this,ot).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(G.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(G.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(G.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(G.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(G.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(G.Types.insert,r),this.trigger(G.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(G.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(G.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}}ot=new WeakMap;const Tc=Array.prototype.slice;function Jm(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const $e={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=Tc.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=Tc.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=!Jm(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:ln.performance&&ln.performance.now?ln.performance:Date},Et=class Et extends or{constructor(n,r,s){super();x(this,"_flagOffset",!0);x(this,"_flagOpacity",!0);x(this,"_flagColor",!0);x(this,"_offset",0);x(this,"_opacity",1);x(this,"_color","#fff");for(let o in Rc)Object.defineProperty(this,o,Rc[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Et.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Et.Index<=0?"#fff":"#000",Et.Index=(Et.Index+1)%2}static fromObject(n){const r=new Et().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Et.Properties.length;r++){const s=Et.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Et;return $e.each(Et.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",$e.each(Et.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};x(Et,"Index",0),x(Et,"Properties",["offset","opacity","color"]);let ni=Et;const Rc={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)}}},fn=class fn extends or{constructor(n){super();x(this,"_flagStops",!1);x(this,"_flagSpread",!1);x(this,"_flagUnits",!1);x(this,"_spread","");x(this,"_units","");for(let r in $c)Object.defineProperty(this,r,$c[r]);this._renderer.type="gradient",this._renderer.flagStops=ep.bind(this),this._renderer.bindStops=tp.bind(this),this._renderer.unbindStops=np.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 ni?o:new ni().copy(o)));const s=new fn(r).copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new fn(r);return $e.each(fn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<fn.Properties.length;r++){const s=fn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return $e.each(fn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(G.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}};x(fn,"Stop",ni),x(fn,"Properties",["spread","stops","units"]);let Je=fn;const $c={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(G.Types.insert,e).unbind(G.Types.remove,n),this._stops=new ti((t||[]).slice(0)),this._stops.bind(G.Types.insert,e).bind(G.Types.remove,n),e(this._stops)}}};function ep(){this._flagStops=!0}function tp(t){let e=t.length;for(;e--;)t[e].bind(G.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function np(t){let e=t.length;for(;e--;)t[e].unbind(G.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const qn=class qn extends Je{constructor(n,r,s,o,a){super(a);x(this,"_flagEndPoints",!1);x(this,"_left",null);x(this,"_right",null);for(let l in Ec)Object.defineProperty(this,l,Ec[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=ip.bind(this),this.left=new ge,this.right=new ge,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 qn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<qn.Properties.length;r++){const s=qn.Properties[r];s in n&&(this[s]=n[s]instanceof ge?n[s]:new ge().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new qn(this.left._x,this.left._y,this.right._x,this.right._y,r);return $e.each(Je.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(G.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};x(qn,"Stop",ni),x(qn,"Properties",["left","right"]);let xt=qn;const Ec={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof ge&&this._left.unbind(G.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(G.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof ge&&this._right.unbind(G.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(G.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function ip(){this._flagEndPoints=!0}const gn=class gn extends Je{constructor(n,r,s,o,a,l){super(o);x(this,"_flagRadius",!1);x(this,"_flagCenter",!1);x(this,"_flagFocal",!1);x(this,"_radius",0);x(this,"_center",null);x(this,"_focal",null);for(let c in Nc)Object.defineProperty(this,c,Nc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=rp.bind(this),this._renderer.flagFocal=sp.bind(this),this.center=new ge,this.radius=typeof s=="number"?s:1,this.focal=new ge,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 gn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<gn.Properties.length;r++){const s=gn.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof ge?n[s]:new ge().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 gn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return $e.each(Je.Properties.concat(gn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return $e.each(gn.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(G.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};x(gn,"Stop",ni),x(gn,"Properties",["center","radius","focal"]);let vt=gn;const Nc={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(G.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(G.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(G.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(G.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function rp(){this._flagCenter=!0}function sp(){this._flagFocal=!0}function Pc(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 Jr(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 Fc(t,e,n){let r,s,o,a,l,c,d,h;const u=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(u||e).x,c=(u||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,u&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),qm(r,l,s,c,o,d,a,h,n)}function Mc(t,e,n){let r,s,o,a,l,c,d,h;const u=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(u||e).x,c=(u||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,u&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),kc(r,l,s,c,o,d,a,h,n)}function ii(t){switch(t.renderer.type){case"texture":return qe.fromObject(t);case"gradient":return Je.fromObject(t);case"linear-gradient":return xt.fromObject(t);case"radial-gradient":return vt.fromObject(t)}return t}const op=Math.cos,ap=Math.sin,Ac=Math.tan,mo=[],Ct=class Ct extends G{constructor(n,r,s,o,a,l){super();x(this,"elements",new wc(9));x(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 C=n;let T,$,E;const I=r[0]||0,O=r[1]||0,V=r[2]||0;return T=C[0]*I+C[1]*O+C[2]*V,$=C[3]*I+C[4]*O+C[5]*V,E=C[6]*I+C[7]*O+C[8]*V,[T,$,E]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],u=n[6],m=n[7],f=n[8],g=r[0],p=r[1],y=r[2],b=r[3],_=r[4],v=r[5],k=r[6],S=r[7],B=r[8];return s=s||new wc(9),s[0]=o*g+a*b+l*k,s[1]=o*p+a*_+l*S,s[2]=o*y+a*v+l*B,s[3]=c*g+d*b+h*k,s[4]=c*p+d*_+h*S,s[5]=c*y+d*v+h*B,s[6]=u*g+m*b+f*k,s[7]=u*p+m*_+f*S,s[8]=u*y+m*v+f*B,s}static fromObject(n){return new Ct().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const u=n;n=u[0],r=u[1],s=u[2],o=u[3],a=u[4],l=u[5],c=u[6],d=u[7],h=u[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]=h,this.trigger(G.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(G.Types.change)}identity(){return this.elements[0]=Ct.Identity[0],this.elements[1]=Ct.Identity[1],this.elements[2]=Ct.Identity[2],this.elements[3]=Ct.Identity[3],this.elements[4]=Ct.Identity[4],this.elements[5]=Ct.Identity[5],this.elements[6]=Ct.Identity[6],this.elements[7]=Ct.Identity[7],this.elements[8]=Ct.Identity[8],this.trigger(G.Types.change)}multiply(n,r,s,o,a,l,c,d,h){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(G.Types.change);if(typeof s>"u"&&(s=1),typeof o>"u"){n=n||0,r=r||0,s=s||0,a=this.elements;const D=a[0]*n+a[1]*r+a[2]*s,ee=a[3]*n+a[4]*r+a[5]*s,N=a[6]*n+a[7]*r+a[8]*s;return[D,ee,N]}const u=this.elements,m=[n,r,s,o,a,l,c,d,h],f=u[0],g=u[1],p=u[2],y=u[3],b=u[4],_=u[5],v=u[6],k=u[7],S=u[8],B=m[0],C=m[1],T=m[2],$=m[3],E=m[4],I=m[5],O=m[6],V=m[7],L=m[8];return this.elements[0]=f*B+g*$+p*O,this.elements[1]=f*C+g*E+p*V,this.elements[2]=f*T+g*I+p*L,this.elements[3]=y*B+b*$+_*O,this.elements[4]=y*C+b*E+_*V,this.elements[5]=y*T+b*I+_*L,this.elements[6]=v*B+k*$+S*O,this.elements[7]=v*C+k*E+S*V,this.elements[8]=v*T+k*I+S*L,this.trigger(G.Types.change)}inverse(n){const r=this.elements;n=n||new Ct;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],u=r[7],m=r[8],f=m*c-d*u,g=-m*l+d*h,p=u*l-c*h;let y=s*f+o*g+a*p;return y?(y=1/y,n.elements[0]=f*y,n.elements[1]=(-m*o+a*u)*y,n.elements[2]=(d*o-a*c)*y,n.elements[3]=g*y,n.elements[4]=(m*s-a*h)*y,n.elements[5]=(-d*s+a*l)*y,n.elements[6]=p*y,n.elements[7]=(-u*s+o*h)*y,n.elements[8]=(c*s-o*l)*y,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=op(n),s=ap(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=Ac(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=Ac(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return mo.length=0,this.toTransformArray(n,mo),mo.map(cn).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const m=s[6],f=s[7],g=s[8];if(o){r[0]=a,r[1]=d,r[2]=m,r[3]=l,r[4]=h,r[5]=f,r[6]=c,r[7]=u,r[8]=g;return}return[a,d,m,l,h,f,c,u,g]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=u;return}return[a,d,l,h,c,u]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const m=s[6],f=s[7],g=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u,r[6]=m,r[7]=f,r[8]=g;return}return[a,l,c,d,h,u,m,f,g]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u;return}return[a,l,c,d,h,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Ct().copy(this)}};x(Ct,"Identity",[1,0,0,0,1,0,0,0,1]);let ar=Ct;Dm(ar);const Cr=class Cr extends or{constructor(){super();x(this,"_flagMatrix",!0);x(this,"_flagScale",!1);x(this,"_matrix",null);x(this,"_worldMatrix",null);x(this,"_position",null);x(this,"_rotation",0);x(this,"_scale",1);x(this,"_skewX",0);x(this,"_skewY",0);for(let n in es)Object.defineProperty(this,n,es[n]);this._renderer.flagMatrix=Vc.bind(this),this.isShape=!0,this.matrix=new ar,this.worldMatrix=new ar,this.position=new ge,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new Cr().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 es.position.get.apply(this,arguments)}set translation(n){es.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 ge?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 ge?n.scale:new ge(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 Cr;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 ge?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 ge?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}};x(Cr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let wn=Cr;const es={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(G.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(G.Types.change,this._renderer.flagMatrix),Vc.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 ge&&this._scale.unbind(G.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof ge&&this._scale.bind(G.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 Hm(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Vc(){this._flagMatrix=!0}const Ii=Math.min,Oi=Math.max,lp=Math.ceil,cp=Math.floor,dp=new ge,Gt=class Gt extends wn{constructor(n,r,s,o){super();x(this,"_flagVertices",!0);x(this,"_flagLength",!0);x(this,"_flagFill",!0);x(this,"_flagStroke",!0);x(this,"_flagLinewidth",!0);x(this,"_flagOpacity",!0);x(this,"_flagVisible",!0);x(this,"_flagCap",!0);x(this,"_flagJoin",!0);x(this,"_flagMiter",!0);x(this,"_flagStrokeAttenuation",!0);x(this,"_flagMask",!1);x(this,"_flagClip",!1);x(this,"_length",0);x(this,"_fill","#fff");x(this,"_stroke","#000");x(this,"_linewidth",1);x(this,"_opacity",1);x(this,"_visible",!0);x(this,"_cap","round");x(this,"_join","round");x(this,"_miter",4);x(this,"_closed",!0);x(this,"_curved",!1);x(this,"_automatic",!0);x(this,"_beginning",0);x(this,"_ending",1);x(this,"_mask",null);x(this,"_clip",!1);x(this,"_dashes",null);x(this,"_strokeAttenuation",!0);for(let a in Ic)Object.defineProperty(this,a,Ic[a]);this._renderer.type="path",this._renderer.flagVertices=Oc.bind(this),this._renderer.bindVertices=zc.bind(this),this._renderer.unbindVertices=Lc.bind(this),this._renderer.flagFill=Dc.bind(this),this._renderer.flagStroke=Hc.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:ii(n.fill),s=typeof n.stroke=="string"?n.stroke:ii(n.stroke),o=new Gt().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<Gt.Properties.length;r++){const s=Gt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Gt;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<Gt.Properties.length;s++){const o=Gt.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()),$e.each(Gt.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,h=-1/0,u=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:f,scaleY:g}=Lm(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof f=="number"&&typeof g=="number"&&(s=Math.max(f,g)*(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[f,g]=r.multiply(l.x,l.y),[p,y]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let b=l.controls.right.x,_=l.controls.right.y;l.relative&&(b+=l.x,_+=l.y);let[v,k]=r.multiply(b,_),S=c.controls.left.x,B=c.controls.left.y;c.relative&&(S+=c.x,B+=c.y);let[C,T]=r.multiply(S,B);const $=Xm(f,g,v,k,C,T,p,y);u=Ii($.min.y-s,u),d=Ii($.min.x-s,d),h=Oi($.max.x+s,h),m=Oi($.max.y+s,m)}else a<=1&&(u=Ii(g-s,u),d=Ii(f-s,d),h=Oi(f+s,h),m=Oi(g+s,m)),u=Ii(y-s,u),d=Ii(p-s,d),h=Oi(p+s,h),m=Oi(y+s,m)}return{top:u,left:d,right:h,bottom:m,width:h-d,height:m-u}}getPointAt(n,r){let s,o,a,l,c,d,h,u,m,f,g,p,y,b,_,v=this.length*Math.min(Math.max(n,0),1);const k=this.vertices.length,S=k-1;let B=null,C=null;for(let P=0,H=this._lengths.length,q=0;P<H;P++){if(q+this._lengths[P]>=v){this._closed?(s=Vi(P,k),o=Vi(P-1,k),P===0&&(s=o,o=P)):(s=P,o=Math.min(Math.max(P-1,0),S)),B=this.vertices[s],C=this.vertices[o],v-=q,this._lengths[P]!==0?n=v/this._lengths[P]:n=0;break}q+=this._lengths[P]}if(B===null||C===null)return null;if(B){if(!C)return B}else return C;_=C.controls&&C.controls.right,b=B.controls&&B.controls.left,c=C.x,f=C.y,d=(_||C).x,g=(_||C).y,h=(b||B).x,p=(b||B).y,u=B.x,y=B.y,_&&C.relative&&(d+=C.x,g+=C.y),b&&B.relative&&(h+=B.x,p+=B.y),l=Kr(n,c,d,h,u),m=Kr(n,f,g,p,y);const T=Ht(c,d,n),$=Ht(f,g,n),E=Ht(d,h,n),I=Ht(g,p,n),O=Ht(h,u,n),V=Ht(p,y,n),L=Ht(T,E,n),D=Ht($,I,n),ee=Ht(E,O,n),N=Ht(I,V,n);return $e.isObject(r)?(r.x=l,r.y=m,r instanceof Re&&(r.controls.left.x=L,r.controls.left.y=D,r.controls.right.x=ee,r.controls.right.y=N,(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,L-l,D-m,ee-l,N-m,this._curved?he.curve:he.line),a.t=n,a)}plot(){if(this.curved)return Um(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?he.move:he.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===he.close;let o=this.vertices[r],a=[],l;return $e.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===he.move){a.push(new Re(o.x,o.y)),d>0&&(a[a.length-1].command=he.line),o=c;return}l=Mc(c,o,n),a=a.concat(l),$e.each(l,function(h,u){u<=0&&o.command===he.move?h.command=he.move:h.command=he.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=Mc(c,o,n),a=a.concat(l),$e.each(l,function(h,u){u<=0&&o.command===he.move?h.command=he.move:h.command=he.line})),a.push(new Re(c.x,c.y)),a[a.length-1].command=s?he.close:he.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=[]),$e.each(this.vertices,function(c,d){if(d<=0||c.command===he.move){a=c,this._lengths[d]=0;return}this._lengths[d]=Fc(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=Jr(this,s*this._length),l=Jr(this,o*this._length),c=lp(a),d=cp(l);let h,u,m,f,g,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&&!u?(g=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,g),g.command=this._renderer.collection[p].command,this._renderer.vertices.push(g),u=g,m=this._collection[p-1],m&&m.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),m.relative?this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(ge.zero,1-g.t):this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(m,1-g.t))):p>=c&&p<=d&&(g=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(g),p===d&&Pc(this,o)?(u=g,!r&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):p===c&&Pc(this,s)&&(h=g,h.command=he.move,!r&&h.controls&&(h.relative?h.controls.left.clear():h.controls.left.copy(h))));c>0&&!h&&(p=c-1,g=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(s,g),g.command=he.move,this._renderer.vertices.unshift(g),f=this._collection[p+1],f&&f.controls&&(g.controls.left.clear(),f.relative?this._renderer.collection[p+1].controls.left.copy(f.controls.left).lerp(ge.zero,g.t):(dp.copy(f),this._renderer.collection[p+1].controls.left.copy(f.controls.left).lerp(f,g.t))))}return wn.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,wn.prototype.flagReset.call(this),this}};x(Gt,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),x(Gt,"Utils",{getCurveLength:Fc});let Ee=Gt;const Ic={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 Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.bind(G.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";$e.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(G.Types.insert,e).unbind(G.Types.remove,n),t instanceof ti?this._collection=t:this._collection=new ti(t||[]),this._collection.bind(G.Types.insert,e).bind(G.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,$e.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 Oc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function zc(t){let e=t.length;for(;e--;)t[e].bind(G.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Lc(t){let e=t.length;for(;e--;)t[e].unbind(G.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Dc(){this._flagFill=!0}function Hc(){this._flagStroke=!0}const hp=Math.ceil,up=Math.floor,mn=class mn extends wn{constructor(n){super();x(this,"_flagVertices",!0);x(this,"_flagLength",!0);x(this,"_flagFill",!0);x(this,"_flagStroke",!0);x(this,"_flagLinewidth",!0);x(this,"_flagOpacity",!0);x(this,"_flagVisible",!0);x(this,"_flagSize",!0);x(this,"_flagSizeAttenuation",!0);x(this,"_flagStrokeAttenuation",!0);x(this,"_length",0);x(this,"_fill","#fff");x(this,"_stroke","#000");x(this,"_linewidth",1);x(this,"_opacity",1);x(this,"_visible",!0);x(this,"_size",1);x(this,"_sizeAttenuation",!1);x(this,"_beginning",0);x(this,"_ending",1);x(this,"_dashes",null);x(this,"_strokeAttenuation",!0);x(this,"noFill",Ee.prototype.noFill);x(this,"noStroke",Ee.prototype.noStroke);x(this,"corner",Ee.prototype.corner);x(this,"center",Ee.prototype.center);x(this,"getBoundingClientRect",Ee.prototype.getBoundingClientRect);x(this,"_updateLength",Ee.prototype._updateLength);for(let r in Wc)Object.defineProperty(this,r,Wc[r]);this._renderer.type="points",this._renderer.flagVertices=Oc.bind(this),this._renderer.bindVertices=zc.bind(this),this._renderer.unbindVertices=Lc.bind(this),this._renderer.flagFill=Dc.bind(this),this._renderer.flagStroke=Hc.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:ii(n.fill),s=typeof n.stroke=="string"?n.stroke:ii(n.stroke),o=new mn().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<mn.Properties.length;r++){const s=mn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new mn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<mn.Properties.length;s++){const o=mn.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()),$e.each(mn.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,h=a.y,u=kc(l,c,l,c,d,h,d,h,n);r=r.concat(u)}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=Jr(this,n*this._length),o=Jr(this,r*this._length),a=hp(s),l=up(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let h=0;h<this._collection.length;h++)h>=a&&h<=l&&(d=this._collection[h],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}};x(mn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let ts=mn;const Wc={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 Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.bind(G.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(G.Types.insert,e).unbind(G.Types.remove,n),t instanceof ti?this._collection=t:this._collection=new ti(t||[]),this._collection.bind(G.Types.insert,e).bind(G.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 ti{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);Aa(this,Rs,{});this.attach(n),this.on(G.Types.insert,this.attach),this.on(G.Types.remove,this.detach)}get ids(){return Bt(this,Rs)}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}}Rs=new WeakMap;const Sn=class Sn extends Ee{constructor(n,r,s,o,a,l,c){const d=c||go.Resolution*3,h=[];for(let u=0;u<d;u++)h.push(new Re);super(h,!0,!1,!0);x(this,"_flagStartAngle",!1);x(this,"_flagEndAngle",!1);x(this,"_flagInnerRadius",!1);x(this,"_flagOuterRadius",!1);x(this,"_startAngle",0);x(this,"_endAngle",ei);x(this,"_innerRadius",0);x(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let u in qc)Object.defineProperty(this,u,qc[u]);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 Sn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Sn.Properties.length;r++){const s=Sn.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=Vi(n,ei)===Vi(r,ei),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,u=0,m,f,g,p,y,b,_,v,k;for(a?d--:l||(d-=2),m=0,f=d-1;m<d;m++){switch(g=m/f,p=c[u],y=g*(r-n)+n,b=(r-n)/d,_=o*Math.cos(y),v=o*Math.sin(y),m){case 0:h=he.move;break;default:h=he.curve}p.command=h,p.x=_,p.y=v,p.controls.left.clear(),p.controls.right.clear(),p.command===he.curve&&(k=o*b/Math.PI,p.controls.left.x=k*Math.cos(y-it),p.controls.left.y=k*Math.sin(y-it),p.controls.right.x=k*Math.cos(y+it),p.controls.right.y=k*Math.sin(y+it),m===1&&p.controls.left.multiplyScalar(2),m===f&&p.controls.right.multiplyScalar(2)),u++}if(l){for(a?(c[u].command=he.close,u++):(d--,f=d-1),m=0;m<d;m++)g=m/f,p=c[u],y=(1-g)*(r-n)+n,b=(r-n)/d,_=s*Math.cos(y),v=s*Math.sin(y),h=he.curve,m<=0&&(h=a?he.move:he.line),p.command=h,p.x=_,p.y=v,p.controls.left.clear(),p.controls.right.clear(),p.command===he.curve&&(k=s*b/Math.PI,p.controls.left.x=k*Math.cos(y+it),p.controls.left.y=k*Math.sin(y+it),p.controls.right.x=k*Math.cos(y-it),p.controls.right.y=k*Math.sin(y-it),m===1&&p.controls.left.multiplyScalar(2),m===f&&p.controls.right.multiplyScalar(2)),u++;c[u].copy(c[0]),c[u].command=he.line}else a||(c[u].command=he.line,c[u].x=0,c[u].y=0,u++,c[u].copy(c[0]),c[u].command=he.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 Sn(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<Ee.Properties.length;d++){const h=Ee.Properties[d];c[h]=this[h]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<Sn.Properties.length;r++){const s=Sn.Properties[r];n[s]=this[s]}return n}};x(Sn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let po=Sn;const qc={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}}},yo=Math.cos,bo=Math.sin,Bn=class Bn extends Ee{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);x(this,"_flagRadius",!1);x(this,"_radius",0);this._renderer.type="circle";for(let c in Xc)Object.defineProperty(this,c,Xc[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 Bn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Bn.Properties.length;r++){const s=Bn.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*ei,d=s*yo(c),h=s*bo(c),u=o*yo(c-it),m=o*bo(c-it),f=o*yo(c+it),g=o*bo(c+it),p=this.vertices[a];p.command=a===0?he.move:he.curve,p.set(d,h),p.controls.left.set(u,m),p.controls.right.set(f,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new Bn(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<Ee.Properties.length;s++){const o=Ee.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<Bn.Properties.length;r++){const s=Bn.Properties[r];n[s]=this[s]}return n}};x(Bn,"Properties",["radius"]);let _o=Bn;const Xc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},wo=Math.cos,xo=Math.sin,Tn=class Tn extends Ee{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);x(this,"_flagWidth",!1);x(this,"_flagHeight",!1);x(this,"_width",0);x(this,"_height",0);this._renderer.type="ellipse";for(let d in Yc)Object.defineProperty(this,d,Yc[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 Tn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Tn.Properties.length;r++){const s=Tn.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*ei,d=s*wo(c),h=o*xo(c),u=s*r*wo(c-it),m=o*r*xo(c-it),f=s*r*wo(c+it),g=o*r*xo(c+it),p=this.vertices[a];p.command=a===0?he.move:he.curve,p.set(d,h),p.controls.left.set(u,m),p.controls.right.set(f,g)}}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 Tn(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<Ee.Properties.length;l++){const c=Ee.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<Tn.Properties.length;r++){const s=Tn.Properties[r];n[s]=this[s]}return n}};x(Tn,"Properties",["width","height"]);let vo=Tn;const Yc={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,gp=Math.sin,Rn=class Rn extends Ee{constructor(n,r,s,o){o=Math.max(o||0,3);super();x(this,"_flagWidth",!1);x(this,"_flagHeight",!1);x(this,"_flagSides",!1);x(this,"_radius",0);x(this,"_width",0);x(this,"_height",0);x(this,"_sides",0);this._renderer.type="polygon";for(let a in Uc)Object.defineProperty(this,a,Uc[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 Rn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Rn.Properties.length;r++){const s=Rn.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=ei*a+Math.PI/2,c=this._width*fp(l)/2,d=this._height*gp(l)/2;o>=s?this.vertices.push(new Re(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?he.move:he.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 Rn(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<Ee.Properties.length;s++){const o=Ee.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<Rn.Properties.length;r++){const s=Rn.Properties[r];n[s]=this[s]}return n}};x(Rn,"Properties",["width","height","sides"]);let ko=Rn;const Uc={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}}},bi=class bi extends Ee{constructor(n,r,s,o){const a=[new Re,new Re,new Re,new Re];super(a,!0,!1,!0);x(this,"_flagWidth",!1);x(this,"_flagHeight",!1);x(this,"_width",0);x(this,"_height",0);x(this,"_origin",null);this._renderer.type="rectangle";for(let l in Gc)Object.defineProperty(this,l,Gc[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new ge,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new bi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<bi.Properties.length;r++){const s=bi.Properties[r];s in n&&(typeof n[s]=="number"?this[s]=n[s]:this[s]instanceof ge&&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=he.move,this.vertices[1].set(n,-r).sub(this._origin).command=he.line,this.vertices[2].set(n,r).sub(this._origin).command=he.line,this.vertices[3].set(-n,r).sub(this._origin).command=he.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=he.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new bi(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<Ee.Properties.length;s++){const o=Ee.Properties[s];r[o]instanceof ge?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}};x(bi,"Properties",["width","height","origin"]);let lr=bi;const Gc={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(G.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(G.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},$n=class $n extends Ee{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?he.move:he.curve));super(l);x(this,"_flagWidth",!1);x(this,"_flagHeight",!1);x(this,"_flagRadius",!1);x(this,"_width",0);x(this,"_height",0);x(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in Kc)Object.defineProperty(this,c,Kc[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 ge)&&(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 $n().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<$n.Properties.length;r++){const s=$n.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof ge?o:new ge().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 ge?(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 $n(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<Ee.Properties.length;l++){const c=Ee.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<$n.Properties.length;r++){const s=$n.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};x($n,"Properties",["width","height","radius"]);let Co=$n;const Kc={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 ge&&this._radius.unbind(G.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof ge&&this._radius.bind(G.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function mp(){this._flagRadius=!0}const pp=Math.cos,yp=Math.sin,En=class En extends Ee{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();x(this,"_flagInnerRadius",!1);x(this,"_flagOuterRadius",!1);x(this,"_flagSides",!1);x(this,"_innerRadius",0);x(this,"_outerRadius",0);x(this,"_sides",0);this._renderer.type="star";for(let l in Zc)Object.defineProperty(this,l,Zc[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 En().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<En.Properties.length;r++){const s=En.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=ei*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*pp(l),h=c*yp(l);o>=s?this.vertices.push(new Re(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?he.move:he.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 En(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<Ee.Properties.length;l++){const c=Ee.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<En.Properties.length;r++){const s=En.Properties[r];n[s]=this[s]}return n}};x(En,"Properties",["innerRadius","outerRadius","sides"]);let So=En;const Zc={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 Bo;const Qc=Math.min,Jc=Math.max;ln.document&&(Bo=document.createElement("canvas"));const gt=class gt extends wn{constructor(n,r,s,o){super();x(this,"_flagValue",!0);x(this,"_flagFamily",!0);x(this,"_flagSize",!0);x(this,"_flagLeading",!0);x(this,"_flagAlignment",!0);x(this,"_flagBaseline",!0);x(this,"_flagStyle",!0);x(this,"_flagWeight",!0);x(this,"_flagDecoration",!0);x(this,"_flagFill",!0);x(this,"_flagStroke",!0);x(this,"_flagLinewidth",!0);x(this,"_flagOpacity",!0);x(this,"_flagVisible",!0);x(this,"_flagMask",!1);x(this,"_flagClip",!1);x(this,"_flagDirection",!0);x(this,"_flagStrokeAttenuation",!0);x(this,"_value","");x(this,"_family","sans-serif");x(this,"_size",13);x(this,"_leading",17);x(this,"_alignment","center");x(this,"_baseline","middle");x(this,"_style","normal");x(this,"_weight",500);x(this,"_decoration","none");x(this,"_direction","ltr");x(this,"_fill","#000");x(this,"_stroke","none");x(this,"_linewidth",1);x(this,"_opacity",1);x(this,"_visible",!0);x(this,"_mask",null);x(this,"_clip",!1);x(this,"_dashes",null);x(this,"_strokeAttenuation",!0);for(let a in ed)Object.defineProperty(this,a,ed[a]);if(this._renderer.type="text",this._renderer.flagFill=bp.bind(this),this._renderer.flagStroke=_p.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,!$e.isObject(o))return this;for(let a=0;a<gt.Properties.length;a++){const l=gt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(Bo){const r=Bo.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*gt.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:ii(n.fill),s=typeof n.stroke=="string"?n.stroke:ii(n.stroke),o=new gt().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<gt.Properties.length;r++){const s=gt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new gt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<gt.Properties.length;s++){const o=gt.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<gt.Properties.length;r++){const s=gt.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}=gt.Measure(this),h=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-h,o=c+h;break;case"right":s=-(c+h),o=h;break;default:s=-(c/2+h),o=c/2+h}switch(this.baseline){case"middle":a=-(d/2+h),l=d/2+h;break;default:a=-(d+h),l=h}const[u,m]=r.multiply(s,a),[f,g]=r.multiply(s,l),[p,y]=r.multiply(o,a),[b,_]=r.multiply(o,l);return a=Qc(m,g,y,_),s=Qc(u,f,p,b),o=Jc(u,f,p,b),l=Jc(m,g,y,_),{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}};x(gt,"Ratio",.6),x(gt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let zi=gt;const ed={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 Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.bind(G.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,$e.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 bp(){this._flagFill=!0}function _p(){this._flagStroke=!0}const Nn=class Nn extends lr{constructor(n,r,s,o){super(r,s,0,0);x(this,"_flagTextures",!1);x(this,"_flagFrameRate",!1);x(this,"_flagIndex",!1);x(this,"_amount",1);x(this,"_duration",0);x(this,"_index",0);x(this,"_startTime",0);x(this,"_playing",!1);x(this,"_firstFrame",0);x(this,"_lastFrame",0);x(this,"_loop",!0);x(this,"_textures",null);x(this,"_frameRate",0);x(this,"_origin",null);this._renderer.type="image-sequence";for(let a in td)Object.defineProperty(this,a,td[a]);this._renderer.flagTextures=wp.bind(this),this._renderer.bindTextures=xp.bind(this),this._renderer.unbindTextures=vp.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(nd.bind(this)):typeof n=="string"&&(this.textures=[nd(n)]),this.origin=new ge,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=Nn.DefaultFrameRate,this.index=0}static fromObject(n){const r=new Nn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Nn.Properties.length;r++){const s=Nn.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=$e.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 Nn(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,h;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,$e.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=$e.performance.now()-this._startTime,h=this._lastFrame+1,l=1e3*(h-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),d=Ht(this._firstFrame,h,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 qe))&&(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}};x(Nn,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),x(Nn,"DefaultFrameRate",30);let To=Nn;const td={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(G.Types.insert,e).unbind(G.Types.remove,n),this._textures=new ti((t||[]).slice(0)),this._textures.bind(G.Types.insert,e).bind(G.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 wp(){this._flagTextures=!0}function xp(t){let e=t.length;for(;e--;)t[e].bind(G.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function vp(t){let e=t.length;for(;e--;)t[e].unbind(G.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function nd(t){if(t instanceof qe)return t;if(typeof t=="string")return new qe(t)}const _i=class _i extends lr{constructor(n,r,s,o,a,l){super(r,s,0,0);x(this,"_flagTexture",!1);x(this,"_flagColumns",!1);x(this,"_flagRows",!1);x(this,"_flagFrameRate",!1);x(this,"_flagIndex",!1);x(this,"_amount",1);x(this,"_duration",0);x(this,"_startTime",0);x(this,"_playing",!1);x(this,"_firstFrame",0);x(this,"_lastFrame",0);x(this,"_loop",!0);x(this,"_texture",null);x(this,"_columns",1);x(this,"_rows",1);x(this,"_frameRate",0);x(this,"_index",0);x(this,"_origin",null);this._renderer.type="sprite";for(let c in id)Object.defineProperty(this,c,id[c]);this.noStroke(),this.noFill(),n instanceof qe?this.texture=n:typeof n=="string"&&(this.texture=new qe(n)),this.origin=new ge,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 _i().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<_i.Properties.length;r++){const s=_i.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=$e.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 _i(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,h,u,m,f;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)){u=n.image.width,m=n.image.height,o=u/r,a=m/s,c=this._amount,this.width!==o&&(this.width=o),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&($e.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=$e.performance.now()-this._startTime,f=this._lastFrame+1,d=1e3*(f-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),h=Ht(this._firstFrame,f,l/d),h=Math.floor(h),h!==this._index&&(this._index=h,h>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const g=this._index%r,p=Math.floor(this._index/r),y=-o*g+(u-o)/2,b=-a*p+(m-a)/2;y!==n.offset.x&&(n.offset.x=y),b!==n.offset.y&&(n.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}};x(_i,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let Ro=_i;const id={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}}},ns=Math.min,is=Math.max,Kt=class Kt extends wn{constructor(n){super();x(this,"_flagAdditions",!1);x(this,"_flagSubtractions",!1);x(this,"_flagOrder",!1);x(this,"_flagOpacity",!0);x(this,"_flagBeginning",!1);x(this,"_flagEnding",!1);x(this,"_flagLength",!1);x(this,"_flagMask",!1);x(this,"_fill","#fff");x(this,"_stroke","#000");x(this,"_linewidth",1);x(this,"_opacity",1);x(this,"_visible",!0);x(this,"_cap","round");x(this,"_join","round");x(this,"_miter",4);x(this,"_closed",!0);x(this,"_curved",!1);x(this,"_automatic",!0);x(this,"_beginning",0);x(this,"_ending",1);x(this,"_length",0);x(this,"_mask",null);x(this,"_strokeAttenuation",!0);for(let r in rd)Object.defineProperty(this,r,rd[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++)sd.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)sd.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new Kt;for(let o=0;o<Kt.Properties.length;o++){const a=Kt.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:ii(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 po.fromObject(o);case"circle":return _o.fromObject(o);case"element":return or.fromObject(o);case"ellipse":return vo.fromObject(o);case"group":return Kt.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return To.fromObject(o);case"path":return Ee.fromObject(o);case"points":return ts.fromObject(o);case"polygon":return ko.fromObject(o);case"rectangle":return lr.fromObject(o);case"rounded-rectangle":return Co.fromObject(o);case"shape":return wn.fromObject(o);case"sprite":return Ro.fromObject(o);case"star":return So.fromObject(o);case"text":return zi.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<Kt.Properties.length;r++){const s=Kt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Kt,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,$e.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,h=-1/0,u=1/0,m=-1/0;const f=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const p=this.children[g];if(!(!p.visible||f.test(p._renderer.type))&&(r=p.getBoundingClientRect(n),o=typeof r.top!="number"||$e.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||$e.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||$e.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||$e.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[y,b]=s.multiply(r.left,r.top),[_,v]=s.multiply(r.right,r.top),[k,S]=s.multiply(r.left,r.bottom),[B,C]=s.multiply(r.right,r.bottom);u=ns(b,v,S,C,u),d=ns(y,_,k,B,d),h=is(y,_,k,B,h),m=is(b,v,S,C,m)}else u=ns(r.top,u),d=ns(r.left,d),h=is(r.right,h),m=is(r.bottom,m)}return{top:u,left:d,right:h,bottom:m,width:h-d,height:m-u}}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,h=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):h<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):h>c&&h<c+r?(s.beginning=0,s.ending=(h-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}};x(Kt,"Children",jc),x(Kt,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let xn=Kt;const rd={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=xn.InsertChildren.bind(this),n=xn.RemoveChildren.bind(this),r=xn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new jc(t),this._children.bind(G.Types.insert,e),this._children.bind(G.Types.remove,n),this._children.bind(G.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,$e.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 sd(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 rs extends Ee{constructor(e,n,r,s){const o=[new Re(e,n),new Re(r,s)];super(o);for(let a in od)Object.defineProperty(this,a,od[a]);this.vertices[0].command=he.move,this.vertices[1].command=he.line,this.automatic=!1}}x(rs,"Properties",["left","right"]);const od={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if($e.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=he.move;else{const e=new Zr("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($e.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=he.line;else{const e=new Zr("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class $o{constructor(e=0,n=0){this.x=e,this.y=n}}class ri{constructor(e=10,n=0,r="A"){x(this,"start",new $o);x(this,"end",new $o);this.width=e,this.angle=n,this.label=r}}const Ve={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"}},kp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Cp(t,e){return i.openBlock(),i.createElementBlock("svg",kp,[...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 ss=i.markRaw({name:"ion-close",render:Cp}),Sp={class:"mr-3 flex flex-col gap-2"},Bp=["onClick"],Tp={class:"h-full p-2"},Rp={},$p=i.defineComponent({...Rp,__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.useTemplateRef("drawing-template-containers"),s=e;return i.onMounted(()=>{var o;(o=n.settings.allTemplates)==null||o.forEach((a,l)=>{var d;const c=(d=r.value)==null?void 0:d.at(l);c&&s("init-draw-template",c,a)})}),i.watch(()=>n.settings.allTemplates,(o,a)=>{i.nextTick(()=>{o.forEach((l,c)=>{var d;if(!a.includes(l)){const h=(d=r.value)==null?void 0:d.at(c);h&&s("init-draw-template",h,l)}})})},{deep:!0}),(o,a)=>{const l=ss;return i.openBlock(),i.createBlock(i.unref(z.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",Sp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.settings.allTemplates,(c,d)=>(i.openBlock(),i.createElementBlock("div",{key:d,class:"group relative"},[i.createVNode(i.unref(z.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":d===t.selectTemplateIndex}]),onClick:h=>s("template:select",d)},[i.createElementVNode("div",Tp,[i.createElementVNode("div",{ref_for:!0,ref:"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Bp)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.label),1)]),_:2},1024),c.isCustom&&!c.isNewRec()?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,size:"tiny",quaternary:"",circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:h=>s("remove-custom-template",d)},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),ad=Zn($p,[["__scopeId","data-v-cf2c29de"]]),Ep={class:"flex gap-3"},Np={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},Pp={ref:"drawing-container",class:"size-full"},Fp={},ld=i.defineComponent({...Fp,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,h=i.computed(()=>n.value.configuratorParams.linesAngles.map((N,P)=>new ri(n.value.configuratorParams.linesWidths[P],N,`A-${P+1}`))),u=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),m=i.computed(()=>{var N,P;return n.value.configuratorParams.startTailType&&((N=n.settings.startTailConfigs)!=null&&N[n.value.configuratorParams.startTailType])?(P=n.settings.startTailConfigs)==null?void 0:P[n.value.configuratorParams.startTailType].points:[]}),f=i.computed(()=>{var N,P;return n.value.configuratorParams.endTailType&&((N=n.settings.endTailConfigs)!=null&&N[n.value.configuratorParams.endTailType])?(P=n.settings.endTailConfigs)==null?void 0:P[n.value.configuratorParams.endTailType].points:[]}),g=(N,P=!1)=>{N[0].start.x=0,N[0].start.y=0;let H=0;for(let q=0;q<N.length;q++){const U=N[q],F=N[q-1]??new ri(0,H);H+=!P||q>1?F.angle:0;const M=(!P||q>0?U.angle:0)+H;if(N[q].end.x=U.width*Math.cos(M*Math.PI/180)+N[q].start.x,N[q].end.y=U.width*Math.sin(M*Math.PI/180)+N[q].start.y,q<N.length-1){const Z=q+1;N[Z].start.x=N[q].end.x,N[Z].start.y=N[q].end.y}}return N},p=(N,P,H,q,U=!1)=>{let F=g([...H,...q]);P.length>0&&(F=[...g(P),...F]);let M=0,Z=0,fe=0,ie=0;F.forEach(Ae=>{M=Math.min(M,Ae.start.x,Ae.end.x),Z=Math.min(Z,Ae.start.y,Ae.end.y),fe=Math.max(fe,Ae.start.x,Ae.end.x),ie=Math.max(ie,Ae.start.y,Ae.end.y)});let me,re;M===0&&Z===0&&fe===0&&ie===0?(me=1,re=1):(me=N.width/Math.abs(fe-M),re=(U?N.height:N.height-Ve.colorSideLabel.size)/Math.abs(ie-Z));const Me=Math.min(me,re);return M=M<0?-M*Me:0,Z=Z<0?-Z*Me:0,[Me,M,Z]},y=N=>{const P=new ts([N]);return P._size=Ve.anchorPoint.size,P.fill=Ve.anchorPoint.color,P.stroke="transparent",P._linewidth=Ve.anchorPoint.strokeSize,l.push(P),P},b=(N,P)=>{if(l=[],n.settings.allowChangeFirstPoint){const H=N[0],q=new ge(H.vertices[0].x,H.vertices[0].y);q.bind(G.Types.change,()=>{H.vertices[0].copy(q)});const U=y(q);P.add(U)}N.forEach((H,q)=>{const U=N[q+1],F=new ge(H.vertices[1].x,H.vertices[1].y);F.bind(G.Types.change,()=>{H.vertices[1].copy(F),U!==void 0&&U.vertices[0].copy(F)});const M=y(F);P.add(M)})},_=N=>N*(Math.PI/180),v=(N,P,H)=>{const q=P.vertices.length-1;N.position.x=P.vertices[q].x,N.position.y=P.vertices[q].y;const U=Math.atan2(P.vertices[q].y-P.vertices[0].y,P.vertices[q].x-P.vertices[0].x);N.rotation=_(H)+U},k=(N,P,H)=>{if(P.vertices[0]===void 0)return;N.position.x=P.vertices[0].x,N.position.y=P.vertices[0].y;const q=P.vertices.length-1,U=Math.atan2(P.vertices[q].y-P.vertices[0].y,P.vertices[q].x-P.vertices[0].x);N.rotation=_(H)+U},S=(N,P,H)=>{const q=new xn;if(N.length===0)return q;const U=[];return[...N].reverse().forEach((F,M)=>{M!==0&&F.angle>0&&(F.angle*=-1),U.push(F)}),N=g(U,!0),k(q,P,N[0].angle),[P.vertices[0],P.vertices[1]].forEach(F=>{F.bind(G.Types.change,()=>{k(q,P,N[0].angle)})}),N.forEach(F=>{const M=F.start.x*H,Z=F.end.x*H,fe=F.start.y*H,ie=F.end.y*H,me=new rs(M,fe,Z,ie);me.linewidth=Ve.line.size,me.stroke=Ve.line.color,q.add(me)}),q},B=(N,P,H)=>{const q=new xn;return N.length===0||(N=g(N,!0),v(q,P,N[0].angle),[P.vertices[0],P.vertices[1]].forEach(U=>{U.bind(G.Types.change,()=>{v(q,P,N[0].angle)})}),N.forEach(U=>{const F=U.start.x*H,M=U.end.x*H,Z=U.start.y*H,fe=U.end.y*H,ie=new rs(F,Z,M,fe);ie.linewidth=Ve.line.size,ie.stroke=Ve.line.color,q.add(ie)})),q},C=(N,P,H,q)=>{const U=P.vertices[0].x+(P.vertices[1].x-P.vertices[0].x)/2-8*Math.sin(N.angle*Math.PI/180),F=P.vertices[0].y+(P.vertices[1].y-P.vertices[0].y)/2-8*Math.cos(N.angle*Math.PI/180),M=new zi(N.label,U+10,F-10);let Z;M.size=Ve.lineLabel.size,M.weight=600,M.fill=Ve.lineLabel.color,M.id+=1,M.rotation=Ve.lineLabel.rotation,q>0&&(Z=new zi(`${N.angle}°`,P.vertices[0].x+25,P.vertices[0].y-25),Z.size=Ve.angleLabel.size,Z.weight=600,Z.fill=Ve.angleLabel.color,Z.rotation=Ve.angleLabel.rotation,Z.id+=q,o.push(Z),H.add(Z)),H.add(M),$(M,P,0,Z),$(M,P,1)},T=()=>{const{size:N}=Ve.colorSideLabel,P=0,H=0,q=u.value?N/2:N/2-N,U=u.value?N/2-N:N/2,F=new xn;if(!c)return F;const M=5,Z=Math.atan2(U-q,H-P),fe=[new Re(P,q,0,0,0,0,an.Commands.move),new Re(H,U,0,0,0,0,an.Commands.line),new Re(H-M*Math.cos(Z-Math.PI/4),U-M*Math.sin(Z-Math.PI/4),0,0,0,0,an.Commands.line),new Re(H,U,0,0,0,0,an.Commands.move),new Re(H-M*Math.cos(Z+Math.PI/4),U-M*Math.sin(Z+Math.PI/4),0,0,0,0,an.Commands.line)],ie=new Ee(fe,!1,!1,!0);ie.noFill(),ie.cap="round",ie.join="round",ie.linewidth=N/7,ie.stroke=Ve.colorSideLabel.color,F.add(ie);const me=new zi(u.value?"Цвет снизу":"Цвет сверху",10,0);me.size=N,me.weight=600,me.fill=Ve.colorSideLabel.color,me.alignment="left",F.add(me);const re=F.getBoundingClientRect();return F.position.x=(c.width-re.width)*d+10,F.position.y=u.value?c.height+re.height*2:re.height/2,F},$=(N,P,H,q)=>{P.vertices[H].bind(G.Types.change,()=>{const U=P.vertices.length-1,F=Math.atan2(P.vertices[0].y-P.vertices[U].y,P.vertices[0].x-P.vertices[U].x)*180/Math.PI,M=P.vertices[0].x+(P.vertices[U].x-P.vertices[0].x)/2-8*Math.sin(F*Math.PI/180),Z=P.vertices[0].y+(P.vertices[U].y-P.vertices[0].y)/2-8*Math.cos(F*Math.PI/180);N.position.x=M+10,N.position.y=Z-10,N.rotation=-.5,q&&(q.position.x=P.vertices[0].x+25,q.position.y=P.vertices[0].y-25)})},E=(N,P,H,q,U=!1)=>{var Ie;if(N.clear(),H.length===0){N.update();return}const F=g(H),[M,Z,fe]=p(N,P,F,q,U),ie=new xn,me=new Array,re=new Array;U||(o=[],a=[]),F.forEach((Le,pt)=>{const Zt=Le.start.x*M+Z,Qt=Le.end.x*M+Z,St=Le.start.y*M+fe,At=Le.end.y*M+fe,yt=new rs(Zt,St,Qt,At);yt.linewidth=U?Ve.previewLine.size:Ve.line.size,yt.stroke=U?Ve.previewLine.color:Ve.line.color,a.push(yt),me.push(yt),ie.add(yt),!U&&Le.label!==""&&C(Le,yt,ie,pt)});const Me=me.at(-1);let Ae=ie.getBoundingClientRect();if(!U){const Le=T();re.push(Le)}if(P.length>0){const Le=S(P,me[0],M);ie.add(Le)}if(q.length>0&&Me){const Le=B(q,Me,M);ie.add(Le)}if(re.push(ie),N.makeGroup(re),Ae=ie.getBoundingClientRect(),ie.position.x=0-Ae.left+(N.width-Ae.width)/(2*(U?1:d)),ie.position.y=0-Ae.top+(N.height-Ae.height)/(2*(U?1:d)),N.update(),!U){const Le=((Ie=n.value.configuratorParams)==null?void 0:Ie.colorSide)==="top";ie.position.y=ie.position.y+Ve.colorSideLabel.size*Number(Le),b(me,ie),N.update()}},I=(N,P)=>{if(N&&!P.isNewRec()){const H=new an({width:N.scrollWidth,height:N.scrollHeight});H.appendTo(N),E(H,[],P.points,[],!0)}},O=()=>{c&&E(c,m.value,h.value,f.value,!1)},V=N=>N*(180/Math.PI),L=(N,P)=>{const H=N[1].x-N[0].x,q=N[1].y-N[0].y,U=P[1].x-P[0].x,F=P[1].y-P[0].y;let M=Math.atan2(H*F-q*U,H*U+q*F);return M=V(M),Math.round(M)*-1},D=N=>{const P=a.map((H,q,U)=>{const F=U[q-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let M=Math.ceil(H._length/N/n.settings.lineWidthStep)*n.settings.lineWidthStep;const Z=o[q-1];M<(U.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(M=U.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),M>n.settings.maxLineWidth&&(M=n.settings.maxLineWidth);const fe=L(H.vertices,F.vertices);return Z&&(Z.value=`${fe}°`),new ri(M,fe,`A-${q+1}`)});r("pointer:move",P)},ee=N=>{let P=null,H;const q=Z=>{P=l.find(fe=>{const ie=fe.renderer;return(ie==null?void 0:ie.elem)===Z.target}),[H]=p(N,m.value,h.value.map(fe=>fe),f.value)},U=Z=>{if(P){const fe=P.renderer,ie=fe==null?void 0:fe.elem;if(!ie)return;const me=ie.getBoundingClientRect();P.vertices[0].x-=me.x-(Z instanceof MouseEvent?Z.clientX:Z.targetTouches[0].clientX)+Ve.anchorPoint.size/2,P.vertices[0].y-=me.y-(Z instanceof MouseEvent?Z.clientY:Z.targetTouches[0].clientY)+Ve.anchorPoint.size/2,D(H),N.update()}},F=()=>{P&&r("pointer:up",h.value),P=null},M=s.value;M&&(M.addEventListener("touchstart",q,{passive:!0}),M.addEventListener("touchend",F,{passive:!0}),M.addEventListener("mousedown",q),M.addEventListener("mouseup",F),M.addEventListener("mousemove",U),M.addEventListener("touchmove",U,{passive:!0}))};return i.onMounted(()=>{s.value&&(c=new an({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{O()},{deep:!0,immediate:!0}),ee(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(N,P)=>(i.openBlock(),i.createElementBlock("div",Ep,[i.createVNode(ad,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":P[0]||(P[0]=H=>r("template:select",H)),onInitDrawTemplate:I},null,8,["select-template-index","settings"]),i.createElementVNode("div",Np,[i.createElementVNode("div",Pp,null,512)])]))}}),Mp={class:"flex max-w-[50rem] flex-col gap-3"},Ap={},cd=i.defineComponent({...Ap,__name:"kozyrek-configurator",props:{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(n.settings),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),h=i.ref({quantity:{},marker:{},length:{}}),u=i.ref(0),m=(C=0)=>{var $;const T=($=c.value.allTemplates)==null?void 0:$.at(C);T!==void 0&&(u.value=C,l.value.configuratorParams.linesWidths=T.points.map(E=>A.isArray(E)?E[0]:E.width),l.value.configuratorParams.linesAngles=T.points.map(E=>A.isArray(E)?E[1]:E.angle),b()),p(l.value.configuratorParams)},f=async()=>{const C=prompt("Введите название шаблона:");if(!C)return;a.value=!0;const T={label:C,points:l.value.configuratorParams.linesWidths.map(($,E)=>[$,l.value.configuratorParams.linesAngles[E]])};await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).createTemplate(n.cartItem.category,T,h.value).then(()=>{c.value.addCustomTemplate(T),u.value=c.value.allTemplates.length-1}).catch(()=>{a.value=!1}),a.value=!1},g=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(u.value=c.value.allTemplates.length-1)},p=async C=>{b(),s.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(n.cartItem.category,C,h.value).then(T=>{l.value.product=T}).catch(()=>{s.value=!1}),s.value=!1},y=()=>{o.value=!0,r("submit",l.value,h.value,()=>{o.value=!1})},b=()=>{const C={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach((T,$)=>{C[`lines_widths[${$+1}]`]={},C[`lines_angles[${$+1}]`]={}}),h.value=C},_=C=>{d.value.linesWidths=C.map(T=>T.width),d.value.linesAngles=C.map(T=>T.angle)},v=C=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,b(),g(),p(l.value.configuratorParams)},k=(C,T)=>{d.value.linesWidths=C,d.value.linesAngles=T},S=C=>{const T=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,$=0;l.value.configuratorParams.linesWidths.splice(C+1,0,T),l.value.configuratorParams.linesAngles.splice(C+1,0,$),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],b(),g(),p(l.value.configuratorParams)},B=C=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(C,1),l.value.configuratorParams.linesAngles.splice(C,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],b(),g(),p(l.value.configuratorParams))};return i.onBeforeMount(()=>{m()}),i.watch(()=>n.cartItem,C=>{l.value=new Y.CartItemBase(C),m()}),(C,T)=>{const $=z.NButton;return i.openBlock(),i.createElementBlock("div",Mp,[t.settings.allowShowTable?(i.openBlock(),i.createBlock($,{key:0,type:"tertiary",class:"self-end",onClick:T[0]||(T[0]=E=>r("click:view-switch"))},{default:i.withCtx(()=>[...T[3]||(T[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(ld,{value:l.value,"select-template-index":u.value,settings:c.value,"onPointer:up":v,"onPointer:move":_,"onTemplate:select":m},null,8,["value","select-template-index","settings"]),i.createVNode(Ua,{value:l.value,"onUpdate:value":T[1]||(T[1]=E=>l.value=E),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":u.value,"onUpdate:params":T[2]||(T[2]=E=>p(E)),"onUpdate:preview":k,onSubmit:y,"onClick:saveTemplate":f,"onClick:addLine":S,"onClick:removeLine":B},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])}}}),Vp={},Li=i.defineComponent({...Vp,__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}},emits:["update:value"],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=A.debounce(()=>s("update:value",o.value),a.value),c=f=>{o.value=f,l()};i.watch(()=>r.value,f=>{o.value=f});const d=i.ref(null);return e({focus:()=>{var f;return(f=d.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=d.value)==null?void 0:f.blur()},select:()=>{var f;return(f=d.value)==null?void 0:f.select()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(z.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value??null,clearable:t.clearable,"show-button":!1,placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,validator:t.validator,"onUpdate:value":c},{prefix:i.withCtx(()=>[i.renderSlot(f.$slots,"prefix")]),_:3},8,["value","clearable","placeholder","min","max","step","validator"]))}}),Ip={key:0,class:"flex items-baseline gap-1"},Op={key:0,class:"flex items-baseline gap-1"},zp={key:0},Lp={class:"text-lg font-semibold"},Dp={key:1,class:"text-red-500 text-sm mb-2"},Hp={class:"flex gap-3"},Wp={},dd=i.defineComponent({...Wp,__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,{emit:e}){const n=t,r=e,s=i.computed(()=>bt.isPhoneDevice()),o=(()=>{const p=A.cloneDeep(i.toRaw(n.value.configuratorParams)),y=p.mountType,b=n.settings.widthOverlaps[y]??0,_=n.settings.heightOverlaps[y]??0;return p.width&&p.width>0&&(p.width-=b),p.height&&p.height>0&&(p.height-=_),i.ref(p)})(),a=i.computed(()=>n.settings.widthOverlaps[o.value.mountType]??0),l=i.computed(()=>n.settings.heightOverlaps[o.value.mountType]??0),c=i.computed(()=>{const p=o.value.width;return p?p+a.value:void 0}),d=i.computed(()=>{const p=o.value.height;return p?p+l.value:void 0}),h=i.computed(()=>n.settings.maxWidths[o.value.netType]),u=i.computed(()=>n.settings.maxHeights[o.value.netType]),m=i.computed(()=>{var k;const p=c.value,y=d.value,{quantity:b}=n.value,_=((k=n.value.product)==null?void 0:k.costRub)||0;if(!p||!y||!b||_===0)return null;const v=p*y/1e6;return(_*b*v).toLocaleString("ru-ru",{minimumFractionDigits:2})}),f=i.computed(()=>{const p=c.value,y=d.value,b=!!(p&&p>=n.settings.minWidth&&p<=n.settings.maxWidths[o.value.netType]),_=!!(y&&y>=n.settings.minHeight&&y<=n.settings.maxHeights[o.value.netType]),v=!!(n.value.quantity&&n.value.quantity>0);return b&&_&&v}),g=(p,y)=>{p&&p in o.value&&y!==void 0&&(o.value[p]=y);const b={...o.value,width:c.value??0,height:d.value??0};r("update:params",b);const _=new Y.CartItemBase(n.value);_.configuratorParams=b,r("update:value",_)};return i.watch(()=>n.value,p=>{o.value=A.cloneDeep(i.toRaw(p.configuratorParams))}),(p,y)=>{const b=z.NInput;return i.openBlock(),i.createBlock(i.unref(z.NForm),{class:"flex flex-col gap-2 px-4 md:max-w-96"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:i.unref(o).netType,"onUpdate:value":[y[0]||(y[0]=_=>i.unref(o).netType=_),y[1]||(y[1]=_=>g("netType",_))],options:t.settings.netType.map(_=>({label:t.settings.descriptions.net_type[_],value:_}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:i.unref(o).color,"onUpdate:value":[y[2]||(y[2]=_=>i.unref(o).color=_),y[3]||(y[3]=_=>g("color",_))],options:t.settings.color.map(_=>({label:t.settings.descriptions.color[_],value:_}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:i.unref(o).mountType,"onUpdate:value":[y[4]||(y[4]=_=>i.unref(o).mountType=_),y[5]||(y[5]=_=>g("mountType",_))],options:t.settings.mountType.map(_=>({label:t.settings.descriptions.mount_type[_],value:_}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.width.feedback||"","show-feedback":t.validation.width.showFeedback||!!(c.value&&c.value>=t.settings.minWidth&&c.value<=t.settings.maxWidths[i.unref(o).netType]),"validation-status":t.validation.width.validationStatus||void 0,label:`Ширина светового проёма от ${t.settings.minWidth-a.value} ${h.value?" до "+(h.value-a.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&c.value&&c.value>=t.settings.minWidth&&c.value<=t.settings.maxWidths[i.unref(o).netType]?(i.openBlock(),i.createElementBlock("div",Ip,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(c.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:y[7]||(y[7]=_=>r("click:instructions-toggle"))},{default:i.withCtx(()=>[...y[14]||(y[14]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Li,{value:i.unref(o).width||void 0,max:h.value-a.value,min:t.settings.minWidth-a.value,placeholder:"Введите ширину светового проёма",class:"w-full","onUpdate:value":y[6]||(y[6]=_=>g("width",_??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.height.feedback||"","show-feedback":t.validation.height.showFeedback||!!(d.value&&d.value>=t.settings.minHeight&&d.value<=t.settings.maxHeights[i.unref(o).netType]),"validation-status":t.validation.height.validationStatus||void 0,label:`Высота светового проёма от ${t.settings.minHeight-l.value} ${u.value?" до "+(u.value-l.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&d.value&&d.value>=t.settings.minHeight&&d.value<=t.settings.maxHeights[i.unref(o).netType]?(i.openBlock(),i.createElementBlock("div",Op,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(d.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:y[9]||(y[9]=_=>r("click:instructions-toggle"))},{default:i.withCtx(()=>[...y[15]||(y[15]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Li,{value:i.unref(o).height||void 0,max:u.value-l.value,min:t.settings.minHeight-l.value,placeholder:"Введите высоту светового проёма",class:"w-full","onUpdate:value":y[8]||(y[8]=_=>g("height",_??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.quantity.feedback||"","show-feedback":t.validation.quantity.showFeedback||!1,"validation-status":t.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,"onUpdate:value":y[10]||(y[10]=_=>t.value.quantity=_),min:1,"show-button":!1,validator:_=>Number.isInteger(_),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{feedback:t.validation.marker.feedback||"","show-feedback":t.validation.marker.showFeedback||!1,"validation-status":t.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(b,{value:t.value.marker,"onUpdate:value":y[11]||(y[11]=_=>t.value.marker=_),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(nr,{"is-product-searching":t.isProductSearching,product:t.value.product},null,8,["is-product-searching","product"]),m.value?(i.openBlock(),i.createElementBlock("div",zp,[y[16]||(y[16]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Lp,i.toDisplayString(m.value)+" ₽",1)])):i.createCommentVNode("",!0),f.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Dp," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",Hp,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!f.value,type:"primary",class:"self-start",onClick:y[12]||(y[12]=_=>r("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,type:"default",onClick:y[13]||(y[13]=_=>r("click:show-preview-drawer"))},{default:i.withCtx(()=>[...y[17]||(y[17]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1})}}}),jp="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",qp="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",Xp="/img/configurators/mosquitto/measurement-instructions/mount.png",Yp="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",Up="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",Gp={class:"flex flex-col gap-6"},Kp={class:"flex gap-4"},Zp={class:"flex flex-col gap-2"},Qp={class:"flex gap-4"},Jp={class:"flex flex-col gap-2"},e0={class:"flex gap-4"},t0={class:"flex flex-col gap-2"},n0={},hd=i.defineComponent({...n0,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=bt.initRefDependingOnDeviceResolution("small","small","medium"),r=bt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=e;return(a,l)=>{const c=z.NText;return i.openBlock(),i.createBlock(i.unref(z.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",Gp,[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:jp,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:qp,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",Kp,[l[9]||(l[9]=i.createElementVNode("img",{src:Xp,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Zp,[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",Qp,[l[15]||(l[15]=i.createElementVNode("img",{src:Yp,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Jp,[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",e0,[l[21]||(l[21]=i.createElementVNode("img",{src:Up,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",t0,[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"])}}}),i0={class:"flex flex-col items-center justify-between rounded-xl"},r0={class:"img-preview relative flex justify-center"},s0={},o0=i.defineComponent({...s0,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(t,{emit:e}){const n=t,r=i.computed(()=>{const o=A.keys(n.settings.crossbarCount).find(a=>n.settings.crossbarCount[Number(a)]&&(!n.settings.crossbarCount[Number(a)+1]||n.configuratorParams.height<n.settings.crossbarCount[Number(a)+1]));if(o!==void 0)return String(Number(o)+1)}),s=e;return(o,a)=>{const l=z.NButton;return i.openBlock(),i.createElementBlock("div",i0,[i.createElementVNode("div",r0,[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})])}}}),Eo=Zn(o0,[["__scopeId","data-v-f04663ef"]]),a0={class:"grid md:grid-cols-2"},l0={},ud=i.defineComponent({...l0,__name:"mosquito-configurator",props:{settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>bt.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref({width:{},height:{},quantity:{},marker:{}}),d=i.ref(!1),h=i.ref(!1),u=async f=>{f.height>0&&f.width>0?(d.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(n.cartItem.category,f,c.value).then(g=>{l.value.product=g}).catch(()=>{d.value=!1}),d.value=!1):l.value.product=new Y.Product},m=()=>{h.value=!0,r("submit",l.value,c.value,()=>{h.value=!1})};return i.watch(()=>n.cartItem,f=>{l.value=new Y.CartItemBase(f)}),(f,g)=>{const p=ss;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(hd,{show:a.value,"onUpdate:show":g[0]||(g[0]=y=>a.value=y),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",a0,[s.value?(i.openBlock(),i.createBlock(i.unref(z.NDrawer),{key:1,show:o.value,"onUpdate:show":g[4]||(g[4]=y=>o.value=y),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(z.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:g[2]||(g[2]=y=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(p)]),_:1})]),default:i.withCtx(()=>[i.createVNode(Eo,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:g[3]||(g[3]=y=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(Eo,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:g[1]||(g[1]=y=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(dd,{value:l.value,"onUpdate:value":g[5]||(g[5]=y=>l.value=y),validation:c.value,settings:t.settings,"is-product-searching":d.value,"is-submit-processing":h.value,"onUpdate:params":g[6]||(g[6]=y=>u(y)),onSubmit:g[7]||(g[7]=y=>m()),"onClick:instructionsToggle":g[8]||(g[8]=y=>a.value=!a.value),"onClick:showPreviewDrawer":g[9]||(g[9]=y=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),c0={key:0},d0={},fd=i.defineComponent({...d0,__name:"strip-configurator-line-item",props:{value:{},index:{},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:{default:()=>({})}},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=d=>{s("update:value",d??0,r.index,a)};i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{c()})});const c=()=>{var d;(d=o.value)==null||d.select()};return e({focusWidthInput:c}),(d,h)=>{var f;const u=Ya,m=Xa;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{label:`Полоса №${t.index+1}, мм`,required:!0,"validation-status":a.value||(f=t.validation)==null?void 0:f.validationStatus},{feedback:i.withCtx(()=>{var g,p;return[(g=t.validation)!=null&&g.showFeedback?(i.openBlock(),i.createElementBlock("span",c0,i.toDisplayString((p=t.validation)==null?void 0:p.feedback),1)):i.createCommentVNode("",!0),i.createVNode(nr,{"is-product-searching":a.value,product:t.product},null,8,["is-product-searching","product"])]}),default:i.withCtx(()=>[i.createVNode(i.unref(z.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:l},{default:i.withCtx(()=>[i.createVNode(Li,{ref:"width-input-element",value:t.value||null,class:"w-full",min:t.settings.minLineWidth,step:t.settings.lineWidthStep,validator:g=>!!g&&g>=t.settings.minLineWidth&&g%t.settings.lineWidthStep===0,placeholder:"Введите ширину","onUpdate:value":l},null,8,["value","min","step","validator"])]),_:1},8,["options"]),i.createVNode(i.unref(z.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[0]||(h[0]=g=>s("click:add-line",t.index))},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[1]||(h[1]=g=>s("click:remove-line",t.index))},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled"])]),_:1},8,["label","validation-status"])}}}),h0={class:"my-2 flex w-full flex-col"},u0={key:0},f0={class:"text-lg font-semibold"},g0={class:"flex gap-3"},m0={},gd=i.defineComponent({...m0,__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,{emit:e}){const n=t,r=e,s=i.computed(()=>n.value[0].configuratorParams.linesWidths.reduce((u,m)=>(u??0)+(m??0),0)),o=i.computed(()=>n.settings.width-s.value),a=i.computed(()=>!n.value.some(({product:u})=>!u)),l=i.computed(()=>o.value===0?void 0:[{label:`${(o.value>0?"Остаток +":"Излишек ")+o.value} мм.`,key:o.value}]),c=i.computed(()=>{const{length:u}=n.value[0];return!u||s.value!==n.settings.width?null:(A.reduce(n.value,(f,g)=>{var y;const p=((y=g.product)==null?void 0:y.costRub)||0;return f+p},0)*n.value[0].quantity*u).toLocaleString("ru-ru",{minimumFractionDigits:2})}),d=(u,m,f)=>{const g=n.value.at(m);if(g)if(u&&u>=n.settings.minLineWidth&&u%n.settings.lineWidthStep===0){const p={linesWidths:g.configuratorParams.linesWidths.toSpliced(m,1,u)};r("update:params",p,m,f),h("configuratorParams",p)}else g.product.id=-1},h=(u,m)=>{const f=n.value.map(g=>new Y.CartItemBase(g));f.forEach(g=>{g[u]=m}),r("update:value",f)};return(u,m)=>{const f=z.NInput;return i.openBlock(),i.createBlock(i.unref(z.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>{var g;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.value,(p,y)=>(i.openBlock(),i.createBlock(fd,{key:y,"auto-focus":!0,index:y,value:p.configuratorParams.linesWidths.at(y)??null,product:p.product,settings:t.settings,validation:t.validation[`linesWidths.${y}`],"suggestion-option":l.value,"add-line-button-disabled":o.value<=0||t.value.length>=t.settings.maxLinesCount,"remove-line-button-disabled":t.value.length===1,"onUpdate:value":d,"onClick:addLine":m[0]||(m[0]=b=>r("click:add-line",b)),"onClick:removeLine":m[1]||(m[1]=b=>r("click:remove-line",b))},null,8,["index","value","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled"]))),128)),i.createElementVNode("div",h0,[o.value<0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(t.settings.width),1)]),_:1})):i.createCommentVNode("",!0),a.value&&t.value.length===t.settings.maxLinesCount&&o.value>0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:1,type:"error"},{default:i.withCtx(()=>[...m[7]||(m[7]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[m[8]||(m[8]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(z.NText),{type:o.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(o.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(t.settings.width)+" мм ",1)])]),i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!a.value||o.value<=0||t.value.length>=t.settings.maxLinesCount,type:"primary",class:"self-center",onClick:m[2]||(m[2]=p=>r("click:add-line",t.value.length))},{default:i.withCtx(()=>[...m[9]||(m[9]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["loading","disabled"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.length.feedback||"","show-feedback":t.validation.length.showFeedback||!1,"validation-status":t.validation.length.validationStatus||void 0,label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:n.value[0].length??null,"show-button":!1,max:t.settings.maxLength||void 0,min:t.settings.minLength,step:t.settings.lengthStep,validator:p=>p%t.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full","onUpdate:value":m[3]||(m[3]=p=>h("length",p??0))},null,8,["value","max","min","step","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.quantity.feedback||"","show-feedback":t.validation.quantity.showFeedback||!1,"validation-status":t.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:n.value[0].quantity,"show-button":!1,min:1,validator:p=>Number.isInteger(p),placeholder:"Введите количество",class:"w-full","onUpdate:value":m[4]||(m[4]=p=>h("quantity",p??0))},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{"show-feedback":!1,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(f,{value:n.value[0].marker,placeholder:"Введите маркировку","onUpdate:value":m[5]||(m[5]=p=>h("marker",p))},null,8,["value"])]),_:1}),c.value?(i.openBlock(),i.createElementBlock("div",u0,[m[10]||(m[10]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",f0,i.toDisplayString(c.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",g0,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!a.value||o.value!=0||!((g=t.value[0])!=null&&g.length)||t.value[0].length>t.settings.maxLength||t.value[0].length<t.settings.minLength||t.value[0].quantity===0,type:"primary",class:"self-start",onClick:m[6]||(m[6]=p=>r("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1})}}}),p0={class:"flex grow flex-col"},y0=["src"],b0={class:"w-full"},_0={},md=i.defineComponent({..._0,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",p0,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,y0),i.createElementVNode("div",b0,[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)])]))}}),w0={class:"flex flex-col gap-2"},x0={class:"w-104 flex grow flex-col px-5"},v0={},pd=i.defineComponent({...v0,__name:"strip-configurator",props:{settings:{},cartItems:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.cartItems),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.computed(()=>s.value[0].configuratorParams.linesWidths.reduce((m,f)=>(m??0)+(f??0),0)),c=m=>{m===void 0&&(m=s.value.length-1);const f=s.value.at(0);if(!f)return;f.configuratorParams.linesWidths=f.configuratorParams.linesWidths.toSpliced(m+1,0,null),s.value.forEach(p=>{p.configuratorParams.linesWidths=f.configuratorParams.linesWidths});const g=new Y.CartItemBase({quantity:(f==null?void 0:f.quantity)??1,category:f==null?void 0:f.category,length:(f==null?void 0:f.length)??n.settings.minLength,marker:f==null?void 0:f.marker,configuratorParams:{linesWidths:f==null?void 0:f.configuratorParams.linesWidths}});s.value=s.value.toSpliced(m+1,0,g)},d=m=>{const f=s.value.at(0);f&&(f.configuratorParams.linesWidths=f.configuratorParams.linesWidths.toSpliced(m,1),s.value.forEach(g=>{g.configuratorParams.linesWidths=f.configuratorParams.linesWidths}),s.value=s.value.toSpliced(m,1),delete o[`linesWidths.${m}`],delete o[`linesWidths.${m}`])},h=async(m,f,g)=>{g.value=!0,o.value[`linesWidths.${f}`]={},await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(s.value[f].category,{linesWidths:m.linesWidths.at(f)},o.value).then(p=>{s.value[f].product=p,f===s.value.length-1&&s.value.length<n.settings.maxLinesCount&&l.value&&l.value<n.settings.width&&c()}).catch(()=>{s.value[f].product=new Y.Product,o.value[`linesWidths.${f}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},g.value=!1}),g.value=!1},u=()=>{a.value=!0,r("submit",s.value,o.value,()=>{a.value=!1})};return i.watch(()=>n.cartItems,m=>{s.value=m.map(f=>new Y.CartItemBase(f))}),(m,f)=>{const g=z.NButton;return i.openBlock(),i.createElementBlock("div",w0,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(g,{key:0,type:"tertiary",class:"self-center",onClick:f[0]||(f[0]=p=>r("click:view-switch"))},{default:i.withCtx(()=>[...f[3]||(f[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",x0,[i.createVNode(md,{value:s.value,"onUpdate:value":f[1]||(f[1]=p=>s.value=p),settings:t.settings},null,8,["value","settings"]),i.createVNode(gd,{value:s.value,"onUpdate:value":f[2]||(f[2]=p=>s.value=p),validation:o.value,settings:t.settings,"is-submit-processing":a.value,"onUpdate:params":h,onSubmit:u,"onClick:addLine":c,"onClick:removeLine":d},null,8,["value","validation","settings","is-submit-processing"])])])}}}),k0={class:"flex flex-col gap-3"},C0={},yd=i.defineComponent({...C0,__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,{emit:e}){const n=t,r=e,s=i.useTemplateRef("first-input-element"),o=i.ref(A.cloneDeep(i.toRaw(n.value.configuratorParams))),a=()=>{o.value.length>0&&o.value.width>0&&(r("update:params",o.value),l("configuratorParams",o.value))},l=(c,d)=>{const h=new Y.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.onMounted(()=>{n.value.isNewRec()&&i.nextTick(()=>{var c;(c=s.value)==null||c.focus()})}),i.watch(()=>n.value,c=>{o.value=A.cloneDeep(i.toRaw(c.configuratorParams))}),(c,d)=>{const h=z.NInput;return i.openBlock(),i.createBlock(i.unref(z.NForm),{disabled:t.isSubmitProcessing,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.width.feedback||"","show-feedback":t.validation.width.showFeedback||!1,"validation-status":t.validation.width.validationStatus||void 0,label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(Li,{ref:"first-input-element",value:o.value.width,"onUpdate:value":[d[0]||(d[0]=u=>o.value.width=u),a],class:"w-full",max:t.settings.maxWidth??void 0,min:t.settings.minWidth,validator:u=>!!u&&u>=t.settings.minWidth&&(!t.settings.maxWidth||u<=t.settings.maxWidth),placeholder:"Введите ширину"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.length.feedback||"","show-feedback":t.validation.length.showFeedback||!1,"validation-status":t.validation.length.validationStatus||void 0,label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(Li,{value:o.value.length,"onUpdate:value":[d[1]||(d[1]=u=>o.value.length=u),a],placeholder:"Введите длину",max:t.settings.maxLength,min:t.settings.minLength,validator:u=>u>=t.settings.minLength&&u<=t.settings.maxLength,class:"w-full"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.quantity.feedback||"","show-feedback":t.validation.quantity.showFeedback||!1,"validation-status":t.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество","show-button":!1,min:1,validator:u=>u>0,class:"w-full","onUpdate:value":d[2]||(d[2]=u=>l("quantity",u??0))},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{feedback:t.validation.marker.feedback||"","show-feedback":t.validation.marker.showFeedback||!1,"validation-status":t.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(h,{value:t.value.marker,placeholder:"Введите маркировку","onUpdate:value":d[3]||(d[3]=u=>l("marker",u))},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(nr,{"is-product-searching":t.isProductSearching,product:t.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",k0,[i.createVNode(i.unref(z.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:d[4]||(d[4]=u=>r("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["disabled"])}}}),S0={class:"flex flex-col gap-2"},B0={},bd=i.defineComponent({...B0,__name:"metal-for-doors-configurator",props:{settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.cartItem),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.ref(!1),c=async h=>{a.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(n.cartItem.category,h,o.value).then(u=>{s.value.product=u}).catch(()=>{a.value=!1}),a.value=!1},d=()=>{l.value=!0,r("submit",s.value,o.value,()=>{l.value=!1})};return i.watch(()=>n.cartItem,h=>{s.value=new Y.CartItemBase(h)}),(h,u)=>{const m=z.NButton;return i.openBlock(),i.createElementBlock("div",S0,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:u[0]||(u[0]=f=>r("click:view-switch"))},{default:i.withCtx(()=>[...u[4]||(u[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(yd,{value:s.value,"onUpdate:value":u[1]||(u[1]=f=>s.value=f),validation:o.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":u[2]||(u[2]=f=>c(f)),onSubmit:u[3]||(u[3]=f=>d())},null,8,["value","validation","settings","is-submit-processing"])])}}});class Di extends Y.Identity{constructor(n,r){super();x(this,"label","");x(this,"points",[]);x(this,"isCustom",!1);x(this,"id",-1);x(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>A.isArray(s)?new ri(s[0],s[1],`A-${o+1}`):new ri(s.width,s.angle,`A-${o+1}`))):(this.label="-- Новая конфигурация --",this.points=[new ri(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class No extends Di{constructor(n){super(n);x(this,"isDefault");this.isDefault=n.isDefault??!1}}class _d{constructor(e){x(this,"minLineWidth");x(this,"maxLineWidth");x(this,"lineWidthStep");x(this,"minLineAngle");x(this,"maxLineAngle");x(this,"lineAngleStep");x(this,"stripMinWidth");x(this,"stripMaxWidth");x(this,"stripMinLength");x(this,"stripMaxLength");x(this,"allowShowTable");x(this,"showOnlyTemplates");x(this,"templates");x(this,"customTemplates",[]);x(this,"startTailConfigs");x(this,"endTailConfigs");x(this,"bendCountForExtended");x(this,"extendedProductCatalog");x(this,"allowChangeFirstPoint");x(this,"allowSaveTemplates");x(this,"userTemplatesPrefix");x(this,"lengthStep");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 Di(s)),this.templates.forEach((s,o)=>{s.id=o}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(s=>new No(s)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(s=>new No(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.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).map(([s,o])=>{const a=new Di(o);return a.isCustom=!0,a.id=+s,a}):[],this.customTemplates.push(new Di))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){var r,s;if(!this.allowSaveTemplates)return;const n=new Di(e);n.isCustom=!0,n.id=(((r=this.customTemplates.at(-1))==null?void 0:r.id)??((s=this.templates.at(-1))==null?void 0:s.id)??0)+1,this.customTemplates.splice(-1,0,n)}removeCustomTemplate(e){if(this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===e);n&&n!==-1&&this.customTemplates.splice(n,1)}}class T0{constructor(e){x(this,"minHeight");x(this,"maxHeights");x(this,"minWidth");x(this,"maxWidths");x(this,"netType");x(this,"color");x(this,"mountType");x(this,"descriptions");x(this,"crossbarCount");x(this,"heightOverlaps");x(this,"widthOverlaps");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=Ps.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=Ps.objectToSnake(e.heightOverlaps),this.widthOverlaps=Ps.objectToSnake(e.widthOverlaps)}}const R0={key:0,class:"flex justify-center p-4"},$0={key:1,class:"p-4 text-center text-red-500"},E0={key:2,class:"!bg-white p-4 m-2 rounded-md justify-self-center"},N0={key:3,class:"p-4 text-center text-gray-500"},wd=i.defineComponent({__name:"dynamic-configurator",props:{eventEmitter:{},category:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=i.ref(null),a=i.ref(null),l=i.computed(()=>{var f;return(f=n.category.properties)==null?void 0:f.configurator}),c=i.ref(null),d=i.ref(null),h=f=>{var p,y;const g={category:n.category,configurator:l.value,quantity:1};switch(l.value){case"kozyrek":{const b=f;c.value=new Y.CartItemBase({...g,configuratorParams:{length:b.stripMinLength,linesAngles:[],linesWidths:[],startTailType:A.some(b.startTailConfigs,_=>_.isDefault)?(p=b.startTailConfigs)==null?void 0:p.findIndex(_=>_.isDefault):void 0,endTailType:A.some(b.endTailConfigs,_=>_.isDefault)?(y=b.endTailConfigs)==null?void 0:y.findIndex(_=>_.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const b=f;c.value=new Y.CartItemBase({...g,configuratorParams:{width:0,height:0,netType:b.netType[0]||"",color:b.color[0]||"",mountType:b.mountType[0]||""}});break}case"strip":{d.value=[new Y.CartItemBase({...g,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const b=f;c.value=new Y.CartItemBase({...g,configuratorParams:{width:b.minWidth,length:b.minLength}});break}default:o.value=`Неподдерживаемый тип конфигуратора: ${l.value}.`}},u=async()=>{var f;if(!l.value){o.value="Тип конфигуратора не указан в свойствах категории.";return}s.value=!0,o.value=null;try{const p=await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).getConfiguratorSettings(n.category);switch((f=n.category.properties)==null?void 0:f.configurator){case"kozyrek":a.value=new _d(p);break;case"mosquitto":a.value=new T0(p);break;default:a.value=p;break}h(a.value)}catch(g){"message"in g&&(g.value=`Ошибка при загрузке настроек конфигуратора: ${A.isError(g)?g.message:"Неизвестная ошибка"}.`)}finally{s.value=!1}},m=(f,g,p)=>{const y=b=>{p==null||p(),b&&h(a.value)};r("submit",A.isArray(f)?f[0]:f,g,y)};return i.onMounted(()=>{u()}),(f,g)=>{const p=z.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[s.value?(i.openBlock(),i.createElementBlock("div",R0,[i.createVNode(p,{size:"large"})])):o.value?(i.openBlock(),i.createElementBlock("div",$0,i.toDisplayString(o.value),1)):i.createCommentVNode("",!0),a.value!==null&&(c.value!==null||d.value!==null)?(i.openBlock(),i.createElementBlock("div",E0,[l.value==="kozyrek"?(i.openBlock(),i.createBlock(cd,{key:0,settings:a.value,"cart-item":c.value,"onClick:viewSwitch":g[0]||(g[0]=y=>r("click:view-switch")),onSubmit:m},null,8,["settings","cart-item"])):l.value==="mosquitto"?(i.openBlock(),i.createBlock(ud,{key:1,settings:a.value,"cart-item":c.value,onSubmit:m},null,8,["settings","cart-item"])):l.value==="strip"?(i.openBlock(),i.createBlock(pd,{key:2,settings:a.value,"cart-items":d.value,"onClick:viewSwitch":g[1]||(g[1]=y=>r("click:view-switch")),onSubmit:m},null,8,["settings","cart-items"])):l.value==="metal_for_doors"?(i.openBlock(),i.createBlock(bd,{key:3,settings:a.value,"cart-item":c.value,"onClick:viewSwitch":g[2]||(g[2]=y=>r("click:view-switch")),onSubmit:m},null,8,["settings","cart-item"])):i.createCommentVNode("",!0)])):(i.openBlock(),i.createElementBlock("div",N0,' Конфигуратор "'+i.toDisplayString(l.value)+'" не поддерживается. ',1))],64)}}}),P0={key:0,class:"pt-0.5"},F0={key:0},M0={class:"line-through"},A0={key:0},V0={key:1},I0={class:"flex flex-row gap-1"},O0={key:0},z0={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},L0={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},D0={key:2,class:"flex flex-col"},H0={},W0=i.defineComponent({...H0,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type: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},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($r,"medium"),r=i.computed(()=>{var F;return(F=e==null?void 0:e.filteredItems)==null?void 0:F[e.categoryItem.id]}),s=i.computed(()=>{var F,M;return A.isArray((F=e.categoryItem)==null?void 0:F.categories)&&((M=e.categoryItem.categories)==null?void 0:M.length)>0}),o=i.computed(()=>{var F;return A.isArray((F=e.categoryItem)==null?void 0:F.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([F,M])=>`${M} руб./${T(F)}`).join(", ")),l=i.computed(()=>A.isUndefined(e.filteredItems)||r.value==="*"?o.value:o.value.filter(F=>{var Z;const M=(Z=r.value)==null?void 0:Z.products;return A.isArray(M)&&M.includes(F.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>A.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),h=i.computed(()=>A.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),u=i.computed(()=>A.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),m=i.computed(()=>A.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),f=i.computed(()=>{var F;return((F=e.categoryItem.properties)==null?void 0:F.configurator)!==void 0&&(A.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)}),g=i.computed(()=>A.isNil(e.categoryContextButtonsConfig)?[]:A.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),p=i.computed(()=>new Y.ClientCategory(e.categoryItem)),y=i.ref(!1),b=i.ref(!1),_=i.computed(()=>!A.isUndefined(e.isCategoryItemSelected)),v=i.computed(()=>A.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected),k=i.computed(()=>H.value&&bt.getDeviceTypeByResolution()===Ue.laptop?"auto":"fixed"),S=i.useTemplateRef("collapse-item-reference"),B=i.computed(()=>{var F,M;return(M=(F=e.categoryItem.properties)==null?void 0:F.templateCost)==null?void 0:M.priceCoefficient}),C=i.computed(()=>{var F,M;return(M=(F=e.categoryItem.properties)==null?void 0:F.templateCost)==null?void 0:M.increasePercent}),T=(F,M="ru-RU")=>0 .toLocaleString(M,{style:"currency",currency:F,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),$=F=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:F,target:S.value})},E=(F,M)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:M,isLoadingState:y,target:S.value})},I=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:S.value})},O=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:S.value})},V=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:S.value})},L=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:S.value})},D=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:S.value})},ee=F=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:F,target:S.value})},N=(F,M,Z)=>{e.eventEmitter.emit("configurator:submit",{cartItem:F,target:S.value,callback:Z,validation:M})},P=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem,target:S.value})},H=i.ref(0),q=i.computed(()=>H.value&&o.value.length>0?yg(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}):[]),U=A.debounce(()=>{H.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",U)}),window.addEventListener("resize",U),U(),(F,M)=>{const Z=z.NCheckbox,fe=sf,ie=z.NTooltip,me=tf,re=z.NTag,Me=Qu,Ae=Gu,Ie=z.NButton,Le=Xu,pt=La,Zt=za,Qt=Oa,St=Ia,At=z.NDropdown,yt=z.NDataTable,pn=z.NAlert,Pn=z.NSpin;return i.openBlock(),i.createBlock(Da,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":E},{"pre-arrow":i.withCtx(()=>{var De,ke;return[_.value?(i.openBlock(),i.createElementBlock("div",P0,[i.createVNode(Z,{checked:v.value,disabled:v.value==="disabled","onUpdate:checked":$},null,8,["checked","disabled"])])):i.createCommentVNode("",!0),!d.value&&((De=p.value)!=null&&De.isDisabled)?(i.openBlock(),i.createBlock(ie,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(fe,{class:"pt-1.5"})]),default:i.withCtx(()=>[M[1]||(M[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((ke=p.value)==null?void 0:ke.isFavorite)??!1?(i.openBlock(),i.createBlock(ie,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(me,{class:"pt-1.5"})]),default:i.withCtx(()=>[M[2]||(M[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var De,ke,Oe,J,se;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":(De=p.value)==null?void 0:De.isDisabled})},[i.createVNode(ie,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[M[3]||(M[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:M[0]||(M[0]=i.withModifiers((...Ce)=>i.unref(A.noop)&&i.unref(A.noop)(...Ce),["prevent","stop"]))},[(ke=t.categoryItem.properties)!=null&&ke.m2Price?(i.openBlock(),i.createBlock(re,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((Oe=t.categoryItem.properties)==null?void 0:Oe.templateCost)&&t.categoryItem.properties.m2PriceRetail&&C.value}),round:""},{default:i.withCtx(()=>{var Ce;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(Ce=t.categoryItem.properties)!=null&&Ce.templateCost&&t.categoryItem.properties.m2PriceRetail&&C.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[C.value?(i.openBlock(),i.createBlock(re,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[C.value?(i.openBlock(),i.createElementBlock("span",F0,i.toDisplayString(C.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(re,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",M0,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"])):(J=t.categoryItem.properties)!=null&&J.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[B.value||C.value?(i.openBlock(),i.createBlock(re,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var Ce;return[B.value?(i.openBlock(),i.createElementBlock("span",A0,i.toDisplayString((Ce=B.value)==null?void 0:Ce.name),1)):i.createCommentVNode("",!0),C.value?(i.openBlock(),i.createElementBlock("span",V0,i.toDisplayString(C.value>0?"+":"")+i.toDisplayString(C.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(re,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),h.value&&((se=p.value)!=null&&se.manager)?(i.openBlock(),i.createBlock(re,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:L},{default:i.withCtx(()=>[i.createVNode(ie,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Ce,Jt;return[i.createElementVNode("span",I0,[i.createVNode(Me),i.createTextVNode(" "+i.toDisplayString((Jt=(Ce=p.value)==null?void 0:Ce.manager)==null?void 0:Jt.name),1)])]}),default:i.withCtx(()=>{var Ce,Jt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((Jt=(Ce=p.value)==null?void 0:Ce.manager)==null?void 0:Jt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",O0,[i.createElementVNode("ul",z0,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(De,ke)=>(i.openBlock(),i.createElementBlock("li",{key:ke}," ("+i.toDisplayString(ke)+"): "+i.toDisplayString(De),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.categoryItem.properties,(De,ke)=>(i.openBlock(),i.createElementBlock("li",{key:ke}," ("+i.toDisplayString(ke)+"): "+i.toDisplayString(De),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var De;return[i.createElementVNode("div",L0,[d.value?(i.openBlock(),i.createBlock(ie,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Ie,{ghost:!0,size:i.unref(n),onClick:I},{default:i.withCtx(()=>{var ke;return[(ke=p.value)!=null&&ke.isDisabled?(i.openBlock(),i.createBlock(fe,{key:1})):(i.openBlock(),i.createBlock(Ae,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var ke;return[(ke=p.value)!=null&&ke.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(p.value.hidingComment?`. Причина: '${p.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),h.value&&!((De=p.value)!=null&&De.manager)?(i.openBlock(),i.createBlock(ie,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Ie,{ghost:!0,size:i.unref(n),onClick:V},{default:i.withCtx(()=>[i.createVNode(Le)]),_:1},8,["size"])]),default:i.withCtx(()=>{var ke,Oe,J;return[(ke=p.value)!=null&&ke.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((J=(Oe=p.value)==null?void 0:Oe.manager)==null?void 0:J.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createBlock(ie,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Ie,{ghost:!0,disabled:u.value==="disabled",size:i.unref(n),onClick:O},{default:i.withCtx(()=>{var ke;return[(ke=p.value)!=null&&ke.isRequired?(i.openBlock(),i.createBlock(Zt,{key:1})):(i.openBlock(),i.createBlock(pt,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[M[4]||(M[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(ie,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Ie,{ghost:!0,size:i.unref(n),type:"primary",onClick:D},{default:i.withCtx(()=>[i.createVNode(Qt)]),_:1},8,["size"])]),default:i.withCtx(()=>[M[5]||(M[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),g.value.length>0?(i.openBlock(),i.createBlock(At,{key:4,options:g.value,size:i.unref(n),trigger:"click",onSelect:ee},{default:i.withCtx(()=>[i.createVNode(Ie,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(St)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(F.$slots,"default",{},()=>{var De,ke;return[s.value?(i.openBlock(),i.createBlock(vd,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((De=r.value)==null?void 0:De.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},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"])):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(wd,{key:1,"event-emitter":t.eventEmitter,category:t.categoryItem,onSubmit:N,"onClick:viewSwitch":P},null,8,["event-emitter","category"])):c.value?(i.openBlock(),i.createElementBlock("div",D0,[((ke=t.categoryItem.properties)==null?void 0:ke.configurator)!==void 0?(i.openBlock(),i.createBlock(Ie,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:P},{default:i.withCtx(()=>[...M[6]||(M[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(yt,{columns:q.value,data:l.value,bordered:!0,loading:y.value,remote:!0,"row-key":Oe=>Oe.id,"table-layout":k.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])])):i.createCommentVNode("",!0),!y.value&&!b.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(pn,{key:3,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),b.value?(i.openBlock(),i.createBlock(pn,{key:4,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createBlock(Pn,{key:5,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...M[7]||(M[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),j0=Zn(W0,[["__scopeId","data-v-8ef5b448"]]),q0={class:"sc-collapse flex w-full flex-col"},X0={},xd=i.defineComponent({...X0,__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",q0,[i.renderSlot(o.$slots,"default")]))}}),Y0={},vd=i.defineComponent({...Y0,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{},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]},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:{},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($r,"medium"),r=i.computed(()=>A.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(o=>{var a;return!!((a=e.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(A.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=z.NSpin,c=z.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(xd,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(j0,{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},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"]))),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)}}}),U0={},kd=i.defineComponent({...U0,__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(()=>A.isArray(r.value)),a=new Y.Reference,l=i.computed(()=>{const f=o.value?[]:a,g=A.isUndefined(r.value)?f:r.value;return A.isArray(g)?g.map(p=>p.id):g==null?void 0:g.id}),c=i.computed(()=>zt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue)),d=f=>{var g;if(A.isArray(f)){const p=f.length>0?f.map(y=>{var b;return(b=c.value.find(_=>_.value===y))==null?void 0:b.item}):[];s("update:value",p)}else{const p=f===a.id||(g=c.value.find(y=>y.value===f))==null?void 0:g.item;s("update:value",p)}},h=i.useTemplateRef("select-component");return e({focus:()=>{var f;return(f=h.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=h.value)==null?void 0:f.blur()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(z.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"]))}}),G0={},K0=i.defineComponent({...G0,__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 v,k;const n=t,r=e,s=()=>{const S=Y.PriceCoefficient.getRetailPriceCoefficient();return A.unset(S,"isNewRec"),S},o=S=>!S||S.id===s().id,a=i.computed(()=>{var S;return((S=n.catalogItem)==null?void 0:S.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=S=>{var B,C,T,$;return S.id===s().id?(B=l.value)==null?void 0:B.getRetailCost():($=(T=(C=l.value)==null?void 0:C.priceCoefficients)==null?void 0:T.find(E=>E.coefficient.id===S.id))==null?void 0:$.cost},d=i.computed(()=>{var B;const S=[...((B=Y.useReferencesStore().priceCoefficientsReference)==null?void 0:B.map(C=>structuredClone(i.toRaw(C))))??[],s()];return a.value&&S.forEach(C=>{var $;const T=c(C);T?C.name+=` (${T} ${($=l.value)==null?void 0:$.currency})`:C.name=""}),S.filter(C=>C.name!=="")}),h=i.ref(n.value.coefficient),u=i.ref(((k=(v=n.value)==null?void 0:v.value)==null?void 0:k.toString())??null),m=i.ref(null),f=i.computed(()=>{var S,B;return(B=(S=l.value)==null?void 0:S.priceCoefficients)==null?void 0:B.find(C=>C.coefficient.slug===Y.PriceCoefficientEnum.K0)}),g=i.ref(void 0),p=()=>{var B,C,T;g.value=void 0;let S=Number.parseFloat(((B=u.value)==null?void 0:B.replace(",","."))??"");if(S=Number.isNaN(S)?void 0:S,a.value)if(h.value||u.value){const $=s(),E=c(h.value??$)??0,I=E+E*((S??0)/100);m.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(I),I>(((C=l.value)==null?void 0:C.getRetailCost())??I)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),f.value&&I<(((T=f.value)==null?void 0:T.cost)??0)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else m.value=null;r("update:value",{value:Number.isNaN(S)?void 0:S,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})},y=S=>{A.isArray(S)||(h.value=S,!h.value&&u.value&&(h.value=s()),p())},b=()=>{h.value||(h.value=s()),p()},_=S=>{var C,T,$,E,I,O;const B=Number.parseFloat((S==null?void 0:S.replace(",","."))??"");if(a.value){let V=0;if(B<=0)h.value=void 0,u.value=null;else if(f.value&&B<(((C=f.value)==null?void 0:C.cost)??0))h.value=(T=f.value)==null?void 0:T.coefficient,V=(B-f.value.cost)*100/f.value.cost,g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(B>((($=l.value)==null?void 0:$.getRetailCost())??B)){h.value=s();const L=((E=l.value)==null?void 0:E.getRetailCost())??0;V=(B-L)*100/L,g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const L=(O=(I=l.value)==null?void 0:I.priceCoefficients)==null?void 0:O.filter(D=>D.cost<B);if(L&&L.length>0){const D=L.at(-1);h.value=D==null?void 0:D.coefficient,V=(B-((D==null?void 0:D.cost)??0))*100/((D==null?void 0:D.cost)??1)}g.value={validationStatus:void 0,feedback:void 0}}u.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(V),r("update:value",{value:Number.isNaN(V)?void 0:V,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})}else r("update:value",{value:Number.isNaN(B)?void 0:B,coefficient:void 0})};return i.onMounted(()=>{var S,B,C,T;n.calculationType===Y.CalculationTypeEnum.m2Cost?m.value=((B=(S=n.value)==null?void 0:S.value)==null?void 0:B.toString())??null:!((C=n.value)!=null&&C.coefficient)&&((T=n.value)!=null&&T.value)&&(h.value=s()),p()}),(S,B)=>{var $,E,I;const C=z.NInput,T=z.NInputGroup;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{"show-label":!i.unref(A.isNil)(t.label),label:t.label,"show-feedback":!i.unref(A.isNil)((($=g.value)==null?void 0:$.feedback)??t.feedback),feedback:((E=g.value)==null?void 0:E.feedback)??t.feedback,"validation-status":((I=g.value)==null?void 0:I.validationStatus)??t.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==i.unref(Y.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==i.unref(Y.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(T,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(kd,{class:"w-full min-w-0 flex-1",value:h.value,"reference-list":d.value,clearable:t.clearable,disabled:t.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":y},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(C,{value:u.value,"onUpdate:value":[B[0]||(B[0]=O=>u.value=O),b],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[B[3]||(B[3]=i.createTextVNode("%",-1))]),_:2},[u.value&&!u.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[B[2]||(B[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||t.calculationType===i.unref(Y.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(C,{key:1,value:m.value,"onUpdate:value":[B[1]||(B[1]=O=>m.value=O),_],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var O;return[i.createTextVNode(i.toDisplayString((O=l.value)==null?void 0:O.currency),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),Z0={key:0,class:"flex flex-row gap-2.5"},Q0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},J0={},Cd=i.defineComponent({...J0,__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}})},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=bt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=bt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>window.innerWidth*c.value),h=()=>{s("opening"),o.value=!0,s("update:show",o.value)},u=(f="other")=>{if(a.value){s("processing:cancel",b=>{a.value=b});return}let g=!1;s("closing",f,()=>{g=!0}),g||(o.value=!1,s("update:show",o.value))},m=()=>{s("accept",g=>{a.value=g})};return i.watch(()=>r.show,f=>{f?h():u("other")}),i.watch(()=>r.processing,f=>{a.value=f}),e({open:h,close:u}),(f,g)=>{const p=z.NButton,y=z.NModal;return i.openBlock(),i.createBlock(y,{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":f.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:g[1]||(g[1]=b=>u("header")),onEsc:g[2]||(g[2]=b=>u("esc")),onMaskClick:g[3]||(g[3]=b=>u("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(f.$slots,"default")]),_:2},[f.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(f.$slots,"header")]),key:"0"}:void 0,f.$slots.action||f.$slots["extra-action"]||t.acceptButton.show||t.cancelButton.show?{name:"action",fn:i.withCtx(()=>[f.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",Z0,[i.renderSlot(f.$slots,"extra-action")])):i.createCommentVNode("",!0),f.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",Q0,[i.renderSlot(f.$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:g[0]||(g[0]=b=>u("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"])}}}),ey={class:"text-sm"},ty={class:"text-sm"},ny={},iy=i.defineComponent({...ny,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:n}){const r=i.ref(null),s=i.ref(void 0),o=i.ref(null),a=n,l=i.ref({length:{},quantity:{},marker:{}}),c=i.ref(!1),d=i.computed(()=>{var b,_,v;return r.value?((b=r.value.properties)==null?void 0:b.lengthStep)??((_=r.value.properties)!=null&&_.ignoreMinCountCheck?0:((v=r.value.properties)==null?void 0:v.minCount)??0):0}),h=i.computed(()=>{var v,k,S,B,C,T,$,E,I;if(!r.value)return"";const b=((k=(v=r.value)==null?void 0:v.properties)==null?void 0:k.minLength)??((B=(S=r.value)==null?void 0:S.properties)!=null&&B.ignoreMinCountCheck?0:(T=(C=r.value)==null?void 0:C.properties)==null?void 0:T.minCount),_=(E=($=r.value)==null?void 0:$.properties)==null?void 0:E.maxLength;return b||_?`(${b?`от ${b}`:""}${b&&_?" ":""}${_?`до ${_}`:""} ${(I=r.value)==null?void 0:I.unit})`:""}),u=b=>{var B,C;if(!((C=(B=r.value)==null?void 0:B.properties)!=null&&C.isLengthConfigurator)||!o.value||A.isNil(b)||d.value===0)return;const _=b/d.value,v=Math.round(_),k=Y.UnitsHelper.getProductMultiplicity(r.value),S=Math.max(v,k);o.value.quantity=S},m=b=>{var S,B,C,T;if(!((B=(S=r.value)==null?void 0:S.properties)!=null&&B.isLengthConfigurator)||!o.value||A.isNil(b)||d.value===0)return;const _=b*d.value,v=((C=r.value.properties)==null?void 0:C.minLength)||Y.UnitsHelper.getProductLengthMultiplicity(r.value),k=(T=r.value.properties)==null?void 0:T.maxLength;v!==void 0&&_<v?o.value.length=v:k!==void 0&&_>k?o.value.length=k:o.value.length=_},f=b=>{var v;if(!r.value||!o.value)return;const _=new Y.CartItemBase(o.value);Y.UnitsHelper.productIsMeasurable(r.value)||delete _.length,Y.UnitsHelper.productIsMeasurable(r.value)&&((v=r.value.properties)!=null&&v.isLengthConfigurator)&&d.value&&(_.length=d.value),c.value=!0,a("submit",_,l.value,()=>{c.value=!1,b(!1)})},g=()=>{r.value=null,s.value=void 0,o.value=null,l.value=y()},p=(b,_)=>{var v,k,S,B;if(r.value=b,s.value=_,o.value=new Y.CartItemBase(_??new Y.CartItemBase({product:b,quantity:1,length:((v=b==null?void 0:b.properties)==null?void 0:v.minLength)||((k=b==null?void 0:b.properties)!=null&&k.ignoreMinCountCheck?0:(S=b==null?void 0:b.properties)==null?void 0:S.minCount)||0})),(B=b==null?void 0:b.properties)!=null&&B.isLengthConfigurator&&o.value&&d.value>0){const C=d.value,T=o.value.quantity||1;o.value.length=T*C}},y=()=>({length:{},quantity:{},marker:{}});return e({show:p,closeDialog:g}),(b,_)=>(i.openBlock(),i.createBlock(Cd,{show:!i.unref(A.isNil)(r.value)&&!i.unref(A.isNil)(o.value),title:`${s.value?"Изменение":"Добавление"} товара в корзину`,"accept-button":{show:!0,text:s.value?"Изменить":"В корзину"},processing:c.value,onAccept:f,onClosing:g},{default:i.withCtx(()=>[r.value&&o.value?(i.openBlock(),i.createBlock(i.unref(z.NForm),{key:0,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.unref(Y.UnitsHelper).productIsMeasurable(r.value)?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:0,required:!0,feedback:l.value.length.feedback||"","show-feedback":l.value.length.showFeedback||i.unref(Y.UnitsHelper).getProductLengthMultiplicity(r.value)!==.01||!1,"validation-status":l.value.length.validationStatus||void 0,label:"Метраж, "+r.value.unit+h.value+"м."},i.createSlots({default:i.withCtx(()=>{var v,k,S;return[i.createVNode(i.unref(z.NInputNumber),{value:o.value.length,"onUpdate:value":[_[0]||(_[0]=B=>o.value.length=B),u],"show-button":!1,max:((v=r.value.properties)==null?void 0:v.maxLength)||void 0,min:((k=r.value.properties)==null?void 0:k.minLength)||i.unref(Y.UnitsHelper).getProductLengthMultiplicity(r.value),step:((S=r.value.properties)==null?void 0:S.lengthStep)||i.unref(Y.UnitsHelper).getProductLengthMultiplicity(r.value),validator:B=>{const C=i.unref(Y.UnitsHelper).getProductLengthMultiplicity(r.value);return Math.round(B/C)*C===B},placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]}),_:2},[!l.value.length.feedback&&i.unref(Y.UnitsHelper).getProductLengthMultiplicity(r.value)!==.01?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",ey,"Метраж должен быть кратен "+i.toDisplayString(i.unref(Y.UnitsHelper).getProductLengthMultiplicity(r.value)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status","label"])):i.createCommentVNode("",!0),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:l.value.quantity.feedback||"","show-feedback":l.value.quantity.showFeedback||i.unref(Y.UnitsHelper).getProductMultiplicity(r.value)!==1||!1,"validation-status":l.value.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputGroup),null,i.createSlots({default:i.withCtx(()=>{var v;return[i.createVNode(i.unref(z.NInputNumber),{value:o.value.quantity,"onUpdate:value":[_[1]||(_[1]=k=>o.value.quantity=k),m],"show-button":!1,min:i.unref(Y.UnitsHelper).getProductMultiplicity(r.value),step:i.unref(Y.UnitsHelper).getProductMultiplicity(r.value),validator:k=>k%i.unref(Y.UnitsHelper).getProductMultiplicity(r.value)===0,placeholder:"Введите количество",class:"w-full"},null,8,["value","min","step","validator"]),(v=r.value.properties)!=null&&v.isLengthConfigurator?(i.openBlock(),i.createBlock(i.unref(z.NInputGroupLabel),{key:0,class:"bg-orange-100 font-bold"},{default:i.withCtx(()=>[i.createTextVNode(" x "+i.toDisplayString(d.value)+" "+i.toDisplayString(r.value.unit),1)]),_:1})):i.createCommentVNode("",!0)]}),_:2},[!l.value.quantity.feedback&&i.unref(Y.UnitsHelper).getProductMultiplicity(r.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",ty,"Количество должно быть кратно "+i.toDisplayString(i.unref(Y.UnitsHelper).getProductMultiplicity(r.value)),1)]),key:"0"}:void 0]),1024)]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{feedback:l.value.marker.feedback||"","show-feedback":l.value.marker.showFeedback||!1,"validation-status":l.value.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:o.value.marker,"onUpdate:value":_[2]||(_[2]=v=>o.value.marker=v),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"])]),_:1})):i.createCommentVNode("",!0)]),_:1},8,["show","title","accept-button","processing"]))}}),ry={class:"flex flex-row gap-1"},sy={class:"sc-client-name flex flex-col gap-1 text-base"},oy=["href"],ay={key:1,class:"text-sc-grey"},ly={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},cy={key:0},dy={key:1,class:"text-sm"},hy={},os=i.defineComponent({...hy,__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?Mn.format(n.client.lastLoginAt,Y.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{A.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Fs,d=z.NButton,h=z.NPopover;return i.openBlock(),i.createElementBlock("div",ry,[t.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=u=>a.$emit("click:client-info",t.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(A.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",sy,[i.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=u=>o(u))},[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",ay," [ Деактивирован ] "))],8,oy),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",ly," г. "+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",cy,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",dy," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),uy={class:"text-base"},fy={},Sd=i.defineComponent({...fy,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",uy,i.toDisplayString(t.contragent.name),1))}}),gy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function my(t,e){return i.openBlock(),i.createElementBlock("svg",gy,[...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 py=i.markRaw({name:"tabler-mail",render:my}),yy=["href"],by={},_y=i.defineComponent({...by,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=py;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,yy)],2)}}}),wy={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xy(t,e){return i.openBlock(),i.createElementBlock("svg",wy,[...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 Bd=i.markRaw({name:"fa6-brands-viber",render:xy}),vy={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},ky=["id"],Cy=["id"],Sy=["fill"],By=["fill"];function Ty(t,e){return i.openBlock(),i.createElementBlock("svg",vy,[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,ky),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,Cy)]),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,Sy),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,By),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 Td=i.markRaw({name:"logos-whatsapp-icon",render:Ty,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),Ry={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},$y=["id"],Ey=["fill"];function Ny(t,e){return i.openBlock(),i.createElementBlock("svg",Ry,[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,$y)]),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,Ey),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 Rd=i.markRaw({name:"logos-telegram",render:Ny,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),Py={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Fy(t,e){return i.openBlock(),i.createElementBlock("svg",Py,[...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 $d=i.markRaw({name:"ion-call",render:Fy}),My={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ay(t,e){return i.openBlock(),i.createElementBlock("svg",My,[...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 Vy=i.markRaw({name:"tabler-phone-call",render:Ay}),Iy={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},Oy=["href"],zy=["href"],Ly=["href"],Dy=["href"],Hy={},Wy=i.defineComponent({...Hy,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{try{return e.phone?Ji.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=i.computed(()=>{var l;return A.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return A.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return A.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=Vy,h=$d,u=Rd,m=Td,f=Bd;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]=g=>a.value=!a.value),onFocusout:c[1]||(c[1]=g=>a.value=!1),onMouseleave:c[2]||(c[2]=g=>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",Iy,[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(h)],8,Oy)):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(u)],8,zy)):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,Ly)):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(f)],8,Dy)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),jy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qy(t,e){return i.openBlock(),i.createElementBlock("svg",jy,[...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 Xy=i.markRaw({name:"mdi-envelope",render:qy}),Yy={class:"flex flex-col gap-1"},Uy={key:0,class:"mb-2 flex flex-col text-base"},Gy={key:0,class:"text-sc-dark-grey text-sm"},Ky={key:1,class:"whitespace-nowrap text-sm"},Zy={key:2,class:"whitespace-nowrap text-sm"},Qy={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Jy=["href"],eb=["href"],tb=["href"],nb=["href"],ib=["href"],rb={key:0,class:"flex flex-col text-base"},sb={key:0,class:"text-sc-dark-grey text-sm"},ob={key:1,class:"mt-2 text-sm"},ab={key:0,class:"-mt-1"},lb={},cb=i.defineComponent({...lb,__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?Ji.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),r=i.computed(()=>{var c;return A.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return A.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return A.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 y,b;const h=$d,u=Rd,m=Td,f=Bd,g=Xy,p=z.NPopover;return i.openBlock(),i.createElementBlock("div",Yy,[i.createVNode(p,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var _,v,k,S;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]=B=>l.value=!0),onFocusin:d[1]||(d[1]=B=>l.value=!0),onMouseleave:d[2]||(d[2]=B=>l.value=!1),onFocusout:d[3]||(d[3]=B=>l.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(v=t.contact)!=null&&v.position)?(i.openBlock(),i.createElementBlock("div",Uy,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(k=t.contact)!=null&&k.position?(i.openBlock(),i.createElementBlock("span",Gy,i.toDisplayString((S=t.contact)==null?void 0:S.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.contact.phone?(i.openBlock(),i.createElementBlock("div",Ky,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",Zy,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",Qy,[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(h)],8,Jy)):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(u)],8,eb)):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,tb)):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(f)],8,nb)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(g)],8,ib)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var _,v,k,S;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",rb,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(_=t.contact)!=null&&_.position?(i.openBlock(),i.createElementBlock("span",sb,i.toDisplayString((v=t.contact)==null?void 0:v.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(k=t.contact)!=null&&k.comment?(i.openBlock(),i.createElementBlock("div",ob,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((S=t.contact)==null?void 0:S.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((y=t.contact)!=null&&y.comment)?(i.openBlock(),i.createElementBlock("div",ab,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((b=t.contact)==null?void 0:b.comment),1)])):i.createCommentVNode("",!0)])}}}),db={class:"flex flex-wrap gap-2"},hb={class:"flex flex-col"},ub={class:"flex flex-col"},fb={},gb=i.defineComponent({...fb,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>Y.AppConfigProvider.getConfig().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 A.forOwn(Y.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?Mn.startOfDay(new Date(a)):void 0,to:l?Mn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,u,m,f,g,p;const c=z.NButton,d=z.NDatePicker;return i.openBlock(),i.createElementBlock("div",db,[i.createVNode(d,{value:((u=(h=t.dateRange)==null?void 0:h.from)==null?void 0:u.getTime())??null,clearable:t.clearable,"is-date-disabled":y=>{var b,_;return((b=t.dateRange)==null?void 0:b.to)&&y>((_=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]=y=>{var b,_;return o(y,(_=(b=t.dateRange)==null?void 0:b.to)==null?void 0:_.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",hb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(y,b)=>(i.openBlock(),i.createBlock(c,{key:b,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var v,k;return o((v=y==null?void 0:y.from)==null?void 0:v.getTime(),(k=y==null?void 0:y.to)==null?void 0:k.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(y.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"]),i.createVNode(d,{value:((g=(f=t.dateRange)==null?void 0:f.to)==null?void 0:g.getTime())??null,clearable:t.clearable,"is-date-disabled":y=>{var b,_;return((b=t.dateRange)==null?void 0:b.from)&&y<((_=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]=y=>{var b,_;return o((_=(b=t.dateRange)==null?void 0:b.from)==null?void 0:_.getTime(),y)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",ub,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(y,b)=>(i.openBlock(),i.createBlock(c,{key:b,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var v,k;return o((v=y==null?void 0:y.from)==null?void 0:v.getTime(),(k=y==null?void 0:y.to)==null?void 0:k.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(y.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"])])}}}),mb={class:"sc-lbl-date text-nowrap"},pb={},Po=i.defineComponent({...pb,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>Mn.format(e.date,Y.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Mn.format(e.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",mb,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))}}),yb={class:"flex flex-row gap-2.5"},bb={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},_b={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},wb={class:"mb-0.5 sm:mb-0 sm:ml-3"},xb={},vb=i.defineComponent({...xb,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=ss,s=z.NButton,o=z.NPopover;return i.openBlock(),i.createElementBlock("div",yb,[i.createElementVNode("div",bb,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",_b,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",wb,[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)])])])])}}}),kb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Cb(t,e){return i.openBlock(),i.createElementBlock("svg",kb,[...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 Sb=i.markRaw({name:"ion-download-outline",render:Cb}),Bb={},Tb=i.defineComponent({...Bb,__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 h=new FileReader;h.addEventListener("load",()=>{c.content=h.result??"",r("update:file",c)}),h.readAsDataURL(d.file)};return(l,c)=>{const d=Sb;return i.openBlock(),i.createBlock(i.unref(z.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(z.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"])}}}),Rb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $b(t,e){return i.openBlock(),i.createElementBlock("svg",Rb,[...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 Eb=i.markRaw({name:"ion-checkmark-done-sharp",render:$b}),Nb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Pb(t,e){return i.openBlock(),i.createElementBlock("svg",Nb,[...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 Fb=i.markRaw({name:"ion-options-outline",render:Pb}),Mb={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},Ab={class:"flex-auto"},Vb={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"},Ib={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"},Ob={},Fo=i.defineComponent({...Ob,__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 h=Fb,u=z.NButton,m=z.NPopover,f=Eb,g=ss;return i.openBlock(),i.createElementBlock("div",Mb,[i.createElementVNode("div",Ab,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",Vb,[i.createElementVNode("div",Ib,[t.showEditButton?(i.openBlock(),i.createBlock(m,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:t.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(h)]),_: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(u,{disabled:t.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(f)]),_: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(u,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),zb={},Ed=i.defineComponent({...zb,__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(Fo,{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(Fo,{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"]))]))}}),Lb={},Db=i.defineComponent({...Lb,__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=A.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(z.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),Hb={},Wb=i.defineComponent({...Hb,__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=A.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(A.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(A.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof Ji.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 h=Ji.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof Ji.ParseError)s.value=d;else throw h}};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(Au.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=h=>s.value=h),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"]))}}),jb=Zn(Wb,[["__scopeId","data-v-751dbb0e"]]),qb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Xb(t,e){return i.openBlock(),i.createElementBlock("svg",qb,[...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 Yb=i.markRaw({name:"tabler-external-link",render:Xb}),Ub={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},Gb=["href"],Kb={},Zb=i.defineComponent({...Kb,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=Yb,s=z.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(A.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",Ub,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,Gb),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),Qb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jb(t,e){return i.openBlock(),i.createElementBlock("svg",Qb,[...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 e_=i.markRaw({name:"ion-remove-circle-outline",render:Jb});let as=[];const Nd=new WeakMap;function t_(){as.forEach(t=>t(...Nd.get(t))),as=[]}function Pd(t,...e){Nd.set(t,e),!as.includes(t)&&as.push(t)===1&&requestAnimationFrame(t_)}function cr(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function dr(t){return t.composedPath()[0]||null}function hr(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function ur(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function Yt(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 Fd={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 n_(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 i_(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 dn="^\\s*",hn="\\s*$",Ln="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Mt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",si="([0-9A-Fa-f])",oi="([0-9A-Fa-f]{2})",Md=new RegExp(`${dn}hsl\\s*\\(${Mt},${Ln},${Ln}\\)${hn}`),Ad=new RegExp(`${dn}hsv\\s*\\(${Mt},${Ln},${Ln}\\)${hn}`),Vd=new RegExp(`${dn}hsla\\s*\\(${Mt},${Ln},${Ln},${Mt}\\)${hn}`),Id=new RegExp(`${dn}hsva\\s*\\(${Mt},${Ln},${Ln},${Mt}\\)${hn}`),r_=new RegExp(`${dn}rgb\\s*\\(${Mt},${Mt},${Mt}\\)${hn}`),s_=new RegExp(`${dn}rgba\\s*\\(${Mt},${Mt},${Mt},${Mt}\\)${hn}`),o_=new RegExp(`${dn}#${si}${si}${si}${hn}`),a_=new RegExp(`${dn}#${oi}${oi}${oi}${hn}`),l_=new RegExp(`${dn}#${si}${si}${si}${si}${hn}`),c_=new RegExp(`${dn}#${oi}${oi}${oi}${oi}${hn}`);function $t(t){return parseInt(t,16)}function d_(t){try{let e;if(e=Vd.exec(t))return[cs(e[1]),Dn(e[5]),Dn(e[9]),li(e[13])];if(e=Md.exec(t))return[cs(e[1]),Dn(e[5]),Dn(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function h_(t){try{let e;if(e=Id.exec(t))return[cs(e[1]),Dn(e[5]),Dn(e[9]),li(e[13])];if(e=Ad.exec(t))return[cs(e[1]),Dn(e[5]),Dn(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function ai(t){try{let e;if(e=a_.exec(t))return[$t(e[1]),$t(e[2]),$t(e[3]),1];if(e=r_.exec(t))return[dt(e[1]),dt(e[5]),dt(e[9]),1];if(e=s_.exec(t))return[dt(e[1]),dt(e[5]),dt(e[9]),li(e[13])];if(e=o_.exec(t))return[$t(e[1]+e[1]),$t(e[2]+e[2]),$t(e[3]+e[3]),1];if(e=c_.exec(t))return[$t(e[1]),$t(e[2]),$t(e[3]),li($t(e[4])/255)];if(e=l_.exec(t))return[$t(e[1]+e[1]),$t(e[2]+e[2]),$t(e[3]+e[3]),li($t(e[4]+e[4])/255)];if(t in Fd)return ai(Fd[t]);if(Md.test(t)||Vd.test(t)){const[n,r,s,o]=d_(t);return[...i_(n,r,s),o]}else if(Ad.test(t)||Id.test(t)){const[n,r,s,o]=h_(t);return[...n_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function u_(t){return t>1?1:t<0?0:t}function Mo(t,e,n,r){return`rgba(${dt(t)}, ${dt(e)}, ${dt(n)}, ${u_(r)})`}function Ao(t,e,n,r,s){return dt((t*e*(1-r)+n*r)/s)}function f_(t,e){Array.isArray(t)||(t=ai(t)),Array.isArray(e)||(e=ai(e));const n=t[3],r=e[3],s=li(n+r-n*r);return Mo(Ao(t[0],n,e[0],r,s),Ao(t[1],n,e[1],r,s),Ao(t[2],n,e[2],r,s),s)}function Fe(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:ai(t);return typeof e.alpha=="number"?Mo(n,r,s,e.alpha):Mo(n,r,s,o)}function ls(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:ai(t),{lightness:a=1,alpha:l=1}=e;return g_([n*a,r*a,s*a,o*l])}function li(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function cs(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function dt(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Dn(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function g_(t){const[e,n,r]=t;return 3 in t?`rgba(${dt(e)}, ${dt(n)}, ${dt(r)}, ${li(t[3])})`:`rgba(${dt(e)}, ${dt(n)}, ${dt(r)}, 1)`}function m_(t=8){return Math.random().toString(16).slice(2,2+t)}function Od(t){return Array.isArray(t)?t:[t]}const Vo={STOP:"STOP"};function zd(t,e){const n=e(t);t.children!==void 0&&n!==Vo.STOP&&t.children.forEach(r=>zd(r,e))}function p_(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 y_(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function b_(t){return t.children}function __(t){return t.key}function w_(){return!1}function x_(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function v_(t){return t.disabled===!0}function k_(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function C_(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function Io(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Oo(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function S_(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function B_(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function T_(t){return(t==null?void 0:t.type)==="group"}function R_(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 $_ extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function E_(t,e,n,r){return ds(e.concat(t),n,r,!1)}function N_(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 P_(t,e,n,r){const s=ds(e,n,r,!1),o=ds(t,n,r,!0),a=N_(t,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function zo(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:S_(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:B_(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=e;let u;s!==void 0?u=P_(s,n,e,d):r!==void 0?u=E_(r,n,e,d):u=ds(n,e,d,!1);const m=c==="parent",f=c==="child"||l,g=u,p=new Set,y=Math.max.apply(null,Array.from(h.keys()));for(let b=y;b>=0;b-=1){const _=b===0,v=h.get(b);for(const k of v){if(k.isLeaf)continue;const{key:S,shallowLoaded:B}=k;if(f&&B&&k.children.forEach(E=>{!E.disabled&&!E.isLeaf&&E.shallowLoaded&&g.has(E.key)&&g.delete(E.key)}),k.disabled||!B)continue;let C=!0,T=!1,$=!0;for(const E of k.children){const I=E.key;if(!E.disabled){if($&&($=!1),g.has(I))T=!0;else if(p.has(I)){T=!0,C=!1;break}else if(C=!1,T)break}}C&&!$?(m&&k.children.forEach(E=>{!E.disabled&&g.has(E.key)&&g.delete(E.key)}),g.add(S)):T&&p.add(S),_&&f&&g.has(S)&&g.delete(S)}}return{checkedKeys:Array.from(g),indeterminateKeys:Array.from(p)}}function ds(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&&zd(d,h=>{if(h.disabled)return Vo.STOP;const{key:u}=h;if(!a.has(u)&&(a.add(u),l.add(u),k_(h.rawNode,o))){if(r)return Vo.STOP;if(!n)throw new $_}})}),l}function F_(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 M_(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function A_(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 Ld(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const s=e==="prev"?V_:A_,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 h=Lo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const u=I_(d);u!=null&&u.isGroup?c(s(u,n)):n&&c(s(d,!0))}}}}return c(t),l}function V_(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 I_(t){return t.parent}function Lo(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 h=Lo(d,e);if(h!==null)return h}else return d}}return null}const O_={getChild(){return this.ignored?null:Lo(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return Ld(this,"next",t)},getPrev(t={}){return Ld(this,"prev",t)}};function z_(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 L_(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var D_={};function Dd(t,e,n,r,s,o=null,a=0){const l=[];return t.forEach((c,d)=>{var h;D_.NODE_ENV!=="production"&&C_(c,s)&&console.error("[treemate]: node",c,"is invalid");const u=Object.create(r);if(u.rawNode=c,u.siblings=l,u.level=a,u.index=d,u.isFirstChild=d===0,u.isLastChild=d+1===t.length,u.parent=o,!u.ignored){const m=s(c);Array.isArray(m)&&(u.children=Dd(m,e,n,r,s,u,a+1))}l.push(u),e.set(u.key,u),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(u)}),l}function H_(t,e={}){var n;const r=new Map,s=new Map,{getDisabled:o=v_,getIgnored:a=w_,getIsGroup:l=T_,getKey:c=__}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:b_,h=e.ignoreEmptyChildren?k=>{const S=d(k);return Array.isArray(S)?S.length?S:null:S}:d,u=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return y_(this.rawNode,h)},get shallowLoaded(){return x_(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(k){return L_(this,k)}},O_),m=Dd(t,r,s,u,h);function f(k){if(k==null)return null;const S=r.get(k);return S&&!S.isGroup&&!S.ignored?S:null}function g(k){if(k==null)return null;const S=r.get(k);return S&&!S.ignored?S:null}function p(k,S){const B=g(k);return B?B.getPrev(S):null}function y(k,S){const B=g(k);return B?B.getNext(S):null}function b(k){const S=g(k);return S?S.getParent():null}function _(k){const S=g(k);return S?S.getChild():null}const v={treeNodes:m,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(k){return z_(m,k)},getNode:f,getPrev:p,getNext:y,getParent:b,getChild:_,getFirstAvailableNode(){return M_(m)},getPath(k,S={}){return F_(k,S,v)},getCheckedKeys(k,S={}){const{cascade:B=!0,leafOnly:C=!1,checkStrategy:T="all",allowNotLoaded:$=!1}=S;return zo({checkedKeys:Io(k),indeterminateKeys:Oo(k),cascade:B,leafOnly:C,checkStrategy:T,allowNotLoaded:$},v)},check(k,S,B={}){const{cascade:C=!0,leafOnly:T=!1,checkStrategy:$="all",allowNotLoaded:E=!1}=B;return zo({checkedKeys:Io(S),indeterminateKeys:Oo(S),keysToCheck:k==null?[]:Od(k),cascade:C,leafOnly:T,checkStrategy:$,allowNotLoaded:E},v)},uncheck(k,S,B={}){const{cascade:C=!0,leafOnly:T=!1,checkStrategy:$="all",allowNotLoaded:E=!1}=B;return zo({checkedKeys:Io(S),indeterminateKeys:Oo(S),keysToUncheck:k==null?[]:Od(k),cascade:C,leafOnly:T,checkStrategy:$,allowNotLoaded:E},v)},getNonLeafKeys(k={}){return p_(m,k)}};return v}function hs(t){return t.composedPath()[0]}const W_={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function j_(t,e,n){if(t==="mousemoveoutside"){const r=s=>{e.contains(hs(s))||n(s)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const s=a=>{r=!e.contains(hs(a))},o=a=>{r&&(e.contains(hs(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 Hd(t,e,n){const r=W_[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=j_(t,e,n)),o}function q_(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=Hd(t,e,n);return Object.keys(s).forEach(o=>{kt(o,document,s[o],r)}),!0}return!1}function X_(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=Hd(t,e,n);return Object.keys(s).forEach(o=>{et(o,document,s[o],r)}),!0}return!1}function Y_(){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(C,T,$){const E=C[T];return C[T]=function(){return $.apply(C,arguments),E.apply(C,arguments)},C}function o(C,T){C[T]=Event.prototype[T]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var C;return(C=a.get(this))!==null&&C!==void 0?C:null}function d(C,T){l!==void 0&&Object.defineProperty(C,"currentTarget",{configurable:!0,enumerable:!0,get:T??l.get})}const h={bubble:{},capture:{}},u={};function m(){const C=function(T){const{type:$,eventPhase:E,bubbles:I}=T,O=hs(T);if(E===2)return;const V=E===1?"capture":"bubble";let L=O;const D=[];for(;L===null&&(L=window),D.push(L),L!==window;)L=L.parentNode||null;const ee=h.capture[$],N=h.bubble[$];if(s(T,"stopPropagation",n),s(T,"stopImmediatePropagation",r),d(T,c),V==="capture"){if(ee===void 0)return;for(let P=D.length-1;P>=0&&!t.has(T);--P){const H=D[P],q=ee.get(H);if(q!==void 0){a.set(T,H);for(const U of q){if(e.has(T))break;U(T)}}if(P===0&&!I&&N!==void 0){const U=N.get(H);if(U!==void 0)for(const F of U){if(e.has(T))break;F(T)}}}}else if(V==="bubble"){if(N===void 0)return;for(let P=0;P<D.length&&!t.has(T);++P){const H=D[P],q=N.get(H);if(q!==void 0){a.set(T,H);for(const U of q){if(e.has(T))break;U(T)}}}}o(T,"stopPropagation"),o(T,"stopImmediatePropagation"),d(T)};return C.displayName="evtdUnifiedHandler",C}function f(){const C=function(T){const{type:$,eventPhase:E}=T;if(E!==2)return;const I=u[$];I!==void 0&&I.forEach(O=>O(T))};return C.displayName="evtdUnifiedWindowEventHandler",C}const g=m(),p=f();function y(C,T){const $=h[C];return $[T]===void 0&&($[T]=new Map,window.addEventListener(T,g,C==="capture")),$[T]}function b(C){return u[C]===void 0&&(u[C]=new Set,window.addEventListener(C,p)),u[C]}function _(C,T){let $=C.get(T);return $===void 0&&C.set(T,$=new Set),$}function v(C,T,$,E){const I=h[T][$];if(I!==void 0){const O=I.get(C);if(O!==void 0&&O.has(E))return!0}return!1}function k(C,T){const $=u[C];return!!($!==void 0&&$.has(T))}function S(C,T,$,E){let I;if(typeof E=="object"&&E.once===!0?I=ee=>{B(C,T,I,E),$(ee)}:I=$,q_(C,T,I,E))return;const V=E===!0||typeof E=="object"&&E.capture===!0?"capture":"bubble",L=y(V,C),D=_(L,T);if(D.has(I)||D.add(I),T===window){const ee=b(C);ee.has(I)||ee.add(I)}}function B(C,T,$,E){if(X_(C,T,$,E))return;const O=E===!0||typeof E=="object"&&E.capture===!0,V=O?"capture":"bubble",L=y(V,C),D=_(L,T);if(T===window&&!v(T,O?"bubble":"capture",C,$)&&k(C,$)){const N=u[C];N.delete($),N.size===0&&(window.removeEventListener(C,p),u[C]=void 0)}D.has($)&&D.delete($),D.size===0&&L.delete(T),L.size===0&&(window.removeEventListener(C,g,V==="capture"),h[V][C]=void 0)}return{on:S,off:B}}const{on:kt,off:et}=Y_(),Hi="@@mmoContext",U_={mounted(t,{value:e}){t[Hi]={handler:void 0},typeof e=="function"&&(t[Hi].handler=e,kt("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Hi];typeof e=="function"?n.handler?n.handler!==e&&(et("mousemoveoutside",t,n.handler),n.handler=e,kt("mousemoveoutside",t,e)):(t[Hi].handler=e,kt("mousemoveoutside",t,e)):n.handler&&(et("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Hi];e&&et("mousemoveoutside",t,e),t[Hi].handler=void 0}},Wi="@@coContext",us={mounted(t,{value:e,modifiers:n}){t[Wi]={handler:void 0},typeof e=="function"&&(t[Wi].handler=e,kt("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Wi];typeof e=="function"?r.handler?r.handler!==e&&(et("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,kt("clickoutside",t,e,{capture:n.capture})):(t[Wi].handler=e,kt("clickoutside",t,e,{capture:n.capture})):r.handler&&(et("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Wi];n&&et("clickoutside",t,n,{capture:e.capture}),t[Wi].handler=void 0}};function G_(t,e){console.error(`[vdirs/${t}]: ${e}`)}class K_{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&&G_("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 Do=new K_,ji="@@ziContext",Wd={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n;t[ji]={enabled:!!s,initialized:!1},s&&(Do.ensureZIndex(t,r),t[ji].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n,o=t[ji].enabled;s&&!o&&(Do.ensureZIndex(t,r),t[ji].initialized=!0),t[ji].enabled=!!s},unmounted(t,e){if(!t[ji].initialized)return;const{value:n={}}=e,{zIndex:r}=n;Do.unregister(t,r)}};function Z_(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 Wt(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 Q_=typeof window<"u";let qi,fr;(()=>{var t,e;qi=Q_?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,fr=!1,qi!==void 0?qi.then(()=>{fr=!0}):fr=!0})();function J_(t){if(fr)return;let e=!1;i.onMounted(()=>{fr||qi==null||qi.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Ho(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function fs(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function jd(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 e1=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function t1(){return e1}function Wo(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function jo(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)){jo(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&jo(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function qd(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const s=jo(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let Hn=null;function Xd(){if(Hn===null&&(Hn=document.getElementById("v-binder-view-measurer"),Hn===null)){Hn=document.createElement("div"),Hn.id="v-binder-view-measurer";const{style:t}=Hn;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(Hn)}return Hn.getBoundingClientRect()}function n1(t,e){const n=Xd();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=Xd();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 i1(t){return t.nodeType===9?null:t.parentNode}function Yd(t){if(t===null)return null;const e=i1(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 Yd(e)}const Ud=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=b=>{r.value=b,n&&t.syncTargetWithParent&&n.setTargetRef(b)};let o=[];const a=()=>{let b=r.value;for(;b=Yd(b),b!==null;)o.push(b);for(const _ of o)kt("scroll",_,u,!0)},l=()=>{for(const b of o)et("scroll",b,u,!0);o=[]},c=new Set,d=b=>{c.size===0&&a(),c.has(b)||c.add(b)},h=b=>{c.has(b)&&c.delete(b),c.size===0&&l()},u=()=>{Pd(m)},m=()=>{c.forEach(b=>b())},f=new Set,g=b=>{f.size===0&&kt("resize",window,y),f.has(b)||f.add(b)},p=b=>{f.has(b)&&f.delete(b),f.size===0&&et("resize",window,y)},y=()=>{f.forEach(b=>b())};return i.onBeforeUnmount(()=>{et("resize",window,y),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:g,removeResizeListener:p}},render(){return Wo("binder",this.$slots)}}),Gd=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(qd("follower",this.$slots),[[e]]):qd("follower",this.$slots)}}),r1="@css-render/vue3-ssr";function s1(t,e){return`<style cssr-id="${t}">
|
|
104
104
|
${e}
|
|
105
105
|
</style>`}function o1(t,e,n){const{styles:r,ids:s}=n;s.has(t)||r!==null&&(s.add(t),r.push(s1(t,e)))}const a1=typeof document<"u";function ci(){if(a1)return;const t=i.inject(r1,null);if(t!==null)return{adapter:(e,n)=>o1(e,n,t),context:t}}function Kd(t,e){console.error(`[vueuc/${t}]: ${e}`)}function l1(t){let e=0;for(let n=0;n<t.length;++n)t[n]==="&"&&++e;return e}const Zd=/\s*,(?![^(]*\))\s*/g,c1=/\s+/g;function d1(t,e){const n=[];return e.split(Zd).forEach(r=>{let s=l1(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 h1(t,e){const n=[];return e.split(Zd).forEach(r=>{t.forEach(s=>{n.push((s&&s+" ")+r)})}),n}function u1(t){let e=[""];return t.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?e=d1(e,n):e=h1(e,n))}),e.join(", ").replace(c1," ")}function Qd(t){if(!t)return;const e=t.parentElement;e&&e.removeChild(t)}function gs(t,e){return(e??document.head).querySelector(`style[cssr-id="${t}"]`)}function f1(t){const e=document.createElement("style");return e.setAttribute("cssr-id",t),e}function ms(t){return t?/^\s*@(s|m)/.test(t):!1}const g1=/[A-Z]/g;function Jd(t){return t.replace(g1,e=>"-"+e.toLowerCase())}function m1(t,e=" "){return typeof t=="object"&&t!==null?` {
|
|
106
106
|
`+Object.entries(t).map(n=>e+` ${Jd(n[0])}: ${n[1]};`).join(`
|
|
@@ -113,7 +113,7 @@ ${s}
|
|
|
113
113
|
`);return}l=Jd(l),c!=null&&a.push(` ${l}${m1(c)}`)}),t&&a.push("}"),a.join(`
|
|
114
114
|
`)}function Xo(t,e,n){t&&t.forEach(r=>{if(Array.isArray(r))Xo(r,e,n);else if(typeof r=="function"){const s=r(e);Array.isArray(s)?Xo(s,e,n):s&&n(s)}else r&&n(r)})}function th(t,e,n,r,s){const o=t.$;let a="";if(!o||typeof o=="string")ms(o)?a=o:e.push(o);else if(typeof o=="function"){const d=o({context:r.context,props:s});ms(d)?a=d:e.push(d)}else if(o.before&&o.before(r.context),!o.$||typeof o.$=="string")ms(o.$)?a=o.$:e.push(o.$);else if(o.$){const d=o.$({context:r.context,props:s});ms(d)?a=d:e.push(d)}const l=u1(e),c=eh(l,t.props,r,s);a?n.push(`${a} {`):c.length&&n.push(c),t.children&&Xo(t.children,{context:r.context,props:s},d=>{if(typeof d=="string"){const h=eh(l,{raw:d},r,s);n.push(h)}else th(d,e,n,r,s)}),e.pop(),a&&n.push("}"),o&&o.after&&o.after(r.context)}function y1(t,e,n){const r=[];return th(t,[],r,e,n),r.join(`
|
|
115
115
|
|
|
116
|
-
`)}function Yo(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 b1(t,e,n,r){const{els:s}=e;if(n===void 0)s.forEach(Qd),e.els=[];else{const o=gs(n,r);o&&s.includes(o)&&(Qd(o),e.els=s.filter(a=>a!==o))}}function nh(t,e){t.push(e)}function _1(t,e,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=Yo(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const h=gs(n,l);if(h!==null&&!o)return h;const u=h??f1(n);if(d===void 0&&(d=e.render(r)),u.textContent=d,h!==null)return h;if(a){const m=l.querySelector(`meta[name="${a}"]`);if(m)return l.insertBefore(u,m),nh(e.els,u),u}return s?l.insertBefore(u,l.querySelector("style, link")):l.appendChild(u),nh(e.els,u),u}function w1(t){return y1(this,this.instance,t)}function x1(t={}){const{id:e,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=t;return _1(this.instance,this,e,r,s,o,a,l,n)}function v1(t={}){const{id:e,parent:n}=t;b1(this.instance,this,e,n)}const ps=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:w1,mount:x1,unmount:v1}},k1=function(t,e,n,r){return Array.isArray(e)?ps(t,{$:null},null,e):Array.isArray(n)?ps(t,e,null,n):Array.isArray(r)?ps(t,e,n,r):ps(t,e,n,null)};function ih(t={}){const e={c:((...n)=>k1(e,...n)),use:(n,...r)=>n.install(e,...r),find:gs,context:{},config:t};return e}function C1(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return gs(t)!==null}const{c:Wn}=ih(),Uo="vueuc-style";function rh(t){return t&-t}class sh{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+=rh(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-=rh(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 oh(t){return typeof t=="string"?document.querySelector(t):t()||null}const S1=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:Z_(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Wo("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Wo("lazy-teleport",this.$slots)):null}}),ys={top:"bottom",bottom:"top",left:"right",right:"left"},ah={start:"end",center:"center",end:"start"},Go={top:"height",bottom:"height",left:"width",right:"width"},B1={"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"},T1={"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"},R1={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},lh={top:!0,bottom:!1,left:!0,right:!1},ch={top:"end",bottom:"start",left:"end",right:"start"};function $1(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 h=(f,g,p)=>{let y=0,b=0;const _=n[f]-e[g]-e[f];return _>0&&r&&(p?b=lh[g]?_:-_:y=lh[g]?_:-_),{left:y,top:b}},u=a==="left"||a==="right";if(c!=="center"){const f=R1[t],g=ys[f],p=Go[f];if(n[p]>e[p]){if(e[f]+e[p]<n[p]){const y=(n[p]-e[p])/2;e[f]<y||e[g]<y?e[f]<e[g]?(c=ah[l],d=h(p,g,u)):d=h(p,f,u):c="center"}}else n[p]<e[p]&&e[g]<0&&e[f]>e[g]&&(c=ah[l])}else{const f=a==="bottom"||a==="top"?"left":"top",g=ys[f],p=Go[f],y=(n[p]-e[p])/2;(e[f]<y||e[g]<y)&&(e[f]>e[g]?(c=ch[f],d=h(p,f,u)):(c=ch[g],d=h(p,g,u)))}let m=a;return e[a]<n[Go[a]]&&e[a]<e[ys[a]]&&(m=ys[a]),{placement:c!=="center"?`${m}-${c}`:m,left:d.left,top:d.top}}function E1(t,e){return e?T1[t]:B1[t]}function N1(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 P1=Wn([Wn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Wn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Wn("> *",{pointerEvents:"all"})])]),dh=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=Wt(()=>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=ci();P1.mount({id:"vueuc/binder",head:!0,anchorMetaName:Uo,ssr:l}),i.onBeforeUnmount(()=>{a()}),J_(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const m=r.value;if(m===null)return;const f=e.targetRef,{x:g,y:p,overlap:y}=t,b=g!==void 0&&p!==void 0?n1(g,p):qo(f);m.style.setProperty("--v-target-width",`${Math.round(b.width)}px`),m.style.setProperty("--v-target-height",`${Math.round(b.height)}px`);const{width:_,minWidth:v,placement:k,internalShift:C,flip:B}=t;m.setAttribute("v-placement",k),y?m.setAttribute("v-overlap",""):m.removeAttribute("v-overlap");const{style:S}=m;_==="target"?S.width=`${b.width}px`:_!==void 0?S.width=_:S.width="",v==="target"?S.minWidth=`${b.width}px`:v!==void 0?S.minWidth=v:S.minWidth="";const T=qo(m),$=qo(s.value),{left:E,top:O,placement:I}=$1(k,b,T,C,B,y),A=E1(I,y),{left:L,top:D,transform:ee}=N1(I,$,b,O,E,y);m.setAttribute("v-placement",I),m.style.setProperty("--v-offset-left",`${Math.round(E)}px`),m.style.setProperty("--v-offset-top",`${Math.round(O)}px`),m.style.transform=`translateX(${L}) translateY(${D}) ${ee}`,m.style.setProperty("--v-transform-origin",A),m.style.transformOrigin=A};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 h=fs(),u=Wt(()=>{const{to:m}=t;if(m!==void 0)return m;h.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:u,syncPosition:c}},render(){return i.h(S1,{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,[[Wd,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var di=[],F1=function(){return di.some(function(t){return t.activeTargets.length>0})},M1=function(){return di.some(function(t){return t.skippedTargets.length>0})},hh="ResizeObserver loop completed with undelivered notifications.",A1=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:hh}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=hh),window.dispatchEvent(t)},gr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(gr||(gr={}));var hi=function(t){return Object.freeze(t)},V1=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,hi(this)}return t})(),uh=(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,hi(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})(),Ko=function(t){return t instanceof SVGElement&&"getBBox"in t},fh=function(t){if(Ko(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)},gh=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)},O1=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},mr=typeof window<"u"?window:{},bs=new WeakMap,mh=/auto|scroll/,I1=/^tb|vertical/,z1=/msie|trident/i.test(mr.navigator&&mr.navigator.userAgent),un=function(t){return parseFloat(t||"0")},Xi=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new V1((n?e:t)||0,(n?t:e)||0)},ph=hi({devicePixelContentBoxSize:Xi(),borderBoxSize:Xi(),contentBoxSize:Xi(),contentRect:new uh(0,0,0,0)}),yh=function(t,e){if(e===void 0&&(e=!1),bs.has(t)&&!e)return bs.get(t);if(fh(t))return bs.set(t,ph),ph;var n=getComputedStyle(t),r=Ko(t)&&t.ownerSVGElement&&t.getBBox(),s=!z1&&n.boxSizing==="border-box",o=I1.test(n.writingMode||""),a=!r&&mh.test(n.overflowY||""),l=!r&&mh.test(n.overflowX||""),c=r?0:un(n.paddingTop),d=r?0:un(n.paddingRight),h=r?0:un(n.paddingBottom),u=r?0:un(n.paddingLeft),m=r?0:un(n.borderTopWidth),f=r?0:un(n.borderRightWidth),g=r?0:un(n.borderBottomWidth),p=r?0:un(n.borderLeftWidth),y=u+d,b=c+h,_=p+f,v=m+g,k=l?t.offsetHeight-v-t.clientHeight:0,C=a?t.offsetWidth-_-t.clientWidth:0,B=s?y+_:0,S=s?b+v:0,T=r?r.width:un(n.width)-B-C,$=r?r.height:un(n.height)-S-k,E=T+y+C+_,O=$+b+k+v,I=hi({devicePixelContentBoxSize:Xi(Math.round(T*devicePixelRatio),Math.round($*devicePixelRatio),o),borderBoxSize:Xi(E,O,o),contentBoxSize:Xi(T,$,o),contentRect:new uh(u,c,T,$)});return bs.set(t,I),I},bh=function(t,e,n){var r=yh(t,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case gr.DEVICE_PIXEL_CONTENT_BOX:return a;case gr.BORDER_BOX:return s;default:return o}},L1=(function(){function t(e){var n=yh(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=hi([n.borderBoxSize]),this.contentBoxSize=hi([n.contentBoxSize]),this.devicePixelContentBoxSize=hi([n.devicePixelContentBoxSize])}return t})(),_h=function(t){if(fh(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},D1=function(){var t=1/0,e=[];di.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var h=new L1(d.target),u=_h(d.target);l.push(h),d.lastReportedSize=bh(d.target,d.observedBox),u<t&&(t=u)}),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},wh=function(t){di.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(_h(s.target)>t?n.activeTargets.push(s):n.skippedTargets.push(s))})})},H1=function(){var t=0;for(wh(t);F1();)t=D1(),wh(t);return M1()&&A1(),t>0},Zo,xh=[],W1=function(){return xh.splice(0).forEach(function(t){return t()})},j1=function(t){if(!Zo){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return W1()}).observe(n,r),Zo=function(){n.textContent="".concat(e?e--:e++)}}xh.push(t),Zo()},q1=function(t){j1(function(){requestAnimationFrame(t)})},_s=0,X1=function(){return!!_s},Y1=250,U1={attributes:!0,characterData:!0,childList:!0,subtree:!0},vh=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],kh=function(t){return t===void 0&&(t=0),Date.now()+t},Qo=!1,G1=(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=Y1),!Qo){Qo=!0;var r=kh(e);q1(function(){var s=!1;try{s=H1()}finally{if(Qo=!1,e=r-kh(),!X1())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,U1)};document.body?n():mr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vh.forEach(function(n){return mr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),vh.forEach(function(n){return mr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),Jo=new G1,Ch=function(t){!_s&&t>0&&Jo.start(),_s+=t,!_s&&Jo.stop()},K1=function(t){return!Ko(t)&&!O1(t)&&getComputedStyle(t).display==="inline"},Z1=(function(){function t(e,n){this.target=e,this.observedBox=n||gr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=bh(this.target,this.observedBox,!0);return K1(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),Q1=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),ws=new WeakMap,Sh=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},xs=(function(){function t(){}return t.connect=function(e,n){var r=new Q1(e,n);ws.set(e,r)},t.observe=function(e,n,r){var s=ws.get(e),o=s.observationTargets.length===0;Sh(s.observationTargets,n)<0&&(o&&di.push(s),s.observationTargets.push(new Z1(n,r&&r.box)),Ch(1),Jo.schedule())},t.unobserve=function(e,n){var r=ws.get(e),s=Sh(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&di.splice(di.indexOf(r),1),r.observationTargets.splice(s,1),Ch(-1))},t.disconnect=function(e){var n=this,r=ws.get(e);r.observationTargets.slice().forEach(function(s){return n.unobserve(e,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),J1=(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.");xs.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(!gh(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");xs.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(!gh(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");xs.unobserve(this,e)},t.prototype.disconnect=function(){xs.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class ew{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||J1)(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 pr=new ew,vs=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){Kd("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){Kd("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(pr.registerHandler(s.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&pr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let ks;function tw(){return typeof document>"u"?!1:(ks===void 0&&("matchMedia"in window?ks=window.matchMedia("(pointer:coarse)").matches:ks=!1),ks)}let ea;function Bh(){return typeof document>"u"?1:(ea===void 0&&(ea="chrome"in window?window.devicePixelRatio:1),ea)}const Th="VVirtualListXScroll";function nw({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 h=new sh(d.length,0);return d.forEach((u,m)=>{h.add(m,u.width)}),h}),a=Wt(()=>{const d=o.value;return d!==null?Math.max(d.getBound(s.value)-1,0):0}),l=d=>{const h=o.value;return h!==null?h.sum(d):0},c=Wt(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,t.value.length-1):0});return i.provide(Th,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Rh=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(Th);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}}),iw=Wn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Wn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Wn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),rw=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=ci();iw.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Uo,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:A,defaultScrollKey:L}=t;A!=null?y({index:A}):L!=null&&y({key:L})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}y({top:f.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=Wt(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let A=0;return t.columns.forEach(L=>{A+=L.width}),A}),o=i.computed(()=>{const A=new Map,{keyField:L}=t;return t.items.forEach((D,ee)=>{A.set(D[L],ee)}),A}),{scrollLeftRef:a,listWidthRef:l}=nw({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),h=new Map,u=i.computed(()=>{const{items:A,itemSize:L,keyField:D}=t,ee=new sh(A.length,L);return A.forEach((N,P)=>{const H=N[D],q=h.get(H);q!==void 0&&ee.add(P,q)}),ee}),m=i.ref(0),f=i.ref(0),g=Wt(()=>Math.max(u.value.getBound(f.value-hr(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:A}=d;if(A===void 0)return[];const{items:L,itemSize:D}=t,ee=g.value,N=Math.min(ee+Math.ceil(A/D+1),L.length-1),P=[];for(let H=ee;H<=N;++H)P.push(L[H]);return P}),y=(A,L)=>{if(typeof A=="number"){k(A,L,"auto");return}const{left:D,top:ee,index:N,key:P,position:H,behavior:q,debounce:Y=!0}=A;if(D!==void 0||ee!==void 0)k(D,ee,q);else if(N!==void 0)v(N,q,Y);else if(P!==void 0){const F=o.value.get(P);F!==void 0&&v(F,q,Y)}else H==="bottom"?k(0,Number.MAX_SAFE_INTEGER,q):H==="top"&&k(0,0,q)};let b,_=null;function v(A,L,D){const{value:ee}=u,N=ee.sum(A)+hr(t.paddingTop);if(!D)c.value.scrollTo({left:0,top:N,behavior:L});else{b=A,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{b=void 0,_=null},16);const{scrollTop:P,offsetHeight:H}=c.value;if(N>P){const q=ee.get(A);N+q<=P+H||c.value.scrollTo({left:0,top:N+q-H,behavior:L})}else c.value.scrollTo({left:0,top:N,behavior:L})}}function k(A,L,D){c.value.scrollTo({left:A,top:L,behavior:D})}function C(A,L){var D,ee,N;if(n||t.ignoreItemResize||I(L.target))return;const{value:P}=u,H=o.value.get(A),q=P.get(H),Y=(N=(ee=(D=L.borderBoxSize)===null||D===void 0?void 0:D[0])===null||ee===void 0?void 0:ee.blockSize)!==null&&N!==void 0?N:L.contentRect.height;if(Y===q)return;Y-t.itemSize===0?h.delete(A):h.set(A,Y-t.itemSize);const M=Y-q;if(M===0)return;P.add(H,M);const Z=c.value;if(Z!=null){if(b===void 0){const fe=P.sum(H);Z.scrollTop>fe&&Z.scrollBy(0,M)}else if(H<b)Z.scrollBy(0,M);else if(H===b){const fe=P.sum(H);Y+fe>Z.scrollTop+Z.offsetHeight&&Z.scrollBy(0,M)}O()}m.value++}const B=!tw();let S=!1;function T(A){var L;(L=t.onScroll)===null||L===void 0||L.call(t,A),(!B||!S)&&O()}function $(A){var L;if((L=t.onWheel)===null||L===void 0||L.call(t,A),B){const D=c.value;if(D!=null){if(A.deltaX===0&&(D.scrollTop===0&&A.deltaY<=0||D.scrollTop+D.offsetHeight>=D.scrollHeight&&A.deltaY>=0))return;A.preventDefault(),D.scrollTop+=A.deltaY/Bh(),D.scrollLeft+=A.deltaX/Bh(),O(),S=!0,Pd(()=>{S=!1})}}}function E(A){if(n||I(A.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(A.contentRect.height===d.value)return}else if(A.contentRect.height===d.value&&A.contentRect.width===l.value)return;d.value=A.contentRect.height,l.value=A.contentRect.width;const{onResize:L}=t;L!==void 0&&L(A)}function O(){const{value:A}=c;A!=null&&(f.value=A.scrollTop,a.value=A.scrollLeft)}function I(A){let L=A;for(;L!==null;){if(L.style.display==="none")return!0;L=L.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:A}=t,L=ur(u.value.sum());return m.value,[t.itemsStyle,{boxSizing:"content-box",width:ur(s.value),height:A?"":L,minHeight:A?L:"",paddingTop:ur(t.paddingTop),paddingBottom:ur(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(m.value,{transform:`translateY(${ur(u.value.sum(g.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:y,handleListResize:E,handleListScroll:T,handleListWheel:$,handleItemResize:C}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(vs,{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],h=n.get(d),u=a!=null?i.h(Rh,{index:h,item:c}):void 0,m=l!=null?i.h(Rh,{index:h,item:c}):void 0,f=this.$slots.default({item:c,renderedCols:u,renderedItemWithCols:m,index:h})[0];return t?i.h(vs,{key:d,onResize:g=>this.handleItemResize(d,g)},{default:()=>f}):(f.key=d,f)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),vn="v-hidden",sw=Wn("[v-hidden]",{display:"none!important"}),$h=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 h;if(c!==void 0?h=c():h=r.value,!l||!h)return;h.hasAttribute(vn)&&h.removeAttribute(vn);const{children:u}=l;if(a.showAllItemsBeforeCalculate)for(const v of u)v.hasAttribute(vn)&&v.removeAttribute(vn);const m=l.offsetWidth,f=[],g=e.tail?d==null?void 0:d():null;let p=g?g.offsetWidth:0,y=!1;const b=l.children.length-(e.tail?1:0);for(let v=0;v<b-1;++v){if(v<0)continue;const k=u[v];if(y){k.hasAttribute(vn)||k.setAttribute(vn,"");continue}else k.hasAttribute(vn)&&k.removeAttribute(vn);const C=k.offsetWidth;if(p+=C,f[v]=C,p>m){const{updateCounter:B}=t;for(let S=v;S>=0;--S){const T=b-1-S;B!==void 0?B(T):h.textContent=`${T}`;const $=h.offsetWidth;if(p-=f[S],p+$<=m||S===0){y=!0,v=S-1,g&&(v===-1?(g.style.maxWidth=`${m-$}px`,g.style.boxSizing="border-box"):g.style.maxWidth="");const{onUpdateCount:E}=t;E&&E(T);break}}}}const{onUpdateOverflow:_}=t;y?_!==void 0&&_(!0):(_!==void 0&&_(!1),h.setAttribute(vn,""))}const o=ci();return sw.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Uo,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 Eh(t){return t instanceof HTMLElement}function Nh(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Eh(n)&&(Fh(n)||Nh(n)))return!0}return!1}function Ph(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Eh(n)&&(Fh(n)||Ph(n)))return!0}return!1}function Fh(t){if(!ow(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function ow(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 yr=[];const aw=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=m_(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return yr[yr.length-1]===e}function c(y){var b;y.code==="Escape"&&l()&&((b=t.onEsc)===null||b===void 0||b.call(t,y))}i.onMounted(()=>{i.watch(()=>t.active,y=>{y?(u(),kt("keydown",document,c)):(et("keydown",document,c),s&&m())},{immediate:!0})}),i.onBeforeUnmount(()=>{et("keydown",document,c),s&&m()});function d(y){if(!o&&l()){const b=h();if(b===null||b.contains(dr(y)))return;f("first")}}function h(){const y=n.value;if(y===null)return null;let b=y;for(;b=b.nextSibling,!(b===null||b instanceof Element&&b.tagName==="DIV"););return b}function u(){var y;if(!t.disabled){if(yr.push(e),t.autoFocus){const{initialFocusTo:b}=t;b===void 0?f("first"):(y=oh(b))===null||y===void 0||y.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function m(){var y;if(t.disabled||(document.removeEventListener("focus",d,!0),yr=yr.filter(_=>_!==e),l()))return;const{finalFocusTo:b}=t;b!==void 0?(y=oh(b))===null||y===void 0||y.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function f(y){if(l()&&t.active){const b=n.value,_=r.value;if(b!==null&&_!==null){const v=h();if(v==null||v===_){o=!0,b.focus({preventScroll:!0}),o=!1;return}o=!0;const k=y==="first"?Nh(v):Ph(v);o=!1,k||(o=!0,b.focus({preventScroll:!0}),o=!1)}}}function g(y){if(o)return;const b=h();b!==null&&(y.relatedTarget!==null&&b.contains(y.relatedTarget)?f("last"):f("first"))}function p(y){o||(y.relatedTarget!==null&&y.relatedTarget===n.value?f("last"):f("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:g,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 iC(t){return t}const ta="n-internal-select-menu",Mh="n-internal-select-menu-body",Ah="n-drawer-body",Vh="n-modal-body",Oh="n-popover-body",Ih="__disabled__";function kn(t){const e=i.inject(Vh,null),n=i.inject(Ah,null),r=i.inject(Oh,null),s=i.inject(Mh,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{kt("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{et("fullscreenchange",document,a)})}return Wt(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?Ih: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")})}kn.tdkey=Ih,kn.propTo={type:[String,Object,Boolean],default:void 0};function lw(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 zh(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&pr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&pr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&pr.unregisterHandler(n)}))}function Lh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const cw=/^(\d|\.)+$/,Dh=/(\d|\.)+/;function na(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(cw.test(t)){const s=(Number(t)+n)*e;return r?s===0?"0":`${s}px`:`${s}`}else{const s=Dh.exec(t);return s?t.replace(Dh,String((Number(s[0])+n)*e)):t}return t}function Hh(t){const{left:e,right:n,top:r,bottom:s}=Yt(t);return`${r} ${e} ${s} ${n}`}var Wh={};function dw(t){let e=".",n="__",r="--",s;if(t){let g=t.blockPrefix;g&&(e=g),g=t.elementPrefix,g&&(n=g),g=t.modifierPrefix,g&&(r=g)}const o={install(g){s=g.c;const p=g.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(g){let p,y;return{before(b){p=b.bem.b,y=b.bem.els,b.bem.els=null},after(b){b.bem.b=p,b.bem.els=y},$({context:b,props:_}){return g=typeof g=="string"?g:g({context:b,props:_}),b.bem.b=g,`${(_==null?void 0:_.bPrefix)||e}${b.bem.b}`}}}function l(g){let p;return{before(y){p=y.bem.els},after(y){y.bem.els=p},$({context:y,props:b}){return g=typeof g=="string"?g:g({context:y,props:b}),y.bem.els=g.split(",").map(_=>_.trim()),y.bem.els.map(_=>`${(b==null?void 0:b.bPrefix)||e}${y.bem.b}${n}${_}`).join(", ")}}}function c(g){return{$({context:p,props:y}){g=typeof g=="string"?g:g({context:p,props:y});const b=g.split(",").map(k=>k.trim());function _(k){return b.map(C=>`&${(y==null?void 0:y.bPrefix)||e}${p.bem.b}${k!==void 0?`${n}${k}`:""}${r}${C}`).join(", ")}const v=p.bem.els;if(v!==null){if(Wh.NODE_ENV!=="production"&&v.length>=2)throw Error(`[css-render/plugin-bem]: m(${g}) is invalid, using modifier inside multiple elements is not allowed`);return _(v[0])}else return _()}}}function d(g){return{$({context:p,props:y}){g=typeof g=="string"?g:g({context:p,props:y});const b=p.bem.els;if(Wh.NODE_ENV!=="production"&&b!==null&&b.length>=2)throw Error(`[css-render/plugin-bem]: notM(${g}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(y==null?void 0:y.bPrefix)||e}${p.bem.b}${b!==null&&b.length>0?`${n}${b[0]}`:""}${r}${g})`}}}return Object.assign(o,{cB:((...g)=>s(a(g[0]),g[1],g[2])),cE:((...g)=>s(l(g[0]),g[1],g[2])),cM:((...g)=>s(c(g[0]),g[1],g[2])),cNotM:((...g)=>s(d(g[0]),g[1],g[2]))}),o}const hw=".n-",uw="__",fw="--",jh=ih(),qh=dw({blockPrefix:hw,elementPrefix:uw,modifierPrefix:fw});jh.use(qh);const{c:ae,find:sC}=jh,{cB:ue,cE:ye,cM:Be,cNotM:Ut}=qh,gw=(...t)=>ae(">",[ue(...t)]);function Ge(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let ia;function mw(){return ia===void 0&&(ia=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ia}const pw=new WeakSet;function yw(t){pw.add(t)}function Xh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const Yh=new Set;function jn(t,e){const n=`[naive/${t}]: ${e}`;Yh.has(n)||(Yh.add(n),console.error(n))}function Uh(t,e){console.error(`[naive/${t}]: ${e}`)}function Gh(t,e){throw new Error(`[naive/${t}]: ${e}`)}function ht(t,...e){if(Array.isArray(t))t.forEach(n=>ht(n,...e));else return t(...e)}function ra(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)){ra(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ra(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function bw(t,e="default",n=void 0){const r=t[e];if(!r)return Uh("getFirstSlotVNode",`slot[${e}] is empty`),null;const s=ra(r(n));return s.length===1?s[0]:(Uh("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function _w(t,e=[],n){const r={};return e.forEach(s=>{r[s]=t[s]}),Object.assign(r,n)}function sa(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 Yi(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function Cs(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!Cs(e.children)):!0)?t:null}function oa(t,e){return t&&Cs(t())||e()}function ui(t,e){const n=t&&Cs(t());return e(n||null)}function Kh(t){return!(t&&Cs(t()))}const aa=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),fi="n-config-provider",ww="n";function gi(t={},e={defaultBordered:!0}){const n=i.inject(fi,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(ww),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function mi(t,e,n,r){n||Gh("useThemeClass","cssVarsRef is not passed");const s=i.inject(fi,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=ci();let d;const h=`__${t}`,u=()=>{let m=h;const f=e?e.value:void 0,g=o==null?void 0:o.value;g&&(m+=`-${g}`),f&&(m+=`-${f}`);const{themeOverrides:p,builtinThemeOverrides:y}=r;p&&(m+=`-${Yo(JSON.stringify(p))}`),y&&(m+=`-${Yo(JSON.stringify(y))}`),l.value=m,d=()=>{const b=n.value;let _="";for(const v in b)_+=`${v}: ${b[v]};`;ae(`.${m}`,_).mount({id:m,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{u()}),{themeClass:l,onRender:()=>{d==null||d()}}}const Zh="n-form-item";function xw(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(Zh,null);i.provide(Zh,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 vw={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 la(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function br(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 _r(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)?Cw(l,u=>u.test(a)):kw(l,u=>u.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=e.slice(a.length);return{value:d,rest:h}}}function kw(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Cw(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Sw(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 Bw={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"}},Tw=(t,e,n)=>{let r;const s=Bw[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},Rw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},$w=(t,e,n,r)=>Rw[t],Ew={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Nw={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Pw={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"]},Fw={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"]},Mw={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"}},Aw={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"}},Vw={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:br({values:Ew,defaultWidth:"wide"}),quarter:br({values:Nw,defaultWidth:"wide",argumentCallback:t=>t-1}),month:br({values:Pw,defaultWidth:"wide"}),day:br({values:Fw,defaultWidth:"wide"}),dayPeriod:br({values:Mw,defaultWidth:"wide",formattingValues:Aw,defaultFormattingWidth:"wide"})},Ow=/^(\d+)(th|st|nd|rd)?/i,Iw=/\d+/i,zw={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},Lw={any:[/^b/i,/^(a|c)/i]},Dw={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Hw={any:[/1/i,/2/i,/3/i,/4/i]},Ww={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},jw={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]},qw={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},Xw={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]},Yw={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},Uw={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}},Gw={ordinalNumber:Sw({matchPattern:Ow,parsePattern:Iw,valueCallback:t=>parseInt(t,10)}),era:_r({matchPatterns:zw,defaultMatchWidth:"wide",parsePatterns:Lw,defaultParseWidth:"any"}),quarter:_r({matchPatterns:Dw,defaultMatchWidth:"wide",parsePatterns:Hw,defaultParseWidth:"any",valueCallback:t=>t+1}),month:_r({matchPatterns:Ww,defaultMatchWidth:"wide",parsePatterns:jw,defaultParseWidth:"any"}),day:_r({matchPatterns:qw,defaultMatchWidth:"wide",parsePatterns:Xw,defaultParseWidth:"any"}),dayPeriod:_r({matchPatterns:Yw,defaultMatchWidth:"any",parsePatterns:Uw,defaultParseWidth:"any"})},Kw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Zw={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Qw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Jw={date:la({formats:Kw,defaultWidth:"full"}),time:la({formats:Zw,defaultWidth:"full"}),dateTime:la({formats:Qw,defaultWidth:"full"})},ex={name:"en-US",locale:{code:"en-US",formatDistance:Tw,formatLong:Jw,formatRelative:$w,localize:Vw,match:Gw,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function Qh(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(fi,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:vw[t]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:ex}),localeRef:r}}const wr="naive-ui-style";function xr(t,e,n){if(!e)return;const r=ci(),s=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),o=i.inject(fi,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(C1(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:wr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const vr={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:tx,fontFamily:nx,lineHeight:ix}=vr,Jh=ae("body",`
|
|
116
|
+
`)}function Yo(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 b1(t,e,n,r){const{els:s}=e;if(n===void 0)s.forEach(Qd),e.els=[];else{const o=gs(n,r);o&&s.includes(o)&&(Qd(o),e.els=s.filter(a=>a!==o))}}function nh(t,e){t.push(e)}function _1(t,e,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=Yo(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const h=gs(n,l);if(h!==null&&!o)return h;const u=h??f1(n);if(d===void 0&&(d=e.render(r)),u.textContent=d,h!==null)return h;if(a){const m=l.querySelector(`meta[name="${a}"]`);if(m)return l.insertBefore(u,m),nh(e.els,u),u}return s?l.insertBefore(u,l.querySelector("style, link")):l.appendChild(u),nh(e.els,u),u}function w1(t){return y1(this,this.instance,t)}function x1(t={}){const{id:e,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=t;return _1(this.instance,this,e,r,s,o,a,l,n)}function v1(t={}){const{id:e,parent:n}=t;b1(this.instance,this,e,n)}const ps=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:w1,mount:x1,unmount:v1}},k1=function(t,e,n,r){return Array.isArray(e)?ps(t,{$:null},null,e):Array.isArray(n)?ps(t,e,null,n):Array.isArray(r)?ps(t,e,n,r):ps(t,e,n,null)};function ih(t={}){const e={c:((...n)=>k1(e,...n)),use:(n,...r)=>n.install(e,...r),find:gs,context:{},config:t};return e}function C1(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return gs(t)!==null}const{c:Wn}=ih(),Uo="vueuc-style";function rh(t){return t&-t}class sh{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+=rh(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-=rh(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 oh(t){return typeof t=="string"?document.querySelector(t):t()||null}const S1=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:Z_(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Wo("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Wo("lazy-teleport",this.$slots)):null}}),ys={top:"bottom",bottom:"top",left:"right",right:"left"},ah={start:"end",center:"center",end:"start"},Go={top:"height",bottom:"height",left:"width",right:"width"},B1={"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"},T1={"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"},R1={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},lh={top:!0,bottom:!1,left:!0,right:!1},ch={top:"end",bottom:"start",left:"end",right:"start"};function $1(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 h=(f,g,p)=>{let y=0,b=0;const _=n[f]-e[g]-e[f];return _>0&&r&&(p?b=lh[g]?_:-_:y=lh[g]?_:-_),{left:y,top:b}},u=a==="left"||a==="right";if(c!=="center"){const f=R1[t],g=ys[f],p=Go[f];if(n[p]>e[p]){if(e[f]+e[p]<n[p]){const y=(n[p]-e[p])/2;e[f]<y||e[g]<y?e[f]<e[g]?(c=ah[l],d=h(p,g,u)):d=h(p,f,u):c="center"}}else n[p]<e[p]&&e[g]<0&&e[f]>e[g]&&(c=ah[l])}else{const f=a==="bottom"||a==="top"?"left":"top",g=ys[f],p=Go[f],y=(n[p]-e[p])/2;(e[f]<y||e[g]<y)&&(e[f]>e[g]?(c=ch[f],d=h(p,f,u)):(c=ch[g],d=h(p,g,u)))}let m=a;return e[a]<n[Go[a]]&&e[a]<e[ys[a]]&&(m=ys[a]),{placement:c!=="center"?`${m}-${c}`:m,left:d.left,top:d.top}}function E1(t,e){return e?T1[t]:B1[t]}function N1(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 P1=Wn([Wn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Wn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Wn("> *",{pointerEvents:"all"})])]),dh=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=Wt(()=>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=ci();P1.mount({id:"vueuc/binder",head:!0,anchorMetaName:Uo,ssr:l}),i.onBeforeUnmount(()=>{a()}),J_(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const m=r.value;if(m===null)return;const f=e.targetRef,{x:g,y:p,overlap:y}=t,b=g!==void 0&&p!==void 0?n1(g,p):qo(f);m.style.setProperty("--v-target-width",`${Math.round(b.width)}px`),m.style.setProperty("--v-target-height",`${Math.round(b.height)}px`);const{width:_,minWidth:v,placement:k,internalShift:S,flip:B}=t;m.setAttribute("v-placement",k),y?m.setAttribute("v-overlap",""):m.removeAttribute("v-overlap");const{style:C}=m;_==="target"?C.width=`${b.width}px`:_!==void 0?C.width=_:C.width="",v==="target"?C.minWidth=`${b.width}px`:v!==void 0?C.minWidth=v:C.minWidth="";const T=qo(m),$=qo(s.value),{left:E,top:I,placement:O}=$1(k,b,T,S,B,y),V=E1(O,y),{left:L,top:D,transform:ee}=N1(O,$,b,I,E,y);m.setAttribute("v-placement",O),m.style.setProperty("--v-offset-left",`${Math.round(E)}px`),m.style.setProperty("--v-offset-top",`${Math.round(I)}px`),m.style.transform=`translateX(${L}) translateY(${D}) ${ee}`,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 h=fs(),u=Wt(()=>{const{to:m}=t;if(m!==void 0)return m;h.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:u,syncPosition:c}},render(){return i.h(S1,{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,[[Wd,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var di=[],F1=function(){return di.some(function(t){return t.activeTargets.length>0})},M1=function(){return di.some(function(t){return t.skippedTargets.length>0})},hh="ResizeObserver loop completed with undelivered notifications.",A1=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:hh}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=hh),window.dispatchEvent(t)},gr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(gr||(gr={}));var hi=function(t){return Object.freeze(t)},V1=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,hi(this)}return t})(),uh=(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,hi(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})(),Ko=function(t){return t instanceof SVGElement&&"getBBox"in t},fh=function(t){if(Ko(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)},gh=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)},I1=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},mr=typeof window<"u"?window:{},bs=new WeakMap,mh=/auto|scroll/,O1=/^tb|vertical/,z1=/msie|trident/i.test(mr.navigator&&mr.navigator.userAgent),un=function(t){return parseFloat(t||"0")},Xi=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new V1((n?e:t)||0,(n?t:e)||0)},ph=hi({devicePixelContentBoxSize:Xi(),borderBoxSize:Xi(),contentBoxSize:Xi(),contentRect:new uh(0,0,0,0)}),yh=function(t,e){if(e===void 0&&(e=!1),bs.has(t)&&!e)return bs.get(t);if(fh(t))return bs.set(t,ph),ph;var n=getComputedStyle(t),r=Ko(t)&&t.ownerSVGElement&&t.getBBox(),s=!z1&&n.boxSizing==="border-box",o=O1.test(n.writingMode||""),a=!r&&mh.test(n.overflowY||""),l=!r&&mh.test(n.overflowX||""),c=r?0:un(n.paddingTop),d=r?0:un(n.paddingRight),h=r?0:un(n.paddingBottom),u=r?0:un(n.paddingLeft),m=r?0:un(n.borderTopWidth),f=r?0:un(n.borderRightWidth),g=r?0:un(n.borderBottomWidth),p=r?0:un(n.borderLeftWidth),y=u+d,b=c+h,_=p+f,v=m+g,k=l?t.offsetHeight-v-t.clientHeight:0,S=a?t.offsetWidth-_-t.clientWidth:0,B=s?y+_:0,C=s?b+v:0,T=r?r.width:un(n.width)-B-S,$=r?r.height:un(n.height)-C-k,E=T+y+S+_,I=$+b+k+v,O=hi({devicePixelContentBoxSize:Xi(Math.round(T*devicePixelRatio),Math.round($*devicePixelRatio),o),borderBoxSize:Xi(E,I,o),contentBoxSize:Xi(T,$,o),contentRect:new uh(u,c,T,$)});return bs.set(t,O),O},bh=function(t,e,n){var r=yh(t,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case gr.DEVICE_PIXEL_CONTENT_BOX:return a;case gr.BORDER_BOX:return s;default:return o}},L1=(function(){function t(e){var n=yh(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=hi([n.borderBoxSize]),this.contentBoxSize=hi([n.contentBoxSize]),this.devicePixelContentBoxSize=hi([n.devicePixelContentBoxSize])}return t})(),_h=function(t){if(fh(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},D1=function(){var t=1/0,e=[];di.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var h=new L1(d.target),u=_h(d.target);l.push(h),d.lastReportedSize=bh(d.target,d.observedBox),u<t&&(t=u)}),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},wh=function(t){di.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(_h(s.target)>t?n.activeTargets.push(s):n.skippedTargets.push(s))})})},H1=function(){var t=0;for(wh(t);F1();)t=D1(),wh(t);return M1()&&A1(),t>0},Zo,xh=[],W1=function(){return xh.splice(0).forEach(function(t){return t()})},j1=function(t){if(!Zo){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return W1()}).observe(n,r),Zo=function(){n.textContent="".concat(e?e--:e++)}}xh.push(t),Zo()},q1=function(t){j1(function(){requestAnimationFrame(t)})},_s=0,X1=function(){return!!_s},Y1=250,U1={attributes:!0,characterData:!0,childList:!0,subtree:!0},vh=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],kh=function(t){return t===void 0&&(t=0),Date.now()+t},Qo=!1,G1=(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=Y1),!Qo){Qo=!0;var r=kh(e);q1(function(){var s=!1;try{s=H1()}finally{if(Qo=!1,e=r-kh(),!X1())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,U1)};document.body?n():mr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vh.forEach(function(n){return mr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),vh.forEach(function(n){return mr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),Jo=new G1,Ch=function(t){!_s&&t>0&&Jo.start(),_s+=t,!_s&&Jo.stop()},K1=function(t){return!Ko(t)&&!I1(t)&&getComputedStyle(t).display==="inline"},Z1=(function(){function t(e,n){this.target=e,this.observedBox=n||gr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=bh(this.target,this.observedBox,!0);return K1(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),Q1=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),ws=new WeakMap,Sh=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},xs=(function(){function t(){}return t.connect=function(e,n){var r=new Q1(e,n);ws.set(e,r)},t.observe=function(e,n,r){var s=ws.get(e),o=s.observationTargets.length===0;Sh(s.observationTargets,n)<0&&(o&&di.push(s),s.observationTargets.push(new Z1(n,r&&r.box)),Ch(1),Jo.schedule())},t.unobserve=function(e,n){var r=ws.get(e),s=Sh(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&di.splice(di.indexOf(r),1),r.observationTargets.splice(s,1),Ch(-1))},t.disconnect=function(e){var n=this,r=ws.get(e);r.observationTargets.slice().forEach(function(s){return n.unobserve(e,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),J1=(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.");xs.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(!gh(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");xs.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(!gh(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");xs.unobserve(this,e)},t.prototype.disconnect=function(){xs.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class ew{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||J1)(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 pr=new ew,vs=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){Kd("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){Kd("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(pr.registerHandler(s.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&pr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let ks;function tw(){return typeof document>"u"?!1:(ks===void 0&&("matchMedia"in window?ks=window.matchMedia("(pointer:coarse)").matches:ks=!1),ks)}let ea;function Bh(){return typeof document>"u"?1:(ea===void 0&&(ea="chrome"in window?window.devicePixelRatio:1),ea)}const Th="VVirtualListXScroll";function nw({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 h=new sh(d.length,0);return d.forEach((u,m)=>{h.add(m,u.width)}),h}),a=Wt(()=>{const d=o.value;return d!==null?Math.max(d.getBound(s.value)-1,0):0}),l=d=>{const h=o.value;return h!==null?h.sum(d):0},c=Wt(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,t.value.length-1):0});return i.provide(Th,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Rh=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(Th);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}}),iw=Wn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Wn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Wn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),rw=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=ci();iw.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Uo,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:V,defaultScrollKey:L}=t;V!=null?y({index:V}):L!=null&&y({key:L})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}y({top:f.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=Wt(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let V=0;return t.columns.forEach(L=>{V+=L.width}),V}),o=i.computed(()=>{const V=new Map,{keyField:L}=t;return t.items.forEach((D,ee)=>{V.set(D[L],ee)}),V}),{scrollLeftRef:a,listWidthRef:l}=nw({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),h=new Map,u=i.computed(()=>{const{items:V,itemSize:L,keyField:D}=t,ee=new sh(V.length,L);return V.forEach((N,P)=>{const H=N[D],q=h.get(H);q!==void 0&&ee.add(P,q)}),ee}),m=i.ref(0),f=i.ref(0),g=Wt(()=>Math.max(u.value.getBound(f.value-hr(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:V}=d;if(V===void 0)return[];const{items:L,itemSize:D}=t,ee=g.value,N=Math.min(ee+Math.ceil(V/D+1),L.length-1),P=[];for(let H=ee;H<=N;++H)P.push(L[H]);return P}),y=(V,L)=>{if(typeof V=="number"){k(V,L,"auto");return}const{left:D,top:ee,index:N,key:P,position:H,behavior:q,debounce:U=!0}=V;if(D!==void 0||ee!==void 0)k(D,ee,q);else if(N!==void 0)v(N,q,U);else if(P!==void 0){const F=o.value.get(P);F!==void 0&&v(F,q,U)}else H==="bottom"?k(0,Number.MAX_SAFE_INTEGER,q):H==="top"&&k(0,0,q)};let b,_=null;function v(V,L,D){const{value:ee}=u,N=ee.sum(V)+hr(t.paddingTop);if(!D)c.value.scrollTo({left:0,top:N,behavior:L});else{b=V,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{b=void 0,_=null},16);const{scrollTop:P,offsetHeight:H}=c.value;if(N>P){const q=ee.get(V);N+q<=P+H||c.value.scrollTo({left:0,top:N+q-H,behavior:L})}else c.value.scrollTo({left:0,top:N,behavior:L})}}function k(V,L,D){c.value.scrollTo({left:V,top:L,behavior:D})}function S(V,L){var D,ee,N;if(n||t.ignoreItemResize||O(L.target))return;const{value:P}=u,H=o.value.get(V),q=P.get(H),U=(N=(ee=(D=L.borderBoxSize)===null||D===void 0?void 0:D[0])===null||ee===void 0?void 0:ee.blockSize)!==null&&N!==void 0?N:L.contentRect.height;if(U===q)return;U-t.itemSize===0?h.delete(V):h.set(V,U-t.itemSize);const M=U-q;if(M===0)return;P.add(H,M);const Z=c.value;if(Z!=null){if(b===void 0){const fe=P.sum(H);Z.scrollTop>fe&&Z.scrollBy(0,M)}else if(H<b)Z.scrollBy(0,M);else if(H===b){const fe=P.sum(H);U+fe>Z.scrollTop+Z.offsetHeight&&Z.scrollBy(0,M)}I()}m.value++}const B=!tw();let C=!1;function T(V){var L;(L=t.onScroll)===null||L===void 0||L.call(t,V),(!B||!C)&&I()}function $(V){var L;if((L=t.onWheel)===null||L===void 0||L.call(t,V),B){const D=c.value;if(D!=null){if(V.deltaX===0&&(D.scrollTop===0&&V.deltaY<=0||D.scrollTop+D.offsetHeight>=D.scrollHeight&&V.deltaY>=0))return;V.preventDefault(),D.scrollTop+=V.deltaY/Bh(),D.scrollLeft+=V.deltaX/Bh(),I(),C=!0,Pd(()=>{C=!1})}}}function E(V){if(n||O(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:L}=t;L!==void 0&&L(V)}function I(){const{value:V}=c;V!=null&&(f.value=V.scrollTop,a.value=V.scrollLeft)}function O(V){let L=V;for(;L!==null;){if(L.style.display==="none")return!0;L=L.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:V}=t,L=ur(u.value.sum());return m.value,[t.itemsStyle,{boxSizing:"content-box",width:ur(s.value),height:V?"":L,minHeight:V?L:"",paddingTop:ur(t.paddingTop),paddingBottom:ur(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(m.value,{transform:`translateY(${ur(u.value.sum(g.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:y,handleListResize:E,handleListScroll:T,handleListWheel:$,handleItemResize:S}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(vs,{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],h=n.get(d),u=a!=null?i.h(Rh,{index:h,item:c}):void 0,m=l!=null?i.h(Rh,{index:h,item:c}):void 0,f=this.$slots.default({item:c,renderedCols:u,renderedItemWithCols:m,index:h})[0];return t?i.h(vs,{key:d,onResize:g=>this.handleItemResize(d,g)},{default:()=>f}):(f.key=d,f)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),vn="v-hidden",sw=Wn("[v-hidden]",{display:"none!important"}),$h=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 h;if(c!==void 0?h=c():h=r.value,!l||!h)return;h.hasAttribute(vn)&&h.removeAttribute(vn);const{children:u}=l;if(a.showAllItemsBeforeCalculate)for(const v of u)v.hasAttribute(vn)&&v.removeAttribute(vn);const m=l.offsetWidth,f=[],g=e.tail?d==null?void 0:d():null;let p=g?g.offsetWidth:0,y=!1;const b=l.children.length-(e.tail?1:0);for(let v=0;v<b-1;++v){if(v<0)continue;const k=u[v];if(y){k.hasAttribute(vn)||k.setAttribute(vn,"");continue}else k.hasAttribute(vn)&&k.removeAttribute(vn);const S=k.offsetWidth;if(p+=S,f[v]=S,p>m){const{updateCounter:B}=t;for(let C=v;C>=0;--C){const T=b-1-C;B!==void 0?B(T):h.textContent=`${T}`;const $=h.offsetWidth;if(p-=f[C],p+$<=m||C===0){y=!0,v=C-1,g&&(v===-1?(g.style.maxWidth=`${m-$}px`,g.style.boxSizing="border-box"):g.style.maxWidth="");const{onUpdateCount:E}=t;E&&E(T);break}}}}const{onUpdateOverflow:_}=t;y?_!==void 0&&_(!0):(_!==void 0&&_(!1),h.setAttribute(vn,""))}const o=ci();return sw.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Uo,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 Eh(t){return t instanceof HTMLElement}function Nh(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Eh(n)&&(Fh(n)||Nh(n)))return!0}return!1}function Ph(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Eh(n)&&(Fh(n)||Ph(n)))return!0}return!1}function Fh(t){if(!ow(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function ow(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 yr=[];const aw=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=m_(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return yr[yr.length-1]===e}function c(y){var b;y.code==="Escape"&&l()&&((b=t.onEsc)===null||b===void 0||b.call(t,y))}i.onMounted(()=>{i.watch(()=>t.active,y=>{y?(u(),kt("keydown",document,c)):(et("keydown",document,c),s&&m())},{immediate:!0})}),i.onBeforeUnmount(()=>{et("keydown",document,c),s&&m()});function d(y){if(!o&&l()){const b=h();if(b===null||b.contains(dr(y)))return;f("first")}}function h(){const y=n.value;if(y===null)return null;let b=y;for(;b=b.nextSibling,!(b===null||b instanceof Element&&b.tagName==="DIV"););return b}function u(){var y;if(!t.disabled){if(yr.push(e),t.autoFocus){const{initialFocusTo:b}=t;b===void 0?f("first"):(y=oh(b))===null||y===void 0||y.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function m(){var y;if(t.disabled||(document.removeEventListener("focus",d,!0),yr=yr.filter(_=>_!==e),l()))return;const{finalFocusTo:b}=t;b!==void 0?(y=oh(b))===null||y===void 0||y.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function f(y){if(l()&&t.active){const b=n.value,_=r.value;if(b!==null&&_!==null){const v=h();if(v==null||v===_){o=!0,b.focus({preventScroll:!0}),o=!1;return}o=!0;const k=y==="first"?Nh(v):Ph(v);o=!1,k||(o=!0,b.focus({preventScroll:!0}),o=!1)}}}function g(y){if(o)return;const b=h();b!==null&&(y.relatedTarget!==null&&b.contains(y.relatedTarget)?f("last"):f("first"))}function p(y){o||(y.relatedTarget!==null&&y.relatedTarget===n.value?f("last"):f("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:g,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 iC(t){return t}const ta="n-internal-select-menu",Mh="n-internal-select-menu-body",Ah="n-drawer-body",Vh="n-modal-body",Ih="n-popover-body",Oh="__disabled__";function kn(t){const e=i.inject(Vh,null),n=i.inject(Ah,null),r=i.inject(Ih,null),s=i.inject(Mh,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{kt("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{et("fullscreenchange",document,a)})}return Wt(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?Oh: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")})}kn.tdkey=Oh,kn.propTo={type:[String,Object,Boolean],default:void 0};function lw(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 zh(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&pr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&pr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&pr.unregisterHandler(n)}))}function Lh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const cw=/^(\d|\.)+$/,Dh=/(\d|\.)+/;function na(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(cw.test(t)){const s=(Number(t)+n)*e;return r?s===0?"0":`${s}px`:`${s}`}else{const s=Dh.exec(t);return s?t.replace(Dh,String((Number(s[0])+n)*e)):t}return t}function Hh(t){const{left:e,right:n,top:r,bottom:s}=Yt(t);return`${r} ${e} ${s} ${n}`}var Wh={};function dw(t){let e=".",n="__",r="--",s;if(t){let g=t.blockPrefix;g&&(e=g),g=t.elementPrefix,g&&(n=g),g=t.modifierPrefix,g&&(r=g)}const o={install(g){s=g.c;const p=g.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(g){let p,y;return{before(b){p=b.bem.b,y=b.bem.els,b.bem.els=null},after(b){b.bem.b=p,b.bem.els=y},$({context:b,props:_}){return g=typeof g=="string"?g:g({context:b,props:_}),b.bem.b=g,`${(_==null?void 0:_.bPrefix)||e}${b.bem.b}`}}}function l(g){let p;return{before(y){p=y.bem.els},after(y){y.bem.els=p},$({context:y,props:b}){return g=typeof g=="string"?g:g({context:y,props:b}),y.bem.els=g.split(",").map(_=>_.trim()),y.bem.els.map(_=>`${(b==null?void 0:b.bPrefix)||e}${y.bem.b}${n}${_}`).join(", ")}}}function c(g){return{$({context:p,props:y}){g=typeof g=="string"?g:g({context:p,props:y});const b=g.split(",").map(k=>k.trim());function _(k){return b.map(S=>`&${(y==null?void 0:y.bPrefix)||e}${p.bem.b}${k!==void 0?`${n}${k}`:""}${r}${S}`).join(", ")}const v=p.bem.els;if(v!==null){if(Wh.NODE_ENV!=="production"&&v.length>=2)throw Error(`[css-render/plugin-bem]: m(${g}) is invalid, using modifier inside multiple elements is not allowed`);return _(v[0])}else return _()}}}function d(g){return{$({context:p,props:y}){g=typeof g=="string"?g:g({context:p,props:y});const b=p.bem.els;if(Wh.NODE_ENV!=="production"&&b!==null&&b.length>=2)throw Error(`[css-render/plugin-bem]: notM(${g}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(y==null?void 0:y.bPrefix)||e}${p.bem.b}${b!==null&&b.length>0?`${n}${b[0]}`:""}${r}${g})`}}}return Object.assign(o,{cB:((...g)=>s(a(g[0]),g[1],g[2])),cE:((...g)=>s(l(g[0]),g[1],g[2])),cM:((...g)=>s(c(g[0]),g[1],g[2])),cNotM:((...g)=>s(d(g[0]),g[1],g[2]))}),o}const hw=".n-",uw="__",fw="--",jh=ih(),qh=dw({blockPrefix:hw,elementPrefix:uw,modifierPrefix:fw});jh.use(qh);const{c:ae,find:sC}=jh,{cB:ue,cE:ye,cM:Be,cNotM:Ut}=qh,gw=(...t)=>ae(">",[ue(...t)]);function Ge(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let ia;function mw(){return ia===void 0&&(ia=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ia}const pw=new WeakSet;function yw(t){pw.add(t)}function Xh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const Yh=new Set;function jn(t,e){const n=`[naive/${t}]: ${e}`;Yh.has(n)||(Yh.add(n),console.error(n))}function Uh(t,e){console.error(`[naive/${t}]: ${e}`)}function Gh(t,e){throw new Error(`[naive/${t}]: ${e}`)}function ht(t,...e){if(Array.isArray(t))t.forEach(n=>ht(n,...e));else return t(...e)}function ra(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)){ra(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ra(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function bw(t,e="default",n=void 0){const r=t[e];if(!r)return Uh("getFirstSlotVNode",`slot[${e}] is empty`),null;const s=ra(r(n));return s.length===1?s[0]:(Uh("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function _w(t,e=[],n){const r={};return e.forEach(s=>{r[s]=t[s]}),Object.assign(r,n)}function sa(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 Yi(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function Cs(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!Cs(e.children)):!0)?t:null}function oa(t,e){return t&&Cs(t())||e()}function ui(t,e){const n=t&&Cs(t());return e(n||null)}function Kh(t){return!(t&&Cs(t()))}const aa=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),fi="n-config-provider",ww="n";function gi(t={},e={defaultBordered:!0}){const n=i.inject(fi,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(ww),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function mi(t,e,n,r){n||Gh("useThemeClass","cssVarsRef is not passed");const s=i.inject(fi,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=ci();let d;const h=`__${t}`,u=()=>{let m=h;const f=e?e.value:void 0,g=o==null?void 0:o.value;g&&(m+=`-${g}`),f&&(m+=`-${f}`);const{themeOverrides:p,builtinThemeOverrides:y}=r;p&&(m+=`-${Yo(JSON.stringify(p))}`),y&&(m+=`-${Yo(JSON.stringify(y))}`),l.value=m,d=()=>{const b=n.value;let _="";for(const v in b)_+=`${v}: ${b[v]};`;ae(`.${m}`,_).mount({id:m,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{u()}),{themeClass:l,onRender:()=>{d==null||d()}}}const Zh="n-form-item";function xw(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(Zh,null);i.provide(Zh,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 vw={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 la(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function br(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 _r(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)?Cw(l,u=>u.test(a)):kw(l,u=>u.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=e.slice(a.length);return{value:d,rest:h}}}function kw(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Cw(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Sw(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 Bw={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"}},Tw=(t,e,n)=>{let r;const s=Bw[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},Rw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},$w=(t,e,n,r)=>Rw[t],Ew={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Nw={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Pw={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"]},Fw={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"]},Mw={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"}},Aw={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"}},Vw={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:br({values:Ew,defaultWidth:"wide"}),quarter:br({values:Nw,defaultWidth:"wide",argumentCallback:t=>t-1}),month:br({values:Pw,defaultWidth:"wide"}),day:br({values:Fw,defaultWidth:"wide"}),dayPeriod:br({values:Mw,defaultWidth:"wide",formattingValues:Aw,defaultFormattingWidth:"wide"})},Iw=/^(\d+)(th|st|nd|rd)?/i,Ow=/\d+/i,zw={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},Lw={any:[/^b/i,/^(a|c)/i]},Dw={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Hw={any:[/1/i,/2/i,/3/i,/4/i]},Ww={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},jw={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]},qw={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},Xw={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]},Yw={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},Uw={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}},Gw={ordinalNumber:Sw({matchPattern:Iw,parsePattern:Ow,valueCallback:t=>parseInt(t,10)}),era:_r({matchPatterns:zw,defaultMatchWidth:"wide",parsePatterns:Lw,defaultParseWidth:"any"}),quarter:_r({matchPatterns:Dw,defaultMatchWidth:"wide",parsePatterns:Hw,defaultParseWidth:"any",valueCallback:t=>t+1}),month:_r({matchPatterns:Ww,defaultMatchWidth:"wide",parsePatterns:jw,defaultParseWidth:"any"}),day:_r({matchPatterns:qw,defaultMatchWidth:"wide",parsePatterns:Xw,defaultParseWidth:"any"}),dayPeriod:_r({matchPatterns:Yw,defaultMatchWidth:"any",parsePatterns:Uw,defaultParseWidth:"any"})},Kw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Zw={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Qw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Jw={date:la({formats:Kw,defaultWidth:"full"}),time:la({formats:Zw,defaultWidth:"full"}),dateTime:la({formats:Qw,defaultWidth:"full"})},ex={name:"en-US",locale:{code:"en-US",formatDistance:Tw,formatLong:Jw,formatRelative:$w,localize:Vw,match:Gw,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function Qh(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(fi,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:vw[t]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:ex}),localeRef:r}}const wr="naive-ui-style";function xr(t,e,n){if(!e)return;const r=ci(),s=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),o=i.inject(fi,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(C1(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:wr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const vr={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:tx,fontFamily:nx,lineHeight:ix}=vr,Jh=ae("body",`
|
|
117
117
|
margin: 0;
|
|
118
118
|
font-size: ${tx};
|
|
119
119
|
font-family: ${nx};
|
|
@@ -123,7 +123,7 @@ ${s}
|
|
|
123
123
|
`,[ae("input",`
|
|
124
124
|
font-family: inherit;
|
|
125
125
|
font-size: inherit;
|
|
126
|
-
`)]);var rx={};function Ss(t,e,n){if(!e){rx.NODE_ENV!=="production"&&Gh("use-style","No style is specified.");return}const r=ci(),s=i.inject(fi,null),o=()=>{const a=n.value;e.mount({id:a===void 0?t:a+t,head:!0,anchorMetaName:wr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget}),s!=null&&s.preflightStyleDisabled||Jh.mount({id:"n-global",head:!0,anchorMetaName:wr,ssr:r,parent:s==null?void 0:s.styleMountTarget})};r?o():i.onBeforeMount(o)}function lC(t){return t}function ut(t,e,n,r,s,o){const a=ci(),l=i.inject(fi,null);if(n){const d=()=>{const h=o==null?void 0:o.value;n.mount({id:h===void 0?e:h+e,head:!0,props:{bPrefix:h?`.${h}-`:void 0},anchorMetaName:wr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||Jh.mount({id:"n-global",head:!0,anchorMetaName:wr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:h,self:u,peers:m={}}={},themeOverrides:f={},builtinThemeOverrides:g={}}=s,{common:p,peers:y}=f,{common:b=void 0,[t]:{common:_=void 0,self:v=void 0,peers:k={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:
|
|
126
|
+
`)]);var rx={};function Ss(t,e,n){if(!e){rx.NODE_ENV!=="production"&&Gh("use-style","No style is specified.");return}const r=ci(),s=i.inject(fi,null),o=()=>{const a=n.value;e.mount({id:a===void 0?t:a+t,head:!0,anchorMetaName:wr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget}),s!=null&&s.preflightStyleDisabled||Jh.mount({id:"n-global",head:!0,anchorMetaName:wr,ssr:r,parent:s==null?void 0:s.styleMountTarget})};r?o():i.onBeforeMount(o)}function lC(t){return t}function ut(t,e,n,r,s,o){const a=ci(),l=i.inject(fi,null);if(n){const d=()=>{const h=o==null?void 0:o.value;n.mount({id:h===void 0?e:h+e,head:!0,props:{bPrefix:h?`.${h}-`:void 0},anchorMetaName:wr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||Jh.mount({id:"n-global",head:!0,anchorMetaName:wr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:h,self:u,peers:m={}}={},themeOverrides:f={},builtinThemeOverrides:g={}}=s,{common:p,peers:y}=f,{common:b=void 0,[t]:{common:_=void 0,self:v=void 0,peers:k={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:S=void 0,[t]:B={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:C,peers:T={}}=B,$=A.merge({},h||_||b||r.common,S,C,p),E=A.merge((d=u||v||r.self)===null||d===void 0?void 0:d($),g,B,f);return{common:$,self:E,peers:A.merge({},r.peers,k,m),peerOverrides:A.merge({},g.peers,T,y)}})}ut.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const sx=ue("base-icon",`
|
|
127
127
|
height: 1em;
|
|
128
128
|
width: 1em;
|
|
129
129
|
line-height: 1em;
|
|
@@ -134,7 +134,7 @@ ${s}
|
|
|
134
134
|
`,[ae("svg",`
|
|
135
135
|
height: 1em;
|
|
136
136
|
width: 1em;
|
|
137
|
-
`)]),kr=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){Ss("-base-icon",sx,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)}}),eu=i.defineComponent({name:"BaseIconSwitchTransition",setup(t,{slots:e}){const n=fs();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},e)}});function tu(t,e){const n=i.defineComponent({render(){return e()}});return i.defineComponent({name:
|
|
137
|
+
`)]),kr=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){Ss("-base-icon",sx,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)}}),eu=i.defineComponent({name:"BaseIconSwitchTransition",setup(t,{slots:e}){const n=fs();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},e)}});function tu(t,e){const n=i.defineComponent({render(){return e()}});return i.defineComponent({name:A.upperFirst(t),setup(){var r;const s=(r=i.inject(fi,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 ox=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"})))}}),ax=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"}))}}),lx=tu("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"}))))),cx=tu("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"}))))),dx=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:hx}=vr;function ca({originalTransform:t="",left:e=0,top:n=0,transition:r=`all .3s ${hx} !important`}={}){return[ae("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${t} scale(0.75)`,left:e,top:n,opacity:0}),ae("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${t}`,left:e,top:n,opacity:1}),ae("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:e,top:n,transition:r})]}const ux=ue("base-clear",`
|
|
138
138
|
flex-shrink: 0;
|
|
139
139
|
height: 1em;
|
|
140
140
|
width: 1em;
|
|
@@ -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
|
-
`,[_x(),ae("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),Sx=Object.assign(Object.assign({},ut.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"}}),ou=i.defineComponent({name:"Scrollbar",props:Sx,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=gi(t),s=xr("Scrollbar",r,e),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),u=i.ref(null),m=i.ref(null),f=i.ref(null),g=i.ref(null),p=i.ref(null),y=i.ref(0),b=i.ref(0),_=i.ref(!1),v=i.ref(!1);let k=!1,C=!1,B,S,T=0,$=0,E=0,O=0;const I=t1(),A=ut("Scrollbar","-scrollbar",Cx,ha,t,e),L=i.computed(()=>{const{value:R}=m,{value:j}=h,{value:ne}=g;return R===null||j===null||ne===null?0:Math.min(R,ne*R/j+hr(A.value.self.width)*1.5)}),D=i.computed(()=>`${L.value}px`),ee=i.computed(()=>{const{value:R}=f,{value:j}=u,{value:ne}=p;return R===null||j===null||ne===null?0:ne*R/j+hr(A.value.self.height)*1.5}),N=i.computed(()=>`${ee.value}px`),P=i.computed(()=>{const{value:R}=m,{value:j}=y,{value:ne}=h,{value:le}=g;if(R===null||ne===null||le===null)return 0;{const ce=ne-R;return ce?j/ce*(le-L.value):0}}),H=i.computed(()=>`${P.value}px`),q=i.computed(()=>{const{value:R}=f,{value:j}=b,{value:ne}=u,{value:le}=p;if(R===null||ne===null||le===null)return 0;{const ce=ne-R;return ce?j/ce*(le-ee.value):0}}),Y=i.computed(()=>`${q.value}px`),F=i.computed(()=>{const{value:R}=m,{value:j}=h;return R!==null&&j!==null&&j>R}),M=i.computed(()=>{const{value:R}=f,{value:j}=u;return R!==null&&j!==null&&j>R}),Z=i.computed(()=>{const{trigger:R}=t;return R==="none"||_.value}),fe=i.computed(()=>{const{trigger:R}=t;return R==="none"||v.value}),ie=i.computed(()=>{const{container:R}=t;return R?R():a.value}),me=i.computed(()=>{const{content:R}=t;return R?R():l.value}),re=(R,j)=>{if(!t.scrollable)return;if(typeof R=="number"){pt(R,j??0,0,!1,"auto");return}const{left:ne,top:le,index:ce,elSize:pe,position:_e,behavior:xe,el:Ye,debounce:yn=!0}=R;(ne!==void 0||le!==void 0)&&pt(ne??0,le??0,0,!1,xe),Ye!==void 0?pt(0,Ye.offsetTop,Ye.offsetHeight,yn,xe):ce!==void 0&&pe!==void 0?pt(0,ce*pe,pe,yn,xe):_e==="bottom"?pt(0,Number.MAX_SAFE_INTEGER,0,!1,xe):_e==="top"&&pt(0,0,0,!1,xe)},Me=lw(()=>{t.container||re({top:y.value,left:b.value})}),Ae=()=>{Me.isDeactivated||se()},Oe=R=>{if(Me.isDeactivated)return;const{onResize:j}=t;j&&j(R),se()},Le=(R,j)=>{if(!t.scrollable)return;const{value:ne}=ie;ne&&(typeof R=="object"?ne.scrollBy(R):ne.scrollBy(R,j||0))};function pt(R,j,ne,le,ce){const{value:pe}=ie;if(pe){if(le){const{scrollTop:_e,offsetHeight:xe}=pe;if(j>_e){j+ne<=_e+xe||pe.scrollTo({left:R,top:j+ne-xe,behavior:ce});return}}pe.scrollTo({left:R,top:j,behavior:ce})}}function Zt(){pn(),Pn(),se()}function Qt(){St()}function St(){At(),yt()}function At(){S!==void 0&&window.clearTimeout(S),S=window.setTimeout(()=>{v.value=!1},t.duration)}function yt(){B!==void 0&&window.clearTimeout(B),B=window.setTimeout(()=>{_.value=!1},t.duration)}function pn(){B!==void 0&&window.clearTimeout(B),_.value=!0}function Pn(){S!==void 0&&window.clearTimeout(S),v.value=!0}function De(R){const{onScroll:j}=t;j&&j(R),ke()}function ke(){const{value:R}=ie;R&&(y.value=R.scrollTop,b.value=R.scrollLeft*(s!=null&&s.value?-1:1))}function Ie(){const{value:R}=me;R&&(h.value=R.offsetHeight,u.value=R.offsetWidth);const{value:j}=ie;j&&(m.value=j.offsetHeight,f.value=j.offsetWidth);const{value:ne}=d,{value:le}=c;ne&&(p.value=ne.offsetWidth),le&&(g.value=le.offsetHeight)}function J(){const{value:R}=ie;R&&(y.value=R.scrollTop,b.value=R.scrollLeft*(s!=null&&s.value?-1:1),m.value=R.offsetHeight,f.value=R.offsetWidth,h.value=R.scrollHeight,u.value=R.scrollWidth);const{value:j}=d,{value:ne}=c;j&&(p.value=j.offsetWidth),ne&&(g.value=ne.offsetHeight)}function se(){t.scrollable&&(t.useUnifiedContainer?J():(Ie(),ke()))}function Ce(R){var j;return!(!((j=o.value)===null||j===void 0)&&j.contains(dr(R)))}function Jt(R){R.preventDefault(),R.stopPropagation(),C=!0,kt("mousemove",window,Ui,!0),kt("mouseup",window,wi,!0),$=b.value,E=s!=null&&s.value?window.innerWidth-R.clientX:R.clientX}function Ui(R){if(!C)return;B!==void 0&&window.clearTimeout(B),S!==void 0&&window.clearTimeout(S);const{value:j}=f,{value:ne}=u,{value:le}=ee;if(j===null||ne===null)return;const pe=(s!=null&&s.value?window.innerWidth-R.clientX-E:R.clientX-E)*(ne-j)/(j-le),_e=ne-j;let xe=$+pe;xe=Math.min(_e,xe),xe=Math.max(xe,0);const{value:Ye}=ie;if(Ye){Ye.scrollLeft=xe*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:yn}=t;yn&&yn(xe)}}function wi(R){R.preventDefault(),R.stopPropagation(),et("mousemove",window,Ui,!0),et("mouseup",window,wi,!0),C=!1,se(),Ce(R)&&St()}function Gi(R){R.preventDefault(),R.stopPropagation(),k=!0,kt("mousemove",window,Xn,!0),kt("mouseup",window,xi,!0),T=y.value,O=R.clientY}function Xn(R){if(!k)return;B!==void 0&&window.clearTimeout(B),S!==void 0&&window.clearTimeout(S);const{value:j}=m,{value:ne}=h,{value:le}=L;if(j===null||ne===null)return;const pe=(R.clientY-O)*(ne-j)/(j-le),_e=ne-j;let xe=T+pe;xe=Math.min(_e,xe),xe=Math.max(xe,0);const{value:Ye}=ie;Ye&&(Ye.scrollTop=xe)}function xi(R){R.preventDefault(),R.stopPropagation(),et("mousemove",window,Xn,!0),et("mouseup",window,xi,!0),k=!1,se(),Ce(R)&&St()}i.watchEffect(()=>{const{value:R}=M,{value:j}=F,{value:ne}=e,{value:le}=d,{value:ce}=c;le&&(R?le.classList.remove(`${ne}-scrollbar-rail--disabled`):le.classList.add(`${ne}-scrollbar-rail--disabled`)),ce&&(j?ce.classList.remove(`${ne}-scrollbar-rail--disabled`):ce.classList.add(`${ne}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||se()}),i.onBeforeUnmount(()=>{B!==void 0&&window.clearTimeout(B),S!==void 0&&window.clearTimeout(S),et("mousemove",window,Xn,!0),et("mouseup",window,xi,!0)});const Ki=i.computed(()=>{const{common:{cubicBezierEaseInOut:R},self:{color:j,colorHover:ne,height:le,width:ce,borderRadius:pe,railInsetHorizontalTop:_e,railInsetHorizontalBottom:xe,railInsetVerticalRight:Ye,railInsetVerticalLeft:yn,railColor:ba}}=A.value,{top:_a,right:wa,bottom:xa,left:va}=Yt(_e),{top:ka,right:Ca,bottom:Sa,left:Ba}=Yt(xe),{top:Ta,right:Ra,bottom:$a,left:Ea}=Yt(s!=null&&s.value?Hh(Ye):Ye),{top:Na,right:Pa,bottom:Fa,left:Ma}=Yt(s!=null&&s.value?Hh(yn):yn);return{"--n-scrollbar-bezier":R,"--n-scrollbar-color":j,"--n-scrollbar-color-hover":ne,"--n-scrollbar-border-radius":pe,"--n-scrollbar-width":ce,"--n-scrollbar-height":le,"--n-scrollbar-rail-top-horizontal-top":_a,"--n-scrollbar-rail-right-horizontal-top":wa,"--n-scrollbar-rail-bottom-horizontal-top":xa,"--n-scrollbar-rail-left-horizontal-top":va,"--n-scrollbar-rail-top-horizontal-bottom":ka,"--n-scrollbar-rail-right-horizontal-bottom":Ca,"--n-scrollbar-rail-bottom-horizontal-bottom":Sa,"--n-scrollbar-rail-left-horizontal-bottom":Ba,"--n-scrollbar-rail-top-vertical-right":Ta,"--n-scrollbar-rail-right-vertical-right":Ra,"--n-scrollbar-rail-bottom-vertical-right":$a,"--n-scrollbar-rail-left-vertical-right":Ea,"--n-scrollbar-rail-top-vertical-left":Na,"--n-scrollbar-rail-right-vertical-left":Pa,"--n-scrollbar-rail-bottom-vertical-left":Fa,"--n-scrollbar-rail-left-vertical-left":Ma,"--n-scrollbar-rail-color":ba}}),en=n?mi("scrollbar",void 0,Ki,t):void 0;return Object.assign(Object.assign({},{scrollTo:re,scrollBy:Le,sync:se,syncUnifiedContainer:J,handleMouseEnterWrapper:Zt,handleMouseLeaveWrapper:Qt}),{mergedClsPrefix:e,rtlEnabled:s,containerScrollTop:y,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:F,needXBar:M,yBarSizePx:D,xBarSizePx:N,yBarTopPx:H,xBarLeftPx:Y,isShowXBar:Z,isShowYBar:fe,isIos:I,handleScroll:De,handleContentResize:Ae,handleContainerResize:Oe,handleYScrollMouseDown:Gi,handleXScrollMouseDown:Jt,cssVars:n?void 0:Ki,themeClass:en==null?void 0:en.themeClass,onRender:en==null?void 0:en.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",h=(f,g)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,f],"data-scrollbar-rail":!0,style:[g||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?aa: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})),u=()=>{var f,g;return(f=this.onRender)===null||f===void 0||f.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?(g=e.default)===null||g===void 0?void 0:g.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(vs,{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:h(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?aa: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?u():i.h(vs,{onResize:this.handleContainerResize},{default:u});return o?i.h(i.Fragment,null,m,h(this.themeClass,this.cssVars)):m}}),Bx=ou,Tx={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function Rx(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},Tx),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const au={name:"Empty",common:pi,self:Rx},$x=ue("empty",`
|
|
297
|
+
`,[_x(),ae("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),Sx=Object.assign(Object.assign({},ut.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"}}),ou=i.defineComponent({name:"Scrollbar",props:Sx,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=gi(t),s=xr("Scrollbar",r,e),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),u=i.ref(null),m=i.ref(null),f=i.ref(null),g=i.ref(null),p=i.ref(null),y=i.ref(0),b=i.ref(0),_=i.ref(!1),v=i.ref(!1);let k=!1,S=!1,B,C,T=0,$=0,E=0,I=0;const O=t1(),V=ut("Scrollbar","-scrollbar",Cx,ha,t,e),L=i.computed(()=>{const{value:R}=m,{value:j}=h,{value:ne}=g;return R===null||j===null||ne===null?0:Math.min(R,ne*R/j+hr(V.value.self.width)*1.5)}),D=i.computed(()=>`${L.value}px`),ee=i.computed(()=>{const{value:R}=f,{value:j}=u,{value:ne}=p;return R===null||j===null||ne===null?0:ne*R/j+hr(V.value.self.height)*1.5}),N=i.computed(()=>`${ee.value}px`),P=i.computed(()=>{const{value:R}=m,{value:j}=y,{value:ne}=h,{value:le}=g;if(R===null||ne===null||le===null)return 0;{const ce=ne-R;return ce?j/ce*(le-L.value):0}}),H=i.computed(()=>`${P.value}px`),q=i.computed(()=>{const{value:R}=f,{value:j}=b,{value:ne}=u,{value:le}=p;if(R===null||ne===null||le===null)return 0;{const ce=ne-R;return ce?j/ce*(le-ee.value):0}}),U=i.computed(()=>`${q.value}px`),F=i.computed(()=>{const{value:R}=m,{value:j}=h;return R!==null&&j!==null&&j>R}),M=i.computed(()=>{const{value:R}=f,{value:j}=u;return R!==null&&j!==null&&j>R}),Z=i.computed(()=>{const{trigger:R}=t;return R==="none"||_.value}),fe=i.computed(()=>{const{trigger:R}=t;return R==="none"||v.value}),ie=i.computed(()=>{const{container:R}=t;return R?R():a.value}),me=i.computed(()=>{const{content:R}=t;return R?R():l.value}),re=(R,j)=>{if(!t.scrollable)return;if(typeof R=="number"){pt(R,j??0,0,!1,"auto");return}const{left:ne,top:le,index:ce,elSize:pe,position:_e,behavior:xe,el:Ye,debounce:yn=!0}=R;(ne!==void 0||le!==void 0)&&pt(ne??0,le??0,0,!1,xe),Ye!==void 0?pt(0,Ye.offsetTop,Ye.offsetHeight,yn,xe):ce!==void 0&&pe!==void 0?pt(0,ce*pe,pe,yn,xe):_e==="bottom"?pt(0,Number.MAX_SAFE_INTEGER,0,!1,xe):_e==="top"&&pt(0,0,0,!1,xe)},Me=lw(()=>{t.container||re({top:y.value,left:b.value})}),Ae=()=>{Me.isDeactivated||se()},Ie=R=>{if(Me.isDeactivated)return;const{onResize:j}=t;j&&j(R),se()},Le=(R,j)=>{if(!t.scrollable)return;const{value:ne}=ie;ne&&(typeof R=="object"?ne.scrollBy(R):ne.scrollBy(R,j||0))};function pt(R,j,ne,le,ce){const{value:pe}=ie;if(pe){if(le){const{scrollTop:_e,offsetHeight:xe}=pe;if(j>_e){j+ne<=_e+xe||pe.scrollTo({left:R,top:j+ne-xe,behavior:ce});return}}pe.scrollTo({left:R,top:j,behavior:ce})}}function Zt(){pn(),Pn(),se()}function Qt(){St()}function St(){At(),yt()}function At(){C!==void 0&&window.clearTimeout(C),C=window.setTimeout(()=>{v.value=!1},t.duration)}function yt(){B!==void 0&&window.clearTimeout(B),B=window.setTimeout(()=>{_.value=!1},t.duration)}function pn(){B!==void 0&&window.clearTimeout(B),_.value=!0}function Pn(){C!==void 0&&window.clearTimeout(C),v.value=!0}function De(R){const{onScroll:j}=t;j&&j(R),ke()}function ke(){const{value:R}=ie;R&&(y.value=R.scrollTop,b.value=R.scrollLeft*(s!=null&&s.value?-1:1))}function Oe(){const{value:R}=me;R&&(h.value=R.offsetHeight,u.value=R.offsetWidth);const{value:j}=ie;j&&(m.value=j.offsetHeight,f.value=j.offsetWidth);const{value:ne}=d,{value:le}=c;ne&&(p.value=ne.offsetWidth),le&&(g.value=le.offsetHeight)}function J(){const{value:R}=ie;R&&(y.value=R.scrollTop,b.value=R.scrollLeft*(s!=null&&s.value?-1:1),m.value=R.offsetHeight,f.value=R.offsetWidth,h.value=R.scrollHeight,u.value=R.scrollWidth);const{value:j}=d,{value:ne}=c;j&&(p.value=j.offsetWidth),ne&&(g.value=ne.offsetHeight)}function se(){t.scrollable&&(t.useUnifiedContainer?J():(Oe(),ke()))}function Ce(R){var j;return!(!((j=o.value)===null||j===void 0)&&j.contains(dr(R)))}function Jt(R){R.preventDefault(),R.stopPropagation(),S=!0,kt("mousemove",window,Ui,!0),kt("mouseup",window,wi,!0),$=b.value,E=s!=null&&s.value?window.innerWidth-R.clientX:R.clientX}function Ui(R){if(!S)return;B!==void 0&&window.clearTimeout(B),C!==void 0&&window.clearTimeout(C);const{value:j}=f,{value:ne}=u,{value:le}=ee;if(j===null||ne===null)return;const pe=(s!=null&&s.value?window.innerWidth-R.clientX-E:R.clientX-E)*(ne-j)/(j-le),_e=ne-j;let xe=$+pe;xe=Math.min(_e,xe),xe=Math.max(xe,0);const{value:Ye}=ie;if(Ye){Ye.scrollLeft=xe*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:yn}=t;yn&&yn(xe)}}function wi(R){R.preventDefault(),R.stopPropagation(),et("mousemove",window,Ui,!0),et("mouseup",window,wi,!0),S=!1,se(),Ce(R)&&St()}function Gi(R){R.preventDefault(),R.stopPropagation(),k=!0,kt("mousemove",window,Xn,!0),kt("mouseup",window,xi,!0),T=y.value,I=R.clientY}function Xn(R){if(!k)return;B!==void 0&&window.clearTimeout(B),C!==void 0&&window.clearTimeout(C);const{value:j}=m,{value:ne}=h,{value:le}=L;if(j===null||ne===null)return;const pe=(R.clientY-I)*(ne-j)/(j-le),_e=ne-j;let xe=T+pe;xe=Math.min(_e,xe),xe=Math.max(xe,0);const{value:Ye}=ie;Ye&&(Ye.scrollTop=xe)}function xi(R){R.preventDefault(),R.stopPropagation(),et("mousemove",window,Xn,!0),et("mouseup",window,xi,!0),k=!1,se(),Ce(R)&&St()}i.watchEffect(()=>{const{value:R}=M,{value:j}=F,{value:ne}=e,{value:le}=d,{value:ce}=c;le&&(R?le.classList.remove(`${ne}-scrollbar-rail--disabled`):le.classList.add(`${ne}-scrollbar-rail--disabled`)),ce&&(j?ce.classList.remove(`${ne}-scrollbar-rail--disabled`):ce.classList.add(`${ne}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||se()}),i.onBeforeUnmount(()=>{B!==void 0&&window.clearTimeout(B),C!==void 0&&window.clearTimeout(C),et("mousemove",window,Xn,!0),et("mouseup",window,xi,!0)});const Ki=i.computed(()=>{const{common:{cubicBezierEaseInOut:R},self:{color:j,colorHover:ne,height:le,width:ce,borderRadius:pe,railInsetHorizontalTop:_e,railInsetHorizontalBottom:xe,railInsetVerticalRight:Ye,railInsetVerticalLeft:yn,railColor:ba}}=V.value,{top:_a,right:wa,bottom:xa,left:va}=Yt(_e),{top:ka,right:Ca,bottom:Sa,left:Ba}=Yt(xe),{top:Ta,right:Ra,bottom:$a,left:Ea}=Yt(s!=null&&s.value?Hh(Ye):Ye),{top:Na,right:Pa,bottom:Fa,left:Ma}=Yt(s!=null&&s.value?Hh(yn):yn);return{"--n-scrollbar-bezier":R,"--n-scrollbar-color":j,"--n-scrollbar-color-hover":ne,"--n-scrollbar-border-radius":pe,"--n-scrollbar-width":ce,"--n-scrollbar-height":le,"--n-scrollbar-rail-top-horizontal-top":_a,"--n-scrollbar-rail-right-horizontal-top":wa,"--n-scrollbar-rail-bottom-horizontal-top":xa,"--n-scrollbar-rail-left-horizontal-top":va,"--n-scrollbar-rail-top-horizontal-bottom":ka,"--n-scrollbar-rail-right-horizontal-bottom":Ca,"--n-scrollbar-rail-bottom-horizontal-bottom":Sa,"--n-scrollbar-rail-left-horizontal-bottom":Ba,"--n-scrollbar-rail-top-vertical-right":Ta,"--n-scrollbar-rail-right-vertical-right":Ra,"--n-scrollbar-rail-bottom-vertical-right":$a,"--n-scrollbar-rail-left-vertical-right":Ea,"--n-scrollbar-rail-top-vertical-left":Na,"--n-scrollbar-rail-right-vertical-left":Pa,"--n-scrollbar-rail-bottom-vertical-left":Fa,"--n-scrollbar-rail-left-vertical-left":Ma,"--n-scrollbar-rail-color":ba}}),en=n?mi("scrollbar",void 0,Ki,t):void 0;return Object.assign(Object.assign({},{scrollTo:re,scrollBy:Le,sync:se,syncUnifiedContainer:J,handleMouseEnterWrapper:Zt,handleMouseLeaveWrapper:Qt}),{mergedClsPrefix:e,rtlEnabled:s,containerScrollTop:y,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:F,needXBar:M,yBarSizePx:D,xBarSizePx:N,yBarTopPx:H,xBarLeftPx:U,isShowXBar:Z,isShowYBar:fe,isIos:O,handleScroll:De,handleContentResize:Ae,handleContainerResize:Ie,handleYScrollMouseDown:Gi,handleXScrollMouseDown:Jt,cssVars:n?void 0:Ki,themeClass:en==null?void 0:en.themeClass,onRender:en==null?void 0:en.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",h=(f,g)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,f],"data-scrollbar-rail":!0,style:[g||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?aa: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})),u=()=>{var f,g;return(f=this.onRender)===null||f===void 0||f.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?(g=e.default)===null||g===void 0?void 0:g.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(vs,{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:h(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?aa: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?u():i.h(vs,{onResize:this.handleContainerResize},{default:u});return o?i.h(i.Fragment,null,m,h(this.themeClass,this.cssVars)):m}}),Bx=ou,Tx={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function Rx(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},Tx),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const au={name:"Empty",common:pi,self:Rx},$x=ue("empty",`
|
|
298
298
|
display: flex;
|
|
299
299
|
flex-direction: column;
|
|
300
300
|
align-items: center;
|
|
@@ -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
|
-
`,[fu({enterScale:"0.5"})])])]),Vx=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},ut.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}=gi(t),r=xr("InternalSelectMenu",n,e),s=ut("InternalSelectMenu","-internal-select-menu",Ax,lu,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(()=>R_(c.value)),h=i.ref(null);function u(){const{treeMate:F}=t;let M=null;const{value:Z}=t;Z===null?M=F.getFirstAvailableNode():(t.multiple?M=F.getNode((Z||[])[(Z||[]).length-1]):M=F.getNode(Z),(!M||M.disabled)&&(M=F.getFirstAvailableNode())),L(M||null)}function m(){const{value:F}=h;F&&!t.treeMate.getNode(F.key)&&(h.value=null)}let f;i.watch(()=>t.show,F=>{F?f=i.watch(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?u():m(),i.nextTick(D)):m()},{immediate:!0}):f==null||f()},{immediate:!0}),i.onBeforeUnmount(()=>{f==null||f()});const g=i.computed(()=>hr(s.value.self[Ge("optionHeight",t.size)])),p=i.computed(()=>Yt(s.value.self[Ge("padding",t.size)])),y=i.computed(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),b=i.computed(()=>{const F=c.value;return F&&F.length===0});function _(F){const{onToggle:M}=t;M&&M(F)}function v(F){const{onScroll:M}=t;M&&M(F)}function k(F){var M;(M=l.value)===null||M===void 0||M.sync(),v(F)}function
|
|
427
|
+
`,[fu({enterScale:"0.5"})])])]),Vx=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},ut.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}=gi(t),r=xr("InternalSelectMenu",n,e),s=ut("InternalSelectMenu","-internal-select-menu",Ax,lu,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(()=>R_(c.value)),h=i.ref(null);function u(){const{treeMate:F}=t;let M=null;const{value:Z}=t;Z===null?M=F.getFirstAvailableNode():(t.multiple?M=F.getNode((Z||[])[(Z||[]).length-1]):M=F.getNode(Z),(!M||M.disabled)&&(M=F.getFirstAvailableNode())),L(M||null)}function m(){const{value:F}=h;F&&!t.treeMate.getNode(F.key)&&(h.value=null)}let f;i.watch(()=>t.show,F=>{F?f=i.watch(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?u():m(),i.nextTick(D)):m()},{immediate:!0}):f==null||f()},{immediate:!0}),i.onBeforeUnmount(()=>{f==null||f()});const g=i.computed(()=>hr(s.value.self[Ge("optionHeight",t.size)])),p=i.computed(()=>Yt(s.value.self[Ge("padding",t.size)])),y=i.computed(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),b=i.computed(()=>{const F=c.value;return F&&F.length===0});function _(F){const{onToggle:M}=t;M&&M(F)}function v(F){const{onScroll:M}=t;M&&M(F)}function k(F){var M;(M=l.value)===null||M===void 0||M.sync(),v(F)}function S(){var F;(F=l.value)===null||F===void 0||F.sync()}function B(){const{value:F}=h;return F||null}function C(F,M){M.disabled||L(M,!1)}function T(F,M){M.disabled||_(M)}function $(F){var M;cr(F,"action")||(M=t.onKeyup)===null||M===void 0||M.call(t,F)}function E(F){var M;cr(F,"action")||(M=t.onKeydown)===null||M===void 0||M.call(t,F)}function I(F){var M;(M=t.onMousedown)===null||M===void 0||M.call(t,F),!t.focusable&&F.preventDefault()}function O(){const{value:F}=h;F&&L(F.getNext({loop:!0}),!0)}function V(){const{value:F}=h;F&&L(F.getPrev({loop:!0}),!0)}function L(F,M=!1){h.value=F,M&&D()}function D(){var F,M;const Z=h.value;if(!Z)return;const fe=d.value(Z.key);fe!==null&&(t.virtualScroll?(F=a.value)===null||F===void 0||F.scrollTo({index:fe}):(M=l.value)===null||M===void 0||M.scrollTo({index:fe,elSize:g.value}))}function ee(F){var M,Z;!((M=o.value)===null||M===void 0)&&M.contains(F.target)&&((Z=t.onFocus)===null||Z===void 0||Z.call(t,F))}function N(F){var M,Z;!((M=o.value)===null||M===void 0)&&M.contains(F.relatedTarget)||(Z=t.onBlur)===null||Z===void 0||Z.call(t,F)}i.provide(ta,{handleOptionMouseEnter:C,handleOptionClick:T,valueSetRef:y,pendingTmNodeRef:h,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(Mh,o),i.onMounted(()=>{const{value:F}=l;F&&F.sync()});const P=i.computed(()=>{const{size:F}=t,{common:{cubicBezierEaseInOut:M},self:{height:Z,borderRadius:fe,color:ie,groupHeaderTextColor:me,actionDividerColor:re,optionTextColorPressed:Me,optionTextColor:Ae,optionTextColorDisabled:Ie,optionTextColorActive:Le,optionOpacityDisabled:pt,optionCheckColor:Zt,actionTextColor:Qt,optionColorPending:St,optionColorActive:At,loadingColor:yt,loadingSize:pn,optionColorActivePending:Pn,[Ge("optionFontSize",F)]:De,[Ge("optionHeight",F)]:ke,[Ge("optionPadding",F)]:Oe}}=s.value;return{"--n-height":Z,"--n-action-divider-color":re,"--n-action-text-color":Qt,"--n-bezier":M,"--n-border-radius":fe,"--n-color":ie,"--n-option-font-size":De,"--n-group-header-text-color":me,"--n-option-check-color":Zt,"--n-option-color-pending":St,"--n-option-color-active":At,"--n-option-color-active-pending":Pn,"--n-option-height":ke,"--n-option-opacity-disabled":pt,"--n-option-text-color":Ae,"--n-option-text-color-active":Le,"--n-option-text-color-disabled":Ie,"--n-option-text-color-pressed":Me,"--n-option-padding":Oe,"--n-option-padding-left":Yt(Oe,"left"),"--n-option-padding-right":Yt(Oe,"right"),"--n-loading-color":yt,"--n-loading-size":pn}}),{inlineThemeDisabled:H}=t,q=H?mi("internal-select-menu",i.computed(()=>t.size[0]),P,t):void 0,U={selfRef:o,next:O,prev:V,getPendingTmNode:B};return zh(o,t.onResize),Object.assign({mergedTheme:s,mergedClsPrefix:e,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:g,padding:p,flattenedNodes:c,empty:b,virtualListContainer(){const{value:F}=a;return F==null?void 0:F.listElRef},virtualListContent(){const{value:F}=a;return F==null?void 0:F.itemsElRef},doScroll:v,handleFocusin:ee,handleFocusout:N,handleKeyUp:$,handleKeyDown:E,handleMouseDown:I,handleVirtualListResize:S,handleVirtualListScroll:k,cssVars:H?void 0:P,themeClass:q==null?void 0:q.themeClass,onRender:q==null?void 0:q.onRender},U)},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},ui(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(nu,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},oa(t.empty,()=>[i.h(Nx,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(ou,{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(rw,{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(cu,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h(du,{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(cu,{key:a.key,clsPrefix:n,tmNode:a}):i.h(du,{clsPrefix:n,key:a.key,tmNode:a})))}),ui(t.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(px,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),Ix={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function Ox(t){const{boxShadow2:e,popoverColor:n,textColor2:r,borderRadius:s,fontSize:o,dividerColor:a}=t;return Object.assign(Object.assign({},Ix),{fontSize:o,borderRadius:s,color:n,dividerColor:a,textColor:r,boxShadow:e})}const gu={name:"Popover",common:pi,peers:{Scrollbar:ha},self:Ox},ua={top:"bottom",bottom:"top",left:"right",right:"left"},tt="var(--n-arrow-height) * 1.414",zx=ae([ue("popover",`
|
|
428
428
|
transition:
|
|
429
429
|
box-shadow .3s var(--n-bezier),
|
|
430
430
|
background-color .3s var(--n-bezier),
|
|
@@ -526,7 +526,7 @@ ${s}
|
|
|
526
526
|
`),jt("right-end",`
|
|
527
527
|
right: calc(${tt} / -2);
|
|
528
528
|
bottom: calc(${Cn("right-end")} + var(--v-offset-top));
|
|
529
|
-
`),...
|
|
529
|
+
`),...A.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)`} - ${tt}) / 2)`,c=Cn(s);return ae(`[v-placement="${s}"] >`,[ue("popover-shared",[Be("center-arrow",[ue("popover-arrow",`${e}: calc(max(${l}, ${c}) ${o?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function Cn(t){return["top","bottom"].includes(t.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function jt(t,e){const n=t.split("-")[0],r=["top","bottom"].includes(n)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return ae(`[v-placement="${t}"] >`,[ue("popover-shared",`
|
|
530
530
|
margin-${ua[n]}: var(--n-space);
|
|
531
531
|
`,[Be("show-arrow",`
|
|
532
532
|
margin-${ua[n]}: var(--n-space-arrow);
|
|
@@ -540,7 +540,7 @@ ${s}
|
|
|
540
540
|
${n}: 100%;
|
|
541
541
|
${ua[n]}: auto;
|
|
542
542
|
${r}
|
|
543
|
-
`,[ue("popover-arrow",e)])])])}const mu=Object.assign(Object.assign({},ut.props),{to:kn.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 Lx({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 Dx=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:mu,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o,mergedRtlRef:a}=gi(t),l=ut("Popover","-popover",zx,gu,t,s),c=xr("Popover",a,s),d=i.ref(null),h=i.inject("NPopover"),u=i.ref(null),m=i.ref(t.show),f=i.ref(!1);i.watchEffect(()=>{const{show:$}=t;$&&!mw()&&!t.internalDeactivateImmediately&&(f.value=!0)});const g=i.computed(()=>{const{trigger:$,onClickoutside:E}=t,O=[],{positionManuallyRef:{value:I}}=h;return I||($==="click"&&!E&&O.push([us,B,void 0,{capture:!0}]),$==="hover"&&O.push([U_,C])),E&&O.push([us,B,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&f.value)&&O.push([i.vShow,t.show]),O}),p=i.computed(()=>{const{common:{cubicBezierEaseInOut:$,cubicBezierEaseIn:E,cubicBezierEaseOut:O},self:{space:I,spaceArrow:A,padding:L,fontSize:D,textColor:ee,dividerColor:N,color:P,boxShadow:H,borderRadius:q,arrowHeight:Y,arrowOffset:F,arrowOffsetVertical:M}}=l.value;return{"--n-box-shadow":H,"--n-bezier":$,"--n-bezier-ease-in":E,"--n-bezier-ease-out":O,"--n-font-size":D,"--n-text-color":ee,"--n-color":P,"--n-divider-color":N,"--n-border-radius":q,"--n-arrow-height":Y,"--n-arrow-offset":F,"--n-arrow-offset-vertical":M,"--n-padding":L,"--n-space":I,"--n-space-arrow":A}}),y=i.computed(()=>{const $=t.width==="trigger"?void 0:na(t.width),E=[];$&&E.push({width:$});const{maxWidth:O,minWidth:I}=t;return O&&E.push({maxWidth:na(O)}),I&&E.push({maxWidth:na(I)}),o||E.push(p.value),E}),b=o?mi("popover",void 0,p,t):void 0;h.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{h.setBodyInstance(null)}),i.watch(i.toRef(t,"show"),$=>{t.animated||($?m.value=!0:m.value=!1)});function _(){var $;($=d.value)===null||$===void 0||$.syncPosition()}function v($){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&h.handleMouseEnter($)}function k($){t.trigger==="hover"&&t.keepAliveOnHover&&h.handleMouseLeave($)}function C($){t.trigger==="hover"&&!S().contains(dr($))&&h.handleMouseMoveOutside($)}function B($){(t.trigger==="click"&&!S().contains(dr($))||t.onClickoutside)&&h.handleClickOutside($)}function S(){return h.getTriggerElement()}i.provide(Oh,u),i.provide(Ah,null),i.provide(Vh,null);function T(){if(b==null||b.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&f.value))return null;let E;const O=h.internalRenderBodyRef.value,{value:I}=s;if(O)E=O([`${I}-popover-shared`,(c==null?void 0:c.value)&&`${I}-popover--rtl`,b==null?void 0:b.themeClass.value,t.overlap&&`${I}-popover-shared--overlap`,t.showArrow&&`${I}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${I}-popover-shared--center-arrow`],u,y.value,v,k);else{const{value:A}=h.extraClassRef,{internalTrapFocus:L}=t,D=!Kh(e.header)||!Kh(e.footer),ee=()=>{var N,P;const H=D?i.h(i.Fragment,null,ui(e.header,F=>F?i.h("div",{class:[`${I}-popover__header`,t.headerClass],style:t.headerStyle},F):null),ui(e.default,F=>F?i.h("div",{class:[`${I}-popover__content`,t.contentClass],style:t.contentStyle},e):null),ui(e.footer,F=>F?i.h("div",{class:[`${I}-popover__footer`,t.footerClass],style:t.footerStyle},F):null)):t.scrollable?(N=e.default)===null||N===void 0?void 0:N.call(e):i.h("div",{class:[`${I}-popover__content`,t.contentClass],style:t.contentStyle},e),q=t.scrollable?i.h(Bx,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:D?void 0:`${I}-popover__content ${(P=t.contentClass)!==null&&P!==void 0?P:""}`,contentStyle:D?void 0:t.contentStyle},{default:()=>H}):H,Y=t.showArrow?Lx({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:I}):null;return[q,Y]};E=i.h("div",i.mergeProps({class:[`${I}-popover`,`${I}-popover-shared`,(c==null?void 0:c.value)&&`${I}-popover--rtl`,b==null?void 0:b.themeClass.value,A.map(N=>`${I}-${N}`),{[`${I}-popover--scrollable`]:t.scrollable,[`${I}-popover--show-header-or-footer`]:D,[`${I}-popover--raw`]:t.raw,[`${I}-popover-shared--overlap`]:t.overlap,[`${I}-popover-shared--show-arrow`]:t.showArrow,[`${I}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:u,style:y.value,onKeydown:h.handleKeydown,onMouseenter:v,onMouseleave:k},n),L?i.h(aw,{active:t.show,autoFocus:!0},{default:ee}):ee())}return i.withDirectives(E,g.value)}return{displayed:f,namespace:r,isMounted:h.isMountedRef,zIndex:h.zIndexRef,followerRef:d,adjustedTo:kn(t),followerEnabled:m,renderContentNode:T}},render(){return i.h(dh,{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===kn.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 Hx={};const Wx=Object.keys(mu),jx={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function qx(t,e,n){jx[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 Xx={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:kn.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},Yx=Object.assign(Object.assign(Object.assign({},ut.props),Xx),{internalOnAfterLeave:Function,internalRenderBody:Function}),Ux=i.defineComponent({name:"Popover",inheritAttrs:!1,props:Yx,slots:Object,__popover__:!0,setup(t){Hx.NODE_ENV!=="production"&&i.watchEffect(()=>{t.maxWidth!==void 0&&jn("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&jn("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&jn("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&jn("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&jn("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=fs(),n=i.ref(null),r=i.computed(()=>t.show),s=i.ref(t.defaultShow),o=Ho(r,s),a=Wt(()=>t.disabled?!1:o.value),l=()=>{if(t.disabled)return!0;const{getDisabled:D}=t;return!!(D!=null&&D())},c=()=>l()?!1:o.value,d=jd(t,["arrow","showArrow"]),h=i.computed(()=>t.overlap?!1:d.value);let u=null;const m=i.ref(null),f=i.ref(null),g=Wt(()=>t.x!==void 0&&t.y!==void 0);function p(D){const{"onUpdate:show":ee,onUpdateShow:N,onShow:P,onHide:H}=t;s.value=D,ee&&ht(ee,D),N&&ht(N,D),D&&P&&ht(P,!0),D&&H&&ht(H,!1)}function y(){u&&u.syncPosition()}function b(){const{value:D}=m;D&&(window.clearTimeout(D),m.value=null)}function _(){const{value:D}=f;D&&(window.clearTimeout(D),f.value=null)}function v(){const D=l();if(t.trigger==="focus"&&!D){if(c())return;p(!0)}}function k(){const D=l();if(t.trigger==="focus"&&!D){if(!c())return;p(!1)}}function C(){const D=l();if(t.trigger==="hover"&&!D){if(_(),m.value!==null||c())return;const ee=()=>{p(!0),m.value=null},{delay:N}=t;N===0?ee():m.value=window.setTimeout(ee,N)}}function B(){const D=l();if(t.trigger==="hover"&&!D){if(b(),f.value!==null||!c())return;const ee=()=>{p(!1),f.value=null},{duration:N}=t;N===0?ee():f.value=window.setTimeout(ee,N)}}function S(){B()}function T(D){var ee;c()&&(t.trigger==="click"&&(b(),_(),p(!1)),(ee=t.onClickoutside)===null||ee===void 0||ee.call(t,D))}function $(){if(t.trigger==="click"&&!l()){b(),_();const D=!c();p(D)}}function E(D){t.internalTrapFocus&&D.key==="Escape"&&(b(),_(),p(!1))}function O(D){s.value=D}function I(){var D;return(D=n.value)===null||D===void 0?void 0:D.targetRef}function A(D){u=D}return i.provide("NPopover",{getTriggerElement:I,handleKeydown:E,handleMouseEnter:C,handleMouseLeave:B,handleClickOutside:T,handleMouseMoveOutside:S,setBodyInstance:A,positionManuallyRef:g,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:g,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:h,getMergedShow:c,setShow:O,handleClick:$,handleMouseEnter:C,handleMouseLeave:B,handleFocus:v,handleBlur:k,syncPosition:y}},render(){var t;const{positionManually:e,$slots:n}=this;let r,s=!1;if(!e&&(r=bw(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(h=>{h.onBlur(d)})},onFocus:d=>{l.forEach(h=>{h.onFocus(d)})},onClick:d=>{l.forEach(h=>{h.onClick(d)})},onMouseenter:d=>{l.forEach(h=>{h.onMouseenter(d)})},onMouseleave:d=>{l.forEach(h=>{h.onMouseleave(d)})}};qx(r,a?"nested":e?"manual":this.trigger,c)}}return i.h(Ud,{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}}),[[Wd,{enabled:o,zIndex:this.zIndex}]]):null,e?null:i.h(Gd,null,{default:()=>r}),i.h(Dx,_w(this.$props,Wx,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)}})]}})}}),Gx={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 Kx(t){const{textColor2:e,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:h,opacityDisabled:u,tagColor:m,closeIconColor:f,closeIconColorHover:g,closeIconColorPressed:p,borderRadiusSmall:y,fontSizeMini:b,fontSizeTiny:_,fontSizeSmall:v,fontSizeMedium:k,heightMini:C,heightTiny:B,heightSmall:S,heightMedium:T,closeColorHover:$,closeColorPressed:E,buttonColor2Hover:O,buttonColor2Pressed:I,fontWeightStrong:A}=t;return Object.assign(Object.assign({},Gx),{closeBorderRadius:y,heightTiny:C,heightSmall:B,heightMedium:S,heightLarge:T,borderRadius:y,opacityDisabled:u,fontSizeTiny:b,fontSizeSmall:_,fontSizeMedium:v,fontSizeLarge:k,fontWeightStrong:A,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:O,colorPressedCheckable:I,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${h}`,textColor:e,color:m,colorBordered:"rgb(250, 250, 252)",closeIconColor:f,closeIconColorHover:g,closeIconColorPressed:p,closeColorHover:$,closeColorPressed:E,borderPrimary:`1px solid ${Fe(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:Fe(s,{alpha:.12}),colorBorderedPrimary:Fe(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:Fe(s,{alpha:.12}),closeColorPressedPrimary:Fe(s,{alpha:.18}),borderInfo:`1px solid ${Fe(o,{alpha:.3})}`,textColorInfo:o,colorInfo:Fe(o,{alpha:.12}),colorBorderedInfo:Fe(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:Fe(o,{alpha:.12}),closeColorPressedInfo:Fe(o,{alpha:.18}),borderSuccess:`1px solid ${Fe(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Fe(a,{alpha:.12}),colorBorderedSuccess:Fe(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Fe(a,{alpha:.12}),closeColorPressedSuccess:Fe(a,{alpha:.18}),borderWarning:`1px solid ${Fe(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Fe(l,{alpha:.15}),colorBorderedWarning:Fe(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Fe(l,{alpha:.12}),closeColorPressedWarning:Fe(l,{alpha:.18}),borderError:`1px solid ${Fe(c,{alpha:.23})}`,textColorError:c,colorError:Fe(c,{alpha:.1}),colorBorderedError:Fe(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Fe(c,{alpha:.12}),closeColorPressedError:Fe(c,{alpha:.18})})}const Zx={common:pi,self:Kx},Qx={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},Jx=ue("tag",`
|
|
543
|
+
`,[ue("popover-arrow",e)])])])}const mu=Object.assign(Object.assign({},ut.props),{to:kn.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 Lx({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 Dx=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:mu,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o,mergedRtlRef:a}=gi(t),l=ut("Popover","-popover",zx,gu,t,s),c=xr("Popover",a,s),d=i.ref(null),h=i.inject("NPopover"),u=i.ref(null),m=i.ref(t.show),f=i.ref(!1);i.watchEffect(()=>{const{show:$}=t;$&&!mw()&&!t.internalDeactivateImmediately&&(f.value=!0)});const g=i.computed(()=>{const{trigger:$,onClickoutside:E}=t,I=[],{positionManuallyRef:{value:O}}=h;return O||($==="click"&&!E&&I.push([us,B,void 0,{capture:!0}]),$==="hover"&&I.push([U_,S])),E&&I.push([us,B,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&f.value)&&I.push([i.vShow,t.show]),I}),p=i.computed(()=>{const{common:{cubicBezierEaseInOut:$,cubicBezierEaseIn:E,cubicBezierEaseOut:I},self:{space:O,spaceArrow:V,padding:L,fontSize:D,textColor:ee,dividerColor:N,color:P,boxShadow:H,borderRadius:q,arrowHeight:U,arrowOffset:F,arrowOffsetVertical:M}}=l.value;return{"--n-box-shadow":H,"--n-bezier":$,"--n-bezier-ease-in":E,"--n-bezier-ease-out":I,"--n-font-size":D,"--n-text-color":ee,"--n-color":P,"--n-divider-color":N,"--n-border-radius":q,"--n-arrow-height":U,"--n-arrow-offset":F,"--n-arrow-offset-vertical":M,"--n-padding":L,"--n-space":O,"--n-space-arrow":V}}),y=i.computed(()=>{const $=t.width==="trigger"?void 0:na(t.width),E=[];$&&E.push({width:$});const{maxWidth:I,minWidth:O}=t;return I&&E.push({maxWidth:na(I)}),O&&E.push({maxWidth:na(O)}),o||E.push(p.value),E}),b=o?mi("popover",void 0,p,t):void 0;h.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{h.setBodyInstance(null)}),i.watch(i.toRef(t,"show"),$=>{t.animated||($?m.value=!0:m.value=!1)});function _(){var $;($=d.value)===null||$===void 0||$.syncPosition()}function v($){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&h.handleMouseEnter($)}function k($){t.trigger==="hover"&&t.keepAliveOnHover&&h.handleMouseLeave($)}function S($){t.trigger==="hover"&&!C().contains(dr($))&&h.handleMouseMoveOutside($)}function B($){(t.trigger==="click"&&!C().contains(dr($))||t.onClickoutside)&&h.handleClickOutside($)}function C(){return h.getTriggerElement()}i.provide(Ih,u),i.provide(Ah,null),i.provide(Vh,null);function T(){if(b==null||b.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&f.value))return null;let E;const I=h.internalRenderBodyRef.value,{value:O}=s;if(I)E=I([`${O}-popover-shared`,(c==null?void 0:c.value)&&`${O}-popover--rtl`,b==null?void 0:b.themeClass.value,t.overlap&&`${O}-popover-shared--overlap`,t.showArrow&&`${O}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${O}-popover-shared--center-arrow`],u,y.value,v,k);else{const{value:V}=h.extraClassRef,{internalTrapFocus:L}=t,D=!Kh(e.header)||!Kh(e.footer),ee=()=>{var N,P;const H=D?i.h(i.Fragment,null,ui(e.header,F=>F?i.h("div",{class:[`${O}-popover__header`,t.headerClass],style:t.headerStyle},F):null),ui(e.default,F=>F?i.h("div",{class:[`${O}-popover__content`,t.contentClass],style:t.contentStyle},e):null),ui(e.footer,F=>F?i.h("div",{class:[`${O}-popover__footer`,t.footerClass],style:t.footerStyle},F):null)):t.scrollable?(N=e.default)===null||N===void 0?void 0:N.call(e):i.h("div",{class:[`${O}-popover__content`,t.contentClass],style:t.contentStyle},e),q=t.scrollable?i.h(Bx,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:D?void 0:`${O}-popover__content ${(P=t.contentClass)!==null&&P!==void 0?P:""}`,contentStyle:D?void 0:t.contentStyle},{default:()=>H}):H,U=t.showArrow?Lx({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:O}):null;return[q,U]};E=i.h("div",i.mergeProps({class:[`${O}-popover`,`${O}-popover-shared`,(c==null?void 0:c.value)&&`${O}-popover--rtl`,b==null?void 0:b.themeClass.value,V.map(N=>`${O}-${N}`),{[`${O}-popover--scrollable`]:t.scrollable,[`${O}-popover--show-header-or-footer`]:D,[`${O}-popover--raw`]:t.raw,[`${O}-popover-shared--overlap`]:t.overlap,[`${O}-popover-shared--show-arrow`]:t.showArrow,[`${O}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:u,style:y.value,onKeydown:h.handleKeydown,onMouseenter:v,onMouseleave:k},n),L?i.h(aw,{active:t.show,autoFocus:!0},{default:ee}):ee())}return i.withDirectives(E,g.value)}return{displayed:f,namespace:r,isMounted:h.isMountedRef,zIndex:h.zIndexRef,followerRef:d,adjustedTo:kn(t),followerEnabled:m,renderContentNode:T}},render(){return i.h(dh,{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===kn.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 Hx={};const Wx=Object.keys(mu),jx={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function qx(t,e,n){jx[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 Xx={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:kn.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},Yx=Object.assign(Object.assign(Object.assign({},ut.props),Xx),{internalOnAfterLeave:Function,internalRenderBody:Function}),Ux=i.defineComponent({name:"Popover",inheritAttrs:!1,props:Yx,slots:Object,__popover__:!0,setup(t){Hx.NODE_ENV!=="production"&&i.watchEffect(()=>{t.maxWidth!==void 0&&jn("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&jn("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&jn("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&jn("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&jn("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=fs(),n=i.ref(null),r=i.computed(()=>t.show),s=i.ref(t.defaultShow),o=Ho(r,s),a=Wt(()=>t.disabled?!1:o.value),l=()=>{if(t.disabled)return!0;const{getDisabled:D}=t;return!!(D!=null&&D())},c=()=>l()?!1:o.value,d=jd(t,["arrow","showArrow"]),h=i.computed(()=>t.overlap?!1:d.value);let u=null;const m=i.ref(null),f=i.ref(null),g=Wt(()=>t.x!==void 0&&t.y!==void 0);function p(D){const{"onUpdate:show":ee,onUpdateShow:N,onShow:P,onHide:H}=t;s.value=D,ee&&ht(ee,D),N&&ht(N,D),D&&P&&ht(P,!0),D&&H&&ht(H,!1)}function y(){u&&u.syncPosition()}function b(){const{value:D}=m;D&&(window.clearTimeout(D),m.value=null)}function _(){const{value:D}=f;D&&(window.clearTimeout(D),f.value=null)}function v(){const D=l();if(t.trigger==="focus"&&!D){if(c())return;p(!0)}}function k(){const D=l();if(t.trigger==="focus"&&!D){if(!c())return;p(!1)}}function S(){const D=l();if(t.trigger==="hover"&&!D){if(_(),m.value!==null||c())return;const ee=()=>{p(!0),m.value=null},{delay:N}=t;N===0?ee():m.value=window.setTimeout(ee,N)}}function B(){const D=l();if(t.trigger==="hover"&&!D){if(b(),f.value!==null||!c())return;const ee=()=>{p(!1),f.value=null},{duration:N}=t;N===0?ee():f.value=window.setTimeout(ee,N)}}function C(){B()}function T(D){var ee;c()&&(t.trigger==="click"&&(b(),_(),p(!1)),(ee=t.onClickoutside)===null||ee===void 0||ee.call(t,D))}function $(){if(t.trigger==="click"&&!l()){b(),_();const D=!c();p(D)}}function E(D){t.internalTrapFocus&&D.key==="Escape"&&(b(),_(),p(!1))}function I(D){s.value=D}function O(){var D;return(D=n.value)===null||D===void 0?void 0:D.targetRef}function V(D){u=D}return i.provide("NPopover",{getTriggerElement:O,handleKeydown:E,handleMouseEnter:S,handleMouseLeave:B,handleClickOutside:T,handleMouseMoveOutside:C,setBodyInstance:V,positionManuallyRef:g,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:g,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:h,getMergedShow:c,setShow:I,handleClick:$,handleMouseEnter:S,handleMouseLeave:B,handleFocus:v,handleBlur:k,syncPosition:y}},render(){var t;const{positionManually:e,$slots:n}=this;let r,s=!1;if(!e&&(r=bw(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(h=>{h.onBlur(d)})},onFocus:d=>{l.forEach(h=>{h.onFocus(d)})},onClick:d=>{l.forEach(h=>{h.onClick(d)})},onMouseenter:d=>{l.forEach(h=>{h.onMouseenter(d)})},onMouseleave:d=>{l.forEach(h=>{h.onMouseleave(d)})}};qx(r,a?"nested":e?"manual":this.trigger,c)}}return i.h(Ud,{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}}),[[Wd,{enabled:o,zIndex:this.zIndex}]]):null,e?null:i.h(Gd,null,{default:()=>r}),i.h(Dx,_w(this.$props,Wx,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)}})]}})}}),Gx={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 Kx(t){const{textColor2:e,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:h,opacityDisabled:u,tagColor:m,closeIconColor:f,closeIconColorHover:g,closeIconColorPressed:p,borderRadiusSmall:y,fontSizeMini:b,fontSizeTiny:_,fontSizeSmall:v,fontSizeMedium:k,heightMini:S,heightTiny:B,heightSmall:C,heightMedium:T,closeColorHover:$,closeColorPressed:E,buttonColor2Hover:I,buttonColor2Pressed:O,fontWeightStrong:V}=t;return Object.assign(Object.assign({},Gx),{closeBorderRadius:y,heightTiny:S,heightSmall:B,heightMedium:C,heightLarge:T,borderRadius:y,opacityDisabled:u,fontSizeTiny:b,fontSizeSmall:_,fontSizeMedium:v,fontSizeLarge:k,fontWeightStrong:V,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:I,colorPressedCheckable:O,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${h}`,textColor:e,color:m,colorBordered:"rgb(250, 250, 252)",closeIconColor:f,closeIconColorHover:g,closeIconColorPressed:p,closeColorHover:$,closeColorPressed:E,borderPrimary:`1px solid ${Fe(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:Fe(s,{alpha:.12}),colorBorderedPrimary:Fe(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:Fe(s,{alpha:.12}),closeColorPressedPrimary:Fe(s,{alpha:.18}),borderInfo:`1px solid ${Fe(o,{alpha:.3})}`,textColorInfo:o,colorInfo:Fe(o,{alpha:.12}),colorBorderedInfo:Fe(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:Fe(o,{alpha:.12}),closeColorPressedInfo:Fe(o,{alpha:.18}),borderSuccess:`1px solid ${Fe(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Fe(a,{alpha:.12}),colorBorderedSuccess:Fe(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Fe(a,{alpha:.12}),closeColorPressedSuccess:Fe(a,{alpha:.18}),borderWarning:`1px solid ${Fe(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Fe(l,{alpha:.15}),colorBorderedWarning:Fe(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Fe(l,{alpha:.12}),closeColorPressedWarning:Fe(l,{alpha:.18}),borderError:`1px solid ${Fe(c,{alpha:.23})}`,textColorError:c,colorError:Fe(c,{alpha:.1}),colorBorderedError:Fe(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Fe(c,{alpha:.12}),closeColorPressedError:Fe(c,{alpha:.18})})}const Zx={common:pi,self:Kx},Qx={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},Jx=ue("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
|
`,[Ut("disabled",[ae("&:hover","background-color: var(--n-color-hover-checkable);",[Ut("checked","color: var(--n-text-color-hover-checkable);")]),ae("&:active","background-color: var(--n-color-pressed-checkable);",[Ut("checked","color: var(--n-text-color-pressed-checkable);")])]),Be("checked",`
|
|
611
611
|
color: var(--n-text-color-checked);
|
|
612
612
|
background-color: var(--n-color-checked);
|
|
613
|
-
`,[Ut("disabled",[ae("&:hover","background-color: var(--n-color-checked-hover);"),ae("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var ev={};const tv=Object.assign(Object.assign(Object.assign({},ut.props),Qx),{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}),nv="n-tag",fa=i.defineComponent({name:"Tag",props:tv,slots:Object,setup(t){ev.NODE_ENV!=="production"&&i.watchEffect(()=>{t.onCheckedChange!==void 0&&jn("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}=gi(t),a=ut("Tag","-tag",Jx,Zx,t,r);i.provide(nv,{roundRef:i.toRef(t,"round")});function l(){if(!t.disabled&&t.checkable){const{checked:f,onCheckedChange:g,onUpdateChecked:p,"onUpdate:checked":y}=t;p&&p(!f),y&&y(!f),g&&g(!f)}}function c(f){if(t.triggerClickOnClose||f.stopPropagation(),!t.disabled){const{onClose:g}=t;g&&ht(g,f)}}const d={setTextContent(f){const{value:g}=e;g&&(g.textContent=f)}},h=xr("Tag",o,r),u=i.computed(()=>{const{type:f,size:g,color:{color:p,textColor:y}={}}=t,{common:{cubicBezierEaseInOut:b},self:{padding:_,closeMargin:v,borderRadius:k,opacityDisabled:
|
|
613
|
+
`,[Ut("disabled",[ae("&:hover","background-color: var(--n-color-checked-hover);"),ae("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var ev={};const tv=Object.assign(Object.assign(Object.assign({},ut.props),Qx),{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}),nv="n-tag",fa=i.defineComponent({name:"Tag",props:tv,slots:Object,setup(t){ev.NODE_ENV!=="production"&&i.watchEffect(()=>{t.onCheckedChange!==void 0&&jn("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}=gi(t),a=ut("Tag","-tag",Jx,Zx,t,r);i.provide(nv,{roundRef:i.toRef(t,"round")});function l(){if(!t.disabled&&t.checkable){const{checked:f,onCheckedChange:g,onUpdateChecked:p,"onUpdate:checked":y}=t;p&&p(!f),y&&y(!f),g&&g(!f)}}function c(f){if(t.triggerClickOnClose||f.stopPropagation(),!t.disabled){const{onClose:g}=t;g&&ht(g,f)}}const d={setTextContent(f){const{value:g}=e;g&&(g.textContent=f)}},h=xr("Tag",o,r),u=i.computed(()=>{const{type:f,size:g,color:{color:p,textColor:y}={}}=t,{common:{cubicBezierEaseInOut:b},self:{padding:_,closeMargin:v,borderRadius:k,opacityDisabled:S,textColorCheckable:B,textColorHoverCheckable:C,textColorPressedCheckable:T,textColorChecked:$,colorCheckable:E,colorHoverCheckable:I,colorPressedCheckable:O,colorChecked:V,colorCheckedHover:L,colorCheckedPressed:D,closeBorderRadius:ee,fontWeightStrong:N,[Ge("colorBordered",f)]:P,[Ge("closeSize",g)]:H,[Ge("closeIconSize",g)]:q,[Ge("fontSize",g)]:U,[Ge("height",g)]:F,[Ge("color",f)]:M,[Ge("textColor",f)]:Z,[Ge("border",f)]:fe,[Ge("closeIconColor",f)]:ie,[Ge("closeIconColorHover",f)]:me,[Ge("closeIconColorPressed",f)]:re,[Ge("closeColorHover",f)]:Me,[Ge("closeColorPressed",f)]:Ae}}=a.value,Ie=Yt(v);return{"--n-font-weight-strong":N,"--n-avatar-size-override":`calc(${F} - 8px)`,"--n-bezier":b,"--n-border-radius":k,"--n-border":fe,"--n-close-icon-size":q,"--n-close-color-pressed":Ae,"--n-close-color-hover":Me,"--n-close-border-radius":ee,"--n-close-icon-color":ie,"--n-close-icon-color-hover":me,"--n-close-icon-color-pressed":re,"--n-close-icon-color-disabled":ie,"--n-close-margin-top":Ie.top,"--n-close-margin-right":Ie.right,"--n-close-margin-bottom":Ie.bottom,"--n-close-margin-left":Ie.left,"--n-close-size":H,"--n-color":p||(n.value?P:M),"--n-color-checkable":E,"--n-color-checked":V,"--n-color-checked-hover":L,"--n-color-checked-pressed":D,"--n-color-hover-checkable":I,"--n-color-pressed-checkable":O,"--n-font-size":U,"--n-height":F,"--n-opacity-disabled":S,"--n-padding":_,"--n-text-color":y||Z,"--n-text-color-checkable":B,"--n-text-color-checked":$,"--n-text-color-hover-checkable":C,"--n-text-color-pressed-checkable":T}}),m=s?mi("tag",i.computed(()=>{let f="";const{type:g,size:p,color:{color:y,textColor:b}={}}=t;return f+=g[0],f+=p[0],y&&(f+=`a${Lh(y)}`),b&&(f+=`b${Lh(b)}`),n.value&&(f+="c"),f}),u,t):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:h,mergedClsPrefix:r,contentRef:e,mergedBordered:n,handleClick:l,handleCloseClick:c,cssVars:s?void 0:u,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=ui(c.avatar,u=>u&&i.h("div",{class:`${n}-tag__avatar`},u)),h=ui(c.icon,u=>u&&i.h("div",{class:`${n}-tag__icon`},u));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`]:h,[`${n}-tag--closable`]:s}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},h||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(mx,{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)}}),iv=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(nu,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:t.loading},{default:()=>t.showArrow?i.h(fx,{clsPrefix:n,show:t.showClear,onClear:t.onClear},{placeholder:()=>i.h(kr,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>oa(e.default,()=>[i.h(ax,null)])})}):null})}}}),rv={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function sv(t){const{borderRadius:e,textColor2:n,textColorDisabled:r,inputColor:s,inputColorDisabled:o,primaryColor:a,primaryColorHover:l,warningColor:c,warningColorHover:d,errorColor:h,errorColorHover:u,borderColor:m,iconColor:f,iconColorDisabled:g,clearColor:p,clearColorHover:y,clearColorPressed:b,placeholderColor:_,placeholderColorDisabled:v,fontSizeTiny:k,fontSizeSmall:S,fontSizeMedium:B,fontSizeLarge:C,heightTiny:T,heightSmall:$,heightMedium:E,heightLarge:I,fontWeight:O}=t;return Object.assign(Object.assign({},rv),{fontSizeTiny:k,fontSizeSmall:S,fontSizeMedium:B,fontSizeLarge:C,heightTiny:T,heightSmall:$,heightMedium:E,heightLarge:I,borderRadius:e,fontWeight:O,textColor:n,textColorDisabled:r,placeholderColor:_,placeholderColorDisabled:v,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 ${Fe(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${Fe(a,{alpha:.2})}`,caretColor:a,arrowColor:f,arrowColorDisabled:g,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 ${Fe(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${Fe(c,{alpha:.2})}`,colorActiveWarning:s,caretColorWarning:c,borderError:`1px solid ${h}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${h}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${Fe(h,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${Fe(h,{alpha:.2})}`,colorActiveError:s,caretColorError:h,clearColor:p,clearColorHover:y,clearColorPressed:b})}const pu={name:"InternalSelection",common:pi,peers:{Popover:gu},self:sv},ov=ae([ue("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
|
-
`)])])]),av=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},ut.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}=gi(t),r=xr("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),h=i.ref(null),u=i.ref(null),m=i.ref(null),f=i.ref(null),g=i.ref(!1),p=i.ref(!1),y=i.ref(!1),b=ut("InternalSelection","-internal-selection",ov,pu,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(y.value||t.active)),v=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):Yi(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),k=i.computed(()=>{const J=t.selectedOption;if(J)return J[t.labelField]}),C=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function B(){var J;const{value:se}=s;if(se){const{value:Ce}=o;Ce&&(Ce.style.width=`${se.offsetWidth}px`,t.maxTagCount!=="responsive"&&((J=m.value)===null||J===void 0||J.sync({showAllItemsBeforeCalculate:!1})))}}function S(){const{value:J}=f;J&&(J.style.display="none")}function T(){const{value:J}=f;J&&(J.style.display="inline-block")}i.watch(i.toRef(t,"active"),J=>{J||S()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick(B)});function $(J){const{onFocus:se}=t;se&&se(J)}function E(J){const{onBlur:se}=t;se&&se(J)}function O(J){const{onDeleteOption:se}=t;se&&se(J)}function I(J){const{onClear:se}=t;se&&se(J)}function A(J){const{onPatternInput:se}=t;se&&se(J)}function L(J){var se;(!J.relatedTarget||!(!((se=a.value)===null||se===void 0)&&se.contains(J.relatedTarget)))&&$(J)}function D(J){var se;!((se=a.value)===null||se===void 0)&&se.contains(J.relatedTarget)||E(J)}function ee(J){I(J)}function N(){y.value=!0}function P(){y.value=!1}function H(J){!t.active||!t.filterable||J.target!==o.value&&J.preventDefault()}function q(J){O(J)}const Y=i.ref(!1);function F(J){if(J.key==="Backspace"&&!Y.value&&!t.pattern.length){const{selectedOptions:se}=t;se!=null&&se.length&&q(se[se.length-1])}}let M=null;function Z(J){const{value:se}=s;if(se){const Ce=J.target.value;se.textContent=Ce,B()}t.ignoreComposition&&Y.value?M=J:A(J)}function fe(){Y.value=!0}function ie(){Y.value=!1,t.ignoreComposition&&A(M),M=null}function me(J){var se;p.value=!0,(se=t.onPatternFocus)===null||se===void 0||se.call(t,J)}function re(J){var se;p.value=!1,(se=t.onPatternBlur)===null||se===void 0||se.call(t,J)}function Me(){var J,se;if(t.filterable)p.value=!1,(J=d.value)===null||J===void 0||J.blur(),(se=o.value)===null||se===void 0||se.blur();else if(t.multiple){const{value:Ce}=l;Ce==null||Ce.blur()}else{const{value:Ce}=c;Ce==null||Ce.blur()}}function Ae(){var J,se,Ce;t.filterable?(p.value=!1,(J=d.value)===null||J===void 0||J.focus()):t.multiple?(se=l.value)===null||se===void 0||se.focus():(Ce=c.value)===null||Ce===void 0||Ce.focus()}function Oe(){const{value:J}=o;J&&(T(),J.focus())}function Le(){const{value:J}=o;J&&J.blur()}function pt(J){const{value:se}=h;se&&se.setTextContent(`+${J}`)}function Zt(){const{value:J}=u;return J}function Qt(){return o.value}let St=null;function At(){St!==null&&window.clearTimeout(St)}function yt(){t.active||(At(),St=window.setTimeout(()=>{C.value&&(g.value=!0)},100))}function pn(){At()}function Pn(J){J||(At(),g.value=!1)}i.watch(C,J=>{J||(g.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const J=d.value;J&&(t.disabled?J.removeAttribute("tabindex"):J.tabIndex=p.value?-1:0)})}),zh(a,t.onResize);const{inlineThemeDisabled:De}=t,ke=i.computed(()=>{const{size:J}=t,{common:{cubicBezierEaseInOut:se},self:{fontWeight:Ce,borderRadius:Jt,color:Ui,placeholderColor:wi,textColor:Gi,paddingSingle:Xn,paddingMultiple:xi,caretColor:Ki,colorDisabled:en,textColorDisabled:Fn,placeholderColorDisabled:R,colorActive:j,boxShadowFocus:ne,boxShadowActive:le,boxShadowHover:ce,border:pe,borderFocus:_e,borderHover:xe,borderActive:Ye,arrowColor:yn,arrowColorDisabled:ba,loadingColor:_a,colorActiveWarning:wa,boxShadowFocusWarning:xa,boxShadowActiveWarning:va,boxShadowHoverWarning:ka,borderWarning:Ca,borderFocusWarning:Sa,borderHoverWarning:Ba,borderActiveWarning:Ta,colorActiveError:Ra,boxShadowFocusError:$a,boxShadowActiveError:Ea,boxShadowHoverError:Na,borderError:Pa,borderFocusError:Fa,borderHoverError:Ma,borderActiveError:X2,clearColor:Y2,clearColorHover:U2,clearColorPressed:G2,clearSize:K2,arrowSize:Z2,[Ge("height",J)]:Q2,[Ge("fontSize",J)]:J2}}=b.value,$s=Yt(Xn),Es=Yt(xi);return{"--n-bezier":se,"--n-border":pe,"--n-border-active":Ye,"--n-border-focus":_e,"--n-border-hover":xe,"--n-border-radius":Jt,"--n-box-shadow-active":le,"--n-box-shadow-focus":ne,"--n-box-shadow-hover":ce,"--n-caret-color":Ki,"--n-color":Ui,"--n-color-active":j,"--n-color-disabled":en,"--n-font-size":J2,"--n-height":Q2,"--n-padding-single-top":$s.top,"--n-padding-multiple-top":Es.top,"--n-padding-single-right":$s.right,"--n-padding-multiple-right":Es.right,"--n-padding-single-left":$s.left,"--n-padding-multiple-left":Es.left,"--n-padding-single-bottom":$s.bottom,"--n-padding-multiple-bottom":Es.bottom,"--n-placeholder-color":wi,"--n-placeholder-color-disabled":R,"--n-text-color":Gi,"--n-text-color-disabled":Fn,"--n-arrow-color":yn,"--n-arrow-color-disabled":ba,"--n-loading-color":_a,"--n-color-active-warning":wa,"--n-box-shadow-focus-warning":xa,"--n-box-shadow-active-warning":va,"--n-box-shadow-hover-warning":ka,"--n-border-warning":Ca,"--n-border-focus-warning":Sa,"--n-border-hover-warning":Ba,"--n-border-active-warning":Ta,"--n-color-active-error":Ra,"--n-box-shadow-focus-error":$a,"--n-box-shadow-active-error":Ea,"--n-box-shadow-hover-error":Na,"--n-border-error":Pa,"--n-border-focus-error":Fa,"--n-border-hover-error":Ma,"--n-border-active-error":X2,"--n-clear-size":K2,"--n-clear-color":Y2,"--n-clear-color-hover":U2,"--n-clear-color-pressed":G2,"--n-arrow-size":Z2,"--n-font-weight":Ce}}),Ie=De?mi("internal-selection",i.computed(()=>t.size[0]),ke,t):void 0;return{mergedTheme:b,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:v,label:k,selected:C,showTagsPanel:g,isComposing:Y,counterRef:h,counterWrapperRef:u,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:m,inputTagElRef:f,handleMouseDown:H,handleFocusin:L,handleClear:ee,handleMouseEnter:N,handleMouseLeave:P,handleDeleteOption:q,handlePatternKeyDown:F,handlePatternInputInput:Z,handlePatternInputBlur:re,handlePatternInputFocus:me,handleMouseEnterCounter:yt,handleMouseLeaveCounter:pn,handleFocusout:D,handleCompositionEnd:ie,handleCompositionStart:fe,onPopoverUpdateShow:Pn,focus:Ae,focusInput:Oe,blur:Me,blurInput:Le,updateCounter:pt,getCounter:Zt,getTail:Qt,renderLabel:t.renderLabel,cssVars:De?void 0:ke,themeClass:Ie==null?void 0:Ie.themeClass,onRender:Ie==null?void 0:Ie.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:h,renderLabel:u}=this;d==null||d();const m=o==="responsive",f=typeof o=="number",g=m||f,p=i.h(aa,null,{default:()=>i.h(iv,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var b,_;return(_=(b=this.$slots).arrow)===null||_===void 0?void 0:_.call(b)}})});let y;if(e){const{labelField:b}=this,_=A=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:A.value},h?h({option:A,handleClose:()=>{this.handleDeleteOption(A)}}):i.h(fa,{size:n,closable:!A.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(A)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>u?u(A,!0):Yi(A[b],A,!0)})),v=()=>(f?this.selectedOptions.slice(0,o):this.selectedOptions).map(_),k=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,C=m?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(fa,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let B;if(f){const A=this.selectedOptions.length-o;A>0&&(B=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(fa,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${A}`})))}const S=m?s?i.h($h,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:v,counter:C,tail:()=>k}):i.h($h,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:v,counter:C}):f&&B?v().concat(B):v(),T=g?()=>i.h("div",{class:`${l}-base-selection-popover`},m?v():this.selectedOptions.map(_)):void 0,$=g?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,O=(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,I=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},S,m?null:k,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},S,p);y=i.h(i.Fragment,null,g?i.h(Ux,Object.assign({},$,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>I,default:T}):I,O)}else if(s){const b=this.pattern||this.isComposing,_=this.active?!b:!this.selected,v=this.active?!1:this.selected;y=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:Xh(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})),v?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`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):Yi(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 y=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:Xh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):Yi(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},y,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function lv(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const cv={name:"Select",common:pi,peers:{InternalSelection:pu,InternalSelectMenu:lu},self:lv},dv=ae([ue("select",`
|
|
813
|
+
`)])])]),av=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},ut.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}=gi(t),r=xr("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),h=i.ref(null),u=i.ref(null),m=i.ref(null),f=i.ref(null),g=i.ref(!1),p=i.ref(!1),y=i.ref(!1),b=ut("InternalSelection","-internal-selection",ov,pu,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(y.value||t.active)),v=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):Yi(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),k=i.computed(()=>{const J=t.selectedOption;if(J)return J[t.labelField]}),S=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function B(){var J;const{value:se}=s;if(se){const{value:Ce}=o;Ce&&(Ce.style.width=`${se.offsetWidth}px`,t.maxTagCount!=="responsive"&&((J=m.value)===null||J===void 0||J.sync({showAllItemsBeforeCalculate:!1})))}}function C(){const{value:J}=f;J&&(J.style.display="none")}function T(){const{value:J}=f;J&&(J.style.display="inline-block")}i.watch(i.toRef(t,"active"),J=>{J||C()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick(B)});function $(J){const{onFocus:se}=t;se&&se(J)}function E(J){const{onBlur:se}=t;se&&se(J)}function I(J){const{onDeleteOption:se}=t;se&&se(J)}function O(J){const{onClear:se}=t;se&&se(J)}function V(J){const{onPatternInput:se}=t;se&&se(J)}function L(J){var se;(!J.relatedTarget||!(!((se=a.value)===null||se===void 0)&&se.contains(J.relatedTarget)))&&$(J)}function D(J){var se;!((se=a.value)===null||se===void 0)&&se.contains(J.relatedTarget)||E(J)}function ee(J){O(J)}function N(){y.value=!0}function P(){y.value=!1}function H(J){!t.active||!t.filterable||J.target!==o.value&&J.preventDefault()}function q(J){I(J)}const U=i.ref(!1);function F(J){if(J.key==="Backspace"&&!U.value&&!t.pattern.length){const{selectedOptions:se}=t;se!=null&&se.length&&q(se[se.length-1])}}let M=null;function Z(J){const{value:se}=s;if(se){const Ce=J.target.value;se.textContent=Ce,B()}t.ignoreComposition&&U.value?M=J:V(J)}function fe(){U.value=!0}function ie(){U.value=!1,t.ignoreComposition&&V(M),M=null}function me(J){var se;p.value=!0,(se=t.onPatternFocus)===null||se===void 0||se.call(t,J)}function re(J){var se;p.value=!1,(se=t.onPatternBlur)===null||se===void 0||se.call(t,J)}function Me(){var J,se;if(t.filterable)p.value=!1,(J=d.value)===null||J===void 0||J.blur(),(se=o.value)===null||se===void 0||se.blur();else if(t.multiple){const{value:Ce}=l;Ce==null||Ce.blur()}else{const{value:Ce}=c;Ce==null||Ce.blur()}}function Ae(){var J,se,Ce;t.filterable?(p.value=!1,(J=d.value)===null||J===void 0||J.focus()):t.multiple?(se=l.value)===null||se===void 0||se.focus():(Ce=c.value)===null||Ce===void 0||Ce.focus()}function Ie(){const{value:J}=o;J&&(T(),J.focus())}function Le(){const{value:J}=o;J&&J.blur()}function pt(J){const{value:se}=h;se&&se.setTextContent(`+${J}`)}function Zt(){const{value:J}=u;return J}function Qt(){return o.value}let St=null;function At(){St!==null&&window.clearTimeout(St)}function yt(){t.active||(At(),St=window.setTimeout(()=>{S.value&&(g.value=!0)},100))}function pn(){At()}function Pn(J){J||(At(),g.value=!1)}i.watch(S,J=>{J||(g.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const J=d.value;J&&(t.disabled?J.removeAttribute("tabindex"):J.tabIndex=p.value?-1:0)})}),zh(a,t.onResize);const{inlineThemeDisabled:De}=t,ke=i.computed(()=>{const{size:J}=t,{common:{cubicBezierEaseInOut:se},self:{fontWeight:Ce,borderRadius:Jt,color:Ui,placeholderColor:wi,textColor:Gi,paddingSingle:Xn,paddingMultiple:xi,caretColor:Ki,colorDisabled:en,textColorDisabled:Fn,placeholderColorDisabled:R,colorActive:j,boxShadowFocus:ne,boxShadowActive:le,boxShadowHover:ce,border:pe,borderFocus:_e,borderHover:xe,borderActive:Ye,arrowColor:yn,arrowColorDisabled:ba,loadingColor:_a,colorActiveWarning:wa,boxShadowFocusWarning:xa,boxShadowActiveWarning:va,boxShadowHoverWarning:ka,borderWarning:Ca,borderFocusWarning:Sa,borderHoverWarning:Ba,borderActiveWarning:Ta,colorActiveError:Ra,boxShadowFocusError:$a,boxShadowActiveError:Ea,boxShadowHoverError:Na,borderError:Pa,borderFocusError:Fa,borderHoverError:Ma,borderActiveError:X2,clearColor:Y2,clearColorHover:U2,clearColorPressed:G2,clearSize:K2,arrowSize:Z2,[Ge("height",J)]:Q2,[Ge("fontSize",J)]:J2}}=b.value,$s=Yt(Xn),Es=Yt(xi);return{"--n-bezier":se,"--n-border":pe,"--n-border-active":Ye,"--n-border-focus":_e,"--n-border-hover":xe,"--n-border-radius":Jt,"--n-box-shadow-active":le,"--n-box-shadow-focus":ne,"--n-box-shadow-hover":ce,"--n-caret-color":Ki,"--n-color":Ui,"--n-color-active":j,"--n-color-disabled":en,"--n-font-size":J2,"--n-height":Q2,"--n-padding-single-top":$s.top,"--n-padding-multiple-top":Es.top,"--n-padding-single-right":$s.right,"--n-padding-multiple-right":Es.right,"--n-padding-single-left":$s.left,"--n-padding-multiple-left":Es.left,"--n-padding-single-bottom":$s.bottom,"--n-padding-multiple-bottom":Es.bottom,"--n-placeholder-color":wi,"--n-placeholder-color-disabled":R,"--n-text-color":Gi,"--n-text-color-disabled":Fn,"--n-arrow-color":yn,"--n-arrow-color-disabled":ba,"--n-loading-color":_a,"--n-color-active-warning":wa,"--n-box-shadow-focus-warning":xa,"--n-box-shadow-active-warning":va,"--n-box-shadow-hover-warning":ka,"--n-border-warning":Ca,"--n-border-focus-warning":Sa,"--n-border-hover-warning":Ba,"--n-border-active-warning":Ta,"--n-color-active-error":Ra,"--n-box-shadow-focus-error":$a,"--n-box-shadow-active-error":Ea,"--n-box-shadow-hover-error":Na,"--n-border-error":Pa,"--n-border-focus-error":Fa,"--n-border-hover-error":Ma,"--n-border-active-error":X2,"--n-clear-size":K2,"--n-clear-color":Y2,"--n-clear-color-hover":U2,"--n-clear-color-pressed":G2,"--n-arrow-size":Z2,"--n-font-weight":Ce}}),Oe=De?mi("internal-selection",i.computed(()=>t.size[0]),ke,t):void 0;return{mergedTheme:b,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:v,label:k,selected:S,showTagsPanel:g,isComposing:U,counterRef:h,counterWrapperRef:u,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:m,inputTagElRef:f,handleMouseDown:H,handleFocusin:L,handleClear:ee,handleMouseEnter:N,handleMouseLeave:P,handleDeleteOption:q,handlePatternKeyDown:F,handlePatternInputInput:Z,handlePatternInputBlur:re,handlePatternInputFocus:me,handleMouseEnterCounter:yt,handleMouseLeaveCounter:pn,handleFocusout:D,handleCompositionEnd:ie,handleCompositionStart:fe,onPopoverUpdateShow:Pn,focus:Ae,focusInput:Ie,blur:Me,blurInput:Le,updateCounter:pt,getCounter:Zt,getTail:Qt,renderLabel:t.renderLabel,cssVars:De?void 0:ke,themeClass:Oe==null?void 0:Oe.themeClass,onRender:Oe==null?void 0:Oe.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:h,renderLabel:u}=this;d==null||d();const m=o==="responsive",f=typeof o=="number",g=m||f,p=i.h(aa,null,{default:()=>i.h(iv,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var b,_;return(_=(b=this.$slots).arrow)===null||_===void 0?void 0:_.call(b)}})});let y;if(e){const{labelField:b}=this,_=V=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:V.value},h?h({option:V,handleClose:()=>{this.handleDeleteOption(V)}}):i.h(fa,{size:n,closable:!V.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(V)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>u?u(V,!0):Yi(V[b],V,!0)})),v=()=>(f?this.selectedOptions.slice(0,o):this.selectedOptions).map(_),k=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,S=m?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(fa,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let B;if(f){const V=this.selectedOptions.length-o;V>0&&(B=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(fa,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${V}`})))}const C=m?s?i.h($h,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:v,counter:S,tail:()=>k}):i.h($h,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:v,counter:S}):f&&B?v().concat(B):v(),T=g?()=>i.h("div",{class:`${l}-base-selection-popover`},m?v():this.selectedOptions.map(_)):void 0,$=g?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,I=(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,O=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},C,m?null:k,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},C,p);y=i.h(i.Fragment,null,g?i.h(Ux,Object.assign({},$,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>O,default:T}):O,I)}else if(s){const b=this.pattern||this.isComposing,_=this.active?!b:!this.selected,v=this.active?!1:this.selected;y=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:Xh(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})),v?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`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):Yi(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 y=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:Xh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):Yi(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},y,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function lv(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const cv={name:"Select",common:pi,peers:{InternalSelection:pu,InternalSelectMenu:lu},self:lv},dv=ae([ue("select",`
|
|
814
814
|
z-index: auto;
|
|
815
815
|
outline: none;
|
|
816
816
|
width: 100%;
|
|
@@ -819,5 +819,5 @@ ${s}
|
|
|
819
819
|
`),ue("select-menu",`
|
|
820
820
|
margin: 4px 0;
|
|
821
821
|
box-shadow: var(--n-menu-box-shadow);
|
|
822
|
-
`,[fu({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Bs(t){return t.type==="group"}function yu(t){return t.type==="ignored"}function ga(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function hv(t,e){return{getIsGroup:Bs,getIgnored:yu,getKey(r){return Bs(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function uv(t,e,n,r){if(!e)return t;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(Bs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(yu(l))continue;e(n,l)&&a.push(l)}return a}return s(t)}function fv(t,e,n){const r=new Map;return t.forEach(s=>{Bs(s)?s[n].forEach(o=>{r.set(o[e],o)}):r.set(s[e],s)}),r}var gv={};const mv=Object.assign(Object.assign({},ut.props),{to:kn.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}),pv=i.defineComponent({name:"Select",props:mv,slots:Object,setup(t){gv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&jn("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&jn("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=gi(t),o=ut("Select","-select",dv,cv,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Ho(l,a),d=i.ref(!1),h=i.ref(""),u=jd(t,["items","options"]),m=i.ref([]),f=i.ref([]),g=i.computed(()=>f.value.concat(m.value).concat(u.value)),p=i.computed(()=>{const{filter:R}=t;if(R)return R;const{labelField:j,valueField:ne}=t;return(le,ce)=>{if(!ce)return!1;const pe=ce[j];if(typeof pe=="string")return ga(le,pe);const _e=ce[ne];return typeof _e=="string"?ga(le,_e):typeof _e=="number"?ga(le,String(_e)):!1}}),y=i.computed(()=>{if(t.remote)return u.value;{const{value:R}=g,{value:j}=h;return!j.length||!t.filterable?R:uv(R,p.value,j,t.childrenField)}}),b=i.computed(()=>{const{valueField:R,childrenField:j}=t,ne=hv(R,j);return H_(y.value,ne)}),_=i.computed(()=>fv(g.value,t.valueField,t.childrenField)),v=i.ref(!1),k=Ho(i.toRef(t,"show"),v),C=i.ref(null),B=i.ref(null),S=i.ref(null),{localeRef:T}=Qh("Select"),$=i.computed(()=>{var R;return(R=t.placeholder)!==null&&R!==void 0?R:T.value.placeholder}),E=[],O=i.ref(new Map),I=i.computed(()=>{const{fallbackOption:R}=t;if(R===void 0){const{labelField:j,valueField:ne}=t;return le=>({[j]:String(le),[ne]:le})}return R===!1?!1:j=>Object.assign(R(j),{value:j})});function A(R){const j=t.remote,{value:ne}=O,{value:le}=_,{value:ce}=I,pe=[];return R.forEach(_e=>{if(le.has(_e))pe.push(le.get(_e));else if(j&&ne.has(_e))pe.push(ne.get(_e));else if(ce){const xe=ce(_e);xe&&pe.push(xe)}}),pe}const L=i.computed(()=>{if(t.multiple){const{value:R}=c;return Array.isArray(R)?A(R):[]}return null}),D=i.computed(()=>{const{value:R}=c;return!t.multiple&&!Array.isArray(R)?R===null?null:A([R])[0]||null:null}),ee=xw(t),{mergedSizeRef:N,mergedDisabledRef:P,mergedStatusRef:H}=ee;function q(R,j){const{onChange:ne,"onUpdate:value":le,onUpdateValue:ce}=t,{nTriggerFormChange:pe,nTriggerFormInput:_e}=ee;ne&&ht(ne,R,j),ce&&ht(ce,R,j),le&&ht(le,R,j),a.value=R,pe(),_e()}function Y(R){const{onBlur:j}=t,{nTriggerFormBlur:ne}=ee;j&&ht(j,R),ne()}function F(){const{onClear:R}=t;R&&ht(R)}function M(R){const{onFocus:j,showOnFocus:ne}=t,{nTriggerFormFocus:le}=ee;j&&ht(j,R),le(),ne&&re()}function Z(R){const{onSearch:j}=t;j&&ht(j,R)}function fe(R){const{onScroll:j}=t;j&&ht(j,R)}function ie(){var R;const{remote:j,multiple:ne}=t;if(j){const{value:le}=O;if(ne){const{valueField:ce}=t;(R=L.value)===null||R===void 0||R.forEach(pe=>{le.set(pe[ce],pe)})}else{const ce=D.value;ce&&le.set(ce[t.valueField],ce)}}}function me(R){const{onUpdateShow:j,"onUpdate:show":ne}=t;j&&ht(j,R),ne&&ht(ne,R),v.value=R}function re(){P.value||(me(!0),v.value=!0,t.filterable&&Xn())}function Me(){me(!1)}function Ae(){h.value="",f.value=E}const Oe=i.ref(!1);function Le(){t.filterable&&(Oe.value=!0)}function pt(){t.filterable&&(Oe.value=!1,k.value||Ae())}function Zt(){P.value||(k.value?t.filterable?Xn():Me():re())}function Qt(R){var j,ne;!((ne=(j=S.value)===null||j===void 0?void 0:j.selfRef)===null||ne===void 0)&&ne.contains(R.relatedTarget)||(d.value=!1,Y(R),Me())}function St(R){M(R),d.value=!0}function At(){d.value=!0}function yt(R){var j;!((j=C.value)===null||j===void 0)&&j.$el.contains(R.relatedTarget)||(d.value=!1,Y(R),Me())}function pn(){var R;(R=C.value)===null||R===void 0||R.focus(),Me()}function Pn(R){var j;k.value&&(!((j=C.value)===null||j===void 0)&&j.$el.contains(dr(R))||Me())}function De(R){if(!Array.isArray(R))return[];if(I.value)return Array.from(R);{const{remote:j}=t,{value:ne}=_;if(j){const{value:le}=O;return R.filter(ce=>ne.has(ce)||le.has(ce))}else return R.filter(le=>ne.has(le))}}function ke(R){Ie(R.rawNode)}function Ie(R){if(P.value)return;const{tag:j,remote:ne,clearFilterAfterSelect:le,valueField:ce}=t;if(j&&!ne){const{value:pe}=f,_e=pe[0]||null;if(_e){const xe=m.value;xe.length?xe.push(_e):m.value=[_e],f.value=E}}if(ne&&O.value.set(R[ce],R),t.multiple){const pe=De(c.value),_e=pe.findIndex(xe=>xe===R[ce]);if(~_e){if(pe.splice(_e,1),j&&!ne){const xe=J(R[ce]);~xe&&(m.value.splice(xe,1),le&&(h.value=""))}}else pe.push(R[ce]),le&&(h.value="");q(pe,A(pe))}else{if(j&&!ne){const pe=J(R[ce]);~pe?m.value=[m.value[pe]]:m.value=E}Gi(),Me(),q(R[ce],R)}}function J(R){return m.value.findIndex(ne=>ne[t.valueField]===R)}function se(R){k.value||re();const{value:j}=R.target;h.value=j;const{tag:ne,remote:le}=t;if(Z(j),ne&&!le){if(!j){f.value=E;return}const{onCreate:ce}=t,pe=ce?ce(j):{[t.labelField]:j,[t.valueField]:j},{valueField:_e,labelField:xe}=t;u.value.some(Ye=>Ye[_e]===pe[_e]||Ye[xe]===pe[xe])||m.value.some(Ye=>Ye[_e]===pe[_e]||Ye[xe]===pe[xe])?f.value=E:f.value=[pe]}}function Ce(R){R.stopPropagation();const{multiple:j}=t;!j&&t.filterable&&Me(),F(),j?q([],[]):q(null,null)}function Jt(R){!cr(R,"action")&&!cr(R,"empty")&&!cr(R,"header")&&R.preventDefault()}function Ui(R){fe(R)}function wi(R){var j,ne,le,ce,pe;if(!t.keyboard){R.preventDefault();return}switch(R.key){case" ":if(t.filterable)break;R.preventDefault();case"Enter":if(!(!((j=C.value)===null||j===void 0)&&j.isComposing)){if(k.value){const _e=(ne=S.value)===null||ne===void 0?void 0:ne.getPendingTmNode();_e?ke(_e):t.filterable||(Me(),Gi())}else if(re(),t.tag&&Oe.value){const _e=f.value[0];if(_e){const xe=_e[t.valueField],{value:Ye}=c;t.multiple&&Array.isArray(Ye)&&Ye.includes(xe)||Ie(_e)}}}R.preventDefault();break;case"ArrowUp":if(R.preventDefault(),t.loading)return;k.value&&((le=S.value)===null||le===void 0||le.prev());break;case"ArrowDown":if(R.preventDefault(),t.loading)return;k.value?(ce=S.value)===null||ce===void 0||ce.next():re();break;case"Escape":k.value&&(yw(R),Me()),(pe=C.value)===null||pe===void 0||pe.focus();break}}function Gi(){var R;(R=C.value)===null||R===void 0||R.focus()}function Xn(){var R;(R=C.value)===null||R===void 0||R.focusInput()}function xi(){var R;k.value&&((R=B.value)===null||R===void 0||R.syncPosition())}ie(),i.watch(i.toRef(t,"options"),ie);const Ki={focus:()=>{var R;(R=C.value)===null||R===void 0||R.focus()},focusInput:()=>{var R;(R=C.value)===null||R===void 0||R.focusInput()},blur:()=>{var R;(R=C.value)===null||R===void 0||R.blur()},blurInput:()=>{var R;(R=C.value)===null||R===void 0||R.blurInput()}},en=i.computed(()=>{const{self:{menuBoxShadow:R}}=o.value;return{"--n-menu-box-shadow":R}}),Fn=s?mi("select",void 0,en,t):void 0;return Object.assign(Object.assign({},Ki),{mergedStatus:H,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:b,isMounted:fs(),triggerRef:C,menuRef:S,pattern:h,uncontrolledShow:v,mergedShow:k,adjustedTo:kn(t),uncontrolledValue:a,mergedValue:c,followerRef:B,localizedPlaceholder:$,selectedOption:D,selectedOptions:L,mergedSize:N,mergedDisabled:P,focused:d,activeWithoutMenuOpen:Oe,inlineThemeDisabled:s,onTriggerInputFocus:Le,onTriggerInputBlur:pt,handleTriggerOrMenuResize:xi,handleMenuFocus:At,handleMenuBlur:yt,handleMenuTabOut:pn,handleTriggerClick:Zt,handleToggle:ke,handleDeleteOption:Ie,handlePatternInput:se,handleClear:Ce,handleTriggerBlur:Qt,handleTriggerFocus:St,handleKeydown:wi,handleMenuAfterLeave:Ae,handleMenuClickOutside:Pn,handleMenuScroll:Ui,handleMenuKeydown:wi,handleMenuMousedown:Jt,mergedTheme:o,cssVars:s?void 0:en,themeClass:Fn==null?void 0:Fn.themeClass,onRender:Fn==null?void 0:Fn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(Ud,null,{default:()=>[i.h(Gd,null,{default:()=>i.h(av,{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(dh,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===kn.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(Vx,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],[us,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[us,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),yv={},bu=i.defineComponent({...yv,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t;return((t=U.AppConfigProvider.getConfig())==null?void 0:t.minLength.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(()=>V.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),h=i.useTemplateRef("select-component"),u=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(v=>{if(V.isEmpty(v))return;const k=o.value?r.value:r.value?[r.value]:[],C=v.filter(B=>!k.some(S=>S.id===B.id));l.value=r.optionsListConverter([...k,...C])}).finally(()=>{d.value=!1}))};let m="";const f=V.debounce(()=>u(m),800),g=_=>{m=_,f()},p=_=>{var v;if(V.isArray(_)){const k=_.length>0?_.map(C=>{var B;return i.toRaw((B=l.value.find(S=>S.value===C))==null?void 0:B.item)}):[];s("update:value",k)}else if(_>0){const k=i.toRaw((v=l.value.find(C=>C.value===_))==null?void 0:v.item);s("update:value",k)}else s("update:value",null)};return e({focus:()=>{var _;return(_=h.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=h.value)==null?void 0:_.blurInput()}}),(_,v)=>(i.openBlock(),i.createBlock(i.unref(pv),{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:g,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),bv={},_u=i.defineComponent({...bv,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t;return((t=U.AppConfigProvider.getConfig())==null?void 0:t.minLength.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 u=>r.searchType==="categories"?U.HttpRequester.getInstance(U.ProductCategoryDataProvider).publicSimpleSearch(u):r.searchType==="products"?U.HttpRequester.getInstance(U.ProductDataProvider).publicSimpleSearch(u):new Promise(m=>{m([])}),l=u=>r.searchType==="categories"?zt.convertReferencesToSelectOptionsList(u,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":m.name):r.searchType==="products"?zt.convertReferencesToSelectOptionsList(u,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":`[${m.code}] ${m.name}`):[],c=(u,m)=>{if(r.renderLabel)return r.renderLabel(u,m);if(r.searchType==="products"){const f=u.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},f.code),i.h("span",{},[f.name])])}if(r.searchType==="categories"){const f=u.item;return i.h("div",{},[f.name])}};return e({focus:()=>{var u;return(u=o.value)==null?void 0:u.focus()},blur:()=>{var u;return(u=o.value)==null?void 0:u.blur()}}),(u,m)=>(i.openBlock(),i.createBlock(bu,{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]=f=>s("update:value",f))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),_v={class:"col-span-2 flex flex-row gap-2.5"},wv={class:"flex-1"},xv={class:"text-sc-grey"},vv={class:"ml-2.5"},kv={key:0,class:"flex-none"},Cv={},Sv=i.defineComponent({...Cv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t;return((t=U.AppConfigProvider.getConfig())==null?void 0:t.minLength.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(u=>i.toRaw(u)))},c=u=>{u&&(a.value=[...a.value.map(m=>i.toRaw(m)),...(V.isArray(u)?u:[u]).filter(m=>!a.value.some(f=>f.id===m.id))],i.nextTick(()=>{s.value=null}),l())},d=u=>{u&&(a.value=a.value.map(m=>m.id===u.id?u:i.toRaw(m)),l())},h=u=>{a.value=a.value.filter(m=>m.id!==u.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(u,m)=>{const f=z.NListItem,g=e_,p=z.NButton,y=z.NList;return i.openBlock(),i.createBlock(y,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(u.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(_u,{value:s.value,"onUpdate:value":[m[0]||(m[0]=b=>s.value=b),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(f,{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,b=>(i.openBlock(),i.createBlock(f,{key:b.id},{suffix:i.withCtx(()=>[i.createVNode(p,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>h(b)},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",_v,[i.createElementVNode("span",wv,[i.createElementVNode("span",xv,i.toDisplayString(b.code),1),i.createElementVNode("span",vv,i.toDisplayString(b.name),1)]),u.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",kv,[i.renderSlot(u.$slots,"item-extra",{item:b,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),Bv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Tv(t,e){return i.openBlock(),i.createElementBlock("svg",Bv,[...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 Rv=i.markRaw({name:"tabler-truck-filled",render:Tv}),$v={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ev(t,e){return i.openBlock(),i.createElementBlock("svg",$v,[...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 Nv=i.markRaw({name:"tabler-truck-delivery",render:Ev}),Pv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Fv(t,e){return i.openBlock(),i.createElementBlock("svg",Pv,[...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 Mv=i.markRaw({name:"tabler-truck-loading",render:Fv}),Av={class:"flex flex-col gap-1"},Vv={key:0,class:"flex flex-row gap-1 text-base"},Ov={key:1,class:"text-sc-dark-grey text-sm"},Iv={class:"text-sc-grey mr-1.5"},zv={key:0},Lv={key:1},Dv={key:2},Hv={},Ts=i.defineComponent({...Hv,__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=U.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Mn.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(s,o)=>{var d,h,u,m,f,g,p,y;const a=Mv,l=Nv,c=Rv;return i.openBlock(),i.createElementBlock("div",Av,[t.showType?(i.openBlock(),i.createElementBlock("span",Vv,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((u=e.value)==null?void 0:u.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",Ov,[i.createElementVNode("span",Iv,i.toDisplayString(n.value),1),(g=(f=t.delivery)==null?void 0:f.address)!=null&&g.address?(i.openBlock(),i.createElementBlock("span",zv,i.toDisplayString(t.delivery.address.address),1)):i.createCommentVNode("",!0),(y=(p=t.delivery)==null?void 0:p.warehouse)!=null&&y.address?(i.openBlock(),i.createElementBlock("span",Lv,"со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",Dv,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),Wv={class:"flex flex-col gap-2.5"},jv={class:"text-base"},qv=["href"],Xv={class:"text-sc-grey"},Yv={},wu=i.defineComponent({...Yv,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Ke.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Ke.Status)?(c=(l=U.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(Ke.CreatedAt)),o=i.computed(()=>e.fields.includes(Ke.ClientInfo)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Ke.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",Wv,[i.createElementVNode("span",jv,[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,qv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(Po,{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",Xv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(os,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Ts,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),Uv={},xu=i.defineComponent({...Uv,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=U.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)}}}),Gv={class:"flex flex-row gap-1.5"},Kv={class:"flex-none text-nowrap"},Zv={class:"flex flex-1 flex-col"},Qv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},Jv={key:0},ek={key:1},tk={},vu=i.defineComponent({...tk,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Gv,[i.createElementVNode("span",Kv,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Zv,[i.createVNode(tr,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",Qv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",Jv,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",ek,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1)])])]))}}),nk={},ik=i.defineComponent({...nk,__name:"order-items-list",props:{order:{}},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,render:o=>i.h(tr,{product:o.product,showCode:!1,showPlanningDates:!1})},{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} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])}];switch(bt.getDeviceTypeByResolution()){case Ue.phone:case Ue.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(vu,{product:o,index:a})}];case Ue.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=z.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.order.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1},null,8,["columns","data","row-key"])],64)}}}),ku=Zn(ik,[["__scopeId","data-v-b15b9b70"]]),rk={class:"text-base"},sk={},ma=i.defineComponent({...sk,__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",rk,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))}}),ok={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},ak={class:"col-span-2"},lk={class:"col-span-2"},ck={class:"btn btn-primary",href:"{{ invoice }}"},dk={},Cu=i.defineComponent({...dk,__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",ok,[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(ma,{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(os,{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(Sd,{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",ak,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(xu,{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(Ts,{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",lk,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(ma,{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",ck," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),hk={key:0},uk={class:"text-sc-dark-grey my-2 text-center"},fk={key:1,class:"text-sc-dark-grey my-2 text-center"},gk={key:2},mk={class:"text-sc-dark-grey mt-4 text-right font-bold"},pk={class:"text-sc-primary"},yk={},Su=i.defineComponent({...yk,__name:"order-info",props:{order:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(new U.Order(e.order)),s=()=>{n.value=!0,U.HttpRequester.getInstance(U.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=z.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",hk,[i.createElementVNode("div",uk,[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",fk," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",gk,[i.createVNode(ku,{order:r.value},null,8,["order"]),i.createElementVNode("div",mk,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",pk,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode(Cu,{order:r.value},null,8,["order"])]))}}}),bk={},_k=i.defineComponent({...bk,__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(()=>U.useReferencesStore().orderStatusReference),l=()=>{const p=e.fields.length>0?e.fields:[Ke.CreatedAt,Ke.Id,Ke.DeliveryInfo,Ke.Status,Ke.SalesDirections,Ke.AttachedUser],y={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},b={type:"expand",expandable:V.constant(!0),renderExpand:v=>i.h(Su,{order:v,class:"pl-10 pt-3 pb-10"}),width:"30"},_=[{title:"Дата заказа",key:Ke.CreatedAt,resizable:!0,minWidth:100,render:v=>i.h(Po,{date:v.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Ke.Id,resizable:!0,minWidth:70,render:v=>i.h("a",{href:e.orderUrl.replace(":id",v.id.toString()),target:"_blank",class:"text-base"},v.id)},{title:"Клиент",key:Ke.ClientInfo,resizable:!0,render:v=>i.h(os,{client:v.client})},{title:"Тип доставки",key:Ke.DeliveryInfo,resizable:!0,render:v=>i.h(Ts,{delivery:v.delivery})},{title:"Статус",key:Ke.Status,resizable:!0,minWidth:90,render:v=>{var k,C;return i.h("span",{class:"text-base"},[((C=(k=a.value)==null?void 0:k.find(B=>B.id===(v.status??-1)))==null?void 0:C.name)??""])}},{title:"Напр. продаж",key:Ke.SalesDirections,resizable:!0,minWidth:70,render:v=>i.h("span",{class:"text-base"},[v.salesDirection.name])},{title:"Закреплено за",key:Ke.AttachedUser,resizable:!0,render:v=>{var k;return i.h("span",{class:"text-base"},[(k=v==null?void 0:v.attachedUser)==null?void 0:k.name])}}];switch(bt.getDeviceTypeByResolution()){case Ue.phone:case Ue.tablet:return[b,{key:"order",title:"Заказ",resizable:!0,render:v=>i.h(wu,{order:v,fields:p,orderUrl:e.orderUrl})}];case Ue.laptop:return[b,...p.map(v=>_.find(k=>k.key===v)??y)];default:return[y]}},c=i.ref(l()),d=i.ref(new U.DataTablePagination(e.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),h=()=>{e.filters&&(o.value=!0,U.HttpRequester.getInstance(U.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}))},u=p=>{d.value.page=p,h()},m=p=>{d.value.pageSize=p,h()},f=p=>{V.isNull(p)?r.value=n():(r.value.field=p.columnKey.toString(),r.value.direction=p.order==="ascend"?"asc":"desc"),c.value.forEach(y=>{if(Object.hasOwn(y,"sortOrder")){const b=y;b.sortOrder=b.key===(p==null?void 0:p.columnKey)&&(p!=null&&p.sorter)&&p.order!==!1?p.order:!1}}),h()},g=()=>{c.value=l()};return i.watch(()=>e.filters,()=>{h()}),i.watch(()=>e.sort,()=>{r.value=n(),h()}),i.onMounted(()=>{g(),window.addEventListener("resize",g),i.nextTick(()=>{h()})}),i.onUnmounted(()=>{window.removeEventListener("resize",g)}),(p,y)=>{const b=z.NDataTable;return i.openBlock(),i.createBlock(b,{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":u,"onUpdate:pageSize":m,"onUpdate:sorter":f},null,8,["columns","data","row-key","pagination","loading"])}}}),wk=Zn(_k,[["__scopeId","data-v-7c4554f4"]]),xk=["href"],vk={class:"text-sc-dark-grey"},kk={},Ck=i.defineComponent({...kk,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>Mn.format(n.order.createdAt,U.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{V.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,xk),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",vk,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),Sk={class:"sc-page flex flex-col"},Bk={class:"my-2 flex flex-row items-end"},Tk={class:"sc-title grow"},Rk={key:0,class:"sc-title-buttons flex-1 grow-0"},$k={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},Ek={key:0,class:"sc-title-extra mt-2 sm:mt-4"},Nk={},Bu=i.defineComponent({...Nk,__name:"page",props:{title:{}},setup(t){return(e,n)=>{const r=z.NH1;return i.openBlock(),i.createElementBlock("div",Sk,[i.createElementVNode("div",Bk,[i.createElementVNode("div",Tk,[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",Rk,[i.createElementVNode("div",$k,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",Ek,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"default")])}}}),Pk={class:"overflow-hidden transition-all duration-300"},Fk={class:"text-lg font-medium leading-none"},Mk={},Tu=i.defineComponent({...Mk,__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(bt.getDeviceTypeByResolution()){case Ue.phone:return window.innerWidth*.66;case Ue.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?V.isUndefined(n.drawerWidth)?s.value=a():s.value=V.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 h=z.NDrawerContent,u=z.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",Pk,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(u,{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(h,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",Fk,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)}}}),Ak={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},Vk={key:0},Ok={class:"sc-page-preview-panel grow"},Ik={key:1,class:"sc-page-preview-panel-extra flex-none"},zk={},Lk=i.defineComponent({...zk,__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,h;window.scrollTo({top:(((h=(d=o.value)==null?void 0:d.getBoundingClientRect())==null?void 0:h.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:s}),(l,c)=>{const d=z.NButton;return i.openBlock(),i.createBlock(Bu,{title:t.title},i.createSlots({default:i.withCtx(()=>[l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",Ak,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",Vk,[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]=h=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",Ok,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",Ik,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Tu,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=h=>n.value=h),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"])}}}),Dk={},Hk=i.defineComponent({...Dk,__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(()=>V.isArray(r.value)),a=i.computed(()=>{var f;return V.isArray(r.value)?r.value.map(g=>g.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>{var p;let f=r.showEmptyValue?[U.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList,g=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=V.isArray(r.value)?r.value.map(b=>b.id):[(p=r.value)==null?void 0:p.id];g=V.union(g,r.managerReferenceList.filter(b=>!b.isActive).map(b=>b.id)),f=r.managerReferenceList.filter(b=>b.isActive||y.includes(b.id))}return zt.convertReferencesToSelectOptionsList(f,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,y=>{const b=!r.groupBySalesDirection||r.groupBySalesDirection&&V.some(o.value?r.value:[r.value],["id",y.id])?` (${y.salesDirection.name}) `:"";return y.salesDirection.isNewRec()?y.name:`${y.name}${b}${y.isActive?"":" [Не активен]"}`},y=>g.includes(y.id)&&y.isActive)}),c=i.computed(()=>l.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),d=i.useTemplateRef("select-component"),h=f=>{if(V.isArray(f)){const g=f.length>0?f.filter(p=>!V.some(r.disabledManagerReferenceList,["id",p])).map(p=>r.managerReferenceList.find(y=>y.id===p)).filter(p=>!V.isNil(p)):[];s("update:value",g)}else{const g=f>0&&!V.some(r.disabledManagerReferenceList,["id",f])?r.managerReferenceList.find(p=>p.id===f):new U.Manager;s("update:value",g??new U.Manager)}};return i.watch(()=>r.value,()=>{var f,g;(g=(f=d.value)==null?void 0:f.$forceUpdate)==null||g.call(f)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,f=>{if(f.length>0&&r.value)if(o.value){const g=r.value;V.some(g,p=>V.some(f,["id",p.id]))&&s("update:value",g.filter(p=>!V.some(f,["id",p.id])))}else{const g=r.value;V.some(f,["id",g.id])&&s("update:value",new U.Manager)}}),e({focus:()=>{var f;return(f=d.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=d.value)==null?void 0:f.blurInput()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:l.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),Wk={class:"m-0.5 flex flex-col p-0.5"},jk={class:"flex flex-row gap-1"},qk={key:0},Xk={key:1},Yk={key:2},Uk={key:3},Gk={class:"flex flex-row gap-1"},Kk={key:0},Zk={key:1},Qk={key:2},Jk={key:3},e2={},Ru=i.defineComponent({...e2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Wk,[i.createElementVNode("span",jk,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",qk,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",Xk,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",Yk,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",Uk,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",Gk,[t.addr.street?(i.openBlock(),i.createElementBlock("span",Kk,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",Zk,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",Qk,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",Jk,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),pa={clearable:!1,value:"",field:void 0,disabled:!1},t2={},n2=i.defineComponent({...t2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...pa,minTermLength:()=>{var t;return((t=U.AppConfigProvider.getConfig())==null?void 0:t.minLength.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=V.debounce(()=>h(),800),h=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(o.value,a):U.HttpRequester.getInstance(U.DataSuggestionProvider).searchAddresses(o.value)).finally(()=>{a.value=!1}))},u=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h(Ru,{addr:b,selected:y},{default:V.constant("-")})},m=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};s("select",y)},f=i.ref(null);function g(){f.value.focus()}return e({focus:g}),(p,y)=>{const b=z.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[y[0]||(y[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),i2={class:"m-0.5 flex flex-col p-0.5"},r2={class:"font-medium"},s2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},o2={key:0},a2={key:1},l2={},$u=i.defineComponent({...l2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",i2,[i.createElementVNode("span",r2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",s2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",o2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",a2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),c2={},d2=i.defineComponent({...c2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...pa,minTermLength:()=>{var t;return((t=U.AppConfigProvider.getConfig())==null?void 0:t.minLength.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=V.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await U.HttpRequester.getInstance(U.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},u=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h($u,{bank:b,selected:y},{default:V.constant("-")})},m=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};s("select",y)},f=i.ref(null);function g(){f.value.focus()}return e({focus:g}),(p,y)=>{const b=z.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[y[0]||(y[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),h2={class:"font-medium"},u2={key:0,class:"flex flex-row gap-2"},f2={key:0,class:"text-xs font-light text-blue-800"},g2={key:1,class:"text-sc-dark-grey text-xs font-light"},m2={},Eu=i.defineComponent({...m2,__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",h2,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",u2,[t.org.inn?(i.openBlock(),i.createElementBlock("span",f2,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",g2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),p2={},y2=i.defineComponent({...p2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...pa,minTermLength:()=>{var t;return((t=U.AppConfigProvider.getConfig())==null?void 0:t.minLength.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=y=>{var b,_;return!!(((_=(b=y.rawData)==null?void 0:b.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>zt.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,y=>y[r.field??"_"]??"-",y=>!r.allowSelectTerminated&&c(y)));i.watch(()=>r.value,y=>{o.value=y}),i.watch(o,()=>{s("update:value",o.value)});const h=V.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await U.HttpRequester.getInstance(U.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},m=(y,b)=>{const _=l.value.find(v=>v.id===y.value)||{};return i.h(Eu,{org:_,selected:b},{default:V.constant("-")})},f=y=>{h.cancel();const b=l.value.find(_=>_.id===y)||{};(r.allowSelectTerminated||!c(b))&&s("select",b)},g=i.ref(null);function p(){g.value.focus()}return e({focus:p}),(y,b)=>{const _=z.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[b[0]||(b[0]=v=>o.value=v),i.unref(h)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":m,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),b2={},_2=i.defineComponent({...b2,__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=z.NButton,h=z.NPopover,u=z.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(h,{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(u,{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"])])}}}),w2={key:0,class:"whitespace-pre-line"},x2={key:1,class:"text-sc-dark-grey"},v2={},k2=i.defineComponent({...v2,__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=z.NInput;return i.openBlock(),i.createBlock(Ed,{disabled:t.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",w2,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",x2," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=h=>s.value=h),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),C2={key:0,class:"text-sm"},S2={key:1},B2={},T2=i.defineComponent({...B2,__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)=>(i.openBlock(),i.createElementBlock("span",null,[t.wrapAsSmall&&t.debt!==0?(i.openBlock(),i.createElementBlock("span",C2,[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)])):i.createCommentVNode("",!0),!t.wrapAsSmall&&t.debt!==0?(i.openBlock(),i.createElementBlock("span",S2,[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)])):i.createCommentVNode("",!0)]))}}),R2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $2(t,e){return i.openBlock(),i.createElementBlock("svg",R2,[...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 E2=i.markRaw({name:"ion-warning",render:$2}),N2={},P2=i.defineComponent({...N2,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=E2,s=z.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"])}}}),mt=class mt{static init(e,n){mt.messagesService&&mt.notificationsService||(mt.messagesService=e,mt.notificationsService=n)}static getMessagesService(){if(!mt.messagesService)throw new Error("UI provider is not initialized.");return mt.messagesService}static getNotificationsService(){if(!mt.notificationsService)throw new Error("UI provider is not initialized.");return mt.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,s;if(V.isEmpty(e.errors)){const o=(s=(r=e.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";mt.notificationsService?mt.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 U.FieldValidationResultData(e.errors[o].toString(),"error"):mt.messagesService?mt.messagesService.error(e.errors[o].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[o])}};x(mt,"messagesService"),x(mt,"notificationsService");let ya=mt;const F2=i.computed(()=>U.useReferencesStore().deliveryTypeReference??[]),M2=i.computed(()=>U.useReferencesStore().managersList??[]),A2=i.computed(()=>U.useReferencesStore().opfReference??[]),V2=i.computed(()=>U.useReferencesStore().partnerGroupsReference??[]),O2=i.computed(()=>U.useReferencesStore().priceCoefficientsReference??[]),I2=i.computed(()=>U.useReferencesStore().productFilesTypesReference??[]),z2=i.computed(()=>U.useReferencesStore().resourceTypesReference),L2=i.computed(()=>U.useReferencesStore().salesDirectionsReference??[]),D2=i.computed(()=>U.useReferencesStore().warehousesReference??[]),H2=i.computed(()=>zt.convertReferencesToSelectOptionsList(U.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),W2=i.computed(()=>zt.convertReferencesToSelectOptionsList(U.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),j2=t=>U.HttpRequester.getInstance(U.ReferenceDataProvider).searchCity(t),q2=t=>zt.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());W.AddProductToCartDialog=iy,W.ConfiguratorSettingsKozyrek=_d,W.ContentHelper=Kn,W.KozyrekLine=ri,W.KozyrekTailTemplate=No,W.KozyrekTemplate=Di,W.OrdersTableFields=Ke,W.Point=$o,W.ScAddressSuggestion=n2,W.ScAddressSuggestionLabel=Ru,W.ScBankSuggestion=d2,W.ScBankSuggestionLabel=$u,W.ScBaseDialog=Cd,W.ScButtonWithConfirmAction=_2,W.ScCategoryCollapse=vd,W.ScClientNameWithShortInfo=os,W.ScCollapse=xd,W.ScCollapseItem=Da,W.ScCommentEditor=k2,W.ScConfiguratorsProductInfo=nr,W.ScContragentWithShortInfo=Sd,W.ScDateRange=gb,W.ScDateTimeLabel=Po,W.ScDebouncedInput=Db,W.ScDebouncedInputNumber=Li,W.ScDebt=T2,W.ScDialogHeader=vb,W.ScDynamicConfigurator=wd,W.ScEmail=_y,W.ScExternalLink=Zb,W.ScImageGallery=qa,W.ScInlineEditableItem=Ed,W.ScInlineView=Fo,W.ScKozyrekConfigurator=cd,W.ScKozyrekConfiguratorParamsForm=Ua,W.ScKozyrekConfiguratorPreview=ld,W.ScKozyrekConfiguratorTemplates=ad,W.ScLightGallery=ja,W.ScManagerSelect=Hk,W.ScMetalForDoorsConfigurator=bd,W.ScMetalForDoorsConfiguratorForm=yd,W.ScMosquitoConfigurator=ud,W.ScMosquitoConfiguratorForm=dd,W.ScMosquitoConfiguratorMeasurementInstructions=hd,W.ScMosquitoConfiguratorPreview=Eo,W.ScOrderCommonInfo=wu,W.ScOrderDeliveryLabel=Ts,W.ScOrderDetails=Cu,W.ScOrderInfo=Su,W.ScOrderItemsList=ku,W.ScOrderPayment=xu,W.ScOrderProductInfo=vu,W.ScOrdersList=wk,W.ScOrgSuggestion=y2,W.ScOrgSuggestionLabel=Eu,W.ScPage=Bu,W.ScPageWithSlidingPanel=Lk,W.ScPersonContactsBlock=cb,W.ScPhone=Wy,W.ScPhoneInput=jb,W.ScProductName=tr,W.ScProductsList=Sv,W.ScReferenceSelect=kd,W.ScSearchableProductSelect=_u,W.ScSearchableReferenceSelect=bu,W.ScSetClientPriceFormItem=K0,W.ScShortTextOrderInfo=Ck,W.ScSingleFileUploadSelector=Tb,W.ScSlidingContentWithDrawer=Tu,W.ScStripConfigurator=pd,W.ScStripConfiguratorForm=gd,W.ScStripConfiguratorLineItem=fd,W.ScStripConfiguratorPreview=md,W.ScUserShortInfo=ma,W.ScWarningIcon=P2,W.SelectOptionHelper=zt,W.UiNotificationProvider=ya,W.WindowResolutionEnum=Ue,W.WindowResolutionProvider=bt,W.channelPrimaryInterestOptionsList=H2,W.componentSizeInjectionKey=$r,W.deliveryTypeReferenceList=F2,W.managersReferenceList=M2,W.naiveUiTheme=kf,W.opfReferenceList=A2,W.partnerGroupReferenceList=V2,W.priceCoefficientsReferenceList=O2,W.productFilesTypesReferenceList=I2,W.renderConfig=Ve,W.resourceReferencesList=z2,W.salesDirectionsReferenceList=L2,W.searchCityReferenceDataHandler=j2,W.searchCityReferenceLabelRenderer=q2,W.sourcePrimaryInterestOptionsList=W2,W.warehousesReferenceList=D2,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
|
|
822
|
+
`,[fu({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Bs(t){return t.type==="group"}function yu(t){return t.type==="ignored"}function ga(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function hv(t,e){return{getIsGroup:Bs,getIgnored:yu,getKey(r){return Bs(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function uv(t,e,n,r){if(!e)return t;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(Bs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(yu(l))continue;e(n,l)&&a.push(l)}return a}return s(t)}function fv(t,e,n){const r=new Map;return t.forEach(s=>{Bs(s)?s[n].forEach(o=>{r.set(o[e],o)}):r.set(s[e],s)}),r}var gv={};const mv=Object.assign(Object.assign({},ut.props),{to:kn.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}),pv=i.defineComponent({name:"Select",props:mv,slots:Object,setup(t){gv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&jn("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&jn("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=gi(t),o=ut("Select","-select",dv,cv,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Ho(l,a),d=i.ref(!1),h=i.ref(""),u=jd(t,["items","options"]),m=i.ref([]),f=i.ref([]),g=i.computed(()=>f.value.concat(m.value).concat(u.value)),p=i.computed(()=>{const{filter:R}=t;if(R)return R;const{labelField:j,valueField:ne}=t;return(le,ce)=>{if(!ce)return!1;const pe=ce[j];if(typeof pe=="string")return ga(le,pe);const _e=ce[ne];return typeof _e=="string"?ga(le,_e):typeof _e=="number"?ga(le,String(_e)):!1}}),y=i.computed(()=>{if(t.remote)return u.value;{const{value:R}=g,{value:j}=h;return!j.length||!t.filterable?R:uv(R,p.value,j,t.childrenField)}}),b=i.computed(()=>{const{valueField:R,childrenField:j}=t,ne=hv(R,j);return H_(y.value,ne)}),_=i.computed(()=>fv(g.value,t.valueField,t.childrenField)),v=i.ref(!1),k=Ho(i.toRef(t,"show"),v),S=i.ref(null),B=i.ref(null),C=i.ref(null),{localeRef:T}=Qh("Select"),$=i.computed(()=>{var R;return(R=t.placeholder)!==null&&R!==void 0?R:T.value.placeholder}),E=[],I=i.ref(new Map),O=i.computed(()=>{const{fallbackOption:R}=t;if(R===void 0){const{labelField:j,valueField:ne}=t;return le=>({[j]:String(le),[ne]:le})}return R===!1?!1:j=>Object.assign(R(j),{value:j})});function V(R){const j=t.remote,{value:ne}=I,{value:le}=_,{value:ce}=O,pe=[];return R.forEach(_e=>{if(le.has(_e))pe.push(le.get(_e));else if(j&&ne.has(_e))pe.push(ne.get(_e));else if(ce){const xe=ce(_e);xe&&pe.push(xe)}}),pe}const L=i.computed(()=>{if(t.multiple){const{value:R}=c;return Array.isArray(R)?V(R):[]}return null}),D=i.computed(()=>{const{value:R}=c;return!t.multiple&&!Array.isArray(R)?R===null?null:V([R])[0]||null:null}),ee=xw(t),{mergedSizeRef:N,mergedDisabledRef:P,mergedStatusRef:H}=ee;function q(R,j){const{onChange:ne,"onUpdate:value":le,onUpdateValue:ce}=t,{nTriggerFormChange:pe,nTriggerFormInput:_e}=ee;ne&&ht(ne,R,j),ce&&ht(ce,R,j),le&&ht(le,R,j),a.value=R,pe(),_e()}function U(R){const{onBlur:j}=t,{nTriggerFormBlur:ne}=ee;j&&ht(j,R),ne()}function F(){const{onClear:R}=t;R&&ht(R)}function M(R){const{onFocus:j,showOnFocus:ne}=t,{nTriggerFormFocus:le}=ee;j&&ht(j,R),le(),ne&&re()}function Z(R){const{onSearch:j}=t;j&&ht(j,R)}function fe(R){const{onScroll:j}=t;j&&ht(j,R)}function ie(){var R;const{remote:j,multiple:ne}=t;if(j){const{value:le}=I;if(ne){const{valueField:ce}=t;(R=L.value)===null||R===void 0||R.forEach(pe=>{le.set(pe[ce],pe)})}else{const ce=D.value;ce&&le.set(ce[t.valueField],ce)}}}function me(R){const{onUpdateShow:j,"onUpdate:show":ne}=t;j&&ht(j,R),ne&&ht(ne,R),v.value=R}function re(){P.value||(me(!0),v.value=!0,t.filterable&&Xn())}function Me(){me(!1)}function Ae(){h.value="",f.value=E}const Ie=i.ref(!1);function Le(){t.filterable&&(Ie.value=!0)}function pt(){t.filterable&&(Ie.value=!1,k.value||Ae())}function Zt(){P.value||(k.value?t.filterable?Xn():Me():re())}function Qt(R){var j,ne;!((ne=(j=C.value)===null||j===void 0?void 0:j.selfRef)===null||ne===void 0)&&ne.contains(R.relatedTarget)||(d.value=!1,U(R),Me())}function St(R){M(R),d.value=!0}function At(){d.value=!0}function yt(R){var j;!((j=S.value)===null||j===void 0)&&j.$el.contains(R.relatedTarget)||(d.value=!1,U(R),Me())}function pn(){var R;(R=S.value)===null||R===void 0||R.focus(),Me()}function Pn(R){var j;k.value&&(!((j=S.value)===null||j===void 0)&&j.$el.contains(dr(R))||Me())}function De(R){if(!Array.isArray(R))return[];if(O.value)return Array.from(R);{const{remote:j}=t,{value:ne}=_;if(j){const{value:le}=I;return R.filter(ce=>ne.has(ce)||le.has(ce))}else return R.filter(le=>ne.has(le))}}function ke(R){Oe(R.rawNode)}function Oe(R){if(P.value)return;const{tag:j,remote:ne,clearFilterAfterSelect:le,valueField:ce}=t;if(j&&!ne){const{value:pe}=f,_e=pe[0]||null;if(_e){const xe=m.value;xe.length?xe.push(_e):m.value=[_e],f.value=E}}if(ne&&I.value.set(R[ce],R),t.multiple){const pe=De(c.value),_e=pe.findIndex(xe=>xe===R[ce]);if(~_e){if(pe.splice(_e,1),j&&!ne){const xe=J(R[ce]);~xe&&(m.value.splice(xe,1),le&&(h.value=""))}}else pe.push(R[ce]),le&&(h.value="");q(pe,V(pe))}else{if(j&&!ne){const pe=J(R[ce]);~pe?m.value=[m.value[pe]]:m.value=E}Gi(),Me(),q(R[ce],R)}}function J(R){return m.value.findIndex(ne=>ne[t.valueField]===R)}function se(R){k.value||re();const{value:j}=R.target;h.value=j;const{tag:ne,remote:le}=t;if(Z(j),ne&&!le){if(!j){f.value=E;return}const{onCreate:ce}=t,pe=ce?ce(j):{[t.labelField]:j,[t.valueField]:j},{valueField:_e,labelField:xe}=t;u.value.some(Ye=>Ye[_e]===pe[_e]||Ye[xe]===pe[xe])||m.value.some(Ye=>Ye[_e]===pe[_e]||Ye[xe]===pe[xe])?f.value=E:f.value=[pe]}}function Ce(R){R.stopPropagation();const{multiple:j}=t;!j&&t.filterable&&Me(),F(),j?q([],[]):q(null,null)}function Jt(R){!cr(R,"action")&&!cr(R,"empty")&&!cr(R,"header")&&R.preventDefault()}function Ui(R){fe(R)}function wi(R){var j,ne,le,ce,pe;if(!t.keyboard){R.preventDefault();return}switch(R.key){case" ":if(t.filterable)break;R.preventDefault();case"Enter":if(!(!((j=S.value)===null||j===void 0)&&j.isComposing)){if(k.value){const _e=(ne=C.value)===null||ne===void 0?void 0:ne.getPendingTmNode();_e?ke(_e):t.filterable||(Me(),Gi())}else if(re(),t.tag&&Ie.value){const _e=f.value[0];if(_e){const xe=_e[t.valueField],{value:Ye}=c;t.multiple&&Array.isArray(Ye)&&Ye.includes(xe)||Oe(_e)}}}R.preventDefault();break;case"ArrowUp":if(R.preventDefault(),t.loading)return;k.value&&((le=C.value)===null||le===void 0||le.prev());break;case"ArrowDown":if(R.preventDefault(),t.loading)return;k.value?(ce=C.value)===null||ce===void 0||ce.next():re();break;case"Escape":k.value&&(yw(R),Me()),(pe=S.value)===null||pe===void 0||pe.focus();break}}function Gi(){var R;(R=S.value)===null||R===void 0||R.focus()}function Xn(){var R;(R=S.value)===null||R===void 0||R.focusInput()}function xi(){var R;k.value&&((R=B.value)===null||R===void 0||R.syncPosition())}ie(),i.watch(i.toRef(t,"options"),ie);const Ki={focus:()=>{var R;(R=S.value)===null||R===void 0||R.focus()},focusInput:()=>{var R;(R=S.value)===null||R===void 0||R.focusInput()},blur:()=>{var R;(R=S.value)===null||R===void 0||R.blur()},blurInput:()=>{var R;(R=S.value)===null||R===void 0||R.blurInput()}},en=i.computed(()=>{const{self:{menuBoxShadow:R}}=o.value;return{"--n-menu-box-shadow":R}}),Fn=s?mi("select",void 0,en,t):void 0;return Object.assign(Object.assign({},Ki),{mergedStatus:H,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:b,isMounted:fs(),triggerRef:S,menuRef:C,pattern:h,uncontrolledShow:v,mergedShow:k,adjustedTo:kn(t),uncontrolledValue:a,mergedValue:c,followerRef:B,localizedPlaceholder:$,selectedOption:D,selectedOptions:L,mergedSize:N,mergedDisabled:P,focused:d,activeWithoutMenuOpen:Ie,inlineThemeDisabled:s,onTriggerInputFocus:Le,onTriggerInputBlur:pt,handleTriggerOrMenuResize:xi,handleMenuFocus:At,handleMenuBlur:yt,handleMenuTabOut:pn,handleTriggerClick:Zt,handleToggle:ke,handleDeleteOption:Oe,handlePatternInput:se,handleClear:Ce,handleTriggerBlur:Qt,handleTriggerFocus:St,handleKeydown:wi,handleMenuAfterLeave:Ae,handleMenuClickOutside:Pn,handleMenuScroll:Ui,handleMenuKeydown:wi,handleMenuMousedown:Jt,mergedTheme:o,cssVars:s?void 0:en,themeClass:Fn==null?void 0:Fn.themeClass,onRender:Fn==null?void 0:Fn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(Ud,null,{default:()=>[i.h(Gd,null,{default:()=>i.h(av,{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(dh,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===kn.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(Vx,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],[us,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[us,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),yv={},bu=i.defineComponent({...yv,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t;return((t=Y.AppConfigProvider.getConfig())==null?void 0:t.minLength.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(()=>A.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),h=i.useTemplateRef("select-component"),u=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(v=>{if(A.isEmpty(v))return;const k=o.value?r.value:r.value?[r.value]:[],S=v.filter(B=>!k.some(C=>C.id===B.id));l.value=r.optionsListConverter([...k,...S])}).finally(()=>{d.value=!1}))};let m="";const f=A.debounce(()=>u(m),800),g=_=>{m=_,f()},p=_=>{var v;if(A.isArray(_)){const k=_.length>0?_.map(S=>{var B;return i.toRaw((B=l.value.find(C=>C.value===S))==null?void 0:B.item)}):[];s("update:value",k)}else if(_>0){const k=i.toRaw((v=l.value.find(S=>S.value===_))==null?void 0:v.item);s("update:value",k)}else s("update:value",null)};return e({focus:()=>{var _;return(_=h.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=h.value)==null?void 0:_.blurInput()}}),(_,v)=>(i.openBlock(),i.createBlock(i.unref(pv),{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:g,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),bv={},_u=i.defineComponent({...bv,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t;return((t=Y.AppConfigProvider.getConfig())==null?void 0:t.minLength.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 u=>r.searchType==="categories"?Y.HttpRequester.getInstance(Y.ProductCategoryDataProvider).publicSimpleSearch(u):r.searchType==="products"?Y.HttpRequester.getInstance(Y.ProductDataProvider).publicSimpleSearch(u):new Promise(m=>{m([])}),l=u=>r.searchType==="categories"?zt.convertReferencesToSelectOptionsList(u,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":m.name):r.searchType==="products"?zt.convertReferencesToSelectOptionsList(u,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":`[${m.code}] ${m.name}`):[],c=(u,m)=>{if(r.renderLabel)return r.renderLabel(u,m);if(r.searchType==="products"){const f=u.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},f.code),i.h("span",{},[f.name])])}if(r.searchType==="categories"){const f=u.item;return i.h("div",{},[f.name])}};return e({focus:()=>{var u;return(u=o.value)==null?void 0:u.focus()},blur:()=>{var u;return(u=o.value)==null?void 0:u.blur()}}),(u,m)=>(i.openBlock(),i.createBlock(bu,{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]=f=>s("update:value",f))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),_v={class:"col-span-2 flex flex-row gap-2.5"},wv={class:"flex-1"},xv={class:"text-sc-grey"},vv={class:"ml-2.5"},kv={key:0,class:"flex-none"},Cv={},Sv=i.defineComponent({...Cv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t;return((t=Y.AppConfigProvider.getConfig())==null?void 0:t.minLength.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(u=>i.toRaw(u)))},c=u=>{u&&(a.value=[...a.value.map(m=>i.toRaw(m)),...(A.isArray(u)?u:[u]).filter(m=>!a.value.some(f=>f.id===m.id))],i.nextTick(()=>{s.value=null}),l())},d=u=>{u&&(a.value=a.value.map(m=>m.id===u.id?u:i.toRaw(m)),l())},h=u=>{a.value=a.value.filter(m=>m.id!==u.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(u,m)=>{const f=z.NListItem,g=e_,p=z.NButton,y=z.NList;return i.openBlock(),i.createBlock(y,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(u.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(_u,{value:s.value,"onUpdate:value":[m[0]||(m[0]=b=>s.value=b),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(f,{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,b=>(i.openBlock(),i.createBlock(f,{key:b.id},{suffix:i.withCtx(()=>[i.createVNode(p,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>h(b)},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",_v,[i.createElementVNode("span",wv,[i.createElementVNode("span",xv,i.toDisplayString(b.code),1),i.createElementVNode("span",vv,i.toDisplayString(b.name),1)]),u.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",kv,[i.renderSlot(u.$slots,"item-extra",{item:b,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),Bv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Tv(t,e){return i.openBlock(),i.createElementBlock("svg",Bv,[...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 Rv=i.markRaw({name:"tabler-truck-filled",render:Tv}),$v={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ev(t,e){return i.openBlock(),i.createElementBlock("svg",$v,[...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 Nv=i.markRaw({name:"tabler-truck-delivery",render:Ev}),Pv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Fv(t,e){return i.openBlock(),i.createElementBlock("svg",Pv,[...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 Mv=i.markRaw({name:"tabler-truck-loading",render:Fv}),Av={class:"flex flex-col gap-1"},Vv={key:0,class:"flex flex-row gap-1 text-base"},Iv={key:1,class:"text-sc-dark-grey text-sm"},Ov={class:"text-sc-grey mr-1.5"},zv={key:0},Lv={key:1},Dv={key:2},Hv={},Ts=i.defineComponent({...Hv,__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=Y.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Mn.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(s,o)=>{var d,h,u,m,f,g,p,y;const a=Mv,l=Nv,c=Rv;return i.openBlock(),i.createElementBlock("div",Av,[t.showType?(i.openBlock(),i.createElementBlock("span",Vv,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((u=e.value)==null?void 0:u.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",Iv,[i.createElementVNode("span",Ov,i.toDisplayString(n.value),1),(g=(f=t.delivery)==null?void 0:f.address)!=null&&g.address?(i.openBlock(),i.createElementBlock("span",zv,i.toDisplayString(t.delivery.address.address),1)):i.createCommentVNode("",!0),(y=(p=t.delivery)==null?void 0:p.warehouse)!=null&&y.address?(i.openBlock(),i.createElementBlock("span",Lv,"со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",Dv,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),Wv={class:"flex flex-col gap-2.5"},jv={class:"text-base"},qv=["href"],Xv={class:"text-sc-grey"},Yv={},wu=i.defineComponent({...Yv,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Ke.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Ke.Status)?(c=(l=Y.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(Ke.CreatedAt)),o=i.computed(()=>e.fields.includes(Ke.ClientInfo)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Ke.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",Wv,[i.createElementVNode("span",jv,[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,qv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(Po,{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",Xv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(os,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Ts,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),Uv={},xu=i.defineComponent({...Uv,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=Y.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)}}}),Gv={class:"flex flex-row gap-1.5"},Kv={class:"flex-none text-nowrap"},Zv={class:"flex flex-1 flex-col"},Qv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},Jv={key:0},ek={key:1},tk={},vu=i.defineComponent({...tk,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Gv,[i.createElementVNode("span",Kv,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Zv,[i.createVNode(tr,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",Qv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",Jv,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",ek,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1)])])]))}}),nk={},ik=i.defineComponent({...nk,__name:"order-items-list",props:{order:{}},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,render:o=>i.h(tr,{product:o.product,showCode:!1,showPlanningDates:!1})},{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} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])}];switch(bt.getDeviceTypeByResolution()){case Ue.phone:case Ue.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(vu,{product:o,index:a})}];case Ue.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=z.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.order.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1},null,8,["columns","data","row-key"])],64)}}}),ku=Zn(ik,[["__scopeId","data-v-b15b9b70"]]),rk={class:"text-base"},sk={},ma=i.defineComponent({...sk,__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",rk,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))}}),ok={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},ak={class:"col-span-2"},lk={class:"col-span-2"},ck={class:"btn btn-primary",href:"{{ invoice }}"},dk={},Cu=i.defineComponent({...dk,__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",ok,[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(ma,{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(os,{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(Sd,{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",ak,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(xu,{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(Ts,{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",lk,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(ma,{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",ck," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),hk={key:0},uk={class:"text-sc-dark-grey my-2 text-center"},fk={key:1,class:"text-sc-dark-grey my-2 text-center"},gk={key:2},mk={class:"text-sc-dark-grey mt-4 text-right font-bold"},pk={class:"text-sc-primary"},yk={},Su=i.defineComponent({...yk,__name:"order-info",props:{order:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(new Y.Order(e.order)),s=()=>{n.value=!0,Y.HttpRequester.getInstance(Y.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=z.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",hk,[i.createElementVNode("div",uk,[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",fk," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",gk,[i.createVNode(ku,{order:r.value},null,8,["order"]),i.createElementVNode("div",mk,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",pk,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode(Cu,{order:r.value},null,8,["order"])]))}}}),bk={},_k=i.defineComponent({...bk,__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(()=>Y.useReferencesStore().orderStatusReference),l=()=>{const p=e.fields.length>0?e.fields:[Ke.CreatedAt,Ke.Id,Ke.DeliveryInfo,Ke.Status,Ke.SalesDirections,Ke.AttachedUser],y={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},b={type:"expand",expandable:A.constant(!0),renderExpand:v=>i.h(Su,{order:v,class:"pl-10 pt-3 pb-10"}),width:"30"},_=[{title:"Дата заказа",key:Ke.CreatedAt,resizable:!0,minWidth:100,render:v=>i.h(Po,{date:v.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Ke.Id,resizable:!0,minWidth:70,render:v=>i.h("a",{href:e.orderUrl.replace(":id",v.id.toString()),target:"_blank",class:"text-base"},v.id)},{title:"Клиент",key:Ke.ClientInfo,resizable:!0,render:v=>i.h(os,{client:v.client})},{title:"Тип доставки",key:Ke.DeliveryInfo,resizable:!0,render:v=>i.h(Ts,{delivery:v.delivery})},{title:"Статус",key:Ke.Status,resizable:!0,minWidth:90,render:v=>{var k,S;return i.h("span",{class:"text-base"},[((S=(k=a.value)==null?void 0:k.find(B=>B.id===(v.status??-1)))==null?void 0:S.name)??""])}},{title:"Напр. продаж",key:Ke.SalesDirections,resizable:!0,minWidth:70,render:v=>i.h("span",{class:"text-base"},[v.salesDirection.name])},{title:"Закреплено за",key:Ke.AttachedUser,resizable:!0,render:v=>{var k;return i.h("span",{class:"text-base"},[(k=v==null?void 0:v.attachedUser)==null?void 0:k.name])}}];switch(bt.getDeviceTypeByResolution()){case Ue.phone:case Ue.tablet:return[b,{key:"order",title:"Заказ",resizable:!0,render:v=>i.h(wu,{order:v,fields:p,orderUrl:e.orderUrl})}];case Ue.laptop:return[b,...p.map(v=>_.find(k=>k.key===v)??y)];default:return[y]}},c=i.ref(l()),d=i.ref(new Y.DataTablePagination(e.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),h=()=>{e.filters&&(o.value=!0,Y.HttpRequester.getInstance(Y.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}))},u=p=>{d.value.page=p,h()},m=p=>{d.value.pageSize=p,h()},f=p=>{A.isNull(p)?r.value=n():(r.value.field=p.columnKey.toString(),r.value.direction=p.order==="ascend"?"asc":"desc"),c.value.forEach(y=>{if(Object.hasOwn(y,"sortOrder")){const b=y;b.sortOrder=b.key===(p==null?void 0:p.columnKey)&&(p!=null&&p.sorter)&&p.order!==!1?p.order:!1}}),h()},g=()=>{c.value=l()};return i.watch(()=>e.filters,()=>{h()}),i.watch(()=>e.sort,()=>{r.value=n(),h()}),i.onMounted(()=>{g(),window.addEventListener("resize",g),i.nextTick(()=>{h()})}),i.onUnmounted(()=>{window.removeEventListener("resize",g)}),(p,y)=>{const b=z.NDataTable;return i.openBlock(),i.createBlock(b,{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":u,"onUpdate:pageSize":m,"onUpdate:sorter":f},null,8,["columns","data","row-key","pagination","loading"])}}}),wk=Zn(_k,[["__scopeId","data-v-7c4554f4"]]),xk=["href"],vk={class:"text-sc-dark-grey"},kk={},Ck=i.defineComponent({...kk,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>Mn.format(n.order.createdAt,Y.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{A.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,xk),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",vk,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),Sk={class:"sc-page flex flex-col"},Bk={class:"my-2 flex flex-row items-end"},Tk={class:"sc-title grow"},Rk={key:0,class:"sc-title-buttons flex-1 grow-0"},$k={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},Ek={key:0,class:"sc-title-extra mt-2 sm:mt-4"},Nk={},Bu=i.defineComponent({...Nk,__name:"page",props:{title:{}},setup(t){return(e,n)=>{const r=z.NH1;return i.openBlock(),i.createElementBlock("div",Sk,[i.createElementVNode("div",Bk,[i.createElementVNode("div",Tk,[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",Rk,[i.createElementVNode("div",$k,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",Ek,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"default")])}}}),Pk={class:"overflow-hidden transition-all duration-300"},Fk={class:"text-lg font-medium leading-none"},Mk={},Tu=i.defineComponent({...Mk,__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(bt.getDeviceTypeByResolution()){case Ue.phone:return window.innerWidth*.66;case Ue.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?A.isUndefined(n.drawerWidth)?s.value=a():s.value=A.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 h=z.NDrawerContent,u=z.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",Pk,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(u,{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(h,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",Fk,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)}}}),Ak={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},Vk={key:0},Ik={class:"sc-page-preview-panel grow"},Ok={key:1,class:"sc-page-preview-panel-extra flex-none"},zk={},Lk=i.defineComponent({...zk,__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,h;window.scrollTo({top:(((h=(d=o.value)==null?void 0:d.getBoundingClientRect())==null?void 0:h.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:s}),(l,c)=>{const d=z.NButton;return i.openBlock(),i.createBlock(Bu,{title:t.title},i.createSlots({default:i.withCtx(()=>[l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",Ak,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",Vk,[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]=h=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",Ik,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",Ok,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Tu,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=h=>n.value=h),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"])}}}),Dk={},Hk=i.defineComponent({...Dk,__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(()=>A.isArray(r.value)),a=i.computed(()=>{var f;return A.isArray(r.value)?r.value.map(g=>g.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>{var p;let f=r.showEmptyValue?[Y.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList,g=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=A.isArray(r.value)?r.value.map(b=>b.id):[(p=r.value)==null?void 0:p.id];g=A.union(g,r.managerReferenceList.filter(b=>!b.isActive).map(b=>b.id)),f=r.managerReferenceList.filter(b=>b.isActive||y.includes(b.id))}return zt.convertReferencesToSelectOptionsList(f,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,y=>{const b=!r.groupBySalesDirection||r.groupBySalesDirection&&A.some(o.value?r.value:[r.value],["id",y.id])?` (${y.salesDirection.name}) `:"";return y.salesDirection.isNewRec()?y.name:`${y.name}${b}${y.isActive?"":" [Не активен]"}`},y=>g.includes(y.id)&&y.isActive)}),c=i.computed(()=>l.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),d=i.useTemplateRef("select-component"),h=f=>{if(A.isArray(f)){const g=f.length>0?f.filter(p=>!A.some(r.disabledManagerReferenceList,["id",p])).map(p=>r.managerReferenceList.find(y=>y.id===p)).filter(p=>!A.isNil(p)):[];s("update:value",g)}else{const g=f>0&&!A.some(r.disabledManagerReferenceList,["id",f])?r.managerReferenceList.find(p=>p.id===f):new Y.Manager;s("update:value",g??new Y.Manager)}};return i.watch(()=>r.value,()=>{var f,g;(g=(f=d.value)==null?void 0:f.$forceUpdate)==null||g.call(f)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,f=>{if(f.length>0&&r.value)if(o.value){const g=r.value;A.some(g,p=>A.some(f,["id",p.id]))&&s("update:value",g.filter(p=>!A.some(f,["id",p.id])))}else{const g=r.value;A.some(f,["id",g.id])&&s("update:value",new Y.Manager)}}),e({focus:()=>{var f;return(f=d.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=d.value)==null?void 0:f.blurInput()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:l.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),Wk={class:"m-0.5 flex flex-col p-0.5"},jk={class:"flex flex-row gap-1"},qk={key:0},Xk={key:1},Yk={key:2},Uk={key:3},Gk={class:"flex flex-row gap-1"},Kk={key:0},Zk={key:1},Qk={key:2},Jk={key:3},e2={},Ru=i.defineComponent({...e2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Wk,[i.createElementVNode("span",jk,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",qk,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",Xk,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",Yk,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",Uk,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",Gk,[t.addr.street?(i.openBlock(),i.createElementBlock("span",Kk,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",Zk,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",Qk,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",Jk,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),pa={clearable:!1,value:"",field:void 0,disabled:!1},t2={},n2=i.defineComponent({...t2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...pa,minTermLength:()=>{var t;return((t=Y.AppConfigProvider.getConfig())==null?void 0:t.minLength.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=A.debounce(()=>h(),800),h=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(o.value,a):Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchAddresses(o.value)).finally(()=>{a.value=!1}))},u=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h(Ru,{addr:b,selected:y},{default:A.constant("-")})},m=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};s("select",y)},f=i.ref(null);function g(){f.value.focus()}return e({focus:g}),(p,y)=>{const b=z.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[y[0]||(y[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),i2={class:"m-0.5 flex flex-col p-0.5"},r2={class:"font-medium"},s2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},o2={key:0},a2={key:1},l2={},$u=i.defineComponent({...l2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",i2,[i.createElementVNode("span",r2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",s2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",o2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",a2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),c2={},d2=i.defineComponent({...c2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...pa,minTermLength:()=>{var t;return((t=Y.AppConfigProvider.getConfig())==null?void 0:t.minLength.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=A.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},u=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h($u,{bank:b,selected:y},{default:A.constant("-")})},m=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};s("select",y)},f=i.ref(null);function g(){f.value.focus()}return e({focus:g}),(p,y)=>{const b=z.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[y[0]||(y[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),h2={class:"font-medium"},u2={key:0,class:"flex flex-row gap-2"},f2={key:0,class:"text-xs font-light text-blue-800"},g2={key:1,class:"text-sc-dark-grey text-xs font-light"},m2={},Eu=i.defineComponent({...m2,__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",h2,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",u2,[t.org.inn?(i.openBlock(),i.createElementBlock("span",f2,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",g2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),p2={},y2=i.defineComponent({...p2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...pa,minTermLength:()=>{var t;return((t=Y.AppConfigProvider.getConfig())==null?void 0:t.minLength.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=y=>{var b,_;return!!(((_=(b=y.rawData)==null?void 0:b.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>zt.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,y=>y[r.field??"_"]??"-",y=>!r.allowSelectTerminated&&c(y)));i.watch(()=>r.value,y=>{o.value=y}),i.watch(o,()=>{s("update:value",o.value)});const h=A.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},m=(y,b)=>{const _=l.value.find(v=>v.id===y.value)||{};return i.h(Eu,{org:_,selected:b},{default:A.constant("-")})},f=y=>{h.cancel();const b=l.value.find(_=>_.id===y)||{};(r.allowSelectTerminated||!c(b))&&s("select",b)},g=i.ref(null);function p(){g.value.focus()}return e({focus:p}),(y,b)=>{const _=z.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[b[0]||(b[0]=v=>o.value=v),i.unref(h)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":m,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),b2={},_2=i.defineComponent({...b2,__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=z.NButton,h=z.NPopover,u=z.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(h,{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(u,{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"])])}}}),w2={key:0,class:"whitespace-pre-line"},x2={key:1,class:"text-sc-dark-grey"},v2={},k2=i.defineComponent({...v2,__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=z.NInput;return i.openBlock(),i.createBlock(Ed,{disabled:t.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",w2,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",x2," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=h=>s.value=h),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),C2={key:0,class:"text-sm"},S2={key:1},B2={},T2=i.defineComponent({...B2,__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)=>(i.openBlock(),i.createElementBlock("span",null,[t.wrapAsSmall&&t.debt!==0?(i.openBlock(),i.createElementBlock("span",C2,[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)])):i.createCommentVNode("",!0),!t.wrapAsSmall&&t.debt!==0?(i.openBlock(),i.createElementBlock("span",S2,[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)])):i.createCommentVNode("",!0)]))}}),R2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $2(t,e){return i.openBlock(),i.createElementBlock("svg",R2,[...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 E2=i.markRaw({name:"ion-warning",render:$2}),N2={},P2=i.defineComponent({...N2,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=E2,s=z.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"])}}}),mt=class mt{static init(e,n){mt.messagesService&&mt.notificationsService||(mt.messagesService=e,mt.notificationsService=n)}static getMessagesService(){if(!mt.messagesService)throw new Error("UI provider is not initialized.");return mt.messagesService}static getNotificationsService(){if(!mt.notificationsService)throw new Error("UI provider is not initialized.");return mt.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,s;if(A.isEmpty(e.errors)){const o=(s=(r=e.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";mt.notificationsService?mt.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 Y.FieldValidationResultData(e.errors[o].toString(),"error"):mt.messagesService?mt.messagesService.error(e.errors[o].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[o])}};x(mt,"messagesService"),x(mt,"notificationsService");let ya=mt;const F2=i.computed(()=>Y.useReferencesStore().deliveryTypeReference??[]),M2=i.computed(()=>Y.useReferencesStore().managersList??[]),A2=i.computed(()=>Y.useReferencesStore().opfReference??[]),V2=i.computed(()=>Y.useReferencesStore().partnerGroupsReference??[]),I2=i.computed(()=>Y.useReferencesStore().priceCoefficientsReference??[]),O2=i.computed(()=>Y.useReferencesStore().productFilesTypesReference??[]),z2=i.computed(()=>Y.useReferencesStore().resourceTypesReference),L2=i.computed(()=>Y.useReferencesStore().salesDirectionsReference??[]),D2=i.computed(()=>Y.useReferencesStore().warehousesReference??[]),H2=i.computed(()=>zt.convertReferencesToSelectOptionsList(Y.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),W2=i.computed(()=>zt.convertReferencesToSelectOptionsList(Y.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),j2=t=>Y.HttpRequester.getInstance(Y.ReferenceDataProvider).searchCity(t),q2=t=>zt.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());W.AddProductToCartDialog=iy,W.ConfiguratorSettingsKozyrek=_d,W.ContentHelper=Kn,W.KozyrekLine=ri,W.KozyrekTailTemplate=No,W.KozyrekTemplate=Di,W.OrdersTableFields=Ke,W.Point=$o,W.ScAddressSuggestion=n2,W.ScAddressSuggestionLabel=Ru,W.ScBankSuggestion=d2,W.ScBankSuggestionLabel=$u,W.ScBaseDialog=Cd,W.ScButtonWithConfirmAction=_2,W.ScCategoryCollapse=vd,W.ScClientNameWithShortInfo=os,W.ScCollapse=xd,W.ScCollapseItem=Da,W.ScCommentEditor=k2,W.ScConfiguratorsProductInfo=nr,W.ScContragentWithShortInfo=Sd,W.ScDateRange=gb,W.ScDateTimeLabel=Po,W.ScDebouncedInput=Db,W.ScDebouncedInputNumber=Li,W.ScDebt=T2,W.ScDialogHeader=vb,W.ScDynamicConfigurator=wd,W.ScEmail=_y,W.ScExternalLink=Zb,W.ScImageGallery=qa,W.ScInlineEditableItem=Ed,W.ScInlineView=Fo,W.ScKozyrekConfigurator=cd,W.ScKozyrekConfiguratorParamsForm=Ua,W.ScKozyrekConfiguratorPreview=ld,W.ScKozyrekConfiguratorTemplates=ad,W.ScLightGallery=ja,W.ScManagerSelect=Hk,W.ScMetalForDoorsConfigurator=bd,W.ScMetalForDoorsConfiguratorForm=yd,W.ScMosquitoConfigurator=ud,W.ScMosquitoConfiguratorForm=dd,W.ScMosquitoConfiguratorMeasurementInstructions=hd,W.ScMosquitoConfiguratorPreview=Eo,W.ScOrderCommonInfo=wu,W.ScOrderDeliveryLabel=Ts,W.ScOrderDetails=Cu,W.ScOrderInfo=Su,W.ScOrderItemsList=ku,W.ScOrderPayment=xu,W.ScOrderProductInfo=vu,W.ScOrdersList=wk,W.ScOrgSuggestion=y2,W.ScOrgSuggestionLabel=Eu,W.ScPage=Bu,W.ScPageWithSlidingPanel=Lk,W.ScPersonContactsBlock=cb,W.ScPhone=Wy,W.ScPhoneInput=jb,W.ScProductName=tr,W.ScProductsList=Sv,W.ScReferenceSelect=kd,W.ScSearchableProductSelect=_u,W.ScSearchableReferenceSelect=bu,W.ScSetClientPriceFormItem=K0,W.ScShortTextOrderInfo=Ck,W.ScSingleFileUploadSelector=Tb,W.ScSlidingContentWithDrawer=Tu,W.ScStripConfigurator=pd,W.ScStripConfiguratorForm=gd,W.ScStripConfiguratorLineItem=fd,W.ScStripConfiguratorPreview=md,W.ScUserShortInfo=ma,W.ScWarningIcon=P2,W.SelectOptionHelper=zt,W.UiNotificationProvider=ya,W.WindowResolutionEnum=Ue,W.WindowResolutionProvider=bt,W.channelPrimaryInterestOptionsList=H2,W.componentSizeInjectionKey=$r,W.deliveryTypeReferenceList=F2,W.managersReferenceList=M2,W.naiveUiTheme=kf,W.opfReferenceList=A2,W.partnerGroupReferenceList=V2,W.priceCoefficientsReferenceList=I2,W.productFilesTypesReferenceList=O2,W.renderConfig=Ve,W.resourceReferencesList=z2,W.salesDirectionsReferenceList=L2,W.searchCityReferenceDataHandler=j2,W.searchCityReferenceLabelRenderer=q2,W.sourcePrimaryInterestOptionsList=W2,W.warehousesReferenceList=D2,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
|
|
823
823
|
//# sourceMappingURL=sc-vue-ui-lib.umd.cjs.map
|