@snabcentr/vue-ui-lib 2.26.6 → 2.27.7

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(L,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","vue-tel-input"],D):(L=typeof globalThis<"u"?globalThis:L||self,D(L.SC_VueUiLib={},L["lodash-es"],L.Vue,L["naive-ui"],L["@snabcentr/common-lib"],L["date-fns"],L["libphonenumber-js"],L["vue-tel-input"]))})(this,function(L,D,i,I,U,Tn,Xi,Wh){"use strict";var Vk=Object.defineProperty;var Lh=L=>{throw TypeError(L)};var Ok=(L,D,i)=>D in L?Vk(L,D,{enumerable:!0,configurable:!0,writable:!0,value:i}):L[D]=i;var x=(L,D,i)=>Ok(L,typeof D!="symbol"?D+"":D,i),Dh=(L,D,i)=>D.has(L)||Lh("Cannot "+i);var Tt=(L,D,i)=>(Dh(L,D,"read from private field"),i?i.call(L):D.get(L)),pa=(L,D,i)=>D.has(L)?Lh("Cannot add the same private member more than once"):D instanceof WeakSet?D.add(L):D.set(L,i),Hh=(L,D,i,I)=>(Dh(L,D,"write to private field"),I?I.call(L,i):D.set(L,i),i);var mi,lt,xs;var Ke=(e=>(e.AttachedUser="attached_user",e.ClientInfo="client_info",e.CreatedAt="created_at",e.DeliveryInfo="delivery_info",e.Id="id",e.SalesDirections="sales_directions",e.Status="status",e))(Ke||{}),qe=(e=>(e.phone="phone",e.tablet="tablet",e.laptop="laptop",e))(qe||{});class Dn{static isVnodeEmpty(t){return t.every(n=>n.type===i.Comment||n.type===i.Text&&D.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&Dn.isVnodeEmpty(n.children))}static hasSlotContent(t){return t?!Dn.isVnodeEmpty(t()):!1}}class zt{static convertReferencesToOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){const a=r?[{label:"",value:-1,disabled:!0}]:[];let l=t.map(c=>({label:s?s(c):c.name,value:c.id,item:c,disabled:o?o(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),[...a,...l]}static convertReferencesToSelectOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return zt.convertReferencesToOptionsList(t,n,r,s,o)}static convertReferencesToAutocompleteOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return zt.convertReferencesToOptionsList(t,n,r,s,o)}}const jh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Xh(e,t){return i.openBlock(),i.createElementBlock("svg",jh,t[0]||(t[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 ga=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Xh}),qh={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Yh(e,t){return i.openBlock(),i.createElementBlock("svg",qh,t[0]||(t[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 ma=i.markRaw({name:"tabler-edit",render:Yh}),Uh={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Gh(e,t){return i.openBlock(),i.createElementBlock("svg",Uh,t[0]||(t[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 Kh=i.markRaw({name:"fluent-pin32-regular",render:Gh}),Zh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jh(e,t){return i.openBlock(),i.createElementBlock("svg",Zh,t[0]||(t[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 Qh=i.markRaw({name:"ion-eye-outline",render:Jh}),eu={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function tu(e,t){return i.openBlock(),i.createElementBlock("svg",eu,t[0]||(t[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 nu=i.markRaw({name:"fluent-pin32-filled",render:tu}),iu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ru(e,t){return i.openBlock(),i.createElementBlock("svg",iu,t[0]||(t[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 _a=i.markRaw({name:"ion-cart-outline",render:ru}),su={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ou(e,t){return i.openBlock(),i.createElementBlock("svg",su,t[0]||(t[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 au=i.markRaw({name:"ion-bookmark-outline",render:ou}),lu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function cu(e,t){return i.openBlock(),i.createElementBlock("svg",lu,t[0]||(t[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 du=i.markRaw({name:"ion-eye-off-sharp",render:cu}),hu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function uu(e,t){return i.openBlock(),i.createElementBlock("svg",hu,t[0]||(t[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 fu=i.markRaw({name:"ion-chevron-forward-outline",render:uu}),pu=["data-name"],gu={class:"sc-collapse-item-header flex flex-row gap-2.5"},mu={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},_u={key:0},yu={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},bu={class:"flex flex-1 flex-col"},wu={key:0,class:"sc-collapse-item-sub-title flex-1"},vu={key:1,class:"sc-collapse-item-title-extra flex-none"},ku={key:0,class:"sc-collapse-item-content"},xu={},Cu=i.defineComponent({...xu,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.inject("itemHeaderClickHandler",D.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=D.some(a,m=>m===r.name),d=i.computed(()=>D.some(l,m=>m===r.name)),h=i.ref(c),f=()=>{r.disabled||(h.value=d.value||!h.value,s("header:click",r.name,h.value),o(r.name,h.value))};return t({expand:()=>{!r.disabled&&!h.value&&(h.value=!0,s("header:click",r.name,h.value),o(r.name,h.value))},toggle:()=>{r.disabled||f()},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)}),(m,_)=>{const y=fu;return i.openBlock(),i.createElementBlock("div",{"data-name":m.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":m.disabled})},[i.createElementVNode("div",gu,[i.createElementVNode("div",mu,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":h.value}),onClick:f},[i.renderSlot(m.$slots,"arrow",{},()=>[i.createVNode(y)],!0)],2)]),i.unref(Dn).hasSlotContent(m.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",_u,[i.createElementVNode("div",yu,[i.renderSlot(m.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",bu,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:f},[i.renderSlot(m.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(m.title),1)],!0)]),i.unref(Dn).hasSlotContent(m.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",wu,[i.renderSlot(m.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(Dn).hasSlotContent(m.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",vu,[i.renderSlot(m.$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",ku,[i.renderSlot(m.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,pu)}}}),Hn=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},ya=Hn(Cu,[["__scopeId","data-v-415a3dda"]]),xr=Symbol(),Su={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"}},Bu={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Tu={},ba=i.defineComponent({...Tu,__name:"product-actions",props:{product:{},eventEmitter:{},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>D.isNil(t.productContextButtonsConfig)?[]:D.isFunction(t.productContextButtonsConfig)?t.productContextButtonsConfig(t.product):t.productContextButtonsConfig),s=()=>{t.eventEmitter.emit("product:add-to-cart",{product:t.product})},o=()=>{t.eventEmitter.emit("product:edit",{product:t.product})},a=l=>{t.eventEmitter.emit("product:context-select",{product:t.product,key:l})};return(l,c)=>{var m;const d=_a,h=I.NButton,f=I.NTooltip,p=ma,u=ga,g=I.NDropdown;return i.openBlock(),i.createElementBlock("div",Bu,[(i.unref(D.isFunction)(l.showProductAddToCartButton)?l.showProductAddToCartButton(l.product):l.showProductAddToCartButton)?(i.openBlock(),i.createBlock(f,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary",onClick:s},{default:i.withCtx(()=>[i.createVNode(d)]),_:1},8,["size"])]),default:i.withCtx(()=>[c[0]||(c[0]=i.createTextVNode(" Добавить в корзину "))]),_:1,__:[0]})):i.createCommentVNode("",!0),(i.unref(D.isFunction)(l.showProductEditButton)?l.showProductEditButton(l.product):l.showProductEditButton)?(i.openBlock(),i.createBlock(f,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary",onClick:o},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["size"])]),default:i.withCtx(()=>[c[1]||(c[1]=i.createTextVNode(" Редактировать "))]),_:1,__:[1]})):i.createCommentVNode("",!0),((m=r.value)==null?void 0:m.length)>0?(i.openBlock(),i.createBlock(g,{key:2,options:r.value,size:i.unref(n),trigger:"click",onSelect:a},{default:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Eu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $u(e,t){return i.openBlock(),i.createElementBlock("svg",Eu,t[0]||(t[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 Nu=i.markRaw({name:"tabler-history",render:$u}),Ru={class:"flex flex-row gap-1"},Pu={key:0,class:"flex flex-row text-nowrap text-sm line-through"},Fu={key:1,class:"flex flex-row text-nowrap text-sm"},Mu={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Au={},Cr=i.defineComponent({...Au,__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(e){const t=e,n=i.computed(()=>D.find(t.product.priceCoefficients,["coefficient.slug",t.costFieldName])),r=i.computed(()=>n.value?n.value.cost:D.get(t.product,t.costFieldName)),s=i.computed(()=>t.additionalThroughFieldName?D.get(t.product,t.additionalThroughFieldName):void 0),o=i.computed(()=>t.product.costDate?Tn.format(t.product.costDate,U.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),a=i.computed(()=>(D.isFunction(t.allowPriceClick)?t.allowPriceClick(t.product):t.allowPriceClick)&&!D.isNil(r.value)),l=i.computed(()=>D.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value))),c=i.computed(()=>{if(t.product.currencySignature==="RUB"||!t.currencyRates||!t.currencyRates[t.product.currencySignature])return null;const h=t.currencyRates[t.product.currencySignature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)*h)}),d=i.computed(()=>D.isNil(s.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(s.value));return(h,f)=>{var m;const p=I.NTag,u=I.NTooltip,g=Nu;return i.openBlock(),i.createElementBlock("div",Ru,[h.showTag?(i.openBlock(),i.createBlock(u,{key:0},{trigger:i.withCtx(()=>[i.createVNode(p,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!n.value}])},{default:i.withCtx(()=>{var _;return[i.createTextVNode(i.toDisplayString(((_=n.value)==null?void 0:_.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var _;return[i.createTextVNode(" "+i.toDisplayString(((_=n.value)==null?void 0:_.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[s.value&&s.value!==r.value?(i.openBlock(),i.createElementBlock("span",Pu,i.toDisplayString(d.value)+" "+i.toDisplayString(h.showQuantityUnit?` ${h.product.currency}/${h.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(m=n.value)==null?void 0:m.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":a.value&&h.eventEmitter}),onClick:f[0]||(f[0]=()=>{var _;a.value&&((_=h.eventEmitter)==null||_.emit("cost:click",{product:h.product,cost:r.value}))})},i.toDisplayString(l.value),3),i.createTextVNode(" "+i.toDisplayString(h.showQuantityUnit?` ${h.product.currency}/${h.product.quantityUnit}`:""),1)],2),c.value?(i.openBlock(),i.createElementBlock("span",Fu," ~ "+i.toDisplayString(c.value)+" "+i.toDisplayString(h.showQuantityUnit?`₽/${h.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),h.showCostDate&&!i.unref(D.isNil)(o.value)?(i.openBlock(),i.createElementBlock("span",Mu,[i.createTextVNode(i.toDisplayString(o.value)+" ",1),h.showPriceHistory&&h.eventEmitter?(i.openBlock(),i.createBlock(u,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"cursor-pointer",onClick:f[1]||(f[1]=_=>{var y;return(y=h.eventEmitter)==null?void 0:y.emit("cost:show-price-history",{product:h.product})})})]),default:i.withCtx(()=>[f[2]||(f[2]=i.createTextVNode(" История цен "))]),_:1,__:[2]})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Iu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Vu(e,t){return i.openBlock(),i.createElementBlock("svg",Iu,t[0]||(t[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 Bs=i.markRaw({name:"ion-information-circle-outline",render:Vu}),Ou={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function zu(e,t){return i.openBlock(),i.createElementBlock("svg",Ou,t[0]||(t[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:zu});/*!
1
+ (function(L,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","vue-tel-input"],D):(L=typeof globalThis<"u"?globalThis:L||self,D(L.SC_VueUiLib={},L["lodash-es"],L.Vue,L["naive-ui"],L["@snabcentr/common-lib"],L["date-fns"],L["libphonenumber-js"],L["vue-tel-input"]))})(this,function(L,D,i,A,Y,Nn,Xi,Wh){"use strict";var Dk=Object.defineProperty;var Lh=L=>{throw TypeError(L)};var Hk=(L,D,i)=>D in L?Dk(L,D,{enumerable:!0,configurable:!0,writable:!0,value:i}):L[D]=i;var C=(L,D,i)=>Hk(L,typeof D!="symbol"?D+"":D,i),Dh=(L,D,i)=>D.has(L)||Lh("Cannot "+i);var Et=(L,D,i)=>(Dh(L,D,"read from private field"),i?i.call(L):D.get(L)),pa=(L,D,i)=>D.has(L)?Lh("Cannot add the same private member more than once"):D instanceof WeakSet?D.add(L):D.set(L,i),Hh=(L,D,i,A)=>(Dh(L,D,"write to private field"),A?A.call(L,i):D.set(L,i),i);var _i,ct,xs;var Ge=(e=>(e.AttachedUser="attached_user",e.ClientInfo="client_info",e.CreatedAt="created_at",e.DeliveryInfo="delivery_info",e.Id="id",e.SalesDirections="sales_directions",e.Status="status",e))(Ge||{}),Xe=(e=>(e.phone="phone",e.tablet="tablet",e.laptop="laptop",e))(Xe||{});class Wn{static isVnodeEmpty(t){return t.every(n=>n.type===i.Comment||n.type===i.Text&&D.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&Wn.isVnodeEmpty(n.children))}static hasSlotContent(t){return t?!Wn.isVnodeEmpty(t()):!1}}class Lt{static convertReferencesToOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){const a=r?[{label:"",value:-1,disabled:!0}]:[];let l=t.map(c=>({label:s?s(c):c.name,value:c.id,item:c,disabled:o?o(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),[...a,...l]}static convertReferencesToSelectOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return Lt.convertReferencesToOptionsList(t,n,r,s,o)}static convertReferencesToAutocompleteOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return Lt.convertReferencesToOptionsList(t,n,r,s,o)}}const jh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Xh(e,t){return i.openBlock(),i.createElementBlock("svg",jh,t[0]||(t[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 ga=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Xh}),qh={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Yh(e,t){return i.openBlock(),i.createElementBlock("svg",qh,t[0]||(t[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 ma=i.markRaw({name:"tabler-edit",render:Yh}),Uh={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Gh(e,t){return i.openBlock(),i.createElementBlock("svg",Uh,t[0]||(t[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 Kh=i.markRaw({name:"fluent-pin32-regular",render:Gh}),Zh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jh(e,t){return i.openBlock(),i.createElementBlock("svg",Zh,t[0]||(t[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 Qh=i.markRaw({name:"ion-eye-outline",render:Jh}),eu={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function tu(e,t){return i.openBlock(),i.createElementBlock("svg",eu,t[0]||(t[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 nu=i.markRaw({name:"fluent-pin32-filled",render:tu}),iu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ru(e,t){return i.openBlock(),i.createElementBlock("svg",iu,t[0]||(t[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 ya=i.markRaw({name:"ion-cart-outline",render:ru}),su={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ou(e,t){return i.openBlock(),i.createElementBlock("svg",su,t[0]||(t[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 au=i.markRaw({name:"ion-bookmark-outline",render:ou}),lu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function cu(e,t){return i.openBlock(),i.createElementBlock("svg",lu,t[0]||(t[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 du=i.markRaw({name:"ion-eye-off-sharp",render:cu}),hu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function uu(e,t){return i.openBlock(),i.createElementBlock("svg",hu,t[0]||(t[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 fu=i.markRaw({name:"ion-chevron-forward-outline",render:uu}),pu=["data-name"],gu={class:"sc-collapse-item-header flex flex-row gap-2.5"},mu={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},yu={key:0},_u={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},bu={class:"flex flex-1 flex-col"},wu={key:0,class:"sc-collapse-item-sub-title flex-1"},vu={key:1,class:"sc-collapse-item-title-extra flex-none"},ku={key:0,class:"sc-collapse-item-content"},xu={},Cu=i.defineComponent({...xu,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.inject("itemHeaderClickHandler",D.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=D.some(a,m=>m===r.name),d=i.computed(()=>D.some(l,m=>m===r.name)),h=i.ref(c),f=()=>{r.disabled||(h.value=d.value||!h.value,s("header:click",r.name,h.value),o(r.name,h.value))};return t({expand:()=>{!r.disabled&&!h.value&&(h.value=!0,s("header:click",r.name,h.value),o(r.name,h.value))},toggle:()=>{r.disabled||f()},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)}),(m,y)=>{const _=fu;return i.openBlock(),i.createElementBlock("div",{"data-name":m.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":m.disabled})},[i.createElementVNode("div",gu,[i.createElementVNode("div",mu,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":h.value}),onClick:f},[i.renderSlot(m.$slots,"arrow",{},()=>[i.createVNode(_)],!0)],2)]),i.unref(Wn).hasSlotContent(m.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",yu,[i.createElementVNode("div",_u,[i.renderSlot(m.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",bu,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:f},[i.renderSlot(m.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(m.title),1)],!0)]),i.unref(Wn).hasSlotContent(m.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",wu,[i.renderSlot(m.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(Wn).hasSlotContent(m.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",vu,[i.renderSlot(m.$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",ku,[i.renderSlot(m.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,pu)}}}),jn=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},_a=jn(Cu,[["__scopeId","data-v-415a3dda"]]),xr=Symbol(),Su={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"}},Bu={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Tu={},ba=i.defineComponent({...Tu,__name:"product-actions",props:{product:{},eventEmitter:{},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>D.isNil(t.productContextButtonsConfig)?[]:D.isFunction(t.productContextButtonsConfig)?t.productContextButtonsConfig(t.product):t.productContextButtonsConfig),s=()=>{t.eventEmitter.emit("product:add-to-cart",{product:t.product})},o=()=>{t.eventEmitter.emit("product:edit",{product:t.product})},a=l=>{t.eventEmitter.emit("product:context-select",{product:t.product,key:l})};return(l,c)=>{var m;const d=ya,h=A.NButton,f=A.NTooltip,p=ma,u=ga,g=A.NDropdown;return i.openBlock(),i.createElementBlock("div",Bu,[(i.unref(D.isFunction)(l.showProductAddToCartButton)?l.showProductAddToCartButton(l.product):l.showProductAddToCartButton)?(i.openBlock(),i.createBlock(f,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary",onClick:s},{default:i.withCtx(()=>[i.createVNode(d)]),_:1},8,["size"])]),default:i.withCtx(()=>[c[0]||(c[0]=i.createTextVNode(" Добавить в корзину "))]),_:1,__:[0]})):i.createCommentVNode("",!0),(i.unref(D.isFunction)(l.showProductEditButton)?l.showProductEditButton(l.product):l.showProductEditButton)?(i.openBlock(),i.createBlock(f,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary",onClick:o},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["size"])]),default:i.withCtx(()=>[c[1]||(c[1]=i.createTextVNode(" Редактировать "))]),_:1,__:[1]})):i.createCommentVNode("",!0),((m=r.value)==null?void 0:m.length)>0?(i.openBlock(),i.createBlock(g,{key:2,options:r.value,size:i.unref(n),trigger:"click",onSelect:a},{default:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Eu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $u(e,t){return i.openBlock(),i.createElementBlock("svg",Eu,t[0]||(t[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 Nu=i.markRaw({name:"tabler-history",render:$u}),Ru={class:"flex flex-row gap-1"},Pu={key:0,class:"flex flex-row text-nowrap text-sm line-through"},Fu={key:1,class:"flex flex-row text-nowrap text-sm"},Mu={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Au={},Cr=i.defineComponent({...Au,__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(e){const t=e,n=i.computed(()=>D.find(t.product.priceCoefficients,["coefficient.slug",t.costFieldName])),r=i.computed(()=>n.value?n.value.cost:D.get(t.product,t.costFieldName)),s=i.computed(()=>t.additionalThroughFieldName?D.get(t.product,t.additionalThroughFieldName):void 0),o=i.computed(()=>t.product.costDate?Nn.format(t.product.costDate,Y.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),a=i.computed(()=>(D.isFunction(t.allowPriceClick)?t.allowPriceClick(t.product):t.allowPriceClick)&&!D.isNil(r.value)),l=i.computed(()=>D.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value))),c=i.computed(()=>{if(t.product.currencySignature==="RUB"||!t.currencyRates||!t.currencyRates[t.product.currencySignature])return null;const h=t.currencyRates[t.product.currencySignature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)*h)}),d=i.computed(()=>D.isNil(s.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(s.value));return(h,f)=>{var m;const p=A.NTag,u=A.NTooltip,g=Nu;return i.openBlock(),i.createElementBlock("div",Ru,[h.showTag?(i.openBlock(),i.createBlock(u,{key:0},{trigger:i.withCtx(()=>[i.createVNode(p,{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",Pu,i.toDisplayString(d.value)+" "+i.toDisplayString(h.showQuantityUnit?` ${h.product.currency}/${h.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(m=n.value)==null?void 0:m.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":a.value&&h.eventEmitter}),onClick:f[0]||(f[0]=()=>{var y;a.value&&((y=h.eventEmitter)==null||y.emit("cost:click",{product:h.product,cost:r.value}))})},i.toDisplayString(l.value),3),i.createTextVNode(" "+i.toDisplayString(h.showQuantityUnit?` ${h.product.currency}/${h.product.quantityUnit}`:""),1)],2),c.value?(i.openBlock(),i.createElementBlock("span",Fu," ~ "+i.toDisplayString(c.value)+" "+i.toDisplayString(h.showQuantityUnit?`₽/${h.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),h.showCostDate&&!i.unref(D.isNil)(o.value)?(i.openBlock(),i.createElementBlock("span",Mu,[i.createTextVNode(i.toDisplayString(o.value)+" ",1),h.showPriceHistory&&h.eventEmitter?(i.openBlock(),i.createBlock(u,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"cursor-pointer",onClick:f[1]||(f[1]=y=>{var _;return(_=h.eventEmitter)==null?void 0:_.emit("cost:show-price-history",{product:h.product})})})]),default:i.withCtx(()=>[f[2]||(f[2]=i.createTextVNode(" История цен "))]),_:1,__:[2]})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Iu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Vu(e,t){return i.openBlock(),i.createElementBlock("svg",Iu,t[0]||(t[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 Bs=i.markRaw({name:"ion-information-circle-outline",render:Vu}),Ou={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function zu(e,t){return i.openBlock(),i.createElementBlock("svg",Ou,t[0]||(t[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:zu});/*!
2
2
  * lightgallery | 2.8.3 | March 1st 2025
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
@@ -37,7 +37,7 @@
37
37
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
38
38
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39
39
  PERFORMANCE OF THIS SOFTWARE.
40
- ***************************************************************************** */var Br=function(){return Br=Object.assign||function(t){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)&&(t[o]=n[o])}return t},Br.apply(this,arguments)},Hu={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"}},un={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ts=500,Wu=function(){function e(t,n){return this.core=t,this.$LG=n,this.settings=Br(Br({},Hu),this.core.settings),this}return e.prototype.buildTemplates=function(){var t=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&&(t+='<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(t)},e.prototype.enableZoom=function(t){var n=this,r=this.settings.enableZoomAfter+t.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&t.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(t.detail.index).addClass("lg-zoomable"),t.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},e.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(un.slideItemLoad+".zoom",this.enableZoom.bind(this))},e.prototype.getDragCords=function(t){return{x:t.pageX,y:t.pageY}},e.prototype.getSwipeCords=function(t){var n=t.touches[0].pageX,r=t.touches[0].pageY;return{x:n,y:r}},e.prototype.getDragAllowedAxises=function(t,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();t?(s=r.offsetHeight*t,o=r.offsetWidth*t):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}},e.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},e.prototype.zoomImage=function(t,n,r,s){if(!(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;t===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),h=d.allowY,f=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 p=this.getPossibleSwipeDragCords(n),u,g,m=o-this.pageX,_=a-this.pageY;if(t-n>1){var y=(t-n)/Math.abs(n);m=(n<0?-m:m)+this.left*(y+(n<0?-1:1)),_=(n<0?-_:_)+this.top*(y+(n<0?-1:1)),u=m/y,g=_/y}else{var y=(t-n)*n;u=m*y,g=_*y}r&&(f?this.isBeyondPossibleLeft(u,p.minX)?u=p.minX:this.isBeyondPossibleRight(u,p.maxX)&&(u=p.maxX):t>1&&(u<p.minX?u=p.minX:u>p.maxX&&(u=p.maxX)),h?this.isBeyondPossibleTop(g,p.minY)?g=p.minY:this.isBeyondPossibleBottom(g,p.maxY)&&(g=p.maxY):t>1&&(g<p.minY?g=p.minY:g>p.maxY&&(g=p.maxY))),this.setZoomStyles({x:u,y:g,scale:t}),this.left=u,this.top=g,s&&this.setZoomImageSize()}},e.prototype.resetImageTranslate=function(t){if(this.isImageSlide(t)){var n=this.core.getSlideItem(t).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)}},e.prototype.setZoomImageSize=function(){var t=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=t.getCurrentImageActualSizeScale();t.scale>=r&&(n.addClass("no-transition"),t.imageReset=!0)},Ts),setTimeout(function(){var r=t.getCurrentImageActualSizeScale();if(t.scale>=r){var s=t.getDragAllowedAxises(t.scale);n.css("width",n.get().naturalWidth+"px").css("height",n.get().naturalHeight+"px"),t.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")}},Ts+50)},e.prototype.setZoomStyles=function(t){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=t.scale,r.css("transform","scale3d("+t.scale+", "+t.scale+", 1)"),s.css("transform","scale3d("+t.scale+", "+t.scale+", 1)");var o="translate3d("+t.x+"px, "+t.y+"px, 0)";n.css("transform",o)},e.prototype.setActualSize=function(t,n){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var s=this.core.galleryItems[this.core.index];this.resetImageTranslate(t),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},Ts+110)}},e.prototype.getNaturalWidth=function(t){var n=this.core.getSlideItem(t).find(".lg-image").first(),r=this.core.galleryItems[t].width;return r?parseFloat(r):n.get().naturalWidth},e.prototype.getActualSizeScale=function(t,n){var r,s;return t>=n?(r=t/n,s=r||2):s=1,s},e.prototype.getCurrentImageActualSizeScale=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=t.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},e.prototype.getPageCords=function(t){var n={};if(t)n.x=t.pageX||t.touches[0].pageX,n.y=t.pageY||t.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},e.prototype.setPageCords=function(t){var n=this.getPageCords(t);this.pageX=n.x,this.pageY=n.y},e.prototype.manageActualPixelClassNames=function(){var t=this.core.getElementById("lg-actual-size");t.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},e.prototype.beginZoom=function(t){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),t>1},e.prototype.getScale=function(t){var n=this.getCurrentImageActualSizeScale();return t<1?t=1:t>n&&(t=n),t},e.prototype.init=function(){var t=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){t.$LG(r.target).hasClass("lg-image")&&t.setActualSize(t.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var s=t.$LG(r.target);r.touches.length===1&&s.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),t.setActualSize(t.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on(un.containerResize+".zoom "+un.rotateRight+".zoom "+un.rotateLeft+".zoom "+un.flipHorizontal+".zoom "+un.flipVertical+".zoom",function(){if(!(!t.core.lgOpened||!t.isImageSlide(t.core.index)||t.core.touchAction)){var r=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();t.top=0,t.left=0,t.setZoomEssentials(),t.setZoomSwipeStyles(r,{x:0,y:0}),t.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){t.core.lgOpened&&(t.scrollTop=t.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(t.isImageSlide(t.core.index)){var r=0;t.imageReset&&(t.resetImageTranslate(t.core.index),r=50),setTimeout(function(){var s=t.scale-t.settings.scale;s<1&&(s=1),t.beginZoom(s),t.zoomImage(s,-t.settings.scale,!0,!t.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){t.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){t.setActualSize(t.core.index)}),this.core.LGel.on(un.beforeOpen+".zoom",function(){t.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(un.afterOpen+".zoom",function(){t.scrollTop=t.$LG(window).scrollTop(),t.pageX=t.core.outer.width()/2,t.pageY=t.core.outer.height()/2+t.scrollTop,t.scale=1}),this.core.LGel.on(un.afterSlide+".zoom",function(r){var s=r.detail.prevIndex;t.scale=1,t.positionChanged=!1,t.zoomInProgress=!1,t.resetZoom(s),t.resetImageTranslate(s),t.isImageSlide(t.core.index)&&t.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},e.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var t=this.scale+this.settings.scale;this.settings.infiniteZoom||(t=this.getScale(t)),this.beginZoom(t),this.zoomImage(t,Math.min(this.settings.scale,t-this.scale),!0,!this.settings.infiniteZoom)}},e.prototype.resetZoom=function(t){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(t!==void 0?t: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()},e.prototype.getTouchDistance=function(t){return Math.sqrt((t.touches[0].pageX-t.touches[1].pageX)*(t.touches[0].pageX-t.touches[1].pageX)+(t.touches[0].pageY-t.touches[1].pageY)*(t.touches[0].pageY-t.touches[1].pageY))},e.prototype.pinchZoom=function(){var t=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=t.core.getSlideItem(t.core.index),!!t.isImageSlide(t.core.index)&&l.touches.length===2){if(l.preventDefault(),t.core.outer.hasClass("lg-first-slide-loading"))return;s=t.scale||1,t.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t.setPageCords(l),t.resetImageTranslate(t.core.index),t.core.touchAction="pinch",n=t.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&t.core.touchAction==="pinch"&&(t.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=t.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){o=t.scale;var h=Math.max(1,s+-d*.02);t.scale=Math.round((h+Number.EPSILON)*100)/100;var f=t.scale-o;t.zoomImage(t.scale,Math.round((f+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(t.core.touchAction==="pinch"&&(t.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,t.scale<=1)t.resetZoom();else{var c=t.getCurrentImageActualSizeScale();if(t.scale>=c){var d=c-t.scale;d===0&&(d=.01),t.zoomImage(c,d,!1,!0)}t.manageActualPixelClassNames(),t.core.outer.addClass("lg-zoomed")}t.core.touchAction=void 0}})},e.prototype.touchendZoom=function(t,n,r,s,o){var a=n.x-t.x,l=n.y-t.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(),f={};f.x=this.left+a,f.y=this.top+l;var p=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(f.y,p.minY)?f.y=p.minY:this.isBeyondPossibleBottom(f.y,p.maxY)&&(f.y=p.maxY)),r&&(this.isBeyondPossibleLeft(f.x,p.minX)?f.x=p.minX:this.isBeyondPossibleRight(f.x,p.maxX)&&(f.x=p.maxX)),s?this.top=f.y:f.y=this.top,r?this.left=f.x:f.x=this.left,this.setZoomSwipeStyles(h,f),this.positionChanged=!0)},e.prototype.getZoomSwipeCords=function(t,n,r,s,o){var a={};if(s){if(a.y=this.top+(n.y-t.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-t.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},e.prototype.isBeyondPossibleLeft=function(t,n){return t>=n},e.prototype.isBeyondPossibleRight=function(t,n){return t<=n},e.prototype.isBeyondPossibleTop=function(t,n){return t>=n},e.prototype.isBeyondPossibleBottom=function(t,n){return t<=n},e.prototype.isImageSlide=function(t){var n=this.core.galleryItems[t];return this.core.getSlideType(n)==="image"},e.prototype.getPossibleSwipeDragCords=function(t){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;t&&(o=o+t*o,a=a+t*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,f={minY:l,maxY:c,minX:d,maxX:h};return f},e.prototype.setZoomSwipeStyles=function(t,n){t.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},e.prototype.zoomSwipe=function(){var t=this,n={},r={},s=!1,o=!1,a=!1,l=new Date,c=new Date,d,h,f=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(p){if(t.isImageSlide(t.core.index)&&(f=t.core.getSlideItem(t.core.index),(t.$LG(p.target).hasClass("lg-item")||f.get().contains(p.target))&&p.touches.length===1&&t.core.outer.hasClass("lg-zoomed"))){p.preventDefault(),l=new Date,t.core.touchAction="zoomSwipe",h=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var u=t.getDragAllowedAxises(0);a=u.allowY,o=u.allowX,(o||a)&&(n=t.getSwipeCords(p)),d=t.getPossibleSwipeDragCords(),t.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(p){if(p.touches.length===1&&t.core.touchAction==="zoomSwipe"&&(t.$LG(p.target).hasClass("lg-item")||f.get().contains(p.target))){p.preventDefault(),t.core.touchAction="zoomSwipe",r=t.getSwipeCords(p);var u=t.getZoomSwipeCords(n,r,o,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(s=!0,t.setZoomSwipeStyles(h,u))}}),this.core.$inner.on("touchend.lg",function(p){if(t.core.touchAction==="zoomSwipe"&&(t.$LG(p.target).hasClass("lg-item")||f.get().contains(p.target))){if(p.preventDefault(),t.core.touchAction=void 0,t.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var u=c.valueOf()-l.valueOf();t.touchendZoom(n,r,o,a,u)}})},e.prototype.zoomDrag=function(){var t=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,f;this.core.outer.on("mousedown.lg.zoom",function(p){if(t.isImageSlide(t.core.index)){var u=t.core.getSlideItem(t.core.index);if(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target)){c=new Date,f=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var g=t.getDragAllowedAxises(0);l=g.allowY,a=g.allowX,t.core.outer.hasClass("lg-zoomed")&&t.$LG(p.target).hasClass("lg-object")&&(a||l)&&(p.preventDefault(),n=t.getDragCords(p),h=t.getPossibleSwipeDragCords(),s=!0,t.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(p){if(s){o=!0,r=t.getDragCords(p);var u=t.getZoomSwipeCords(n,r,a,l,h);t.setZoomSwipeStyles(f,u)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(p){if(s){if(d=new Date,s=!1,t.core.outer.removeClass("lg-zoom-dragging"),o&&(n.x!==r.x||n.y!==r.y)){r=t.getDragCords(p);var u=d.valueOf()-c.valueOf();t.touchendZoom(n,r,a,l,u)}o=!1}t.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},e.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},e.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},e}();const ju={ref:"gallery-container",class:"lightgallery-wrapper"},Xu={},va=i.defineComponent({...Xu,__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(e){const t=e,n={lgAfterAppendSlide:t.onAfterAppendSlide,lgInit:t.onInit,lgHasVideo:t.onHasVideo,lgContainerResize:t.onContainerResize,lgAfterAppendSubHtml:t.onAfterAppendSubHtml,lgBeforeOpen:t.onBeforeOpen,lgAfterOpen:t.onAfterOpen,lgSlideItemLoad:t.onSlideItemLoad,lgBeforeSlide:t.onBeforeSlide,lgAfterSlide:t.onAfterSlide,lgPosterClick:t.onPosterClick,lgDragStart:t.onDragStart,lgDragMove:t.onDragMove,lgDragEnd:t.onDragEnd,lgBeforeNextSlide:t.onBeforeNextSlide,lgBeforePrevSlide:t.onBeforePrevSlide,lgBeforeClose:t.onBeforeClose,lgAfterClose:t.onAfterClose,lgRotateLeft:t.onRotateLeft,lgRotateRight:t.onRotateRight,lgFlipHorizontal:t.onFlipHorizontal,lgFlipVertical:t.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,{...t.settings}),D.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",ju,[i.renderSlot(o.$slots,"default")],512))}}),st=class st{static init(){st.isInitialized||(st.isInitialized=!0,st.windowResizeHandler(),window.addEventListener("resize",st.windowResizeHandler))}static destroy(){window.removeEventListener("resize",st.windowResizeHandler),st.isInitialized=!1}static getDeviceTypeByResolution(){const t=U.AppConfigProvider.getConfig().deviceTypeByResolution;return window.innerWidth<t.tablet?qe.phone:window.innerWidth<t.laptop?qe.tablet:qe.laptop}static initRefDependingOnDeviceResolution(t,n,r){const s=i.ref(r);return st.setRefValueDependingOnDeviceResolution(s,t,n,r),st.refsDependingOnDeviceResolution.push({r:s,phoneValue:t,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return st.getDeviceTypeByResolution()===qe.phone}static isTabletDevice(){return st.getDeviceTypeByResolution()===qe.tablet}static isLaptopDevice(){return st.getDeviceTypeByResolution()===qe.laptop}static setRefValueDependingOnDeviceResolution(t,n,r,s){switch(st.getDeviceTypeByResolution()){case qe.phone:t.value=n;break;case qe.tablet:t.value=r;break;default:t.value=s;break}}static windowResizeHandler(){D.forEach(st.refsDependingOnDeviceResolution,t=>{st.setRefValueDependingOnDeviceResolution(t.r,t.phoneValue,t.tabletValue,t.defaultValue)})}};x(st,"isInitialized",!1),x(st,"refsDependingOnDeviceResolution",[]);let wt=st;const qu=["href"],Yu=["src","alt"],Uu={},ka=i.defineComponent({...Uu,__name:"image-gallery",props:{images:{}},setup(e,{expose:t}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[Du,Wu],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(wt.getDeviceTypeByResolution()===qe.phone?.7:.8),a=i.ref(o()),l=()=>{a.value=o()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),t({show:c}),window.addEventListener("resize",l),(d,h)=>{const f=wa,p=I.NPopover;return i.openBlock(),i.createBlock(p,{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]=u=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(f)])])]),default:i.withCtx(()=>[i.createVNode(va,{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(d.images,(u,g)=>(i.openBlock(),i.createElementBlock("a",{key:g,href:u.image},[i.createElementVNode("img",{src:u.preview,alt:`Изображение #${g+1}`},null,8,Yu)],8,qu))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Gu={class:"flex flex-col text-sm"},Ku={},Zu=i.defineComponent({...Ku,__name:"product-stock-count",props:{product:{}},setup(e){return(t,n)=>{const r=Bs,s=I.NPopover;return i.openBlock(),i.createBlock(s,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(t.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",Gu,[(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})}}}),Ju={class:"flex flex-row justify-between"},Qu={key:0},ef={class:"ml-2 align-sub"},tf={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},nf={class:"@container"},rf={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},sf={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},of={class:"text-sc-dark-grey"},af={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},lf={class:"text-gray-600"},cf={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},df={key:3,class:"underline decoration-dashed"},hf={key:4,class:"sc-product-pack whitespace-nowrap"},uf={class:"text-gray-600"},ff={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},pf={class:"text-gray-600"},gf={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},mf={key:0},_f={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},yf={},Yi=i.defineComponent({...yf,__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,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e,{expose:t}){const n=e,r=i.computed(()=>D.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>D.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,f;return(f=(h=n.product)==null?void 0:h.properties)==null?void 0:f.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>D.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 t({showProductImagesPreview:l}),(h,f)=>{var y,b,S,C,v;const p=wa,u=I.NText,g=ba,m=Bs,_=I.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",Ju,[i.createVNode(u,{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&&h.eventEmitter}),onClick:d},i.toDisplayString(h.product.name),3),h.product.onOrder?(i.openBlock(),i.createElementBlock("span",Qu," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",ef,[h.product.images&&h.product.images.length>0?(i.openBlock(),i.createBlock(ka,{key:0,ref:"image-gallery",images:h.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",tf,[i.createVNode(p)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]),_:1}),h.showProductAddToCartButton||h.showProductEditButton||((y=h.productContextButtonsConfig)==null?void 0:y.length)>0?(i.openBlock(),i.createBlock(g,{key:0,product:h.product,"event-emitter":h.eventEmitter,"show-product-add-to-cart-button":h.showProductAddToCartButton,"show-product-edit-button":h.showProductEditButton,"product-context-buttons-config":h.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",nf,[i.createElementVNode("div",rf,[h.product.supplierSku?(i.openBlock(),i.createElementBlock("div",sf,[f[0]||(f[0]=i.createTextVNode(" Артикул производителя/поставщика: ")),i.createElementVNode("span",of,i.toDisplayString(h.product.supplierSku),1)])):i.createCommentVNode("",!0),h.showCode?(i.openBlock(),i.createElementBlock("span",af,[f[1]||(f[1]=i.createTextVNode(" Артикул: ")),i.createElementVNode("span",lf,i.toDisplayString(h.product.code),1)])):i.createCommentVNode("",!0),h.product.stockCount&&h.product.stockCount.length>0?(i.openBlock(),i.createBlock(Zu,{key:2,product:h.product},{default:i.withCtx(()=>[i.createElementVNode("span",cf,[f[2]||(f[2]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(m,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",df," Нет в наличии ")),(S=(b=h.product)==null?void 0:b.properties)!=null&&S.pack?(i.openBlock(),i.createElementBlock("span",hf,[f[3]||(f[3]=i.createTextVNode(" Норма упаковки: ")),i.createElementVNode("span",uf,i.toDisplayString((v=(C=h.product)==null?void 0:C.properties)==null?void 0:v.pack),1)])):i.createCommentVNode("",!0),h.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",ff,[f[4]||(f[4]=i.createTextVNode(" Планируемая дата поступления на основной склад: ")),i.createElementVNode("span",pf,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(_,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",gf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,B=>(i.openBlock(),i.createBlock(Cr,{key:B.coefficient.slug,product:h.product,"cost-field-name":B.coefficient.slug??"","event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-price-history":h.showPriceHistory,"show-cost-date":h.showCostDate,"currency-rates":h.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","show-cost-date","currency-rates"]))),128)),i.createVNode(Cr,{product:h.product,"event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":h.showCostDate,"show-price-history":h.showPriceHistory,"currency-rates":h.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}),h.showSlugs||h.showProperties?(i.openBlock(),i.createElementBlock("div",mf,[i.createElementVNode("ul",_f,[h.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:h.product.id,slug:h.product.slug},(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0),h.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(h.product.properties,(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),bf=(e,t,n)=>({key:e,title:t,className:"align-top",resizable:!0,render:r=>i.h(Cr,{product:r,costFieldName:e,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),wf=(e,t)=>{if(e.length===0)return[];const n=[],r={};switch(wt.getDeviceTypeByResolution()){case qe.phone:case qe.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(Yi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,currencyRates:t.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(Yi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,currencyRates:t.currencyRates})}),t.showProductCosts&&(D.forEach(e,s=>{D.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),D.forEach(D.sortBy(r,["slug"]),s=>{n.push(bf(s.slug??"",s.name,t))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(Cr,{product:s,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:t.eventEmitter,allowPriceClick:t.allowPriceClick,showQuantityUnit:!0,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,currencyRates:t.currencyRates})})),(t.showProductEditButton||!D.isNil(t.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(ba,{product:s,eventEmitter:t.eventEmitter,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,productContextButtonsConfig:t.productContextButtonsConfig})});break}return n},vf={key:0,class:"pt-0.5"},kf={class:"flex flex-row gap-1"},xf={key:0},Cf={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Sf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Bf={},Tf=i.defineComponent({...Bf,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},selectedCategoriesItems:{default:void 0},selectedProductsItems:{default:void 0},showHideForClientButton:{type:[Boolean,Function],default:!1},showPinButton:{type:[Boolean,Function],default:!1},showCategoryEditButton:{type:[Boolean,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},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},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>{var $;return($=t==null?void 0:t.filteredItems)==null?void 0:$[t.categoryItem.id]}),s=i.computed(()=>{var $,X;return D.isArray(($=t.categoryItem)==null?void 0:$.categories)&&((X=t.categoryItem.categories)==null?void 0:X.length)>0}),o=i.computed(()=>{var $;return D.isArray(($=t.categoryItem)==null?void 0:$.products)?t.categoryItem.products:[]}),a=i.computed(()=>Object.entries(t.categoryItem.currencyRates??{}).map(([$,X])=>`${X} руб./${C($)}`).join(", ")),l=i.computed(()=>D.isUndefined(t.filteredItems)||r.value==="*"?o.value:o.value.filter($=>{var F;const X=(F=r.value)==null?void 0:F.products;return D.isArray(X)&&X.includes($.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>D.isFunction(t.showHideForClientButton)?t.showHideForClientButton(t.categoryItem):t.showHideForClientButton),h=i.computed(()=>D.isFunction(t.showPinButton)?t.showPinButton(t.categoryItem):t.showPinButton),f=i.computed(()=>D.isFunction(t.showCategoryEditButton)?t.showCategoryEditButton(t.categoryItem):t.showCategoryEditButton),p=i.computed(()=>D.isNil(t.categoryContextButtonsConfig)?[]:D.isFunction(t.categoryContextButtonsConfig)?t.categoryContextButtonsConfig(t.categoryItem):t.categoryContextButtonsConfig),u=i.computed(()=>new U.ClientCategory(t.categoryItem)),g=i.ref(!1),m=i.ref(!1),_=i.computed(()=>!D.isUndefined(t.selectedCategoriesItems)),y=i.computed(()=>(t.selectedCategoriesItems??[]).some($=>$.id===t.categoryItem.id)),b=i.computed(()=>q.value&&wt.getDeviceTypeByResolution()===qe.laptop?"auto":"fixed"),S=i.useTemplateRef("collapse-item-reference"),C=($,X="ru-RU")=>0 .toLocaleString(X,{style:"currency",currency:$,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),v=$=>{t.eventEmitter.emit("category:checked",{category:t.categoryItem,checked:$,target:S.value})},B=($,X)=>{t.eventEmitter.emit("category:header-click",{categoryItem:t.categoryItem,expanded:X,isLoadingState:g,target:S.value})},k=()=>{t.eventEmitter.emit("category:hide",{category:t.categoryItem,target:S.value})},E=()=>{t.eventEmitter.emit("category:attach",{category:t.categoryItem,target:S.value})},P=()=>{t.eventEmitter.emit("category:detach",{category:t.categoryItem,target:S.value})},R=()=>{t.eventEmitter.emit("category:edit",{category:t.categoryItem,target:S.value})},j=$=>{t.eventEmitter.emit("category:context-select",{category:t.categoryItem,key:$,target:S.value})},q=i.ref(0),M=i.computed(()=>q.value&&o.value.length>0?wf(o.value,{eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,currencyRates:t.categoryItem.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig}):[]),A=D.debounce(()=>{q.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",A)}),window.addEventListener("resize",A),A(),($,X)=>{const F=I.NCheckbox,N=du,W=I.NTooltip,z=au,G=_a,V=I.NTag,O=nu,J=Qh,he=I.NButton,ie=Kh,ge=ma,re=ga,Fe=I.NDropdown,Me=I.NDataTable,Ge=I.NAlert,Le=I.NSpin;return i.openBlock(),i.createBlock(ya,{ref:"collapse-item-reference",name:$.categoryItem.id,"data-id":$.categoryItem.id,"onHeader:click":B},{"pre-arrow":i.withCtx(()=>{var Pe,$e,ot;return[_.value?(i.openBlock(),i.createElementBlock("div",vf,[i.createVNode(F,{checked:y.value,"onUpdate:checked":v},null,8,["checked"])])):i.createCommentVNode("",!0),!d.value&&((Pe=u.value)!=null&&Pe.isDisabled)?(i.openBlock(),i.createBlock(W,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(N,{class:"pt-1.5"})]),default:i.withCtx(()=>[X[1]||(X[1]=i.createTextVNode(" Категория скрыта для клиента "))]),_:1,__:[1]})):i.createCommentVNode("",!0),(($e=u.value)==null?void 0:$e.isFavorite)??!1?(i.openBlock(),i.createBlock(W,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(z,{class:"pt-1.5"})]),default:i.withCtx(()=>[X[2]||(X[2]=i.createTextVNode(" Избранная категория "))]),_:1,__:[2]})):i.createCommentVNode("",!0),((ot=u.value)==null?void 0:ot.isRequired)??!1?(i.openBlock(),i.createBlock(W,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(G,{class:"pt-1.5"})]),default:i.withCtx(()=>[X[3]||(X[3]=i.createTextVNode(" Доп. продажа "))]),_:1,__:[3]})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var Pe,$e,ot;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":$.categoryItem.isHidden,"text-gray-400":(Pe=u.value)==null?void 0:Pe.isDisabled})},[i.createVNode(W,{disabled:!$.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createTextVNode(i.toDisplayString($.categoryItem.name),1)]),default:i.withCtx(()=>[X[4]||(X[4]=i.createTextVNode(" Категория скрыта "))]),_:1,__:[4]},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:X[0]||(X[0]=i.withModifiers((...De)=>i.unref(D.noop)&&i.unref(D.noop)(...De),["prevent","stop"]))},[($e=$.categoryItem.properties)!=null&&$e.m2Price?(i.openBlock(),i.createBlock(V,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Средняя стоимость: "+i.toDisplayString($.categoryItem.properties.m2Price)+" руб./м2 ",1)]),_:1},8,["size"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(V,{key:1,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),h.value&&((ot=u.value)!=null&&ot.manager)?(i.openBlock(),i.createBlock(V,{key:2,size:i.unref(n),closable:!0,round:"",onClose:P},{default:i.withCtx(()=>[i.createVNode(W,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var De,ct;return[i.createElementVNode("span",kf,[i.createVNode(O),i.createTextVNode(" "+i.toDisplayString((ct=(De=u.value)==null?void 0:De.manager)==null?void 0:ct.name),1)])]}),default:i.withCtx(()=>{var De,ct;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((ct=(De=u.value)==null?void 0:De.manager)==null?void 0:ct.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[$.showSlugs||$.showProperties?(i.openBlock(),i.createElementBlock("div",xf,[i.createElementVNode("ul",Cf,[$.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:$.categoryItem.id,slug:$.categoryItem.slug},(Pe,$e)=>(i.openBlock(),i.createElementBlock("li",{key:$e}," ("+i.toDisplayString($e)+"): "+i.toDisplayString(Pe),1))),128)):i.createCommentVNode("",!0),$.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList($.categoryItem.properties,(Pe,$e)=>(i.openBlock(),i.createElementBlock("li",{key:$e}," ("+i.toDisplayString($e)+"): "+i.toDisplayString(Pe),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var Pe;return[i.createElementVNode("div",Sf,[d.value?(i.openBlock(),i.createBlock(W,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(he,{size:i.unref(n),onClick:k},{default:i.withCtx(()=>{var $e;return[($e=u.value)!=null&&$e.isDisabled?(i.openBlock(),i.createBlock(N,{key:1})):(i.openBlock(),i.createBlock(J,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var $e;return[($e=u.value)!=null&&$e.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(u.value.hidingComment?`. Причина: '${u.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),h.value&&!((Pe=u.value)!=null&&Pe.manager)?(i.openBlock(),i.createBlock(W,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(he,{size:i.unref(n),onClick:E},{default:i.withCtx(()=>[i.createVNode(ie)]),_:1},8,["size"])]),default:i.withCtx(()=>{var $e,ot,De;return[($e=u.value)!=null&&$e.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((De=(ot=u.value)==null?void 0:ot.manager)==null?void 0:De.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(W,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(he,{ghost:!0,size:i.unref(n),type:"primary",onClick:R},{default:i.withCtx(()=>[i.createVNode(ge)]),_:1},8,["size"])]),default:i.withCtx(()=>[X[5]||(X[5]=i.createTextVNode(" Редактировать "))]),_:1,__:[5]})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(Fe,{key:3,options:p.value,size:i.unref(n),trigger:"click",onSelect:j},{default:i.withCtx(()=>[i.createVNode(he,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(re)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot($.$slots,"default",{},()=>{var Pe;return[s.value?(i.openBlock(),i.createBlock(Ca,{key:0,"categories-items":$.categoryItem.categories??[],"has-products":c.value||g.value,"event-emitter":$.eventEmitter,"filtered-items":r.value?((Pe=r.value)==null?void 0:Pe.categories)??{}:void 0,"selected-categories-items":$.selectedCategoriesItems,"selected-products-items":$.selectedProductsItems,"show-slugs":$.showSlugs,"show-properties":$.showProperties,"show-product-costs":$.showProductCosts,"allow-name-click":$.allowNameClick,"allow-price-click":$.allowPriceClick,"show-price-history":$.showPriceHistory,"show-cost-date":$.showCostDate,"show-product-add-to-cart-button":$.showProductAddToCartButton,"show-product-edit-button":$.showProductEditButton,"product-context-buttons-config":$.productContextButtonsConfig,"show-hide-for-client-button":$.showHideForClientButton,"show-pin-button":$.showPinButton,"show-category-edit-button":$.showCategoryEditButton,"category-context-buttons-config":$.categoryContextButtonsConfig},null,8,["categories-items","has-products","event-emitter","filtered-items","selected-categories-items","selected-products-items","show-slugs","show-properties","show-product-costs","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config","show-hide-for-client-button","show-pin-button","show-category-edit-button","category-context-buttons-config"])):i.createCommentVNode("",!0),c.value?(i.openBlock(),i.createBlock(Me,{key:1,columns:M.value,data:l.value,bordered:!0,loading:g.value,remote:!0,"row-key":$e=>$e.id,"table-layout":b.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])):i.createCommentVNode("",!0),!g.value&&!m.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(Ge,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(Ge,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),g.value?(i.openBlock(),i.createBlock(Le,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>X[6]||(X[6]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),Ef=Hn(Tf,[["__scopeId","data-v-b1d02b24"]]),$f={class:"sc-collapse flex w-full flex-col"},Nf={},xa=i.defineComponent({...Nf,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(e,{emit:t}){const n=e,r=t,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",$f,[i.renderSlot(o.$slots,"default")]))}}),Rf={},Ca=i.defineComponent({...Rf,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},filteredItems:{default:void 0},selectedCategoriesItems:{default:void 0},selectedProductsItems:{default:void 0},showHideForClientButton:{type:[Boolean,Function],default:!1},showPinButton:{type:[Boolean,Function],default:!1},showCategoryEditButton:{type:[Boolean,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},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},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>D.isUndefined(t.filteredItems)?t.categoriesItems:t.categoriesItems.filter(o=>{var a;return!!((a=t.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(D.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=I.NSpin,c=I.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(xa,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(Ef,{key:d.id,"category-item":d,"event-emitter":o.eventEmitter,"filtered-items":s(d,o.filteredItems),"selected-categories-items":o.selectedCategoriesItems,"selected-products-items":o.selectedProductsItems,"show-slugs":o.showSlugs,"show-properties":o.showProperties,"show-product-costs":o.showProductCosts,"allow-name-click":o.allowNameClick,"allow-price-click":o.allowPriceClick,"show-price-history":o.showPriceHistory,"show-cost-date":o.showCostDate,"show-product-add-to-cart-button":o.showProductAddToCartButton,"show-product-edit-button":o.showProductEditButton,"product-context-buttons-config":o.productContextButtonsConfig,"show-hide-for-client-button":o.showHideForClientButton,"show-pin-button":o.showPinButton,"show-category-edit-button":o.showCategoryEditButton,"category-context-buttons-config":o.categoryContextButtonsConfig},null,8,["category-item","event-emitter","filtered-items","selected-categories-items","selected-products-items","show-slugs","show-properties","show-product-costs","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config","show-hide-for-client-button","show-pin-button","show-category-edit-button","category-context-buttons-config"]))),128))]),_:1})):o.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),!o.hasProducts&&!o.loading&&o.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)}}}),Pf={class:"text-sm"},Ff={class:"text-sm"},Mf={},Af=i.defineComponent({...Mf,__name:"add-product-to-cart-form",props:{product:{},cartItem:{default:void 0},validation:{default:()=>({length:{},quantity:{},marker:{}})},isSubmitProcessing:{type:Boolean}},emits:["submit"],setup(e,{emit:t}){var l,c,d,h,f,p,u,g;const n=e,r=i.ref(new U.CartItemBase(n.cartItem??new U.CartItemBase({product:n.product,quantity:((c=(l=n.product)==null?void 0:l.properties)==null?void 0:c.minCount)??1,length:((h=(d=n.product)==null?void 0:d.properties)==null?void 0:h.minLength)||((p=(f=n.product)==null?void 0:f.properties)!=null&&p.ignoreMinCountCheck?0:(g=(u=n.product)==null?void 0:u.properties)==null?void 0:g.minCount)||0}))),s=t,o=i.computed(()=>{var y,b,S,C,v,B,k,E,P;const m=((b=(y=n.product)==null?void 0:y.properties)==null?void 0:b.minLength)??((C=(S=n.product)==null?void 0:S.properties)!=null&&C.ignoreMinCountCheck?0:(B=(v=n.product)==null?void 0:v.properties)==null?void 0:B.minCount),_=(E=(k=n.product)==null?void 0:k.properties)==null?void 0:E.maxLength;return m||_?`(${m?`от ${m}`:""}${m&&_?" ":""}${_?`до ${_}`:""} ${(P=n.product)==null?void 0:P.unit})`:""}),a=()=>{U.UnitsHelper.productIsMeasurable(n.product)||delete r.value.length,s("submit",r.value)};return(m,_)=>(i.openBlock(),i.createBlock(i.unref(I.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.unref(U.UnitsHelper).productIsMeasurable(m.product)?(i.openBlock(),i.createBlock(i.unref(I.NFormItem),{key:0,required:!0,feedback:m.validation.length.feedback||"","show-feedback":m.validation.length.showFeedback||i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01||!1,"validation-status":m.validation.length.validationStatus||void 0,label:"Метраж, "+m.product.unit+o.value+"м."},i.createSlots({default:i.withCtx(()=>{var y,b;return[i.createVNode(i.unref(I.NInputNumber),{value:r.value.length,"onUpdate:value":_[0]||(_[0]=S=>r.value.length=S),max:((y=m.product.properties)==null?void 0:y.maxLength)||void 0,min:((b=m.product.properties)==null?void 0:b.minLength)||i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product),step:i.unref(U.UnitsHelper).getProductMultiplicity(m.product),validator:S=>S%i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product)===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]}),_:2},[!m.validation.length.feedback&&i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Pf,"Метраж должен быть кратен "+i.toDisplayString(i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status","label"])):i.createCommentVNode("",!0),i.createVNode(i.unref(I.NFormItem),{required:!0,feedback:m.validation.quantity.feedback||"","show-feedback":m.validation.quantity.showFeedback||i.unref(U.UnitsHelper).getProductMultiplicity(m.product)!==1||!1,"validation-status":m.validation.quantity.validationStatus||void 0,label:"Количество"},i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:r.value.quantity,"onUpdate:value":_[1]||(_[1]=y=>r.value.quantity=y),min:i.unref(U.UnitsHelper).getProductMultiplicity(m.product),step:i.unref(U.UnitsHelper).getProductMultiplicity(m.product),validator:y=>y%i.unref(U.UnitsHelper).getProductMultiplicity(m.product)===0,placeholder:"Введите количество",class:"w-full"},null,8,["value","min","step","validator"])]),_:2},[!m.validation.quantity.feedback&&i.unref(U.UnitsHelper).getProductMultiplicity(m.product)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Ff,"Количество должно быть кратно "+i.toDisplayString(i.unref(U.UnitsHelper).getProductMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(I.NFormItem),{feedback:m.validation.marker.feedback||"","show-feedback":m.validation.marker.showFeedback||!1,"validation-status":m.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInput),{value:r.value.marker,"onUpdate:value":_[2]||(_[2]=y=>r.value.marker=y),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(I.NButton),{loading:m.isSubmitProcessing,disabled:r.value.length===0||r.value.quantity===0,type:"primary",class:"self-start",onClick:_[3]||(_[3]=y=>a())},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(m.cartItem?"Изменить":"В корзину"),1)]),_:1},8,["loading","disabled"])]),_:1}))}}),If={},Sa=i.defineComponent({...If,__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(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>D.isArray(r.value)),a=new U.Reference,l=i.computed(()=>{const u=o.value?[]:a,g=D.isUndefined(r.value)?u:r.value;return D.isArray(g)?g.map(m=>m.id):g==null?void 0:g.id}),c=i.computed(()=>zt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,r.showEmptyValue)),d=u=>{var g;if(D.isArray(u)){const m=u.length>0?u.map(_=>{var y;return(y=c.value.find(b=>b.value===_))==null?void 0:y.item}):[];s("update:value",m)}else{const m=u===a.id||(g=c.value.find(_=>_.value===u))==null?void 0:g.item;s("update:value",m)}},h=i.useTemplateRef("select-component");return t({focus:()=>{var u;return(u=h.value)==null?void 0:u.focus()},blur:()=>{var u;return(u=h.value)==null?void 0:u.blur()}}),(u,g)=>(i.openBlock(),i.createBlock(i.unref(I.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":u.consistentMenuWidth,disabled:u.disabled||c.value.length===0,filterable:u.filterable,"max-tag-count":u.maxTagCount,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),Vf={},Of=i.defineComponent({...Vf,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(e,{emit:t}){var S,C;const n=e,r=t,s=()=>{const v=U.PriceCoefficient.getRetailPriceCoefficient();return D.unset(v,"isNewRec"),v},o=v=>!v||v.id===s().id,a=i.computed(()=>{var v;return((v=n.catalogItem)==null?void 0:v.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=v=>{var B,k,E,P;return v.id===s().id?(B=l.value)==null?void 0:B.getRetailCost():(P=(E=(k=l.value)==null?void 0:k.priceCoefficients)==null?void 0:E.find(R=>R.coefficient.id===v.id))==null?void 0:P.cost},d=i.computed(()=>{var B;const v=[...((B=U.useReferencesStore().priceCoefficientsReference)==null?void 0:B.map(k=>structuredClone(i.toRaw(k))))??[],s()];return a.value&&v.forEach(k=>{var P;const E=c(k);E?k.name+=` (${E} ${(P=l.value)==null?void 0:P.currency})`:k.name=""}),v.filter(k=>k.name!=="")}),h=i.ref(n.value.coefficient),f=i.ref(((C=(S=n.value)==null?void 0:S.value)==null?void 0:C.toString())??null),p=i.ref(null),u=i.computed(()=>{var v,B;return(B=(v=l.value)==null?void 0:v.priceCoefficients)==null?void 0:B.find(k=>k.coefficient.slug===U.PriceCoefficientEnum.K0)}),g=i.ref(void 0),m=()=>{var B,k,E;g.value=void 0;let v=Number.parseFloat(((B=f.value)==null?void 0:B.replace(",","."))??"");if(v=Number.isNaN(v)?void 0:v,a.value)if(h.value||f.value){const P=s(),R=c(h.value??P)??0,j=R+R*((v??0)/100);p.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(j),j>(((k=l.value)==null?void 0:k.getRetailCost())??j)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),u.value&&j<(((E=u.value)==null?void 0:E.cost)??0)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else p.value=null;r("update:value",{value:Number.isNaN(v)?void 0:v,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})},_=v=>{D.isArray(v)||(h.value=v,!h.value&&f.value&&(h.value=s()),m())},y=()=>{h.value||(h.value=s()),m()},b=v=>{var k,E,P,R,j,q;const B=Number.parseFloat((v==null?void 0:v.replace(",","."))??"");if(a.value){let M=0;if(B<=0)h.value=void 0,f.value=null;else if(u.value&&B<(((k=u.value)==null?void 0:k.cost)??0))h.value=(E=u.value)==null?void 0:E.coefficient,M=(B-u.value.cost)*100/u.value.cost,g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(B>(((P=l.value)==null?void 0:P.getRetailCost())??B)){h.value=s();const A=((R=l.value)==null?void 0:R.getRetailCost())??0;M=(B-A)*100/A,g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const A=(q=(j=l.value)==null?void 0:j.priceCoefficients)==null?void 0:q.filter($=>$.cost<B);if(A&&A.length>0){const $=A.at(-1);h.value=$==null?void 0:$.coefficient,M=(B-(($==null?void 0:$.cost)??0))*100/(($==null?void 0:$.cost)??1)}g.value={validationStatus:void 0,feedback:void 0}}f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(M),r("update:value",{value:Number.isNaN(M)?void 0:M,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 v,B,k,E;n.calculationType===U.CalculationTypeEnum.m2Cost?p.value=((B=(v=n.value)==null?void 0:v.value)==null?void 0:B.toString())??null:!((k=n.value)!=null&&k.coefficient)&&((E=n.value)!=null&&E.value)&&(h.value=s()),m()}),(v,B)=>{var P,R,j;const k=I.NInput,E=I.NInputGroup;return i.openBlock(),i.createBlock(i.unref(I.NFormItem),{"show-label":!i.unref(D.isNil)(v.label),label:v.label,"show-feedback":!i.unref(D.isNil)(((P=g.value)==null?void 0:P.feedback)??v.feedback),feedback:((R=g.value)==null?void 0:R.feedback)??v.feedback,"validation-status":((j=g.value)==null?void 0:j.validationStatus)??v.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"grid-cols-1":!a.value||v.calculationType===i.unref(U.CalculationTypeEnum).m2Cost,"grid-cols-3":a.value&&v.calculationType!==i.unref(U.CalculationTypeEnum).m2Cost},"grid w-full gap-2"])},[v.calculationType!==i.unref(U.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(E,{key:0,class:i.normalizeClass({"col-span-2":a.value})},{default:i.withCtx(()=>[i.createVNode(Sa,{value:h.value,"reference-list":d.value,clearable:v.clearable,disabled:v.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":_},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(k,{value:f.value,"onUpdate:value":[B[0]||(B[0]=q=>f.value=q),y],clearable:v.clearable,disabled:v.disabled,placeholder:""},i.createSlots({suffix:i.withCtx(()=>[B[3]||(B[3]=i.createTextVNode("%"))]),_:2},[f.value&&!f.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[B[2]||(B[2]=i.createTextVNode(" + "))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||v.calculationType===i.unref(U.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(k,{key:1,value:p.value,"onUpdate:value":[B[1]||(B[1]=q=>p.value=q),b],clearable:v.clearable,disabled:v.disabled,placeholder:"Стоимость"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var q;return[i.createTextVNode(i.toDisplayString((q=l.value)==null?void 0:q.currency),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),zf={class:"flex flex-row gap-1"},Lf={class:"sc-client-name flex flex-col gap-1 text-base"},Df=["href"],Hf={key:1,class:"text-sc-grey"},Wf={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},jf={key:0},Xf={key:1,class:"text-sm"},qf={},Tr=i.defineComponent({...qf,__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(e,{emit:t}){const n=e,r=t,s=i.computed(()=>n.client.lastLoginAt?Tn.format(n.client.lastLoginAt,U.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{D.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Bs,d=I.NButton,h=I.NPopover;return i.openBlock(),i.createElementBlock("div",zf,[a.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=f=>a.$emit("click:client-info",a.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(D.isNil)(a.popoverPosition),placement:a.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",Lf,[i.createElementVNode("a",{href:a.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=f=>o(f))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!a.client.isActive})},i.toDisplayString(a.client.name),3),a.showSalesDirection&&a.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!a.client.isActive})}," ("+i.toDisplayString(a.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),a.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",Hf," [ Деактивирован ] "))],8,Df),a.showCityAndRegion&&a.client.city?(i.openBlock(),i.createElementBlock("span",Wf," г. "+i.toDisplayString(a.client.city.name)+", "+i.toDisplayString(a.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[a.client.alternativeName?(i.openBlock(),i.createElementBlock("div",jf,i.toDisplayString(a.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",Xf," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),Yf={class:"text-base"},Uf={},Ba=i.defineComponent({...Uf,__name:"contragent-with-short-info",props:{contragent:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("span",Yf,i.toDisplayString(t.contragent.name),1))}}),Gf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Kf(e,t){return i.openBlock(),i.createElementBlock("svg",Gf,t[0]||(t[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 Zf=i.markRaw({name:"tabler-mail",render:Kf}),Jf=["href"],Qf={},ep=i.defineComponent({...Qf,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(e){return(t,n)=>{const r=Zf;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,Jf)],2)}}}),tp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function np(e,t){return i.openBlock(),i.createElementBlock("svg",tp,t[0]||(t[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 Ta=i.markRaw({name:"fa6-brands-viber",render:np}),ip={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},rp=["id"],sp=["id"],op=["fill"],ap=["fill"];function lp(e,t){return i.openBlock(),i.createElementBlock("svg",ip,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:e.idMap.logosWhatsappIcon0,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},t[0]||(t[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)]),8,rp),i.createElementVNode("linearGradient",{id:e.idMap.logosWhatsappIcon1,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},t[1]||(t[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)]),8,sp)]),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosWhatsappIcon0+")",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,op),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosWhatsappIcon1+")",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,ap),t[2]||(t[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 Ea=i.markRaw({name:"logos-whatsapp-icon",render:lp,setup(){const e=()=>Math.random().toString(36).substr(2,10);return{idMap:{logosWhatsappIcon0:"uicons-"+e(),logosWhatsappIcon1:"uicons-"+e()}}}}),cp={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},dp=["id"],hp=["fill"];function up(e,t){return i.openBlock(),i.createElementBlock("svg",cp,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:e.idMap.logosTelegram0,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},t[0]||(t[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)]),8,dp)]),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosTelegram0+")",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,hp),t[1]||(t[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 $a=i.markRaw({name:"logos-telegram",render:up,setup(){return{idMap:{logosTelegram0:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),fp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function pp(e,t){return i.openBlock(),i.createElementBlock("svg",fp,t[0]||(t[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 Na=i.markRaw({name:"ion-call",render:pp}),gp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mp(e,t){return i.openBlock(),i.createElementBlock("svg",gp,t[0]||(t[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 _p=i.markRaw({name:"tabler-phone-call",render:mp}),yp={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},bp=["href"],wp=["href"],vp=["href"],kp=["href"],xp={},Cp=i.defineComponent({...xp,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{try{return t.phone?Xi.parsePhoneNumberWithError(t.phone,t.defaultCountry):void 0}catch{}return t.phone}),r=i.computed(()=>{var l;return D.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return D.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return D.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=_p,h=Na,f=$a,p=Ea,u=Ta;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":l.showPhoneIcon})},[l.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",yp,[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,bp)):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(f)],8,wp)):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(p)],8,vp)):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(u)],8,kp)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),Sp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Bp(e,t){return i.openBlock(),i.createElementBlock("svg",Sp,t[0]||(t[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 Tp=i.markRaw({name:"mdi-envelope",render:Bp}),Ep={class:"flex flex-col gap-1"},$p={key:0,class:"mb-2 flex flex-col text-base"},Np={key:0,class:"text-sc-dark-grey text-sm"},Rp={key:1,class:"whitespace-nowrap text-sm"},Pp={key:2,class:"whitespace-nowrap text-sm"},Fp={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Mp=["href"],Ap=["href"],Ip=["href"],Vp=["href"],Op=["href"],zp={key:0,class:"flex flex-col text-base"},Lp={key:0,class:"text-sc-dark-grey text-sm"},Dp={key:1,class:"mt-2 text-sm"},Hp={key:0,class:"-mt-1"},Wp={},jp=i.defineComponent({...Wp,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(e){const t=e,n=i.computed(()=>{try{return t.contact.phone?Xi.parsePhoneNumberWithError(t.contact.phone,t.defaultCountry):void 0}catch{}return t.contact.phone}),r=i.computed(()=>{var c;return D.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return D.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return D.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||t.contact.email),l=i.ref(!1);return(c,d)=>{var _,y;const h=Na,f=$a,p=Ea,u=Ta,g=Tp,m=I.NPopover;return i.openBlock(),i.createElementBlock("div",Ep,[i.createVNode(m,{disabled:c.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var b,S,C,v;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(b=c.contact)!=null&&b.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${c.classes}`),style:i.normalizeStyle(c.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,[c.fullView&&(c.contact.name||(S=c.contact)!=null&&S.position)?(i.openBlock(),i.createElementBlock("div",$p,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(C=c.contact)!=null&&C.position?(i.openBlock(),i.createElementBlock("span",Np,i.toDisplayString((v=c.contact)==null?void 0:v.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),c.contact.phone?(i.openBlock(),i.createElementBlock("div",Rp,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("div",Pp,i.toDisplayString(c.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",Fp,[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,Mp)):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(f)],8,Ap)):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(p)],8,Ip)):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(u)],8,Vp)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${c.contact.email}`,class:"hover:text-3xl"},[i.createVNode(g)],8,Op)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var b,S,C,v;return[c.contact.name?(i.openBlock(),i.createElementBlock("div",zp,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(b=c.contact)!=null&&b.position?(i.openBlock(),i.createElementBlock("span",Lp,i.toDisplayString((S=c.contact)==null?void 0:S.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(C=c.contact)!=null&&C.comment?(i.openBlock(),i.createElementBlock("div",Dp,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((v=c.contact)==null?void 0:v.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),c.fullView&&((_=c.contact)!=null&&_.comment)?(i.openBlock(),i.createElementBlock("div",Hp,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((y=c.contact)==null?void 0:y.comment),1)])):i.createCommentVNode("",!0)])}}}),Xp={key:0,class:"flex w-fit items-center gap-2"},qp={key:1,class:"flex flex-wrap gap-1"},Yp={key:0},Up={},Ui=i.defineComponent({...Up,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0}},setup(e){const t=e,n=i.computed(()=>{var r,s;return(s=(r=t.product)==null?void 0:r.properties)==null?void 0:s.planingProductionDate});return(r,s)=>{const o=I.NSpin;return r.isProductSearching?(i.openBlock(),i.createElementBlock("div",Xp,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):r.product.isNewRec()?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",qp,[i.createElementVNode("div",null,i.toDisplayString(r.product.code)+" - "+i.toDisplayString(r.product.name)+" - "+i.toDisplayString(r.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(r.product.unit),1),n.value?(i.openBlock(),i.createElementBlock("div",Yp,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)]))}}}),Gp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Kp(e,t){return i.openBlock(),i.createElementBlock("svg",Gp,t[0]||(t[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 Er=i.markRaw({name:"ion-close",render:Kp}),Zp={class:"mr-3 flex flex-col gap-2"},Jp=["onClick"],Qp={class:"h-full p-2"},eg={},tg=i.defineComponent({...eg,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(e,{emit:t}){const n=e,r=i.useTemplateRef("drawing-template-containers"),s=t;return i.onMounted(()=>{n.settings.allTemplates.forEach((o,a)=>{var c;const l=(c=r.value)==null?void 0:c.at(a);l&&s("init-draw-template",l,o)})}),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=Er;return i.openBlock(),i.createBlock(i.unref(I.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",Zp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.settings.allTemplates,(c,d)=>(i.openBlock(),i.createElementBlock("div",{key:d,class:"group relative"},[i.createVNode(i.unref(I.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===o.selectTemplateIndex}]),onClick:h=>s("template:select",d)},[i.createElementVNode("div",Qp,[i.createElementVNode("div",{ref_for:!0,ref:"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Jp)]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(c.label),1)]),_:2},1024),c.isCustom&&!c.isNewRec()?(i.openBlock(),i.createBlock(i.unref(I.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)]),_:2},1032,["onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),Ra=Hn(tg,[["__scopeId","data-v-828c3059"]]),ng={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ig(e,t){return i.openBlock(),i.createElementBlock("svg",ng,t[0]||(t[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 Pa=i.markRaw({name:"ion-trash",render:ig}),rg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sg(e,t){return i.openBlock(),i.createElementBlock("svg",rg,t[0]||(t[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)]))}const Fa=i.markRaw({name:"ion-plus",render:sg}),og={class:"flex flex-col gap-4"},ag={class:"flex flex-col gap-2"},lg={class:"mt-8 font-bold"},cg={class:"grid grow grid-cols-2 items-start gap-2"},dg={class:"flex flex-col gap-4"},hg={class:"flex gap-3"},ug={},Ma=i.defineComponent({...ug,__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","click:view-switch","submit","click:add-line","click:remove-line","click:save-template"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(structuredClone(i.toRaw(n.value.configuratorParams))),o=i.ref(!1),a=()=>{s.value.length>0&&(r("update:params",s.value),l("configuratorParams",s.value))},l=(c,d)=>{const h=new U.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.watch(()=>n.value.configuratorParams,c=>{s.value=D.cloneDeep(i.toRaw(c))},{deep:!0}),i.watch(()=>n.previewParams,c=>{s.value.linesWidths=c.linesWidths,s.value.linesAngles=c.linesAngles},{deep:!0}),(c,d)=>{const h=Fa,f=Pa,p=I.NInput;return i.openBlock(),i.createBlock(i.unref(I.NForm),{class:"grid gap-2 md:grid-cols-2 md:gap-6"},{default:i.withCtx(()=>{var u,g,m,_,y,b,S,C,v;return[i.createElementVNode("div",og,[d[10]||(d[10]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),c.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(I.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:s.value.startTailType,"onUpdate:value":[d[0]||(d[0]=B=>s.value.startTailType=B),a],options:c.settings.startTailConfigs.map(({label:B},k)=>({label:B,value:k})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",ag,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value.linesAngles,(B,k)=>{var E,P,R,j,q,M;return i.openBlock(),i.createElementBlock("div",{key:k,class:"flex items-start gap-2"},[i.createElementVNode("div",lg,i.toDisplayString(k+1),1),i.createElementVNode("div",cg,[i.createVNode(i.unref(I.NFormItem),{label:"Ширина, мм",required:!0,feedback:((E=c.validation[`lines_widths[${k+1}]`])==null?void 0:E.feedback)||"","show-feedback":((P=c.validation[`lines_widths[${k+1}]`])==null?void 0:P.showFeedback)||!1,"validation-status":(R=c.validation[`lines_widths[${k+1}]`])==null?void 0:R.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:s.value.linesWidths[k],"onUpdate:value":[A=>s.value.linesWidths[k]=A,a],min:s.value.linesWidths.length>1?c.settings.minLineWidth:c.settings.stripMinWidth,max:c.settings.maxLineWidth,step:c.settings.lineWidthStep,validator:A=>A%c.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(I.NFormItem),{label:"Угол сгиба, °",required:!0,feedback:((j=c.validation[`lines_angles[${k+1}]`])==null?void 0:j.feedback)||"","show-feedback":((q=c.validation[`lines_angles[${k+1}]`])==null?void 0:q.showFeedback)||!1,"validation-status":(M=c.validation[`lines_angles[${k+1}]`])==null?void 0:M.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:s.value.linesAngles[k],"onUpdate:value":[A=>s.value.linesAngles[k]=A,a],min:c.settings.minLineAngle,max:c.settings.maxLineAngle,step:c.settings.lineAngleStep,validator:A=>A%c.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(I.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:0,size:"medium",onClick:A=>r("click:add-line",k)},{default:i.withCtx(()=>[i.createVNode(h)]),_:2},1032,["onClick"])),c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:1,disabled:s.value.linesWidths.length===1,size:"medium",class:"ml-2",onClick:A=>r("click:remove-line",k)},{default:i.withCtx(()=>[i.createVNode(f)]),_:2},1032,["disabled","onClick"]))]),_:2},1024)])}),128))]),c.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(I.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:s.value.endTailType,"onUpdate:value":[d[1]||(d[1]=B=>s.value.endTailType=B),a],options:c.settings.endTailConfigs.map(({label:B},k)=>({label:B,value:k})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Ui,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),c.settings.allowSaveTemplates&&c.selectTemplateIndex===c.settings.allTemplates.length-1?(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:2,type:"tertiary",class:"self-start",loading:o.value,onClick:d[2]||(d[2]=B=>r("click:save-template"))},{default:i.withCtx(()=>d[9]||(d[9]=[i.createTextVNode(" Сохранить шаблон ")])),_:1,__:[9]},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",dg,[i.createVNode(i.unref(I.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:s.value.colorSide,"onUpdate:value":[d[3]||(d[3]=B=>s.value.colorSide=B),a],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":((u=c.validation.length)==null?void 0:u.showFeedback)||!1,feedback:((g=c.validation.length)==null?void 0:g.feedback)||"","validation-status":(m=c.validation.length)==null?void 0:m.validationStatus,label:`Метраж${c.settings.stripMinLength?" от "+c.settings.stripMinLength:""}${c.settings.stripMaxLength?" до "+c.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:s.value.length,"onUpdate:value":[d[4]||(d[4]=B=>s.value.length=B),a],required:!0,max:c.settings.stripMaxLength||void 0,min:c.settings.stripMinLength,step:c.settings.lengthStep,validator:B=>B%c.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(I.NFormItem),{required:!0,"show-feedback":((_=c.validation.quantity)==null?void 0:_.showFeedback)||!1,feedback:((y=c.validation.quantity)==null?void 0:y.feedback)||"","validation-status":(b=c.validation.quantity)==null?void 0:b.validationStatus,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:c.value.quantity,"onUpdate:value":d[5]||(d[5]=B=>c.value.quantity=B),min:1,validator:B=>Number.isInteger(B),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":((S=c.validation.marker)==null?void 0:S.showFeedback)||!1,feedback:((C=c.validation.marker)==null?void 0:C.feedback)||"","validation-status":(v=c.validation.marker)==null?void 0:v.validationStatus,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(p,{value:c.value.marker,"onUpdate:value":d[6]||(d[6]=B=>c.value.marker=B),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createElementVNode("div",hg,[i.createVNode(i.unref(I.NButton),{loading:c.isSubmitProcessing,type:"primary",class:"self-start",onClick:d[7]||(d[7]=B=>r("submit",c.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading"]),c.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[8]||(d[8]=B=>r("click:view-switch"))},{default:i.withCtx(()=>d[11]||(d[11]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[11]})):i.createCommentVNode("",!0)])])]}),_:1})}}});var Aa=Object.defineProperty,fg=Object.defineProperties,pg=Object.getOwnPropertyDescriptors,Ia=Object.getOwnPropertySymbols,gg=Object.prototype.hasOwnProperty,mg=Object.prototype.propertyIsEnumerable,Es=(e,t,n)=>t in e?Aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$s=(e,t)=>{for(var n in t||(t={}))gg.call(t,n)&&Es(e,n,t[n]);if(Ia)for(var n of Ia(t))mg.call(t,n)&&Es(e,n,t[n]);return e},Ns=(e,t)=>fg(e,pg(t)),Va=(e,t)=>{for(var n in t)Aa(e,n,{get:t[n],enumerable:!0})},w=(e,t,n)=>(Es(e,typeof t!="symbol"?t+"":t,n),n),Oa=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Et=(e,t,n)=>(Oa(e,t,"read from private field"),n?n.call(e):t.get(e)),za=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},_g=(e,t,n,r)=>(Oa(e,t,"write to private field"),t.set(e,n),n),vt={Image:null,isHeadless:!1,shim:function(e,t){return e.tagName=e.nodeName=t||"canvas",e.nodeType=1,e.getAttribute=function(n){return this[n]},e.setAttribute=function(n,r){return this[n]=r,this},e},polyfill:function(e,t){return vt.shim(e),typeof t<"u"&&(vt.Image=t),vt.isHeadless=!0,e}},La={};Va(La,{Curve:()=>xi,getAnchorsFromArcData:()=>wg,getComponentOnCubicBezier:()=>Gi,getControlPoints:()=>Ja,getCurveBoundingBox:()=>Ga,getCurveFromPoints:()=>Za,getCurveLength:()=>Ua,getReflection:()=>Fs,integrate:()=>Ka,subdivide:()=>Ps});var Da={};Va(Da,{HALF_PI:()=>Je,NumArray:()=>Zt,TWO_PI:()=>ht,decomposeMatrix:()=>ki,getComputedMatrix:()=>ja,getPoT:()=>Xa,lerp:()=>Ft,mod:()=>Mt,setMatrix:()=>Wa,toFixed:()=>Ne});var He;typeof window<"u"?He=window:typeof global<"u"?He=global:typeof self<"u"&&(He=self);var Ha,ht=Math.PI*2,Je=Math.PI*.5;function ki(e,t,n,r,s,o){let a;return arguments.length<=1?(a=e.a,t=e.b,n=e.c,r=e.d,s=e.e,o=e.f):a=e,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,a)/Math.PI}}function Wa(e){Ha=e}function ja(e,t){t=t&&t.identity()||new Ha;let n=e;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;t.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9])}return t}function Ft(e,t,n){return n*(t-e)+e}var Rs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function Xa(e){let t=0;for(;Rs[t]&&Rs[t]<e;)t++;return Rs[t]}function Mt(e,t){for(;e<0;)e+=t;return e%t}var Zt=He.Float32Array||Array,yg=Math.floor;function Ne(e){return yg(e*1e6)/1e6}var ee={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},Y=class{constructor(){w(this,"_events",{}),w(this,"_bound",!1)}addEventListener(t,n){return(this._events[t]||(this._events[t]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(t,n){if(!this._events)return this;if(!t&&!n)return this._events={},this._bound=!1,this;const r=t?[t]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){t=r[s];let a=this._events[t];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[t]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(t){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[t];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(t,n,r){const s=this;t&&(o.obj=t,o.name=n,o.handler=r,t.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(t,n,r){return t.off(n,r),this}};w(Y,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),w(Y,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var qa={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(Y.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(Y.Types.change))}}},Xt=class extends Y{constructor(e=0,t=0){super(),w(this,"_x",0),w(this,"_y",0);for(let n in qa)Object.defineProperty(this,n,qa[n]);this.x=e,this.y=t}static add(e,t){return new Xt(e.x+t.x,e.y+t.y)}static sub(e,t){return new Xt(e.x-t.x,e.y-t.y)}static subtract(e,t){return Xt.sub(e,t)}static ratioBetween(e,t){return(e.x*t.x+e.y*t.y)/(e.length()*t.length())}static angleBetween(e,t){if(arguments.length>=4){const s=arguments[0]-arguments[2],o=arguments[1]-arguments[3];return Math.atan2(o,s)}const n=e.x-t.x,r=e.y-t.y;return Math.atan2(r,n)}static distanceBetween(e,t){return Math.sqrt(Xt.distanceBetweenSquared(e,t))}static distanceBetweenSquared(e,t){const n=e.x-t.x,r=e.y-t.y;return n*n+r*r}set(e,t){return this.x=e,this.y=t,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 Xt(this.x,this.y)}add(e,t){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+=t),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,t){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-=t),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,t){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*=t),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,t){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/=t),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 t=this.x-e.x,n=this.y-e.y;return t*t+n*n}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,t){return t=typeof t>"u"?1e-4:t,this.distanceTo(e)<t}lerp(e,t){const n=(e.x-this.x)*t+this.x,r=(e.y-this.y)*t+this.y;return this.set(n,r)}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 t=this.x,n=this.y,r=Math.cos(e),s=Math.sin(e);return this.x=t*r-n*s,this.y=t*s+n*r,this}},Z=Xt;w(Z,"zero",new Xt),w(Z,"left",new Xt(-1,0)),w(Z,"right",new Xt(1,0)),w(Z,"up",new Xt(0,-1)),w(Z,"down",new Xt(0,1));var ve=class extends Z{constructor(t=0,n=0,r=0,s=0,o=0,a=0,l=ee.move){super(t,n),w(this,"controls",{left:new Z,right:new Z}),w(this,"_command",ee.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 Ya)Object.defineProperty(this,d,Ya[d]);this.command=l,this.relative=!0;const c=ve.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(Y.Types.change,c),this.controls.right.set(o,a).addEventListener(Y.Types.change,c)}static makeBroadcast(t){return n;function n(){t._bound&&t.dispatchEvent(Y.Types.change)}}static fromObject(t){return new ve().copy(t)}copy(t){return this.x=t.x,this.y=t.y,typeof t.command=="string"&&(this.command=t.command),t.controls&&(t.controls.left&&this.controls.left.copy(t.controls.left),t.controls.right&&this.controls.right.copy(t.controls.right)),typeof t.relative=="boolean"&&(this.relative=t.relative),typeof t.rx=="number"&&(this.rx=t.rx),typeof t.ry=="number"&&(this.ry=t.ry),typeof t.xAxisRotation=="number"&&(this.xAxisRotation=t.xAxisRotation),typeof t.largeArcFlag=="number"&&(this.largeArcFlag=t.largeArcFlag),typeof t.sweepFlag=="number"&&(this.sweepFlag=t.sweepFlag),this}clone(){return new ve().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())}},Ya={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(Y.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(Y.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(Y.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(Y.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(Y.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(Y.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(Y.Types.change))}}},bg=0,kt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.18",PublishDate:"2025-04-07T22:33:48.746Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return bg++}},xi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],weights:[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]]};function Gi(e,t,n,r,s){const o=1-e;return o*o*o*t+3*o*o*e*n+3*o*e*e*r+e*e*e*s}function Ps(e,t,n,r,s,o,a,l,c){c=c||xi.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new ve(a,l)];const h=[];for(let f=0;f<d;f++){const p=f/d,u=Gi(p,e,n,s,a),g=Gi(p,t,r,o,l);h.push(new ve(u,g))}return h}function Ua(e,t,n,r,s,o,a,l,c){if(e===n&&t===r&&s===a&&o===l){const _=a-e,y=l-t;return Math.sqrt(_*_+y*y)}const d=9*(n-s)+3*(a-e),h=6*(e+s)-12*n,f=3*(n-e),p=9*(r-o)+3*(l-t),u=6*(t+o)-12*r,g=3*(r-t);function m(_){const y=(d*_+h)*_+f,b=(p*_+u)*_+g;return Math.sqrt(y*y+b*b)}return Ka(m,0,1,c||xi.RecursionLimit)}function Ga(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,f,p,u,g,m,_,y;for(let v=0;v<2;++v){if(v==0?(f=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,p=3*n-3*e):(f=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,p=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(f)<1e-12)continue;u=-p/f,0<u&&u<1&&c.push(u);continue}_=f*f-4*p*h,y=Math.sqrt(_),!(_<0)&&(g=(-f+y)/(2*h),0<g&&g<1&&c.push(g),m=(-f-y)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,C;for(;b--;)u=c[b],C=1-u,d[0][b]=C*C*C*e+3*C*C*u*n+3*C*u*u*s+u*u*u*a,d[1][b]=C*C*C*t+3*C*C*u*r+3*C*u*u*o+u*u*u*l;return d[0][S]=e,d[1][S]=t,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function Ka(e,t,n,r){let s=xi.abscissas[r-2],o=xi.weights[r-2],a=.5*(n-t),l=a+t,c=0,d=r+1>>1,h=r&1?o[c++]*e(l):0;for(;c<d;){const f=a*s[c];h+=o[c++]*(e(l+f)+e(l-f))}return a*h}function Za(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?Mt(s-1,n):Math.max(s-1,0),l=t?Mt(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];Ja(c,d,h),d.command=s===0?ee.move:ee.curve}}function Ja(e,t,n){const r=Z.angleBetween(e,t),s=Z.angleBetween(n,t);let o=Z.distanceBetween(e,t),a=Z.distanceBetween(n,t),l=(r+s)/2;return o<1e-4||a<1e-4?(typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(o*=.33,a*=.33,s<r?l+=Je:l-=Je,t.controls.left.x=Math.cos(l)*o,t.controls.left.y=Math.sin(l)*o,l-=Math.PI,t.controls.right.x=Math.cos(l)*a,t.controls.right.y=Math.sin(l)*a,typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}function Fs(e,t,n){return new Z(2*e.x-(t.x+e.x)-(n?e.x:0),2*e.y-(t.y+e.y)-(n?e.y:0))}function wg(e,t,n,r,s,o,a){const l=kt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,f=n*Math.cos(h),p=r*Math.sin(h),u=new ve(f,p);u.command=ee.line}}var Qa=Array.prototype.slice;function vg(e){if(e==null)return!1;const t=e.length;return typeof t=="number"&&t>=0&&t<4294967296}var ae={isNaN:function(e){return typeof e=="number"&&e!==+e},isElement:function(e){return!!(e&&e.nodeType===1)},isObject:function(e){const t=typeof e;return t==="function"||t==="object"&&!!e},extend:function(e){const t=Qa.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]=r[s]}return e},defaults:function(e){const t=Qa.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]===void 0&&(e[s]=r[s])}return e},each:function(e,t,n){const r=n||this,s=!vg(e)&&Object.keys(e),o=(s||e).length;for(let a=0;a<o;a++){const l=s?s[a]:a;t.call(r,e[l],l,e)}return e},performance:He.performance&&He.performance.now?He.performance:Date},At={hasEventListeners:typeof He.addEventListener=="function",bind:function(e,t,n,r){return this.hasEventListeners?e.addEventListener(t,n,!!r):e.attachEvent("on"+t,n),At},unbind:function(e,t,n,r){return At.hasEventListeners?e.removeEventListeners(t,n,!!r):e.detachEvent("on"+t,n),At},getRequestAnimationFrame:function(){const e=["ms","moz","webkit","o"];let t=0,n=He.requestAnimationFrame;if(!n){for(let s=0;s<e.length;s++)n=He[e[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-t)),c=He.setTimeout(d,l);t=a+l;function d(){s(a+l)}return c}return n}},Ci=He.document?He.document.createElement("div"):{};Ci.id="help-two-load",Object.defineProperty(At,"temp",{enumerable:!0,get:function(){return ae.isElement(Ci)&&!He.document.head.contains(Ci)&&(Ci.style.display="none",He.document.head.appendChild(Ci)),Ci}});var $t=class extends Error{constructor(t){super(),w(this,"name","Two.js"),w(this,"message"),this.message=t}},kg=He.devicePixelRatio||1;function xg(e){return e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1}function Ms(e){return kg/xg(e)}var $r=class{constructor(){w(this,"map",{})}add(t,n){return this.map[t]=n,this}remove(t){return delete this.map[t],this}get(t){return this.map[t]}contains(t){return t in this.map}},ut,En=class extends Array{constructor(){super(),za(this,ut,new Y),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 Et(this,ut)}set _events(t){_g(this,ut,t)}get _bound(){return Et(this,ut)._bound}set _bound(t){Et(this,ut)._bound=t}addEventListener(){return Et(this,ut).addEventListener.apply(this,arguments)}on(){return Et(this,ut).on.apply(this,arguments)}bind(){return Et(this,ut).bind.apply(this,arguments)}removeEventListener(){return Et(this,ut).removeEventListener.apply(this,arguments)}off(){return Et(this,ut).off.apply(this,arguments)}unbind(){return Et(this,ut).unbind.apply(this,arguments)}dispatchEvent(){return Et(this,ut).dispatchEvent.apply(this,arguments)}trigger(){return Et(this,ut).trigger.apply(this,arguments)}listen(){return Et(this,ut).listen.apply(this,arguments)}ignore(){return Et(this,ut).ignore.apply(this,arguments)}pop(){const t=super.pop.apply(this,arguments);return this.trigger(Y.Types.remove,[t]),t}shift(){const t=super.shift.apply(this,arguments);return this.trigger(Y.Types.remove,[t]),t}push(){const t=super.push.apply(this,arguments);return this.trigger(Y.Types.insert,arguments),t}unshift(){const t=super.unshift.apply(this,arguments);return this.trigger(Y.Types.insert,arguments),t}splice(){const t=super.splice.apply(this,arguments);if(this.trigger(Y.Types.remove,t),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(Y.Types.insert,n),this.trigger(Y.Types.order)}return t}sort(){return super.sort.apply(this,arguments),this.trigger(Y.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(Y.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(t,n){const r=[];for(let s=0;s<this.length;s++){const o=this[s];let a;n?a=t.call(n,o,s):a=t(o,s),r.push(a)}return r}};ut=new WeakMap;var el=class extends Y{constructor(){super(),w(this,"_flagId",!1),w(this,"_flagClassName",!1),w(this,"_renderer",{}),w(this,"_id",kt.Identifier+kt.uniqueId()),w(this,"_className",""),w(this,"classList",[]);for(let e in tl)Object.defineProperty(this,e,tl[e])}static fromObject(e){const t=new el().copy(e);return"id"in e&&(t.id=e.id),t}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return this.renderer.type=e.renderer.type,this.className=e.className,this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}},Wn=el;w(Wn,"Properties",["renderer","id","className"]);var tl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(e){const t=this._id;e!==this._id&&(this._id=e,this._flagId=!0,this.parent&&(delete this.parent.children.ids[t],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(e){this._className!==e&&(this._flagClassName=!0,this.classList=e.split(/\s+?/),this._className=e)}}},Nr,nl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};He.document&&(Nr=document.createElement("a"));var Qe=class extends Wn{constructor(e,t){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 n in il)Object.defineProperty(this,n,il[n]);if(this._renderer.type="texture",this._renderer.flagOffset=Cg.bind(this),this._renderer.flagScale=Sg.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new Z,typeof t=="function"){const n=(function(){this.unbind(Y.Types.load,n),typeof t=="function"&&t()}).bind(this);this.bind(Y.Types.load,n)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const n=Object.prototype.toString.call(e);(n==="[object HTMLImageElement]"||n==="[object HTMLCanvasElement]"||n==="[object HTMLVideoElement]"||n==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const t=new Qe().copy(e);return"id"in e&&(t.id=e.id),t}static getAbsoluteURL(e){return Nr?(Nr.href=e,Nr.href):e}static loadHeadlessBuffer(e,t){e.image.onload=t,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const t=Qe.getAbsoluteURL(e);if(Qe.ImageRegistry.contains(t))return Qe.ImageRegistry.get(t);let n;return vt.Image?(n=new vt.Image,vt.shim(n,"img")):He.document?nl.video.test(t)?n=document.createElement("video"):n=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),n.crossOrigin="anonymous",n.referrerPolicy="no-referrer",n}static load(e,t){let n=e.image,r=Qe.getTag(n);e._flagImage&&(/canvas/i.test(r)?Qe.Register.canvas(e,t):(e._src=!vt.isHeadless&&n.getAttribute("two-src")||n.src,Qe.Register[r](e,t))),e._flagSrc&&(n||(n=Qe.getImage(e.src),e.image=n),r=Qe.getTag(n),Qe.Register[r](e,t))}clone(){const e=new Qe(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 Z?e.offset:new Z().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof Z?e.scale:new Z().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(Y.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Qe.load(this,(function(){this.loaded=!0,this.trigger(Y.Types.change).trigger(Y.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("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}},Be=Qe;w(Be,"Properties",["src","loaded","repeat","scale","offset","image"]),w(Be,"RegularExpressions",nl),w(Be,"ImageRegistry",new $r),w(Be,"Register",{canvas:function(e,t){e._src="#"+e.id,Qe.ImageRegistry.add(e.src,e.image),typeof t=="function"&&t()},img:function(e,t){const n=e.image,r=function(o){!vt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),typeof t=="function"&&t()},s=function(o){throw!vt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new $t("unable to load "+e.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!vt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),e._src=Qe.getAbsoluteURL(e._src),!(!vt.isHeadless&&n&&n.getAttribute("two-src"))&&(vt.isHeadless||n.setAttribute("two-src",e.src),Qe.ImageRegistry.add(e.src,n),vt.isHeadless?Qe.loadHeadlessBuffer(e,r):e.image.src=e.src)},video:function(e,t){if(vt.isHeadless)throw new $t("video textures are not implemented in headless environments.");const n=function(s){e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",r,!1),e.image.width=e.image.videoWidth,e.image.height=e.image.videoHeight,typeof t=="function"&&t()},r=function(s){throw e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",r,!1),new $t("unable to load "+e.src)};e._src=Qe.getAbsoluteURL(e._src),e.image.getAttribute("two-src")||(e.image.setAttribute("two-src",e.src),Qe.ImageRegistry.add(e.src,e.image)),e.image.readyState>=4?n():(e.image.addEventListener("canplaythrough",n,!1),e.image.addEventListener("error",r,!1),e.image.src=e.src,e.image.load())}});var il={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){const t=Be.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}Be.ImageRegistry.contains(n)?this._image=Be.ImageRegistry.get(e.src):this._image=e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(Y.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(Y.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof Z&&this._scale.unbind(Y.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof Z&&this._scale.bind(Y.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Cg(){this._flagOffset=!0}function Sg(){this._flagScale=!0}var qt=class extends Wn{constructor(e,t,n){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 r in rl)Object.defineProperty(this,r,rl[r]);this._renderer.type="stop",this.offset=typeof e=="number"?e:qt.Index<=0?0:1,this.opacity=typeof n=="number"?n:1,this.color=typeof t=="string"?t:qt.Index<=0?"#fff":"#000",qt.Index=(qt.Index+1)%2}static fromObject(e){const t=new qt().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<qt.Properties.length;t++){const n=qt.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new qt;return ae.each(qt.Properties,function(n){t[n]=this[n]},this),e&&e.stops&&e.stops.push(t),t}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",ae.each(qt.Properties,t=>{e[t]=this[t]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}},Jt=qt;w(Jt,"Index",0),w(Jt,"Properties",["offset","opacity","color"]);var rl={offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset=e,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(e){this._color=e,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},jn=class extends Wn{constructor(e){super(),w(this,"_flagStops",!1),w(this,"_flagSpread",!1),w(this,"_flagUnits",!1),w(this,"_spread",""),w(this,"_units","");for(let t in sl)Object.defineProperty(this,t,sl[t]);this._renderer.type="gradient",this._renderer.flagStops=Bg.bind(this),this._renderer.bindStops=Tg.bind(this),this._renderer.unbindStops=Eg.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let t=e.stops;t&&t.length>0&&(t=t.map(r=>r instanceof Jt?r:new Jt().copy(r)));const n=new jn().copy(e);return"id"in e&&(n.id=e.id),n}clone(e){const t=this.stops.map(r=>r.clone()),n=new jn(t);return ae.each(jn.Properties,r=>{n[r]=this[r]},this),e&&e.add(n),n}copy(e){super.copy.call(this,e);for(let t=0;t<jn.Properties.length;t++){const n=jn.Properties[t];n in e&&(this[n]=e[n])}return this}toObject(){const e={stops:this.stops.map(t=>t.toObject())};return ae.each(jn.Properties,t=>{e[t]=this[t]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(Y.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}},Ue=jn;w(Ue,"Stop",Jt),w(Ue,"Properties",["spread","stops","units"]);var sl={spread:{enumerable:!0,get:function(){return this._spread},set:function(e){this._spread=e,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(e){this._units=e,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(e){const t=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(Y.Types.insert,t).unbind(Y.Types.remove,n),this._stops=new En((e||[]).slice(0)),this._stops.bind(Y.Types.insert,t).bind(Y.Types.remove,n),t(this._stops)}}};function Bg(){this._flagStops=!0}function Tg(e){let t=e.length;for(;t--;)e[t].bind(Y.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function Eg(e){let t=e.length;for(;t--;)e[t].unbind(Y.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}var Ki=class extends Ue{constructor(e,t,n,r,s){super(s),w(this,"_flagEndPoints",!1),w(this,"_left",null),w(this,"_right",null);for(let o in ol)Object.defineProperty(this,o,ol[o]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=$g.bind(this),this.left=new Z,this.right=new Z,typeof e=="number"&&(this.left.x=e),typeof t=="number"&&(this.left.y=t),typeof n=="number"&&(this.right.x=n),typeof r=="number"&&(this.right.y=r)}static fromObject(e){const t=new Ki().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ki.Properties.length;t++){const n=Ki.Properties[t];n in e&&(this[n]=e[n]instanceof Z?e[n]:new Z().copy(e[n]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Ki(this.left._x,this.left._y,this.right._x,this.right._y,t);return ae.each(Ue.Properties,function(r){n[r]=this[r]},this),e&&e.add(n),n}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(Y.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}},Ie=Ki;w(Ie,"Stop",Jt),w(Ie,"Properties",["left","right"]);var ol={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof Z&&this._left.unbind(Y.Types.change,this._renderer.flagEndPoints),this._left=e,this._left.bind(Y.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(e){this._right instanceof Z&&this._right.unbind(Y.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(Y.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function $g(){this._flagEndPoints=!0}var Xn=class extends Ue{constructor(e,t,n,r,s,o){super(r),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 a in al)Object.defineProperty(this,a,al[a]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Ng.bind(this),this._renderer.flagFocal=Rg.bind(this),this.center=new Z,this.radius=typeof n=="number"?n:1,this.focal=new Z,typeof e=="number"&&(this.center.x=e),typeof t=="number"&&(this.center.y=t),this.focal.copy(this.center),typeof s=="number"&&(this.focal.x=s),typeof o=="number"&&(this.focal.y=o)}static fromObject(e){const t=new Xn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Xn.Properties.length;t++){const n=Xn.Properties[t];n in e&&(/(center|focal)i/.test(n)?this[n]=e[n]instanceof Z?e[n]:new Z().copy(e[n]):typeof e[n]=="number"&&(this[n]=e[MediaKeySystemAccess]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Xn(this.center._x,this.center._y,this._radius,t,this.focal._x,this.focal._y);return ae.each(Ue.Properties.concat(Xn.Properties),function(r){n[r]=this[r]},this),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return ae.each(Xn.Properties,function(t){e[t]=this[t]},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(Y.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}},Ve=Xn;w(Ve,"Stop",Jt),w(Ve,"Properties",["center","radius","focal"]);var al={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(e){this._center&&this._center.unbind(Y.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(Y.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(Y.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(Y.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Ng(){this._flagCenter=!0}function Rg(){this._flagFocal=!0}function ll(e,t){if(t===0||t===1)return!0;const r=e._length*t;let s=0;for(let o=0;o<e._lengths.length;o++){const a=e._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Rr(e,t){const n=e._length;if(t<=0)return 0;if(t>=n)return e._lengths.length-1;for(let r=0,s=0;r<e._lengths.length;r++){if(s+e._lengths[r]>=t)return t-=s,Math.max(r-1,0)+t/e._lengths[r];s+=e._lengths[r]}return-1}function cl(e,t,n){let r,s,o,a,l,c,d,h;const f=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(f||t).x,c=(f||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,f&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Ua(r,l,s,c,o,d,a,h,n)}function dl(e,t,n){let r,s,o,a,l,c,d,h;const f=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(f||t).x,c=(f||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,f&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Ps(r,l,s,c,o,d,a,h,n)}function qn(e){switch(e.renderer.type){case"texture":return Be.fromObject(e);case"gradient":return Ue.fromObject(e);case"linear-gradient":return Ie.fromObject(e);case"radial-gradient":return Ve.fromObject(e)}return e}var Pg=Math.cos,Fg=Math.sin,hl=Math.tan,As=[],It=class extends Y{constructor(e,t,n,r,s,o){super(),w(this,"elements",new Zt(9)),w(this,"manual",!1);let a=e;Array.isArray(a)||(a=Array.prototype.slice.call(arguments)),this.identity(),a.length>0&&this.set(a)}static Multiply(e,t,n){if(t.length<=3){const v=e;let B,k,E;const P=t[0]||0,R=t[1]||0,j=t[2]||0;return B=v[0]*P+v[1]*R+v[2]*j,k=v[3]*P+v[4]*R+v[5]*j,E=v[6]*P+v[7]*R+v[8]*j,[B,k,E]}const r=e[0],s=e[1],o=e[2],a=e[3],l=e[4],c=e[5],d=e[6],h=e[7],f=e[8],p=t[0],u=t[1],g=t[2],m=t[3],_=t[4],y=t[5],b=t[6],S=t[7],C=t[8];return n=n||new Zt(9),n[0]=r*p+s*m+o*b,n[1]=r*u+s*_+o*S,n[2]=r*g+s*y+o*C,n[3]=a*p+l*m+c*b,n[4]=a*u+l*_+c*S,n[5]=a*g+l*y+c*C,n[6]=d*p+h*m+f*b,n[7]=d*u+h*_+f*S,n[8]=d*g+h*y+f*C,n}static fromObject(e){return new It().copy(e)}set(e,t,n,r,s,o,a,l,c){if(typeof t>"u"){const d=e;e=d[0],t=d[1],n=d[2],r=d[3],s=d[4],o=d[5],a=d[6],l=d[7],c=d[8]}return this.elements[0]=e,this.elements[1]=t,this.elements[2]=n,this.elements[3]=r,this.elements[4]=s,this.elements[5]=o,this.elements[6]=a,this.elements[7]=l,this.elements[8]=c,this.trigger(Y.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(Y.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(Y.Types.change)}multiply(e,t,n,r,s,o,a,l,c){if(typeof t>"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(Y.Types.change);if(typeof n>"u"&&(n=1),typeof r>"u"){e=e||0,t=t||0,n=n||0,s=this.elements;const M=s[0]*e+s[1]*t+s[2]*n,A=s[3]*e+s[4]*t+s[5]*n,$=s[6]*e+s[7]*t+s[8]*n;return[M,A,$]}const d=this.elements,h=[e,t,n,r,s,o,a,l,c],f=d[0],p=d[1],u=d[2],g=d[3],m=d[4],_=d[5],y=d[6],b=d[7],S=d[8],C=h[0],v=h[1],B=h[2],k=h[3],E=h[4],P=h[5],R=h[6],j=h[7],q=h[8];return this.elements[0]=f*C+p*k+u*R,this.elements[1]=f*v+p*E+u*j,this.elements[2]=f*B+p*P+u*q,this.elements[3]=g*C+m*k+_*R,this.elements[4]=g*v+m*E+_*j,this.elements[5]=g*B+m*P+_*q,this.elements[6]=y*C+b*k+S*R,this.elements[7]=y*v+b*E+S*j,this.elements[8]=y*B+b*P+S*q,this.trigger(Y.Types.change)}inverse(e){const t=this.elements;e=e||new It;const n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],l=t[5],c=t[6],d=t[7],h=t[8],f=h*a-l*d,p=-h*o+l*c,u=d*o-a*c;let g=n*f+r*p+s*u;return g?(g=1/g,e.elements[0]=f*g,e.elements[1]=(-h*r+s*d)*g,e.elements[2]=(l*r-s*a)*g,e.elements[3]=p*g,e.elements[4]=(h*n-s*c)*g,e.elements[5]=(-l*n+s*o)*g,e.elements[6]=u*g,e.elements[7]=(-d*n+r*c)*g,e.elements[8]=(a*n-r*o)*g,e):null}scale(e,t){return arguments.length<=1&&(t=e),this.multiply(e,0,0,0,t,0,0,0,1)}rotate(e){const t=Pg(e),n=Fg(e);return this.multiply(t,-n,0,n,t,0,0,0,1)}translate(e,t){return this.multiply(1,0,e,0,1,t,0,0,1)}skewX(e){const t=hl(e);return this.multiply(1,t,0,0,1,0,0,0,1)}skewY(e){const t=hl(e);return this.multiply(1,0,0,t,1,0,0,0,1)}toString(e){return As.length=0,this.toTransformArray(e,As),As.map(Ne).join(" ")}toTransformArray(e,t){const n=this.elements,r=!!t,s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],d=n[5];if(e){const h=n[6],f=n[7],p=n[8];if(r){t[0]=s,t[1]=l,t[2]=h,t[3]=o,t[4]=c,t[5]=f,t[6]=a,t[7]=d,t[8]=p;return}return[s,l,h,o,c,f,a,d,p]}if(r){t[0]=s,t[1]=l,t[2]=o,t[3]=c,t[4]=a,t[5]=d;return}return[s,l,o,c,a,d]}toArray(e,t){const n=this.elements,r=!!t,s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],d=n[5];if(e){const h=n[6],f=n[7],p=n[8];if(r){t[0]=s,t[1]=o,t[2]=a,t[3]=l,t[4]=c,t[5]=d,t[6]=h,t[7]=f,t[8]=p;return}return[s,o,a,l,c,d,h,f,p]}if(r){t[0]=s,t[1]=o,t[2]=a,t[3]=l,t[4]=c,t[5]=d;return}return[s,o,a,l,c,d]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new It().copy(this)}},Yn=It;w(Yn,"Identity",[1,0,0,0,1,0,0,0,1]),Wa(Yn);var Is=class extends Wn{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 Pr)Object.defineProperty(this,e,Pr[e]);this._renderer.flagMatrix=ul.bind(this),this.isShape=!0,this.matrix=new Yn,this.worldMatrix=new Yn,this.position=new Z,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const t=new Is().copy(e);return"id"in e&&(t.id=e.id),t}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return Pr.position.get.apply(this,arguments)}set translation(e){Pr.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 Z?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 Z?e.scale:new Z(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 t=new Is;return t.position.copy(this.position),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._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 Z?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 Z?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}},fn=Is;w(fn,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Pr={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(Y.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(Y.Types.change,this._renderer.flagMatrix),ul.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(e){this._rotation=e,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof Z&&this._scale.unbind(Y.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof Z&&this._scale.bind(Y.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(e){this._skewX=e,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(e){this._skewY=e,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(e){this._matrix=e,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return ja(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function ul(){this._flagMatrix=!0}var Si=Math.min,Bi=Math.max,Mg=Math.ceil,Ag=Math.floor,Ig=new Z,$n=class extends fn{constructor(e,t,n,r){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,"_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);for(let s in fl)Object.defineProperty(this,s,fl[s]);this._renderer.type="path",this._renderer.flagVertices=pl.bind(this),this._renderer.bindVertices=gl.bind(this),this._renderer.unbindVertices=ml.bind(this),this._renderer.flagFill=_l.bind(this),this._renderer.flagStroke=yl.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!t,this.curved=!!n,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=!r,this.dashes=[],this.dashes.offset=0}static fromObject(e){const t=typeof e.fill=="string"?e.fill:qn(e.fill),n=typeof e.stroke=="string"?e.stroke:qn(e.stroke),r=new $n().copy(Ns($s({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e),this.vertices=[];for(let t=0;t<e.vertices.length;t++){const n=e.vertices[t];n instanceof ve?this.vertices.push(e.vertices[t].clone()):this.vertices.push(new ve().copy(n))}for(let t=0;t<$n.Properties.length;t++){const n=$n.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new $n;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<$n.Properties.length;n++){const r=$n.Properties[n];t[r]=this[r]}return t.className=this.className,t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(t=>t.toObject()),ae.each($n.Properties,t=>{typeof this[t]<"u"&&(this[t].toObject?e[t]=this[t].toObject():e[t]=this[t])},this),e}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),t=e.width/2,n=e.height/2,r=e.left+e.width/2,s=e.top+e.height/2;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s,a.x+=t,a.y+=n}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.x+=t,this.mask.translation.y-=s,this.mask.translation.y+=n),this}center(){const e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let r=0;r<this.vertices.length;r++){const s=this.vertices[r];s.x-=t,s.y-=n}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getBoundingClientRect(e){let t,n,r,s,o,a,l=1/0,c=-1/0,d=1/0,h=-1/0;if(this._update(!0),t=e?this.matrix:this.worldMatrix,n=(this.linewidth||0)/2,r=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:f,scaleY:p}=ki(t.elements[0],t.elements[3],t.elements[1],t.elements[4],t.elements[2],t.elements[5]);typeof f=="number"&&typeof p=="number"&&(n=Math.max(f,p)*(this.linewidth||0)/2)}else n*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(r<=0)return{width:0,height:0};for(s=0;s<r;s++){a=this._renderer.vertices[s],o=this._renderer.vertices[(s+r-1)%r];const[f,p]=t.multiply(o.x,o.y),[u,g]=t.multiply(a.x,a.y);if(o.controls&&a.controls){let m=o.controls.right.x,_=o.controls.right.y;o.relative&&(m+=o.x,_+=o.y);let[y,b]=t.multiply(m,_),S=a.controls.left.x,C=a.controls.left.y;a.relative&&(S+=a.x,C+=a.y);let[v,B]=t.multiply(S,C);const k=Ga(f,p,y,b,v,B,u,g);d=Si(k.min.y-n,d),l=Si(k.min.x-n,l),c=Bi(k.max.x+n,c),h=Bi(k.max.y+n,h)}else s<=1&&(d=Si(p-n,d),l=Si(f-n,l),c=Bi(f+n,c),h=Bi(p+n,h)),d=Si(g-n,d),l=Si(u-n,l),c=Bi(u+n,c),h=Bi(g+n,h)}return{top:d,left:l,right:c,bottom:h,width:c-l,height:h-d}}getPointAt(e,t){let n,r,s,o,a,l,c,d,h,f,p,u,g,m,_,y=this.length*Math.min(Math.max(e,0),1);const b=this.vertices.length,S=b-1;let C=null,v=null;for(let X=0,F=this._lengths.length,N=0;X<F;X++){if(N+this._lengths[X]>=y){this._closed?(n=Mt(X,b),r=Mt(X-1,b),X===0&&(n=r,r=X)):(n=X,r=Math.min(Math.max(X-1,0),S)),C=this.vertices[n],v=this.vertices[r],y-=N,this._lengths[X]!==0?e=y/this._lengths[X]:e=0;break}N+=this._lengths[X]}if(C===null||v===null)return null;if(C){if(!v)return C}else return v;_=v.controls&&v.controls.right,m=C.controls&&C.controls.left,a=v.x,f=v.y,l=(_||v).x,p=(_||v).y,c=(m||C).x,u=(m||C).y,d=C.x,g=C.y,_&&v.relative&&(l+=v.x,p+=v.y),m&&C.relative&&(c+=C.x,u+=C.y),o=Gi(e,a,l,c,d),h=Gi(e,f,p,u,g);const B=Ft(a,l,e),k=Ft(f,p,e),E=Ft(l,c,e),P=Ft(p,u,e),R=Ft(c,d,e),j=Ft(u,g,e),q=Ft(B,E,e),M=Ft(k,P,e),A=Ft(E,R,e),$=Ft(P,j,e);return ae.isObject(t)?(t.x=o,t.y=h,t instanceof ve&&(t.controls.left.x=q,t.controls.left.y=M,t.controls.right.x=A,t.controls.right.y=$,(typeof t.relative!="boolean"||t.relative)&&(t.controls.left.x-=o,t.controls.left.y-=h,t.controls.right.x-=o,t.controls.right.y-=h)),t.t=e,t):(s=new ve(o,h,q-o,M-h,A-o,$-h,this._curved?ee.curve:ee.line),s.t=e,s)}plot(){if(this.curved)return Za(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?ee.move:ee.line;return this}subdivide(e){this._update();const t=this.vertices.length-1,n=this._closed||this.vertices[t]._command===ee.close;let r=this.vertices[t],s=[],o;return ae.each(this.vertices,function(a,l){if(l<=0&&!n){r=a;return}if(a.command===ee.move){s.push(new ve(r.x,r.y)),l>0&&(s[s.length-1].command=ee.line),r=a;return}o=dl(a,r,e),s=s.concat(o),ae.each(o,function(c,d){d<=0&&r.command===ee.move?c.command=ee.move:c.command=ee.line}),l>=t&&(this._closed&&this._automatic&&(r=a,o=dl(a,r,e),s=s.concat(o),ae.each(o,function(c,d){d<=0&&r.command===ee.move?c.command=ee.move:c.command=ee.line})),s.push(new ve(a.x,a.y)),s[s.length-1].command=n?ee.close:ee.line),r=a},this),this._automatic=!1,this._curved=!1,this.vertices=s,this}_updateLength(e,t){t||this._update();const r=this.vertices.length-1;let s=this.vertices[r],o=0;return typeof this._lengths>"u"&&(this._lengths=[]),ae.each(this.vertices,function(a,l){if(l<=0||a.command===ee.move){s=a,this._lengths[l]=0;return}this._lengths[l]=cl(a,s,e),o+=this._lengths[l],s=a},this),this._length=o,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,t=this._closed,n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=Rr(this,n*this._length),o=Rr(this,r*this._length),a=Mg(s),l=Ag(o);let c,d,h,f,p,u;for(this._renderer.vertices.length=0,u=0;u<e;u++)this._renderer.collection.length<=u&&this._renderer.collection.push(new ve),u>l&&!d?(p=this._renderer.collection[u].copy(this._collection[u]),this.getPointAt(r,p),p.command=this._renderer.collection[u].command,this._renderer.vertices.push(p),d=p,h=this._collection[u-1],h&&h.controls&&(p.relative?p.controls.right.clear():p.controls.right.copy(p),h.relative?this._renderer.collection[u-1].controls.right.copy(h.controls.right).lerp(Z.zero,1-p.t):this._renderer.collection[u-1].controls.right.copy(h.controls.right).lerp(h,1-p.t))):u>=a&&u<=l&&(p=this._renderer.collection[u].copy(this._collection[u]),this._renderer.vertices.push(p),u===l&&ll(this,r)?(d=p,!t&&d.controls&&(d.relative?d.controls.right.clear():d.controls.right.copy(d))):u===a&&ll(this,n)&&(c=p,c.command=ee.move,!t&&c.controls&&(c.relative?c.controls.left.clear():c.controls.left.copy(c))));a>0&&!c&&(u=a-1,p=this._renderer.collection[u].copy(this._collection[u]),this.getPointAt(n,p),p.command=ee.move,this._renderer.vertices.unshift(p),f=this._collection[u+1],f&&f.controls&&(p.controls.left.clear(),f.relative?this._renderer.collection[u+1].controls.left.copy(f.controls.left).lerp(Z.zero,p.t):(Ig.copy(f),this._renderer.collection[u+1].controls.left.copy(f.controls.left).lerp(f,p.t))))}return fn.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=!1,fn.prototype.flagReset.call(this),this}},xe=$n;w(xe,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),w(xe,"Utils",{getCurveLength:cl});var fl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&this._stroke.bind(Y.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(e){this._closed=!!e,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=!!e,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){if(e===this._automatic)return;this._automatic=!!e;const t=this._automatic?"ignore":"listen";ae.each(this.vertices,function(n){n[t]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Y.Types.insert,t).unbind(Y.Types.remove,n),e instanceof En?this._collection=e:this._collection=new En(e||[]),this._collection.bind(Y.Types.insert,t).bind(Y.Types.remove,n),t(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function pl(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function gl(e){let t=e.length;for(;t--;)e[t].bind(Y.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function ml(e){let t=e.length;for(;t--;)e[t].unbind(Y.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function _l(){this._flagFill=!0}function yl(){this._flagStroke=!0}var Zi=class extends xe{constructor(e,t,n,r){const s=[new ve,new ve,new ve,new ve];super(s,!0,!1,!0),w(this,"_flagWidth",0),w(this,"_flagHeight",0),w(this,"_width",0),w(this,"_height",0),w(this,"_origin",null),this._renderer.type="rectangle";for(let o in bl)Object.defineProperty(this,o,bl[o]);this.width=typeof n=="number"?n:1,this.height=typeof r=="number"?r:1,this.origin=new Z,typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t),this._update()}static fromObject(e){const t=new Zi().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Zi.Properties.length;t++){const n=Zi.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,t=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new ve),this.vertices[0].set(-e,-t).sub(this._origin).command=ee.move,this.vertices[1].set(e,-t).sub(this._origin).command=ee.line,this.vertices[2].set(e,t).sub(this._origin).command=ee.line,this.vertices[3].set(-e,t).sub(this._origin).command=ee.line,this.vertices[4]&&(this.vertices[4].set(-e,-t).sub(this._origin).command=ee.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=new Zi(0,0,this.width,this.height);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}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}},Nn=Zi;w(Nn,"Properties",["width","height"]);var bl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(Y.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(Y.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Ji=class extends Nn{constructor(e,t,n,r,s,o){super(t,n,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);for(let a in wl)Object.defineProperty(this,a,wl[a]);this.noStroke(),this.noFill(),e instanceof Be?this.texture=e:typeof e=="string"&&(this.texture=new Be(e)),this.origin=new Z,this._update(),typeof r=="number"&&(this.columns=r),typeof s=="number"&&(this.rows=s),typeof o=="number"&&(this.frameRate=o),this.index=0}static fromObject(e){const t=new Ji().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ji.Properties.length;t++){const n=Ji.Properties[t];n in e&&(this[n]=e[n])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=ae.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof t=="number"&&(this._lastFrame=t),typeof n=="function"?this._onLastFrame=n: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 t=new Ji(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&t.play(this._firstFrame,this._lastFrame),t.loop=this.loop,t.firstFrame=this.firstFrame,t.lastFrame=this.lastFrame,e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return 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}_update(){const e=this._texture,t=this._columns,n=this._rows;let r,s,o,a,l,c,d,h,f;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)){d=e.image.width,h=e.image.height,r=d/t,s=h/n,a=this._amount,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s),this._playing&&this._frameRate>0&&(ae.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=ae.performance.now()-this._startTime,f=this._lastFrame+1,l=1e3*(f-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),c=Ft(this._firstFrame,f,o/l),c=Math.floor(c),c!==this._index&&(this._index=c,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const p=this._index%t,u=Math.floor(this._index/t),g=-r*p+(d-r)/2,m=-s*u+(h-s)/2;g!==e.offset.x&&(e.offset.x=g),m!==e.offset.y&&(e.offset.y=m)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}},Fr=Ji;w(Fr,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var wl={texture:{enumerable:!0,get:function(){return this._texture},set:function(e){this._texture=e,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(e){this._columns=e,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(e){this._rows=e,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}},Vs,vl=class extends En{constructor(t){t=Array.isArray(t)?t:Array.prototype.slice.call(arguments),super(t),za(this,Vs,{}),this.attach(t),this.on(Y.Types.insert,this.attach),this.on(Y.Types.remove,this.detach)}get ids(){return Et(this,Vs)}attach(t){for(let n=0;n<t.length;n++){const r=t[n];r&&r.id&&(this.ids[r.id]=r)}return this}detach(t){for(let n=0;n<t.length;n++)delete this.ids[t[n].id];return this}};Vs=new WeakMap;var Un=class extends xe{constructor(e,t,n,r,s,o,a){const l=a||kt.Resolution*3,c=[];for(let d=0;d<l;d++)c.push(new ve);super(c,!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",ht),w(this,"_innerRadius",0),w(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let d in kl)Object.defineProperty(this,d,kl[d]);typeof n=="number"&&(this.innerRadius=n),typeof r=="number"&&(this.outerRadius=r),typeof s=="number"&&(this.startAngle=s),typeof o=="number"&&(this.endAngle=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Un().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Un.Properties.length;t++){const n=Un.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,t=this._endAngle,n=this._innerRadius,r=this._outerRadius,s=Mt(e,ht)===Mt(t,ht),o=n>0,a=this.vertices;let l=o?a.length/2:a.length,c,d=0,h,f,p,u,g,m,_,y,b;for(s?l--:o||(l-=2),h=0,f=l-1;h<l;h++){switch(p=h/f,u=a[d],g=p*(t-e)+e,m=(t-e)/l,_=r*Math.cos(g),y=r*Math.sin(g),h){case 0:c=ee.move;break;default:c=ee.curve}u.command=c,u.x=_,u.y=y,u.controls.left.clear(),u.controls.right.clear(),u.command===ee.curve&&(b=r*m/Math.PI,u.controls.left.x=b*Math.cos(g-Je),u.controls.left.y=b*Math.sin(g-Je),u.controls.right.x=b*Math.cos(g+Je),u.controls.right.y=b*Math.sin(g+Je),h===1&&u.controls.left.multiplyScalar(2),h===f&&u.controls.right.multiplyScalar(2)),d++}if(o){for(s?(a[d].command=ee.close,d++):(l--,f=l-1),h=0;h<l;h++)p=h/f,u=a[d],g=(1-p)*(t-e)+e,m=(t-e)/l,_=n*Math.cos(g),y=n*Math.sin(g),c=ee.curve,h<=0&&(c=s?ee.move:ee.line),u.command=c,u.x=_,u.y=y,u.controls.left.clear(),u.controls.right.clear(),u.command===ee.curve&&(b=n*m/Math.PI,u.controls.left.x=b*Math.cos(g+Je),u.controls.left.y=b*Math.sin(g+Je),u.controls.right.x=b*Math.cos(g-Je),u.controls.right.y=b*Math.sin(g-Je),h===1&&u.controls.left.multiplyScalar(2),h===f&&u.controls.right.multiplyScalar(2)),d++;a[d].copy(a[0]),a[d].command=ee.line}else s||(a[d].command=ee.line,a[d].x=0,a[d].y=0,d++,a[d].copy(a[0]),a[d].command=ee.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 t=this.innerRadius,n=this.outerRadius,r=this.startAngle,s=this.endAngle,o=this.vertices.length,a=new Un(0,0,t,n,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<xe.Properties.length;l++){const c=xe.Properties[l];a[c]=this[c]}return e&&e.add(a),a}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let t=0;t<Un.Properties.length;t++){const n=Un.Properties[t];e[n]=this[n]}return e}},Mr=Un;w(Mr,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var kl={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}}},Os=Math.cos,zs=Math.sin,Gn=class extends xe{constructor(e,t,n,r){const s=r?Math.max(r,2):4,o=[];for(let a=0;a<s;a++)o.push(new ve(0,0,0,0,0,0));super(o,!0,!0,!0),w(this,"_flagRadius",!1),w(this,"_radius",0),this._renderer.type="circle";for(let a in xl)Object.defineProperty(this,a,xl[a]);typeof n=="number"&&(this.radius=n),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Gn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Gn.Properties.length;t++){const n=Gn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const t=4/3*Math.tan(Math.PI/(e*2)),n=this._radius,r=n*t;for(let s=0;s<this.vertices.length;s++){const a=s/e*ht,l=n*Os(a),c=n*zs(a),d=r*Os(a-Je),h=r*zs(a-Je),f=r*Os(a+Je),p=r*zs(a+Je),u=this.vertices[s];u.command=s===0?ee.move:ee.curve,u.set(l,c),u.controls.left.set(d,h),u.controls.right.set(f,p)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const t=new Gn(0,0,this.radius,this.vertices.length);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let t=0;t<Gn.Properties.length;t++){const n=Gn.Properties[t];e[n]=this[n]}return e}},Qi=Gn;w(Qi,"Properties",["radius"]);var xl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Ls=Math.cos,Ds=Math.sin,Kn=class extends xe{constructor(e,t,n,r,s){typeof r!="number"&&typeof n=="number"&&(r=n);const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new ve);super(a,!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 l in Cl)Object.defineProperty(this,l,Cl[l]);typeof n=="number"&&(this.width=n*2),typeof r=="number"&&(this.height=r*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Kn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Kn.Properties.length;t++){const n=Kn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const t=4/3*Math.tan(Math.PI/(this.vertices.length*2)),n=this._width/2,r=this._height/2;for(let s=0;s<this.vertices.length;s++){const a=s/e*ht,l=n*Ls(a),c=r*Ds(a),d=n*t*Ls(a-Je),h=r*t*Ds(a-Je),f=n*t*Ls(a+Je),p=r*t*Ds(a+Je),u=this.vertices[s];u.command=s===0?ee.move:ee.curve,u.set(l,c),u.controls.left.set(d,h),u.controls.right.set(f,p)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=this.width/2,n=this.height/2,r=this.vertices.length,s=new Kn(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let t=0;t<Kn.Properties.length;t++){const n=Kn.Properties[t];e[n]=this[n]}return e}},er=Kn;w(er,"Properties",["width","height"]);var Cl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},Vg=Math.ceil,Og=Math.floor,Rn=class extends fn{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,"_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,"noFill",xe.prototype.noFill),w(this,"noStroke",xe.prototype.noStroke),w(this,"corner",xe.prototype.corner),w(this,"center",xe.prototype.center),w(this,"getBoundingClientRect",xe.prototype.getBoundingClientRect),w(this,"_updateLength",xe.prototype._updateLength);for(let t in Sl)Object.defineProperty(this,t,Sl[t]);this._renderer.type="points",this._renderer.flagVertices=pl.bind(this),this._renderer.bindVertices=gl.bind(this),this._renderer.unbindVertices=ml.bind(this),this._renderer.flagFill=_l.bind(this),this._renderer.flagStroke=yl.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 t=typeof e.fill=="string"?e.fill:qn(e.fill),n=typeof e.stroke=="string"?e.stroke:qn(e.stroke),r=new Rn().copy(Ns($s({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e);for(let t=0;t<e.vertices.length;t++){const n=e.vertices[t];n instanceof ve?this.vertices.push(e.vertices[t].clone()):this.vertices.push(new ve().copy(n))}for(let t=0;t<Rn.Properties.length;t++){const n=Rn.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Rn;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<Rn.Properties.length;n++){const r=Rn.Properties[n];t[r]=this[r]}return t.className=this.className,t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(t=>t.toObject()),ae.each(Rn.Properties,function(t){typeof this[t]<"u"&&(this[t].toObject?e[t]=this[t].toObject():e[t]=this[t])},this),e}subdivide(e){this._update();let t=[];for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n],s=this.vertices[n-1];if(!s)continue;const o=r.x,a=r.y,l=s.x,c=s.y,d=Ps(o,a,o,a,l,c,l,c,e);t=t.concat(d)}return this.vertices=t,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),t=Math.max(this._beginning,this._ending),n=Rr(this,e*this._length),r=Rr(this,t*this._length),s=Vg(n),o=Og(r);let a=0,l;this._renderer.vertices=[],this._renderer.collection=[];for(let c=0;c<this._collection.length;c++)c>=s&&c<=o&&(l=this._collection[c],this._renderer.collection.push(l),this._renderer.vertices[a*2+0]=l.x,this._renderer.vertices[a*2+1]=l.y,a++)}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}},Ar=Rn;w(Ar,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);var Sl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&this._stroke.bind(Y.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(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Y.Types.insert,t).unbind(Y.Types.remove,n),e instanceof En?this._collection=e:this._collection=new En(e||[]),this._collection.bind(Y.Types.insert,t).bind(Y.Types.remove,n),t(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}},zg=Math.cos,Lg=Math.sin,Zn=class extends xe{constructor(e,t,n,r){r=Math.max(r||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 s in Bl)Object.defineProperty(this,s,Bl[s]);this.closed=!0,this.automatic=!1,typeof n=="number"&&(this.radius=n),typeof r=="number"&&(this.sides=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Zn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Zn.Properties.length;t++){const n=Zn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,t=e+1;let n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){const s=(r+.5)/e,o=ht*s+Math.PI/2,a=this._width*zg(o)/2,l=this._height*Lg(o)/2;r>=n?this.vertices.push(new ve(a,l)):this.vertices[r].set(a,l),this.vertices[r].command=r===0?ee.move:ee.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const t=new Zn(0,0,0,this.sides);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,t.width=this.width,t.height=this.height,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let t=0;t<Zn.Properties.length;t++){const n=Zn.Properties[t];e[n]=this[n]}return e}},Ir=Zn;w(Ir,"Properties",["width","height","sides"]);var Bl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},Jn=class extends xe{constructor(e,t,n,r,s){typeof s>"u"&&typeof n=="number"&&typeof r=="number"&&(s=Math.floor(Math.min(n,r)/12));const o=[];for(let a=0;a<10;a++)o.push(new ve(0,0,0,0,0,0,a===0?ee.move:ee.curve));super(o),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 a in Tl)Object.defineProperty(this,a,Tl[a]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Dg.bind(this),typeof n=="number"&&(this.width=n),typeof r=="number"&&(this.height=r),typeof s=="number"&&(this.radius=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Jn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Jn.Properties.length;t++){const n=Jn.Properties[t];if(n in e){const r=e[n];/radius/i.test(n)?this[n]=typeof r=="number"||r instanceof Z?r:new Z().copy(r):typeof r=="number"&&(this[n]=r)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,t=this._height;let n,r;this._radius instanceof Z?(n=this._radius.x,r=this._radius.y):(n=this._radius,r=this._radius);let s,o=e/2,a=t/2;s=this.vertices[0],s.x=-(o-n),s.y=-a,s=this.vertices[1],s.x=o-n,s.y=-a,s.controls.left.clear(),s.controls.right.x=n,s.controls.right.y=0,s=this.vertices[2],s.x=o,s.y=-(a-r),s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[3],s.x=o,s.y=a-r,s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=r,s=this.vertices[4],s.x=o-n,s.y=a,s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[5],s.x=-(o-n),s.y=a,s.controls.left.clear(),s.controls.right.x=-n,s.controls.right.y=0,s=this.vertices[6],s.x=-o,s.y=a-r,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[7],s.x=-o,s.y=-(a-r),s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=-r,s=this.vertices[8],s.x=-(o-n),s.y=-a,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[9],s.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 t=this.width,n=this.height,r=this.radius,s=new Jn(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let t=0;t<Jn.Properties.length;t++){const n=Jn.Properties[t];e[n]=this[n]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}},tr=Jn;w(tr,"Properties",["width","height","radius"]);var Tl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof Z&&this._radius.unbind(Y.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof Z&&this._radius.bind(Y.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Dg(){this._flagRadius=!0}var Hg=Math.cos,Wg=Math.sin,Qn=class extends xe{constructor(e,t,n,r,s){arguments.length<=3&&(r=n,n=r/2),(typeof s!="number"||s<=0)&&(s=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 o in El)Object.defineProperty(this,o,El[o]);this.closed=!0,this.automatic=!1,typeof n=="number"&&(this.innerRadius=n),typeof r=="number"&&(this.outerRadius=r),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Qn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Qn.Properties.length;t++){const n=Qn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,t=e+1;let n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){const s=(r+.5)/e,o=ht*s,a=(r%2?this._outerRadius:this._innerRadius)/2,l=a*Hg(o),c=a*Wg(o);r>=n?this.vertices.push(new ve(l,c)):this.vertices[r].set(l,c),this.vertices[r].command=r===0?ee.move:ee.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const t=this.innerRadius,n=this.outerRadius,r=this.sides,s=new Qn(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let t=0;t<Qn.Properties.length;t++){const n=Qn.Properties[t];e[n]=this[n]}return e}},Vr=Qn;w(Vr,"Properties",["innerRadius","outerRadius","sides"]);var El={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},Hs,$l=Math.min,Nl=Math.max;He.document&&(Hs=document.createElement("canvas"));var Vt=class extends fn{constructor(e,t,n,r){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,"_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);for(let s in Rl)Object.defineProperty(this,s,Rl[s]);if(this._renderer.type="text",this._renderer.flagFill=jg.bind(this),this._renderer.flagStroke=Xg.bind(this),this.value=e,typeof t=="number"&&(this.translation.x=t),typeof n=="number"&&(this.translation.y=n),this.dashes=[],this.dashes.offset=0,!ae.isObject(r))return this;for(let s=0;s<Vt.Properties.length;s++){const o=Vt.Properties[s];o in r&&(this[o]=r[o])}}static Measure(e){if(Hs){const t=Hs.getContext("2d");t.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const n=t.measureText(e.value,0,0),r=n.actualBoundingBoxDescent+n.actualBoundingBoxAscent;return{width:n.width,height:r}}else{const t=this.value.length*this.size*Vt.Ratio,n=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:t,height:n}}}static fromObject(e){const t=typeof e.fill=="string"?e.fill:qn(e.fill),n=typeof e.stroke=="string"?e.stroke:qn(e.stroke),r=new Vt().copy(Ns($s({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e);for(let t=0;t<Vt.Properties.length;t++){const n=Vt.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Vt(this.value);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale;for(let n=0;n<Vt.Properties.length;n++){const r=Vt.Properties[n];t[r]=this[r]}return this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let t=0;t<Vt.Properties.length;t++){const n=Vt.Properties[t];e[n]=this[n]}return e}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let t,n,r,s,o;this._update(!0),t=e?this.matrix:this.worldMatrix;const{width:a,height:l}=Vt.Measure(this),c=(this._linewidth||0)/2;switch(this.alignment){case"left":n=-c,r=a+c;break;case"right":n=-(a+c),r=c;break;default:n=-(a/2+c),r=a/2+c}switch(this.baseline){case"middle":s=-(l/2+c),o=l/2+c;break;default:s=-(l+c),o=c}const[d,h]=t.multiply(n,s),[f,p]=t.multiply(n,o),[u,g]=t.multiply(r,s),[m,_]=t.multiply(r,o);return s=$l(h,p,g,_),n=$l(d,f,u,m),r=Nl(d,f,u,m),o=Nl(h,p,g,_),{top:s,left:n,right:r,bottom:o,width:r-n,height:o-s}}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}},Lt=Vt;w(Lt,"Ratio",.6),w(Lt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);var Rl={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ue||this._fill instanceof Ie||this._fill instanceof Ve||this._fill instanceof Be)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ue||this._stroke instanceof Ie||this._stroke instanceof Ve||this._stroke instanceof Be)&&this._stroke.bind(Y.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function jg(){this._flagFill=!0}function Xg(){this._flagStroke=!0}var Or=Math.min,zr=Math.max,Ti=class extends fn{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);for(let t in Pl)Object.defineProperty(this,t,Pl[t]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let t=0;t<e.length;t++)Fl.call(this,e[t],this)}static RemoveChildren(e){for(let t=0;t<e.length;t++)Fl.call(this,e[t])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const t=new Ti;for(let r=0;r<Ti.Properties.length;r++){const s=Ti.Properties[r];s in e&&(/(fill|stroke)/i.test(s)?t[s]=typeof e[s]=="string"?e[s]:qn(e[s]):t[s]=e[s])}return"mask"in e&&(t.mask=n(e.mask)),"id"in e&&(t.id=e.id),t.children=e.children.map(n),t;function n(r){if(r&&r.renderer)switch(r.renderer.type){case"arc-segment":return Mr.fromObject(r);case"circle":return Qi.fromObject(r);case"ellipse":return er.fromObject(r);case"points":return Ar.fromObject(r);case"polygon":return Ir.fromObject(r);case"rectangle":return Nn.fromObject(r);case"rounded-rectangle":return tr.fromObject(r);case"star":return Vr.fromObject(r);case"path":return xe.fromObject(r);case"text":return Lt.fromObject(r);case"group":return Ti.fromObject(r);case"shape":return fn.fromObject(r);case"element":return Wn.fromObject(r)}return r}}copy(e){return super.copy.call(this,e),console.warn("Two.Group.copy is not supported yet."),this}clone(e){const t=new Ti,n=this.children.map(function(r){return r.clone()});return t.add(n),t.opacity=this.opacity,this.mask&&(t.mask=this.mask),t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.className=this.className,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._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,ae.each(this.children,(t,n)=>{e.children[n]=t.toObject()},this),e}corner(){const e=this.getBoundingClientRect(!0);for(let t=0;t<this.children.length;t++){const n=this.children[t];n.translation.x-=e.left,n.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),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let r=0;r<this.children.length;r++){const s=this.children[r];s.isShape&&(s.translation.x-=t,s.translation.y-=n)}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getById(e){let t=null;function n(r){if(r.id===e)return r;if(r.children){if(r.children.ids[e])return r.children.ids[e];for(let s=0;s<r.children.length;s++)if(t=n(r.children[s]),t)return t}return null}return n(this)}getByClassName(e){const t=[];function n(r){if(Array.prototype.indexOf.call(r.classList,e)>=0&&t.push(r),r.children)for(let s=0;s<r.children.length;s++){const o=r.children[s];n(o)}return t}return n(this)}getByType(e){const t=[];function n(r){if(r instanceof e&&t.push(r),r.children)for(let s=0;s<r.children.length;s++){const o=r.children[s];n(o)}return t}return n(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let t=0;t<e.length;t++){const n=e[t];if(!(n&&n.id))continue;const r=Array.prototype.indexOf.call(this.children,n);r>=0&&this.children.splice(r,1),this.children.push(n)}return this}remove(e){const t=arguments.length,n=this.parent;if(t<=0&&n)return n.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let r=0;r<e.length;r++){const s=e[r];if(!s||!this.children.ids[s.id])continue;const o=this.children.indexOf(s);o>=0&&this.children.splice(o,1)}return this}getBoundingClientRect(e){let t,n,r,s,o,a;this._update(!0);let l=1/0,c=-1/0,d=1/0,h=-1/0;const f=/texture|gradient/i;n=e?this.matrix:this.worldMatrix;for(let p=0;p<this.children.length;p++){const u=this.children[p];if(!(!u.visible||f.test(u._renderer.type))&&(t=u.getBoundingClientRect(e),r=typeof t.top!="number"||ae.isNaN(t.top)||!isFinite(t.top),s=typeof t.left!="number"||ae.isNaN(t.left)||!isFinite(t.left),o=typeof t.right!="number"||ae.isNaN(t.right)||!isFinite(t.right),a=typeof t.bottom!="number"||ae.isNaN(t.bottom)||!isFinite(t.bottom),!(r||s||o||a)))if(e){const[g,m]=n.multiply(t.left,t.top),[_,y]=n.multiply(t.right,t.top),[b,S]=n.multiply(t.left,t.bottom),[C,v]=n.multiply(t.right,t.bottom);d=Or(m,y,S,v,d),l=Or(g,_,b,C,l),c=zr(g,_,b,C,c),h=zr(m,y,S,v,h)}else d=Or(t.top,d),l=Or(t.left,l),c=zr(t.right,c),h=zr(t.bottom,h)}return{top:d,left:l,right:c,bottom:h,width:c-l,height:h-d}}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(t){t.subdivide.apply(t,e)}),this}_update(){let e,t,n;if(this._flagBeginning||this._flagEnding){const r=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),o=this.length;let a=0;const l=r*o,c=s*o;for(e=0;e<this.children.length;e++)n=this.children[e],t=n.length,l>a+t?(n.beginning=1,n.ending=1):c<a?(n.beginning=0,n.ending=0):l>a&&l<a+t?(n.beginning=(l-a)/t,n.ending=1):c>a&&c<a+t?(n.beginning=0,n.ending=(c-a)/t):(n.beginning=0,n.ending=1),a+=t}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}},Ze=Ti;w(Ze,"Children",vl),w(Ze,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var Pl={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){const t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){const t=Ze.InsertChildren.bind(this),n=Ze.RemoveChildren.bind(this),r=Ze.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new vl(e),this._children.bind(Y.Types.insert,t),this._children.bind(Y.Types.remove,n),this._children.bind(Y.Types.order,r),e.length>0&&t(e)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}}};function Fl(e,t){const n=e.parent;let r;if(n===t){s();return}if(n&&n.children.ids[e.id]&&(r=Array.prototype.indexOf.call(n.children,e),n.children.splice(r,1),o()),t){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete e.parent;function s(){t.subtractions.length>0&&(r=Array.prototype.indexOf.call(t.subtractions,e),r>=0&&t.subtractions.splice(r,1)),t.additions.length>0&&(r=Array.prototype.indexOf.call(t.additions,e),r>=0&&t.additions.splice(r,1)),e.parent=t,t.additions.push(e),t._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,e),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,e),r<0&&(n.subtractions.push(e),n._flagSubtractions=!0)}}var Ws=class extends xe{constructor(t,n,r,s){const o=[new ve(t,n),new ve(r,s)];super(o);for(let a in Ml)Object.defineProperty(this,a,Ml[a]);this.vertices[0].command=ee.move,this.vertices[1].command=ee.line,this.automatic=!1}},Ml={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(ae.isObject(e))this.vertices.splice(0,1,e);else{const t=new $t("Two.Line.x argument is not an object.");console.warn(t.name,t.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(ae.isObject(e))this.vertices.splice(1,1,e);else{const t=new $t("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}},Qt={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},qg={start:"left",middle:"center",end:"right"},Al=["id","class","transform","xmlns","viewBox"],Yg=["x","y","width","height","href","xlink:href"];function Ug(e){return qg[e]}function Gg(e){const t=e.getAttribute("dominant-baseline"),n=e.getAttribute("alignment-baseline");return t||n}function nr(e){return e.replace(/svg:/gi,"").toLowerCase()}function Il(e,t){if(t.x+=e.translateX,t.y+=e.translateY,t.x*=e.scaleX,t.y*=e.scaleY,e.rotation!==0){const n=t.length();t.x=n*Math.cos(e.rotation),t.y=n*Math.sin(e.rotation)}}function Kg(e,t){t||(t={});const n=e.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,"");t[l]=c}return t}function Zg(e){const t={},n=Jg(e),r=Math.max(n.length,e.style.length);for(let s=0;s<r;s++){const o=e.style[s],a=n[s];o&&(t[o]=e.style[o]),a&&(t[a]=e.getAttribute(a))}return t}function Jg(e){const t=e.getAttributeNames();for(let n=0;n<Al.length;n++){const r=Al[n],s=Array.prototype.indexOf.call(t,r);s>=0&&t.splice(s,1)}return t}function Qg(e,t){const n=t.split(/[\s,]/),r=-parseFloat(n[0]),s=-parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&s)for(let f=0;f<e.children.length;f++){const p=e.children[f];"translation"in p?p.translation.add(r,s):"x"in p?p.x=r:"y"in p&&(p.y=s)}const l=typeof e.x=="number",c=typeof e.y=="number",d=typeof e.width=="number",h=typeof e.height=="number";return l&&(e.translation.x+=e.x),c&&(e.translation.y+=e.y),(d||h)&&(e.scale=new Z(1,1)),d&&(e.scale.x=e.width/o),h&&(e.scale.y=e.height/a),e.mask=new Nn(0,0,o,a),e.mask.origin.set(-o/2,-a/2),e}function Dt(e,t,n){const r={},s={},o={};let a,l,c,d,h,f,p,u,g,m,_,y,b,S,C,v,B;if(e===null)return r;if(He.getComputedStyle){const k=He.getComputedStyle(e);for(a=k.length;a--;)c=k[a],d=k[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<e.attributes.length;a++)f=e.attributes[a],/style/i.test(f.nodeName)?Kg(f.value,o):s[f.nodeName]=f.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&ae.defaults(r,n),ae.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=e.gradientTransform&&e.gradientTransform.baseVal&&e.gradientTransform.baseVal.length>0?e.gradientTransform.baseVal[0].matrix:e.getCTM?e.getCTM():null,l===null))break;switch(p=ki(l),t._renderer.type){case"linear-gradient":Il(p,t.left),Il(p,t.right);break;case"radial-gradient":t.center.x+=p.translateX,t.center.y+=p.translateY,t.focal.x+=p.translateX,t.focal.y+=p.translateY,t.radius*=Math.max(p.scaleX,p.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=e.transform&&e.transform.baseVal&&e.transform.baseVal.length>0?e.transform.baseVal[0].matrix:e.getCTM?e.getCTM():null,l===null))break;p=ki(l),t.translation.set(p.translateX,p.translateY),t.rotation=Math.PI*(p.rotation/180),t.scale=new Z(p.scaleX,p.scaleY),u=parseFloat((r.x+"").replace("px")),g=parseFloat((r.y+"").replace("px")),u&&(t.translation.x=u),g&&(t.translation.y=g);break;case"visible":if(t instanceof Ze){t._visible=d;break}t.visible=d;break;case"stroke-linecap":if(t instanceof Ze){t._cap=d;break}t.cap=d;break;case"stroke-linejoin":if(t instanceof Ze){t._join=d;break}t.join=d;break;case"stroke-miterlimit":if(t instanceof Ze){t._miter=d;break}t.miter=d;break;case"stroke-width":if(t instanceof Ze){t._linewidth=parseFloat(d);break}t.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(t instanceof Ze){t._opacity=parseFloat(d);break}t.opacity=parseFloat(d);break;case"clip-path":if(Qt.cssBackgroundImage.test(d)&&(m=d.replace(Qt.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(m)&&(y=ze.defs.current.get(m),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],b=nr(y.nodeName),t.mask=ze[b].call(this,y,{}),t._renderer.type){case"text":case"path":t.position.add(t.mask.position),t.mask.position.clear();break}break;case"fill":case"stroke":h=(t instanceof Ze?"_":"")+c,Qt.cssBackgroundImage.test(d)?(m=d.replace(Qt.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(m)?(y=ze.defs.current.get(m),y.object||(b=nr(y.nodeName),y.object=ze[b].call(this,y,{})),y=y.object):(_=tm(this),y=_.getById(m)),t[h]=y):t[h]=d;break;case"id":t.id=d;break;case"class":case"className":t.classList=d.split(" "),t._flagClassName=!0;break;case"x":case"y":if(S=t instanceof Ue,C=t instanceof Ie,v=t instanceof Ve,S||C||v)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new $t("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),t.translation[c]=parseFloat(d);break;case"font-family":t instanceof Lt&&(t.family=d);break;case"font-size":t instanceof Lt&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new $t("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),t.size=parseFloat(d));break;case"font-weight":t instanceof Lt&&(t.weight=d);break;case"font-style":t instanceof Lt&&(t.style=d);break;case"text-decoration":t instanceof Lt&&(t.decoration=d);break;case"line-height":t instanceof Lt&&(t.leading=d);break}return Object.keys(e.dataset).length&&(t.dataset=e.dataset),r}function em(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){const s=e.childNodes[n];!s.id||nr(e.nodeName)==="#text"||t.add(s.id,s)}}function tm(e){for(;e.parent;)e=e.parent;return e.scene}var ze={svg:function(e){const t=ze.defs.current=new $r,n=e.getElementsByTagName("defs");for(let g=0;g<n.length;g++)em(n[g],t);const r=ze.g.call(this,e),s=e.getAttribute("viewBox"),o=e.getAttribute("x"),a=e.getAttribute("y"),l=e.getAttribute("width"),c=e.getAttribute("height");r.defs=t;const d=s!==null,h=o!==null,f=a!==null,p=l!==null,u=c!==null;return h&&(r.x=parseFloat(o.replace(Qt.unitSuffix,""))),f&&(r.y=parseFloat(a.replace(Qt.unitSuffix,""))),p&&(r.width=parseFloat(l.replace(Qt.unitSuffix,""))),u&&(r.height=parseFloat(c.replace(Qt.unitSuffix,""))),d&&Qg(r,s),delete ze.defs.current,r},defs:function(e){return null},use:function(e,t){let n;const r=e.getAttribute("href")||e.getAttribute("xlink:href");if(!r)return n=new $t("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 $t("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<e.attributes.length;c++){const d=e.attributes[c],h=Yg.includes(d.nodeName),f=!a.hasAttribute(d.nodeName);(h||f)&&a.setAttribute(d.nodeName,d.value)}const l=nr(a.nodeName);return ze[l].call(this,a,t)},g:function(e,t){const n=new Ze;Dt.call(this,e,n,t),this.add(n);const r=Zg.call(this,e);for(let s=0,o=e.childNodes.length;s<o;s++){const a=e.childNodes[s],l=a.nodeName;if(!l)return;const c=nr(l);if(c in ze){const d=ze[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(e,t){let n;typeof e=="string"?n=e:n=e.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 xe(r,!0);return s.stroke="none",s.fill="black",Dt.call(this,e,s,t),s},polyline:function(e,t){const n=ze.polygon.call(this,e,t);return n.closed=!1,n},path:function(e,t){let n;typeof e=="string"?(n=e,e=null):n=e.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 f=h.length-1;ae.each(h.slice(0),function(p,u){const g=p.slice(1).trim().match(Qt.path),m=p[0],_=m.toLowerCase();let y,b,S,C,v;const B=[];switch(u===0&&(h=[]),_){case"h":case"v":g.length>1&&(y=1);break;case"m":case"l":case"t":g.length>2&&(y=2);break;case"s":case"q":g.length>4&&(y=4);break;case"c":g.length>6&&(y=6);break;case"a":g.length>7&&(y=7);break}if(y){for(b=0,S=g.length,v=0;b<S;b+=y){if(C=m,v>0)switch(m){case"m":C="l";break;case"M":C="L";break}B.push(C+g.slice(b,b+y).join(" ")),v++}h=Array.prototype.concat.apply(h,B)}else h.push(p)}),ae.each(h,function(p,u){let g,m,_;const y=p[0],b=y.toLowerCase();d=p.slice(1).trim().match(Qt.path),o=y===b;let S,C,v,B,k,E,P,R,j,q,M,A,$,X,F,N,W;switch(b){case"z":if(u>=f)s=!0;else{m=l.x,_=l.y,g=new ve(m,_,void 0,void 0,void 0,void 0,ee.close);for(let z=r.length-1;z>=0;z--){const G=r[z];if(/m/i.test(G.command)){l=G;break}}}break;case"m":case"l":c=void 0,m=parseFloat(d[0]),_=parseFloat(d[1]),g=new ve(m,_,void 0,void 0,void 0,void 0,/m/i.test(b)?ee.move:ee.line),o&&g.addSelf(l),l=g;break;case"h":case"v":q=/h/i.test(b)?"x":"y",M=/x/i.test(q)?"y":"x",g=new ve(void 0,void 0,void 0,void 0,void 0,void 0,ee.line),g[q]=parseFloat(d[0]),g[M]=l[M],o&&(g[q]+=l[q]),l=g;break;case"c":case"s":S=l.x,C=l.y,c||(c=new Z),/c/i.test(b)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[2]),E=parseFloat(d[3]),P=parseFloat(d[4]),R=parseFloat(d[5])):(j=Fs(l,c,o),v=j.x,B=j.y,k=parseFloat(d[0]),E=parseFloat(d[1]),P=parseFloat(d[2]),R=parseFloat(d[3])),o&&(v+=S,B+=C,k+=S,E+=C,P+=S,R+=C),l.controls.right.set(v-l.x,B-l.y),g=new ve(P,R,k-P,E-R,void 0,void 0,ee.curve),l=g,c=g.controls.left;break;case"t":case"q":S=l.x,C=l.y,c||(c=new Z),/q/i.test(b)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[0]),E=parseFloat(d[1]),P=parseFloat(d[2]),R=parseFloat(d[3])):(j=Fs(l,c,o),v=j.x,B=j.y,k=j.x,E=j.y,P=parseFloat(d[0]),R=parseFloat(d[1])),o&&(v+=S,B+=C,k+=S,E+=C,P+=S,R+=C),l.controls.right.set((v-l.x)*.33,(B-l.y)*.33),g=new ve(P,R,k-P,E-R,void 0,void 0,ee.curve),l=g,c=g.controls.left;break;case"a":S=l.x,C=l.y,$=parseFloat(d[0]),X=parseFloat(d[1]),F=parseFloat(d[2]),N=parseFloat(d[3]),W=parseFloat(d[4]),P=parseFloat(d[5]),R=parseFloat(d[6]),o&&(P+=S,R+=C),A=new ve(P,R),A.command=ee.arc,A.rx=$,A.ry=X,A.xAxisRotation=F,A.largeArcFlag=N,A.sweepFlag=W,g=A,l=A,c=void 0;break}g&&(Array.isArray(g)?r=r.concat(g):r.push(g))})}n=new xe(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},ae.each(n.vertices,function(l){l.subSelf(a.centroid)}),Dt.call(this,e,n,t),n.translation.addSelf(a.centroid),n},circle:function(e,t){const n=parseFloat(e.getAttribute("cx")),r=parseFloat(e.getAttribute("cy")),s=parseFloat(e.getAttribute("r")),o=new Qi(0,0,s);return o.stroke="none",o.fill="black",Dt.call(this,e,o,t),o.translation.x=n,o.translation.y=r,o},ellipse:function(e,t){const n=parseFloat(e.getAttribute("cx")),r=parseFloat(e.getAttribute("cy")),s=parseFloat(e.getAttribute("rx")),o=parseFloat(e.getAttribute("ry")),a=new er(0,0,s,o);return a.stroke="none",a.fill="black",Dt.call(this,e,a,t),a.translation.x=n,a.translation.y=r,a},rect:function(e,t){const n=parseFloat(e.getAttribute("rx")),r=parseFloat(e.getAttribute("ry"));if(!ae.isNaN(n)||!ae.isNaN(r))return ze["rounded-rect"](e);const s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new Nn(0,0,s,o);return c.stroke="none",c.fill="black",Dt.call(this,e,c,t),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(e,t){const n=parseFloat(e.getAttribute("rx"))||0,r=parseFloat(e.getAttribute("ry"))||0,s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new Z(n,r),d=new tr(0,0,s,o,c);return d.stroke="none",d.fill="black",Dt.call(this,e,d,t),d.translation.x+=a,d.translation.y+=l,d},line:function(e,t){const n=parseFloat(e.getAttribute("x1")),r=parseFloat(e.getAttribute("y1")),s=parseFloat(e.getAttribute("x2")),o=parseFloat(e.getAttribute("y2")),a=new Ws(n,r,s,o).noFill();return Dt.call(this,e,a,t),a},lineargradient:function(e,t){let n=e.getAttribute("gradientUnits"),r=e.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(e.getAttribute("x1")||0),o=parseFloat(e.getAttribute("y1")||0),a=parseFloat(e.getAttribute("x2")||0),l=parseFloat(e.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 p=0;p<e.children.length;p++){const u=e.children[p];let g=u.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let m=u.getAttribute("stop-color"),_=u.getAttribute("stop-opacity"),y=u.getAttribute("style"),b;m===null&&(b=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,m=b&&b.length>1?b[1]:void 0),_===null?(b=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,_=b&&b.length>1?parseFloat(b[1]):1):_=parseFloat(_),h.push(new Jt(g,m,_))}const f=new Ie(s,o,a,l,h);return f.spread=r,f.units=n,Dt.call(this,e,f,t),f},radialgradient:function(e,t){let n=e.getAttribute("gradientUnits"),r=e.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(e.getAttribute("cx"))||0,o=parseFloat(e.getAttribute("cy"))||0,a=parseFloat(e.getAttribute("r")),l=parseFloat(e.getAttribute("fx")),c=parseFloat(e.getAttribute("fy"));ae.isNaN(l)&&(l=s),ae.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 f=[];for(let u=0;u<e.children.length;u++){const g=e.children[u];let m=g.getAttribute("offset");/%/gi.test(m)&&(m=parseFloat(m.replace(/%/gi,""))/100),m=parseFloat(m);let _=g.getAttribute("stop-color"),y=g.getAttribute("stop-opacity"),b=g.getAttribute("style"),S;_===null&&(S=b?b.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,_=S&&S.length>1?S[1]:void 0),y===null?(S=b?b.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=S&&S.length>1?parseFloat(S[1]):1):y=parseFloat(y),f.push(new Jt(m,_,y))}const p=new Ve(s,o,a,f,l,c);return p.spread=r,p.units=n,Dt.call(this,e,p,t),p},text:function(e,t){const n=Ug(e.getAttribute("text-anchor"))||"left",r=Gg(e)||"baseline";let s="";e.childNodes.length>0&&e.childNodes[0].tagName==="TSPAN"?s=e.childNodes[0].textContent:s=e.textContent;const o=new Lt(s);return Dt.call(this,e,o,t),o.alignment=n,o.baseline=r,o},clippath:function(e,t){return ze.defs.current&&!ze.defs.current.contains(e.id)&&ze.defs.current.add(e.id,e),null},image:function(e,t){let n;const r=e.getAttribute("href")||e.getAttribute("xlink:href");if(!r)return n=new $t("encountered <image /> with no href."),console.warn(n.name,n.message),null;const s=parseFloat(e.getAttribute("x"))||0,o=parseFloat(e.getAttribute("y"))||0,a=parseFloat(e.getAttribute("width")),l=parseFloat(e.getAttribute("height")),c=new Fr(r,s,o);return ae.isNaN(a)||(c.width=a),ae.isNaN(l)||(c.height=l),Dt.call(this,e,c,t),c}};function Vl(e,t){const n=new XMLHttpRequest;return n.open("GET",e),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&t(n.responseText)},n.send(),n}var Ei=class extends Nn{constructor(e,t,n,r){super(t,n,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);for(let s in Ol)Object.defineProperty(this,s,Ol[s]);this._renderer.flagTextures=nm.bind(this),this._renderer.bindTextures=im.bind(this),this._renderer.unbindTextures=rm.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(zl.bind(this)):this.textures=[zl(e)],this.origin=new Z,this._update(),typeof r=="number"?this.frameRate=r:this.frameRate=Ei.DefaultFrameRate,this.index=0}static fromObject(e){const t=new Ei().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ei.Properties.length;t++){const n=Ei.Properties[t];n in e&&(this[n]=e[n])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=ae.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof t=="number"&&(this._lastFrame=t),typeof n=="function"?this._onLastFrame=n: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 t=new Ei(this.textures,this.translation.x,this.translation.y,this.frameRate);return t._loop=this._loop,this._playing&&t.play(),e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.textures=this.textures.map(function(t){return t.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}_update(){const e=this._textures;let t,n,r,s,o,a,l,c;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(s=this._amount,ae.isNaN(this._lastFrame)&&(this._lastFrame=s-1),r=ae.performance.now()-this._startTime,c=this._lastFrame+1,o=1e3*(c-this._firstFrame)/this._frameRate,this._loop?r=r%o:r=Math.min(r,o),l=Ft(this._firstFrame,c,r/o),l=Math.floor(l),l!==this._index&&(this._index=l,a=e[this._index],a.loaded&&(t=a.image.width,n=a.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n),this.fill=a,l>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Be))&&(a=e[this._index],a.loaded&&(t=a.image.width,n=a.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n)),this.fill=a)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}},Lr=Ei;w(Lr,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),w(Lr,"DefaultFrameRate",30);var Ol={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(e){const t=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(Y.Types.insert,t).unbind(Y.Types.remove,n),this._textures=new En((e||[]).slice(0)),this._textures.bind(Y.Types.insert,t).bind(Y.Types.remove,n),t(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}};function nm(){this._flagTextures=!0}function im(e){let t=e.length;for(;t--;)e[t].bind(Y.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function rm(e){let t=e.length;for(;t--;)e[t].unbind(Y.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function zl(e){if(e instanceof Be)return e;if(typeof e=="string")return new Be(e)}var js=[],Xs=Math.max,sm=Math.min,Ll=Math.abs,Dr=Math.sin,Hr=Math.cos,om=Math.acos,Wr=Math.sqrt,Se={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(e){return e in Se?e:"path"},group:{renderChild:function(e){const t=Se.getRendererType(e._renderer.type);Se[t].render.call(e,this.ctx,!0,this.clip)},render:function(e){if(!this._visible)return this;this._update();const t=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);const r=this._mask,s=jr(t),o=!s||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=e,o&&(e.save(),s||e.transform(t[0],t[3],t[1],t[4],t[2],t[5])),r){const a=Se.getRendererType(r._renderer.type);Se[a].render.call(r,e,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Se.getRendererType(l._renderer.type);Se[c].render.call(l,e)}return o&&e.restore(),this.flagReset()}},path:{render:function(e,t,n){let r,s,o,a,l,c,d,h,f,p,u,g,m,_,y,b,S,C,v,B,k,E,P,R,j,q,M,A,$,X,F,N,W,z;if(z=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,$=this._mask,X=this._clip,l=this._opacity*(z||1),c=this._visible,!t&&(!c||X||l===0))return this;if(this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,d=this._cap,h=this._join,f=this._miter,p=this._closed,u=this._renderer.vertices,g=u.length,m=g-1,F=jr(r),W=this.dashes,F||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),$){const re=Se.getRendererType($._renderer.type);Se[re].render.call($,e,!0)}if(a)if(typeof a=="string")e.fillStyle=a;else{const re=Se.getRendererType(a._renderer.type);Se[re].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const re=Se.getRendererType(s._renderer.type);Se[re].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o),f&&(e.miterLimit=f),h&&(e.lineJoin=h),!p&&d&&(e.lineCap=d)}typeof l=="number"&&(e.globalAlpha=l),W&&W.length>0&&(e.lineDashOffset=W.offset||0,e.setLineDash(W)),e.beginPath();let G,V,O,J,he,ie,ge;for(let re=0;re<g;re++)switch(b=u[re],M=b.x,A=b.y,b.command){case ee.close:e.closePath();break;case ee.arc:G=b.rx,V=b.ry,O=b.xAxisRotation,J=b.largeArcFlag,he=b.sweepFlag,_=p?Mt(re-1,g):Xs(re-1,0),y=u[_],ie=y.x,ge=y.y,Se.renderSvgArcCommand(e,ie,ge,G,V,J,he,O,M,A);break;case ee.curve:_=p?Mt(re-1,g):Math.max(re-1,0),y=u[_],P=y.controls&&y.controls.right||Z.zero,R=b.controls&&b.controls.left||Z.zero,y._relative?(k=P.x+y.x,E=P.y+y.y):(k=P.x,E=P.y),b._relative?(v=R.x+b.x,B=R.y+b.y):(v=R.x,B=R.y),e.bezierCurveTo(k,E,v,B,M,A),re>=m&&p&&(S=C,j=b.controls&&b.controls.right||Z.zero,q=S.controls&&S.controls.left||Z.zero,b._relative?(k=j.x+b.x,E=j.y+b.y):(k=j.x,E=j.y),S._relative?(v=q.x+S.x,B=q.y+S.y):(v=q.x,B=q.y),M=S.x,A=S.y,e.bezierCurveTo(k,E,v,B,M,A));break;case ee.line:e.lineTo(M,A);break;case ee.move:C=b,e.moveTo(M,A);break}return p&&e.closePath(),!X&&!n&&(Se.isHidden.test(a)||(N=a._renderer&&a._renderer.offset,N&&(e.save(),e.translate(-a._renderer.offset.x,-a._renderer.offset.y),e.scale(a._renderer.scale.x,a._renderer.scale.y)),e.fill(),N&&e.restore()),Se.isHidden.test(s)||(N=s._renderer&&s._renderer.offset,N&&(e.save(),e.translate(-s._renderer.offset.x,-s._renderer.offset.y),e.scale(s._renderer.scale.x,s._renderer.scale.y),e.lineWidth=o/s._renderer.scale.x),e.stroke(),N&&e.restore())),F||e.restore(),X&&!n&&e.clip(),W&&W.length>0&&e.setLineDash(js),this.flagReset()}},points:{render:function(e,t,n){let r,s,o,a,l,c,d,h,f,p,u,g,m,_,y,b;if(b=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(b||1),c=this._visible,!t&&(!c||l===0))return this;if(this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,h=this._renderer.collection,f=h.length,m=jr(r),y=this.dashes,d=this._size,m||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")e.fillStyle=a;else{const v=Se.getRendererType(a._renderer.type);Se[v].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const v=Se.getRendererType(s._renderer.type);Se[v].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o)}typeof l=="number"&&(e.globalAlpha=l),y&&y.length>0&&(e.lineDashOffset=y.offset||0,e.setLineDash(y)),e.beginPath();let S=d*.5,C;this._sizeAttenuation||(C=this.worldMatrix.elements,C=ki(C[0],C[3],C[1],C[4],C[2],C[5]),S/=Math.max(C.scaleX,C.scaleY));for(let v=0;v<f;v++)p=h[v],u=p.x,g=p.y,e.moveTo(u+S,g),e.arc(u,g,S,0,ht);return n||(Se.isHidden.test(a)||(_=a._renderer&&a._renderer.offset,_&&(e.save(),e.translate(-a._renderer.offset.x,-a._renderer.offset.y),e.scale(a._renderer.scale.x,a._renderer.scale.y)),e.fill(),_&&e.restore()),Se.isHidden.test(s)||(_=s._renderer&&s._renderer.offset,_&&(e.save(),e.translate(-s._renderer.offset.x,-s._renderer.offset.y),e.scale(s._renderer.scale.x,s._renderer.scale.y),e.lineWidth=o/s._renderer.scale.x),e.stroke(),_&&e.restore())),m||e.restore(),y&&y.length>0&&e.setLineDash(js),this.flagReset()}},text:{render:function(e,t,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(!t&&(!o||l||s===0))return this;this._update();const c=this._matrix.elements,d=this._stroke,h=this._linewidth,f=this._fill,p=this._decoration,u=this._direction,g=jr(c),m=f._renderer&&f._renderer.offset&&d._renderer&&d._renderer.offset,_=this.dashes,y=Se.alignments[this._alignment]||this._alignment,b=Se.baselines[this._baseline]||this._baseline;let S,C,v,B,k,E,P,R,j,q,M;if(g||(e.save(),e.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const A=Se.getRendererType(a._renderer.type);Se[A].render.call(a,e,!0)}if(m||(e.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),e.textAlign=y,e.textBaseline=b,e.direction=u,f)if(typeof f=="string")e.fillStyle=f;else{const A=Se.getRendererType(f._renderer.type);Se[A].render.call(f,e,this),e.fillStyle=f._renderer.effect}if(d){if(typeof d=="string")e.strokeStyle=d;else{const A=Se.getRendererType(d._renderer.type);Se[A].render.call(d,e,this),e.strokeStyle=d._renderer.effect}h&&(e.lineWidth=h)}if(typeof s=="number"&&(e.globalAlpha=s),_&&_.length>0&&(e.lineDashOffset=_.offset||0,e.setLineDash(_)),!l&&!n&&(Se.isHidden.test(f)||(f._renderer&&f._renderer.offset?(E=f._renderer.scale.x,P=f._renderer.scale.y,e.save(),e.translate(-f._renderer.offset.x,-f._renderer.offset.y),e.scale(E,P),S=this._size/f._renderer.scale.y,C=this._leading/f._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",C+"px",this._family].join(" "),v=f._renderer.offset.x/f._renderer.scale.x,B=f._renderer.offset.y/f._renderer.scale.y,e.fillText(this.value,v,B),e.restore()):e.fillText(this.value,0,0)),Se.isHidden.test(d)||(d._renderer&&d._renderer.offset?(E=d._renderer.scale.x,P=d._renderer.scale.y,e.save(),e.translate(-d._renderer.offset.x,-d._renderer.offset.y),e.scale(E,P),S=this._size/d._renderer.scale.y,C=this._leading/d._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",C+"px",this._family].join(" "),v=d._renderer.offset.x/d._renderer.scale.x,B=d._renderer.offset.y/d._renderer.scale.y,k=h/d._renderer.scale.x,e.lineWidth=k,e.strokeText(this.value,v,B),e.restore()):e.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(p)){const A=e.measureText(this.value);let $=1;switch(p){case"underline":j=A.actualBoundingBoxDescent,M=A.actualBoundingBoxDescent;break;case"strikethrough":j=0,M=0,$=.5;break}switch(b){case"top":j+=this._size*$,M+=this._size*$;break;case"baseline":case"bottom":j-=this._size*$,M-=this._size*$;break}switch(y){case"left":case"start":R=0,q=A.width;break;case"right":case"end":R=-A.width,q=0;break;default:R=-A.width/2,q=A.width/2}e.lineWidth=Math.max(Math.floor(this._size/15),1),e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(R,j),e.lineTo(q,M),e.stroke()}return g||e.restore(),l&&!n&&e.clip(),_&&_.length>0&&e.setLineDash(js),this.flagReset()}},"linear-gradient":{render:function(e,t){if(t){if(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=t.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=e.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 this.flagReset()}}},"radial-gradient":{render:function(e,t){if(t){if(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=t.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=e.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 this.flagReset()}}},texture:{render:function(e){this._update();const t=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=e.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Z||(this._renderer.offset=new Z),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,t&&(this._renderer.offset.x+=t.width/2,this._renderer.offset.y+=t.height/2,this._scale instanceof Z?(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 Z||(this._renderer.scale=new Z),this._scale instanceof Z?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),this.flagReset()}},renderSvgArcCommand:function(e,t,n,r,s,o,a,l,c,d){l=l*Math.PI/180,r=Ll(r),s=Ll(s);const h=(t-c)/2,f=(n-d)/2,p=Hr(l)*h+Dr(l)*f,u=-Dr(l)*h+Hr(l)*f,g=p*p,m=u*u;let _=r*r,y=s*s;const b=g/_+m/y;if(b>1){const A=Wr(b);r=A*r,s=A*s,_=r*r,y=s*s}const S=_*m+y*g,C=(_*y-S)/S;let v=Wr(Xs(0,C));o===a&&(v=-v);const B=v*r*u/s,k=-v*s*p/r,E=Hr(l)*B-Dr(l)*k+(t+c)/2,P=Dr(l)*B+Hr(l)*k+(n+d)/2,R=Dl(1,0,(p-B)/r,(u-k)/s),j=Dl((p-B)/r,(u-k)/s,(-p-B)/r,(-u-k)/s)%ht,q=R+j;am(e,E,P,r,s,R,q,a===0,l)}},ft=class extends Y{constructor(e){super();const t=e.smoothing!==!1;this.domElement=e.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=e.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=t),this.scene=new Ze,this.scene.parent=this}setSize(e,t,n){return this.width=e,this.height=t,this.ratio=typeof n>"u"?Ms(this.ctx):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,this.domElement.style&&ae.extend(this.domElement.style,{width:e+"px",height:t+"px"}),this.trigger(Y.Types.resize,e,t,n)}render(){const e=this.ratio===1;return e||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Se.group.render.call(this.scene,this.ctx),e||this.ctx.restore(),this}};w(ft,"Utils",Se);function am(e,t,n,r,s,o,a,l,c){const d=a-o,h=xi.Tolerance.epsilon,f=Math.abs(d)<h;let p=Mt(d,ht);p<h&&(f?p=0:p=ht),l===!0&&!f&&(p===ht?p=-ht:p=p-ht);for(let u=0;u<kt.Resolution;u++){const g=u/(kt.Resolution-1),m=o+g*p;let _=t+r*Math.cos(m),y=n+s*Math.sin(m);if(c!==0){const b=Math.cos(c),S=Math.sin(c),C=_-t,v=y-n;_=C*b-v*S+t,y=C*S+v*b+n}e.lineTo(_,y)}}function Dl(e,t,n,r){const s=e*n+t*r,o=Wr(e*e+t*t)*Wr(n*n+r*r);let a=om(Xs(-1,sm(1,s/o)));return e*r-t*n<0&&(a=-a),a}function jr(e){return e[0]==1&&e[3]==0&&e[1]==0&&e[4]==1&&e[2]==0&&e[5]==0}var se={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(e,t){const n=e,r=document.createElementNS(se.ns,n);return n==="svg"&&(t=ae.defaults(t||{},{version:se.version})),t&&Object.keys(t).length>0&&se.setAttributes(r,t),r},setAttributes:function(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r++)/href/.test(n[r])?e.setAttributeNS(se.xlink,n[r],t[n[r]]):e.setAttribute(n[r],t[n[r]]);return this},removeAttributes:function(e,t){for(let n in t)e.removeAttribute(n);return this},toString:function(e,t){let n=e.length,r=n-1,s,o="";for(let a=0;a<n;a++){const l=e[a],c=t?Mt(a-1,n):Math.max(a-1,0),d=e[c];let h,f,p,u,g,m,_,y,b,S,C,v,B,k,E,P=Ne(l.x),R=Ne(l.y);switch(l.command){case ee.close:h=ee.close;break;case ee.arc:C=l.rx,v=l.ry,B=l.xAxisRotation,k=l.largeArcFlag,E=l.sweepFlag,h=ee.arc+" "+C+" "+v+" "+B+" "+k+" "+E+" "+P+" "+R;break;case ee.curve:_=d.controls&&d.controls.right||Z.zero,y=l.controls&&l.controls.left||Z.zero,d.relative?(p=Ne(_.x+d.x),u=Ne(_.y+d.y)):(p=Ne(_.x),u=Ne(_.y)),l.relative?(g=Ne(y.x+l.x),m=Ne(y.y+l.y)):(g=Ne(y.x),m=Ne(y.y)),h=(a===0?ee.move:ee.curve)+" "+p+" "+u+" "+g+" "+m+" "+P+" "+R;break;case ee.move:s=l,h=ee.move+" "+P+" "+R;break;default:h=l.command+" "+P+" "+R}a>=r&&t&&(l.command===ee.curve&&(f=s,b=l.controls&&l.controls.right||l,S=f.controls&&f.controls.left||f,l.relative?(p=Ne(b.x+l.x),u=Ne(b.y+l.y)):(p=Ne(b.x),u=Ne(b.y)),f.relative?(g=Ne(S.x+f.x),m=Ne(S.y+f.y)):(g=Ne(S.x),m=Ne(S.y)),P=Ne(f.x),R=Ne(f.y),h+=" C "+p+" "+u+" "+g+" "+m+" "+P+" "+R),l.command!==ee.close&&(h+=" Z")),o+=h+" "}return o},pointsToString:function(e,t){let n="";const r=t*.5;for(let s=0;s<e.length;s++){const o=e[s].x,a=e[s].y-r;n+=ee.move+" "+o+" "+a+" ",n+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return n},getClip:function(e,t){let n=e._renderer.clip;return n||(n=e._renderer.clip=se.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&t.defs.appendChild(n),n},getRendererType:function(e){return e in se?e:"path"},defs:{update:function(e){const{defs:t}=e;if(t._flagUpdate){const n=Array.prototype.slice.call(t.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})"]`;e.querySelector(a)||t.removeChild(s)}t._flagUpdate=!1}}},group:{appendChild:function(e){const t=e._renderer.elem;if(!t)return;const n=t.nodeName;!n||/(radial|linear)gradient/i.test(n)||e._clip||this.elem.appendChild(t)},removeChild:function(e){const t=e._renderer.elem;!t||t.parentNode!=this.elem||!t.nodeName||e._clip||this.elem.removeChild(t)},orderChild:function(e){this.elem.appendChild(e._renderer.elem)},renderChild:function(e){const t=se.getRendererType(e._renderer.type);se[t].render.call(e,this)},render:function(e){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;this._update(),this._renderer.elem||(this._renderer.elem=se.createElement("g",{id:this.id}),e.appendChild(this._renderer.elem));const t=this._matrix.manual||this._flagMatrix,n={domElement:e,elem:this._renderer.elem};t&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const s=this.children[r],o=se.getRendererType(s._renderer.type);se[o].render.call(s,e)}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(se.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(se.group.removeChild,n),this._flagOrder&&this.children.forEach(se.group.orderChild,n),this._flagMask)if(this._mask){const r=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),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),this.flagReset()}},path:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagVertices){const r=se.toString(this._renderer.vertices,this._closed);t.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}if(this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t["stroke-opacity"]=this._opacity,t["fill-opacity"]=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this._flagCap&&(t["stroke-linecap"]=this._cap),this._flagJoin&&(t["stroke-linejoin"]=this._join),this._flagMiter&&(t["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("path",t),e.appendChild(this._renderer.elem)),this._flagClip){const r=se.getClip(this,e),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=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.flagReset()}},points:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const o=this.worldMatrix.elements,a=ki(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=se.pointsToString(this._renderer.collection,r);t.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}return this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t["stroke-opacity"]=this._opacity,t["fill-opacity"]=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("path",t),e.appendChild(this._renderer.elem)),this.flagReset()}},text:{render:function(e){this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagFamily&&(t["font-family"]=this._family),this._flagSize&&(t["font-size"]=this._size),this._flagLeading&&(t["line-height"]=this._leading),this._flagAlignment&&(t["text-anchor"]=se.alignments[this._alignment]||this._alignment),this._flagBaseline&&(t["dominant-baseline"]=se.baselines[this._baseline]||this._baseline),this._flagStyle&&(t["font-style"]=this._style),this._flagWeight&&(t["font-weight"]=this._weight),this._flagDecoration&&(t["text-decoration"]=this._decoration),this._flagDirection&&(t.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}if(this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t.opacity=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("text",t),e.appendChild(this._renderer.elem)),this._flagClip){const r=se.getClip(this,e),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=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),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(e,t){t||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?se.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=se.createElement("linearGradient",n)),this._renderer.elem.parentNode===null&&e.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?se.setAttributes(o._renderer.elem,a):o._renderer.elem=se.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return this.flagReset()}},"radial-gradient":{render:function(e,t){t||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?se.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=se.createElement("radialGradient",n)),this._renderer.elem.parentNode===null&&e.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?se.setAttributes(o._renderer.elem,a):o._renderer.elem=se.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return this.flagReset()}},texture:{render:function(e,t){t||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 Z?(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 Z?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?se.setAttributes(this._renderer.image,r):this._renderer.image=se.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&se.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=se.createElement("pattern",n)),this._renderer.elem.parentNode===null&&e.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),this.flagReset()}}},Hl=class extends Y{constructor(e){super(),this.domElement=e.domElement||se.createElement("svg"),this.scene=new Ze,this.scene.parent=this,this.defs=se.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(e,t){return this.width=e,this.height=t,se.setAttributes(this.domElement,{width:e,height:t}),this.trigger(Y.Types.resize,e,t)}render(){return se.group.render.call(this.scene,this.domElement),se.defs.update(this.domElement),this}};w(Hl,"Utils",se);var Ht={create:function(e,t,n){const r=e.createShader(e[n]);if(e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){const o=e.getShaderInfoLog(r);throw e.deleteShader(r),new $t("unable to compile shader "+r+": "+o)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
40
+ ***************************************************************************** */var Br=function(){return Br=Object.assign||function(t){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)&&(t[o]=n[o])}return t},Br.apply(this,arguments)},Hu={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"}},gn={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ts=500,Wu=function(){function e(t,n){return this.core=t,this.$LG=n,this.settings=Br(Br({},Hu),this.core.settings),this}return e.prototype.buildTemplates=function(){var t=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&&(t+='<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(t)},e.prototype.enableZoom=function(t){var n=this,r=this.settings.enableZoomAfter+t.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&t.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(t.detail.index).addClass("lg-zoomable"),t.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},e.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(gn.slideItemLoad+".zoom",this.enableZoom.bind(this))},e.prototype.getDragCords=function(t){return{x:t.pageX,y:t.pageY}},e.prototype.getSwipeCords=function(t){var n=t.touches[0].pageX,r=t.touches[0].pageY;return{x:n,y:r}},e.prototype.getDragAllowedAxises=function(t,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();t?(s=r.offsetHeight*t,o=r.offsetWidth*t):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}},e.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},e.prototype.zoomImage=function(t,n,r,s){if(!(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;t===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),h=d.allowY,f=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 p=this.getPossibleSwipeDragCords(n),u,g,m=o-this.pageX,y=a-this.pageY;if(t-n>1){var _=(t-n)/Math.abs(n);m=(n<0?-m:m)+this.left*(_+(n<0?-1:1)),y=(n<0?-y:y)+this.top*(_+(n<0?-1:1)),u=m/_,g=y/_}else{var _=(t-n)*n;u=m*_,g=y*_}r&&(f?this.isBeyondPossibleLeft(u,p.minX)?u=p.minX:this.isBeyondPossibleRight(u,p.maxX)&&(u=p.maxX):t>1&&(u<p.minX?u=p.minX:u>p.maxX&&(u=p.maxX)),h?this.isBeyondPossibleTop(g,p.minY)?g=p.minY:this.isBeyondPossibleBottom(g,p.maxY)&&(g=p.maxY):t>1&&(g<p.minY?g=p.minY:g>p.maxY&&(g=p.maxY))),this.setZoomStyles({x:u,y:g,scale:t}),this.left=u,this.top=g,s&&this.setZoomImageSize()}},e.prototype.resetImageTranslate=function(t){if(this.isImageSlide(t)){var n=this.core.getSlideItem(t).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)}},e.prototype.setZoomImageSize=function(){var t=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=t.getCurrentImageActualSizeScale();t.scale>=r&&(n.addClass("no-transition"),t.imageReset=!0)},Ts),setTimeout(function(){var r=t.getCurrentImageActualSizeScale();if(t.scale>=r){var s=t.getDragAllowedAxises(t.scale);n.css("width",n.get().naturalWidth+"px").css("height",n.get().naturalHeight+"px"),t.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")}},Ts+50)},e.prototype.setZoomStyles=function(t){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=t.scale,r.css("transform","scale3d("+t.scale+", "+t.scale+", 1)"),s.css("transform","scale3d("+t.scale+", "+t.scale+", 1)");var o="translate3d("+t.x+"px, "+t.y+"px, 0)";n.css("transform",o)},e.prototype.setActualSize=function(t,n){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var s=this.core.galleryItems[this.core.index];this.resetImageTranslate(t),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},Ts+110)}},e.prototype.getNaturalWidth=function(t){var n=this.core.getSlideItem(t).find(".lg-image").first(),r=this.core.galleryItems[t].width;return r?parseFloat(r):n.get().naturalWidth},e.prototype.getActualSizeScale=function(t,n){var r,s;return t>=n?(r=t/n,s=r||2):s=1,s},e.prototype.getCurrentImageActualSizeScale=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=t.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},e.prototype.getPageCords=function(t){var n={};if(t)n.x=t.pageX||t.touches[0].pageX,n.y=t.pageY||t.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},e.prototype.setPageCords=function(t){var n=this.getPageCords(t);this.pageX=n.x,this.pageY=n.y},e.prototype.manageActualPixelClassNames=function(){var t=this.core.getElementById("lg-actual-size");t.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},e.prototype.beginZoom=function(t){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),t>1},e.prototype.getScale=function(t){var n=this.getCurrentImageActualSizeScale();return t<1?t=1:t>n&&(t=n),t},e.prototype.init=function(){var t=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){t.$LG(r.target).hasClass("lg-image")&&t.setActualSize(t.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var s=t.$LG(r.target);r.touches.length===1&&s.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),t.setActualSize(t.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on(gn.containerResize+".zoom "+gn.rotateRight+".zoom "+gn.rotateLeft+".zoom "+gn.flipHorizontal+".zoom "+gn.flipVertical+".zoom",function(){if(!(!t.core.lgOpened||!t.isImageSlide(t.core.index)||t.core.touchAction)){var r=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();t.top=0,t.left=0,t.setZoomEssentials(),t.setZoomSwipeStyles(r,{x:0,y:0}),t.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){t.core.lgOpened&&(t.scrollTop=t.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(t.isImageSlide(t.core.index)){var r=0;t.imageReset&&(t.resetImageTranslate(t.core.index),r=50),setTimeout(function(){var s=t.scale-t.settings.scale;s<1&&(s=1),t.beginZoom(s),t.zoomImage(s,-t.settings.scale,!0,!t.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){t.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){t.setActualSize(t.core.index)}),this.core.LGel.on(gn.beforeOpen+".zoom",function(){t.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(gn.afterOpen+".zoom",function(){t.scrollTop=t.$LG(window).scrollTop(),t.pageX=t.core.outer.width()/2,t.pageY=t.core.outer.height()/2+t.scrollTop,t.scale=1}),this.core.LGel.on(gn.afterSlide+".zoom",function(r){var s=r.detail.prevIndex;t.scale=1,t.positionChanged=!1,t.zoomInProgress=!1,t.resetZoom(s),t.resetImageTranslate(s),t.isImageSlide(t.core.index)&&t.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},e.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var t=this.scale+this.settings.scale;this.settings.infiniteZoom||(t=this.getScale(t)),this.beginZoom(t),this.zoomImage(t,Math.min(this.settings.scale,t-this.scale),!0,!this.settings.infiniteZoom)}},e.prototype.resetZoom=function(t){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(t!==void 0?t: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()},e.prototype.getTouchDistance=function(t){return Math.sqrt((t.touches[0].pageX-t.touches[1].pageX)*(t.touches[0].pageX-t.touches[1].pageX)+(t.touches[0].pageY-t.touches[1].pageY)*(t.touches[0].pageY-t.touches[1].pageY))},e.prototype.pinchZoom=function(){var t=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=t.core.getSlideItem(t.core.index),!!t.isImageSlide(t.core.index)&&l.touches.length===2){if(l.preventDefault(),t.core.outer.hasClass("lg-first-slide-loading"))return;s=t.scale||1,t.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t.setPageCords(l),t.resetImageTranslate(t.core.index),t.core.touchAction="pinch",n=t.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&t.core.touchAction==="pinch"&&(t.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=t.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){o=t.scale;var h=Math.max(1,s+-d*.02);t.scale=Math.round((h+Number.EPSILON)*100)/100;var f=t.scale-o;t.zoomImage(t.scale,Math.round((f+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(t.core.touchAction==="pinch"&&(t.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,t.scale<=1)t.resetZoom();else{var c=t.getCurrentImageActualSizeScale();if(t.scale>=c){var d=c-t.scale;d===0&&(d=.01),t.zoomImage(c,d,!1,!0)}t.manageActualPixelClassNames(),t.core.outer.addClass("lg-zoomed")}t.core.touchAction=void 0}})},e.prototype.touchendZoom=function(t,n,r,s,o){var a=n.x-t.x,l=n.y-t.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(),f={};f.x=this.left+a,f.y=this.top+l;var p=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(f.y,p.minY)?f.y=p.minY:this.isBeyondPossibleBottom(f.y,p.maxY)&&(f.y=p.maxY)),r&&(this.isBeyondPossibleLeft(f.x,p.minX)?f.x=p.minX:this.isBeyondPossibleRight(f.x,p.maxX)&&(f.x=p.maxX)),s?this.top=f.y:f.y=this.top,r?this.left=f.x:f.x=this.left,this.setZoomSwipeStyles(h,f),this.positionChanged=!0)},e.prototype.getZoomSwipeCords=function(t,n,r,s,o){var a={};if(s){if(a.y=this.top+(n.y-t.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-t.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},e.prototype.isBeyondPossibleLeft=function(t,n){return t>=n},e.prototype.isBeyondPossibleRight=function(t,n){return t<=n},e.prototype.isBeyondPossibleTop=function(t,n){return t>=n},e.prototype.isBeyondPossibleBottom=function(t,n){return t<=n},e.prototype.isImageSlide=function(t){var n=this.core.galleryItems[t];return this.core.getSlideType(n)==="image"},e.prototype.getPossibleSwipeDragCords=function(t){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;t&&(o=o+t*o,a=a+t*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,f={minY:l,maxY:c,minX:d,maxX:h};return f},e.prototype.setZoomSwipeStyles=function(t,n){t.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},e.prototype.zoomSwipe=function(){var t=this,n={},r={},s=!1,o=!1,a=!1,l=new Date,c=new Date,d,h,f=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(p){if(t.isImageSlide(t.core.index)&&(f=t.core.getSlideItem(t.core.index),(t.$LG(p.target).hasClass("lg-item")||f.get().contains(p.target))&&p.touches.length===1&&t.core.outer.hasClass("lg-zoomed"))){p.preventDefault(),l=new Date,t.core.touchAction="zoomSwipe",h=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var u=t.getDragAllowedAxises(0);a=u.allowY,o=u.allowX,(o||a)&&(n=t.getSwipeCords(p)),d=t.getPossibleSwipeDragCords(),t.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(p){if(p.touches.length===1&&t.core.touchAction==="zoomSwipe"&&(t.$LG(p.target).hasClass("lg-item")||f.get().contains(p.target))){p.preventDefault(),t.core.touchAction="zoomSwipe",r=t.getSwipeCords(p);var u=t.getZoomSwipeCords(n,r,o,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(s=!0,t.setZoomSwipeStyles(h,u))}}),this.core.$inner.on("touchend.lg",function(p){if(t.core.touchAction==="zoomSwipe"&&(t.$LG(p.target).hasClass("lg-item")||f.get().contains(p.target))){if(p.preventDefault(),t.core.touchAction=void 0,t.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var u=c.valueOf()-l.valueOf();t.touchendZoom(n,r,o,a,u)}})},e.prototype.zoomDrag=function(){var t=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,f;this.core.outer.on("mousedown.lg.zoom",function(p){if(t.isImageSlide(t.core.index)){var u=t.core.getSlideItem(t.core.index);if(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target)){c=new Date,f=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var g=t.getDragAllowedAxises(0);l=g.allowY,a=g.allowX,t.core.outer.hasClass("lg-zoomed")&&t.$LG(p.target).hasClass("lg-object")&&(a||l)&&(p.preventDefault(),n=t.getDragCords(p),h=t.getPossibleSwipeDragCords(),s=!0,t.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(p){if(s){o=!0,r=t.getDragCords(p);var u=t.getZoomSwipeCords(n,r,a,l,h);t.setZoomSwipeStyles(f,u)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(p){if(s){if(d=new Date,s=!1,t.core.outer.removeClass("lg-zoom-dragging"),o&&(n.x!==r.x||n.y!==r.y)){r=t.getDragCords(p);var u=d.valueOf()-c.valueOf();t.touchendZoom(n,r,a,l,u)}o=!1}t.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},e.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},e.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},e}();const ju={ref:"gallery-container",class:"lightgallery-wrapper"},Xu={},va=i.defineComponent({...Xu,__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(e){const t=e,n={lgAfterAppendSlide:t.onAfterAppendSlide,lgInit:t.onInit,lgHasVideo:t.onHasVideo,lgContainerResize:t.onContainerResize,lgAfterAppendSubHtml:t.onAfterAppendSubHtml,lgBeforeOpen:t.onBeforeOpen,lgAfterOpen:t.onAfterOpen,lgSlideItemLoad:t.onSlideItemLoad,lgBeforeSlide:t.onBeforeSlide,lgAfterSlide:t.onAfterSlide,lgPosterClick:t.onPosterClick,lgDragStart:t.onDragStart,lgDragMove:t.onDragMove,lgDragEnd:t.onDragEnd,lgBeforeNextSlide:t.onBeforeNextSlide,lgBeforePrevSlide:t.onBeforePrevSlide,lgBeforeClose:t.onBeforeClose,lgAfterClose:t.onAfterClose,lgRotateLeft:t.onRotateLeft,lgRotateRight:t.onRotateRight,lgFlipHorizontal:t.onFlipHorizontal,lgFlipVertical:t.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,{...t.settings}),D.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",ju,[i.renderSlot(o.$slots,"default")],512))}}),at=class at{static init(){at.isInitialized||(at.isInitialized=!0,at.windowResizeHandler(),window.addEventListener("resize",at.windowResizeHandler))}static destroy(){window.removeEventListener("resize",at.windowResizeHandler),at.isInitialized=!1}static getDeviceTypeByResolution(){const t=Y.AppConfigProvider.getConfig().deviceTypeByResolution;return window.innerWidth<t.tablet?Xe.phone:window.innerWidth<t.laptop?Xe.tablet:Xe.laptop}static initRefDependingOnDeviceResolution(t,n,r){const s=i.ref(r);return at.setRefValueDependingOnDeviceResolution(s,t,n,r),at.refsDependingOnDeviceResolution.push({r:s,phoneValue:t,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return at.getDeviceTypeByResolution()===Xe.phone}static isTabletDevice(){return at.getDeviceTypeByResolution()===Xe.tablet}static isLaptopDevice(){return at.getDeviceTypeByResolution()===Xe.laptop}static setRefValueDependingOnDeviceResolution(t,n,r,s){switch(at.getDeviceTypeByResolution()){case Xe.phone:t.value=n;break;case Xe.tablet:t.value=r;break;default:t.value=s;break}}static windowResizeHandler(){D.forEach(at.refsDependingOnDeviceResolution,t=>{at.setRefValueDependingOnDeviceResolution(t.r,t.phoneValue,t.tabletValue,t.defaultValue)})}};C(at,"isInitialized",!1),C(at,"refsDependingOnDeviceResolution",[]);let vt=at;const qu=["href"],Yu=["src","alt"],Uu={},ka=i.defineComponent({...Uu,__name:"image-gallery",props:{images:{}},setup(e,{expose:t}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[Du,Wu],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(vt.getDeviceTypeByResolution()===Xe.phone?.7:.8),a=i.ref(o()),l=()=>{a.value=o()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),t({show:c}),window.addEventListener("resize",l),(d,h)=>{const f=wa,p=A.NPopover;return i.openBlock(),i.createBlock(p,{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]=u=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(f)])])]),default:i.withCtx(()=>[i.createVNode(va,{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(d.images,(u,g)=>(i.openBlock(),i.createElementBlock("a",{key:g,href:u.image},[i.createElementVNode("img",{src:u.preview,alt:`Изображение #${g+1}`},null,8,Yu)],8,qu))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Gu={class:"flex flex-col text-sm"},Ku={},Zu=i.defineComponent({...Ku,__name:"product-stock-count",props:{product:{}},setup(e){return(t,n)=>{const r=Bs,s=A.NPopover;return i.openBlock(),i.createBlock(s,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(t.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",Gu,[(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})}}}),Ju={class:"flex flex-row justify-between"},Qu={key:0},ef={class:"ml-2 align-sub"},tf={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},nf={class:"@container"},rf={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},sf={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},of={class:"text-sc-dark-grey"},af={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},lf={class:"text-gray-600"},cf={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},df={key:3,class:"underline decoration-dashed"},hf={key:4,class:"sc-product-pack whitespace-nowrap"},uf={class:"text-gray-600"},ff={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},pf={class:"text-gray-600"},gf={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},mf={key:0},yf={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},_f={},Yi=i.defineComponent({..._f,__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,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e,{expose:t}){const n=e,r=i.computed(()=>D.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>D.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,f;return(f=(h=n.product)==null?void 0:h.properties)==null?void 0:f.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>D.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 t({showProductImagesPreview:l}),(h,f)=>{var _,b,S,x,v;const p=wa,u=A.NText,g=ba,m=Bs,y=A.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",Ju,[i.createVNode(u,{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&&h.eventEmitter}),onClick:d},i.toDisplayString(h.product.name),3),h.product.onOrder?(i.openBlock(),i.createElementBlock("span",Qu," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",ef,[h.product.images&&h.product.images.length>0?(i.openBlock(),i.createBlock(ka,{key:0,ref:"image-gallery",images:h.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",tf,[i.createVNode(p)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]),_:1}),h.showProductAddToCartButton||h.showProductEditButton||((_=h.productContextButtonsConfig)==null?void 0:_.length)>0?(i.openBlock(),i.createBlock(g,{key:0,product:h.product,"event-emitter":h.eventEmitter,"show-product-add-to-cart-button":h.showProductAddToCartButton,"show-product-edit-button":h.showProductEditButton,"product-context-buttons-config":h.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",nf,[i.createElementVNode("div",rf,[h.product.supplierSku?(i.openBlock(),i.createElementBlock("div",sf,[f[0]||(f[0]=i.createTextVNode(" Артикул производителя/поставщика: ")),i.createElementVNode("span",of,i.toDisplayString(h.product.supplierSku),1)])):i.createCommentVNode("",!0),h.showCode?(i.openBlock(),i.createElementBlock("span",af,[f[1]||(f[1]=i.createTextVNode(" Артикул: ")),i.createElementVNode("span",lf,i.toDisplayString(h.product.code),1)])):i.createCommentVNode("",!0),h.product.stockCount&&h.product.stockCount.length>0?(i.openBlock(),i.createBlock(Zu,{key:2,product:h.product},{default:i.withCtx(()=>[i.createElementVNode("span",cf,[f[2]||(f[2]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(m,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",df," Нет в наличии ")),(S=(b=h.product)==null?void 0:b.properties)!=null&&S.pack?(i.openBlock(),i.createElementBlock("span",hf,[f[3]||(f[3]=i.createTextVNode(" Норма упаковки: ")),i.createElementVNode("span",uf,i.toDisplayString((v=(x=h.product)==null?void 0:x.properties)==null?void 0:v.pack),1)])):i.createCommentVNode("",!0),h.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",ff,[f[4]||(f[4]=i.createTextVNode(" Планируемая дата поступления на основной склад: ")),i.createElementVNode("span",pf,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(y,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",gf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,B=>(i.openBlock(),i.createBlock(Cr,{key:B.coefficient.slug,product:h.product,"cost-field-name":B.coefficient.slug??"","event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-price-history":h.showPriceHistory,"show-cost-date":h.showCostDate,"currency-rates":h.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","show-cost-date","currency-rates"]))),128)),i.createVNode(Cr,{product:h.product,"event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":h.showCostDate,"show-price-history":h.showPriceHistory,"currency-rates":h.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}),h.showSlugs||h.showProperties?(i.openBlock(),i.createElementBlock("div",mf,[i.createElementVNode("ul",yf,[h.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:h.product.id,slug:h.product.slug},(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0),h.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(h.product.properties,(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),bf=(e,t,n)=>({key:e,title:t,className:"align-top",resizable:!0,render:r=>i.h(Cr,{product:r,costFieldName:e,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),wf=(e,t)=>{if(e.length===0)return[];const n=[],r={};switch(vt.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(Yi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,currencyRates:t.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(Yi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,currencyRates:t.currencyRates})}),t.showProductCosts&&(D.forEach(e,s=>{D.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),D.forEach(D.sortBy(r,["slug"]),s=>{n.push(bf(s.slug??"",s.name,t))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(Cr,{product:s,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:t.eventEmitter,allowPriceClick:t.allowPriceClick,showQuantityUnit:!0,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,currencyRates:t.currencyRates})})),(t.showProductEditButton||!D.isNil(t.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(ba,{product:s,eventEmitter:t.eventEmitter,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,productContextButtonsConfig:t.productContextButtonsConfig})});break}return n},vf={key:0,class:"pt-0.5"},kf={key:0},xf={class:"line-through"},Cf={key:0},Sf={key:1},Bf={class:"flex flex-row gap-1"},Tf={key:0},Ef={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},$f={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Nf={},Rf=i.defineComponent({...Nf,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},selectedCategoriesItems:{default:void 0},selectedProductsItems:{default:void 0},showHideForClientButton:{type:[Boolean,Function],default:!1},showPinButton:{type:[Boolean,Function],default:!1},showCategoryEditButton:{type:[Boolean,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},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},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>{var T;return(T=t==null?void 0:t.filteredItems)==null?void 0:T[t.categoryItem.id]}),s=i.computed(()=>{var T,$;return D.isArray((T=t.categoryItem)==null?void 0:T.categories)&&(($=t.categoryItem.categories)==null?void 0:$.length)>0}),o=i.computed(()=>{var T;return D.isArray((T=t.categoryItem)==null?void 0:T.products)?t.categoryItem.products:[]}),a=i.computed(()=>Object.entries(t.categoryItem.currencyRates??{}).map(([T,$])=>`${$} руб./${B(T)}`).join(", ")),l=i.computed(()=>D.isUndefined(t.filteredItems)||r.value==="*"?o.value:o.value.filter(T=>{var j;const $=(j=r.value)==null?void 0:j.products;return D.isArray($)&&$.includes(T.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>D.isFunction(t.showHideForClientButton)?t.showHideForClientButton(t.categoryItem):t.showHideForClientButton),h=i.computed(()=>D.isFunction(t.showPinButton)?t.showPinButton(t.categoryItem):t.showPinButton),f=i.computed(()=>D.isFunction(t.showCategoryEditButton)?t.showCategoryEditButton(t.categoryItem):t.showCategoryEditButton),p=i.computed(()=>D.isNil(t.categoryContextButtonsConfig)?[]:D.isFunction(t.categoryContextButtonsConfig)?t.categoryContextButtonsConfig(t.categoryItem):t.categoryContextButtonsConfig),u=i.computed(()=>new Y.ClientCategory(t.categoryItem)),g=i.ref(!1),m=i.ref(!1),y=i.computed(()=>!D.isUndefined(t.selectedCategoriesItems)),_=i.computed(()=>(t.selectedCategoriesItems??[]).some(T=>T.id===t.categoryItem.id)),b=i.computed(()=>M.value&&vt.getDeviceTypeByResolution()===Xe.laptop?"auto":"fixed"),S=i.useTemplateRef("collapse-item-reference"),x=i.computed(()=>{var T,$;return($=(T=t.categoryItem.properties)==null?void 0:T.templateCost)==null?void 0:$.priceCoefficient}),v=i.computed(()=>{var T,$;return($=(T=t.categoryItem.properties)==null?void 0:T.templateCost)==null?void 0:$.increasePercent}),B=(T,$="ru-RU")=>0 .toLocaleString($,{style:"currency",currency:T,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),k=T=>{t.eventEmitter.emit("category:checked",{category:t.categoryItem,checked:T,target:S.value})},N=(T,$)=>{t.eventEmitter.emit("category:header-click",{categoryItem:t.categoryItem,expanded:$,isLoadingState:g,target:S.value})},P=()=>{t.eventEmitter.emit("category:hide",{category:t.categoryItem,target:S.value})},R=()=>{t.eventEmitter.emit("category:attach",{category:t.categoryItem,target:S.value})},W=()=>{t.eventEmitter.emit("category:detach",{category:t.categoryItem,target:S.value})},q=()=>{t.eventEmitter.emit("category:edit",{category:t.categoryItem,target:S.value})},F=T=>{t.eventEmitter.emit("category:context-select",{category:t.categoryItem,key:T,target:S.value})},M=i.ref(0),V=i.computed(()=>M.value&&o.value.length>0?wf(o.value,{eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,currencyRates:t.categoryItem.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig}):[]),K=D.debounce(()=>{M.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",K)}),window.addEventListener("resize",K),K(),(T,$)=>{const j=A.NCheckbox,z=du,U=A.NTooltip,I=au,O=ya,Z=A.NTag,ge=nu,ie=Qh,he=A.NButton,re=Kh,Pe=ma,Fe=ga,Ze=A.NDropdown,Le=A.NDataTable,dt=A.NAlert,Zt=A.NSpin;return i.openBlock(),i.createBlock(_a,{ref:"collapse-item-reference",name:T.categoryItem.id,"data-id":T.categoryItem.id,"onHeader:click":N},{"pre-arrow":i.withCtx(()=>{var Oe,Ce,Je;return[y.value?(i.openBlock(),i.createElementBlock("div",vf,[i.createVNode(j,{checked:_.value,"onUpdate:checked":k},null,8,["checked"])])):i.createCommentVNode("",!0),!d.value&&((Oe=u.value)!=null&&Oe.isDisabled)?(i.openBlock(),i.createBlock(U,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(z,{class:"pt-1.5"})]),default:i.withCtx(()=>[$[1]||($[1]=i.createTextVNode(" Категория скрыта для клиента "))]),_:1,__:[1]})):i.createCommentVNode("",!0),((Ce=u.value)==null?void 0:Ce.isFavorite)??!1?(i.openBlock(),i.createBlock(U,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(I,{class:"pt-1.5"})]),default:i.withCtx(()=>[$[2]||($[2]=i.createTextVNode(" Избранная категория "))]),_:1,__:[2]})):i.createCommentVNode("",!0),((Je=u.value)==null?void 0:Je.isRequired)??!1?(i.openBlock(),i.createBlock(U,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(O,{class:"pt-1.5"})]),default:i.withCtx(()=>[$[3]||($[3]=i.createTextVNode(" Доп. продажа "))]),_:1,__:[3]})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var Oe,Ce,Je,Qe,un;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":T.categoryItem.isHidden,"text-gray-400":(Oe=u.value)==null?void 0:Oe.isDisabled})},[i.createVNode(U,{disabled:!T.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(T.categoryItem.name),1)]),default:i.withCtx(()=>[$[4]||($[4]=i.createTextVNode(" Категория скрыта "))]),_:1,__:[4]},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:$[0]||($[0]=i.withModifiers((...Ue)=>i.unref(D.noop)&&i.unref(D.noop)(...Ue),["prevent","stop"]))},[(Ce=T.categoryItem.properties)!=null&&Ce.m2Price?(i.openBlock(),i.createBlock(Z,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((Je=T.categoryItem.properties)==null?void 0:Je.templateCost)&&T.categoryItem.properties.m2PriceRetail&&v.value}),round:""},{default:i.withCtx(()=>{var Ue;return[i.createTextVNode(" Средняя стоимость: "+i.toDisplayString(T.categoryItem.properties.m2Price)+" руб./м2 ",1),(Ue=T.categoryItem.properties)!=null&&Ue.templateCost&&T.categoryItem.properties.m2PriceRetail&&v.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[v.value?(i.openBlock(),i.createBlock(Z,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[v.value?(i.openBlock(),i.createElementBlock("span",kf,i.toDisplayString(v.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(Z,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",xf,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"])):(Qe=T.categoryItem.properties)!=null&&Qe.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[x.value||v.value?(i.openBlock(),i.createBlock(Z,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var Ue;return[x.value?(i.openBlock(),i.createElementBlock("span",Cf,i.toDisplayString((Ue=x.value)==null?void 0:Ue.name),1)):i.createCommentVNode("",!0),v.value?(i.openBlock(),i.createElementBlock("span",Sf,i.toDisplayString(v.value>0?"+":"")+i.toDisplayString(v.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Z,{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&&((un=u.value)!=null&&un.manager)?(i.openBlock(),i.createBlock(Z,{key:3,size:i.unref(n),closable:!0,round:"",onClose:W},{default:i.withCtx(()=>[i.createVNode(U,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Ue,Ft;return[i.createElementVNode("span",Bf,[i.createVNode(ge),i.createTextVNode(" "+i.toDisplayString((Ft=(Ue=u.value)==null?void 0:Ue.manager)==null?void 0:Ft.name),1)])]}),default:i.withCtx(()=>{var Ue,Ft;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((Ft=(Ue=u.value)==null?void 0:Ue.manager)==null?void 0:Ft.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[T.showSlugs||T.showProperties?(i.openBlock(),i.createElementBlock("div",Tf,[i.createElementVNode("ul",Ef,[T.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:T.categoryItem.id,slug:T.categoryItem.slug},(Oe,Ce)=>(i.openBlock(),i.createElementBlock("li",{key:Ce}," ("+i.toDisplayString(Ce)+"): "+i.toDisplayString(Oe),1))),128)):i.createCommentVNode("",!0),T.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(T.categoryItem.properties,(Oe,Ce)=>(i.openBlock(),i.createElementBlock("li",{key:Ce}," ("+i.toDisplayString(Ce)+"): "+i.toDisplayString(Oe),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var Oe;return[i.createElementVNode("div",$f,[d.value?(i.openBlock(),i.createBlock(U,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(he,{size:i.unref(n),onClick:P},{default:i.withCtx(()=>{var Ce;return[(Ce=u.value)!=null&&Ce.isDisabled?(i.openBlock(),i.createBlock(z,{key:1})):(i.openBlock(),i.createBlock(ie,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var Ce;return[(Ce=u.value)!=null&&Ce.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(u.value.hidingComment?`. Причина: '${u.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),h.value&&!((Oe=u.value)!=null&&Oe.manager)?(i.openBlock(),i.createBlock(U,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(he,{size:i.unref(n),onClick:R},{default:i.withCtx(()=>[i.createVNode(re)]),_:1},8,["size"])]),default:i.withCtx(()=>{var Ce,Je,Qe;return[(Ce=u.value)!=null&&Ce.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((Qe=(Je=u.value)==null?void 0:Je.manager)==null?void 0:Qe.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(U,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(he,{ghost:!0,size:i.unref(n),type:"primary",onClick:q},{default:i.withCtx(()=>[i.createVNode(Pe)]),_:1},8,["size"])]),default:i.withCtx(()=>[$[5]||($[5]=i.createTextVNode(" Редактировать "))]),_:1,__:[5]})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(Ze,{key:3,options:p.value,size:i.unref(n),trigger:"click",onSelect:F},{default:i.withCtx(()=>[i.createVNode(he,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(Fe)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(T.$slots,"default",{},()=>{var Oe;return[s.value?(i.openBlock(),i.createBlock(Ca,{key:0,"categories-items":T.categoryItem.categories??[],"has-products":c.value||g.value,"event-emitter":T.eventEmitter,"filtered-items":r.value?((Oe=r.value)==null?void 0:Oe.categories)??{}:void 0,"selected-categories-items":T.selectedCategoriesItems,"selected-products-items":T.selectedProductsItems,"show-slugs":T.showSlugs,"show-properties":T.showProperties,"show-product-costs":T.showProductCosts,"allow-name-click":T.allowNameClick,"allow-price-click":T.allowPriceClick,"show-price-history":T.showPriceHistory,"show-cost-date":T.showCostDate,"show-product-add-to-cart-button":T.showProductAddToCartButton,"show-product-edit-button":T.showProductEditButton,"product-context-buttons-config":T.productContextButtonsConfig,"show-hide-for-client-button":T.showHideForClientButton,"show-pin-button":T.showPinButton,"show-category-edit-button":T.showCategoryEditButton,"category-context-buttons-config":T.categoryContextButtonsConfig},null,8,["categories-items","has-products","event-emitter","filtered-items","selected-categories-items","selected-products-items","show-slugs","show-properties","show-product-costs","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config","show-hide-for-client-button","show-pin-button","show-category-edit-button","category-context-buttons-config"])):i.createCommentVNode("",!0),c.value?(i.openBlock(),i.createBlock(Le,{key:1,columns:V.value,data:l.value,bordered:!0,loading:g.value,remote:!0,"row-key":Ce=>Ce.id,"table-layout":b.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])):i.createCommentVNode("",!0),!g.value&&!m.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(dt,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(dt,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),g.value?(i.openBlock(),i.createBlock(Zt,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>$[6]||($[6]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),Pf=jn(Rf,[["__scopeId","data-v-4f1dd4a2"]]),Ff={class:"sc-collapse flex w-full flex-col"},Mf={},xa=i.defineComponent({...Mf,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(e,{emit:t}){const n=e,r=t,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",Ff,[i.renderSlot(o.$slots,"default")]))}}),Af={},Ca=i.defineComponent({...Af,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},filteredItems:{default:void 0},selectedCategoriesItems:{default:void 0},selectedProductsItems:{default:void 0},showHideForClientButton:{type:[Boolean,Function],default:!1},showPinButton:{type:[Boolean,Function],default:!1},showCategoryEditButton:{type:[Boolean,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},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},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>D.isUndefined(t.filteredItems)?t.categoriesItems:t.categoriesItems.filter(o=>{var a;return!!((a=t.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(D.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=A.NSpin,c=A.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(xa,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(Pf,{key:d.id,"category-item":d,"event-emitter":o.eventEmitter,"filtered-items":s(d,o.filteredItems),"selected-categories-items":o.selectedCategoriesItems,"selected-products-items":o.selectedProductsItems,"show-slugs":o.showSlugs,"show-properties":o.showProperties,"show-product-costs":o.showProductCosts,"allow-name-click":o.allowNameClick,"allow-price-click":o.allowPriceClick,"show-price-history":o.showPriceHistory,"show-cost-date":o.showCostDate,"show-product-add-to-cart-button":o.showProductAddToCartButton,"show-product-edit-button":o.showProductEditButton,"product-context-buttons-config":o.productContextButtonsConfig,"show-hide-for-client-button":o.showHideForClientButton,"show-pin-button":o.showPinButton,"show-category-edit-button":o.showCategoryEditButton,"category-context-buttons-config":o.categoryContextButtonsConfig},null,8,["category-item","event-emitter","filtered-items","selected-categories-items","selected-products-items","show-slugs","show-properties","show-product-costs","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config","show-hide-for-client-button","show-pin-button","show-category-edit-button","category-context-buttons-config"]))),128))]),_:1})):o.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),!o.hasProducts&&!o.loading&&o.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)}}}),If={class:"text-sm"},Vf={class:"text-sm"},Of={},zf=i.defineComponent({...Of,__name:"add-product-to-cart-form",props:{product:{},cartItem:{default:void 0},validation:{default:()=>({length:{},quantity:{},marker:{}})},isSubmitProcessing:{type:Boolean}},emits:["submit"],setup(e,{emit:t}){var l,c,d,h,f,p,u,g;const n=e,r=i.ref(new Y.CartItemBase(n.cartItem??new Y.CartItemBase({product:n.product,quantity:((c=(l=n.product)==null?void 0:l.properties)==null?void 0:c.minCount)??1,length:((h=(d=n.product)==null?void 0:d.properties)==null?void 0:h.minLength)||((p=(f=n.product)==null?void 0:f.properties)!=null&&p.ignoreMinCountCheck?0:(g=(u=n.product)==null?void 0:u.properties)==null?void 0:g.minCount)||0}))),s=t,o=i.computed(()=>{var _,b,S,x,v,B,k,N,P;const m=((b=(_=n.product)==null?void 0:_.properties)==null?void 0:b.minLength)??((x=(S=n.product)==null?void 0:S.properties)!=null&&x.ignoreMinCountCheck?0:(B=(v=n.product)==null?void 0:v.properties)==null?void 0:B.minCount),y=(N=(k=n.product)==null?void 0:k.properties)==null?void 0:N.maxLength;return m||y?`(${m?`от ${m}`:""}${m&&y?" ":""}${y?`до ${y}`:""} ${(P=n.product)==null?void 0:P.unit})`:""}),a=()=>{Y.UnitsHelper.productIsMeasurable(n.product)||delete r.value.length,s("submit",r.value)};return(m,y)=>(i.openBlock(),i.createBlock(i.unref(A.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.unref(Y.UnitsHelper).productIsMeasurable(m.product)?(i.openBlock(),i.createBlock(i.unref(A.NFormItem),{key:0,required:!0,feedback:m.validation.length.feedback||"","show-feedback":m.validation.length.showFeedback||i.unref(Y.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01||!1,"validation-status":m.validation.length.validationStatus||void 0,label:"Метраж, "+m.product.unit+o.value+"м."},i.createSlots({default:i.withCtx(()=>{var _,b;return[i.createVNode(i.unref(A.NInputNumber),{value:r.value.length,"onUpdate:value":y[0]||(y[0]=S=>r.value.length=S),max:((_=m.product.properties)==null?void 0:_.maxLength)||void 0,min:((b=m.product.properties)==null?void 0:b.minLength)||i.unref(Y.UnitsHelper).getProductLengthMultiplicity(m.product),step:i.unref(Y.UnitsHelper).getProductMultiplicity(m.product),validator:S=>S%i.unref(Y.UnitsHelper).getProductLengthMultiplicity(m.product)===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]}),_:2},[!m.validation.length.feedback&&i.unref(Y.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",If,"Метраж должен быть кратен "+i.toDisplayString(i.unref(Y.UnitsHelper).getProductLengthMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status","label"])):i.createCommentVNode("",!0),i.createVNode(i.unref(A.NFormItem),{required:!0,feedback:m.validation.quantity.feedback||"","show-feedback":m.validation.quantity.showFeedback||i.unref(Y.UnitsHelper).getProductMultiplicity(m.product)!==1||!1,"validation-status":m.validation.quantity.validationStatus||void 0,label:"Количество"},i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:r.value.quantity,"onUpdate:value":y[1]||(y[1]=_=>r.value.quantity=_),min:i.unref(Y.UnitsHelper).getProductMultiplicity(m.product),step:i.unref(Y.UnitsHelper).getProductMultiplicity(m.product),validator:_=>_%i.unref(Y.UnitsHelper).getProductMultiplicity(m.product)===0,placeholder:"Введите количество",class:"w-full"},null,8,["value","min","step","validator"])]),_:2},[!m.validation.quantity.feedback&&i.unref(Y.UnitsHelper).getProductMultiplicity(m.product)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Vf,"Количество должно быть кратно "+i.toDisplayString(i.unref(Y.UnitsHelper).getProductMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(A.NFormItem),{feedback:m.validation.marker.feedback||"","show-feedback":m.validation.marker.showFeedback||!1,"validation-status":m.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInput),{value:r.value.marker,"onUpdate:value":y[2]||(y[2]=_=>r.value.marker=_),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(A.NButton),{loading:m.isSubmitProcessing,disabled:r.value.length===0||r.value.quantity===0,type:"primary",class:"self-start",onClick:y[3]||(y[3]=_=>a())},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(m.cartItem?"Изменить":"В корзину"),1)]),_:1},8,["loading","disabled"])]),_:1}))}}),Lf={},Sa=i.defineComponent({...Lf,__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(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>D.isArray(r.value)),a=new Y.Reference,l=i.computed(()=>{const u=o.value?[]:a,g=D.isUndefined(r.value)?u:r.value;return D.isArray(g)?g.map(m=>m.id):g==null?void 0:g.id}),c=i.computed(()=>Lt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,r.showEmptyValue)),d=u=>{var g;if(D.isArray(u)){const m=u.length>0?u.map(y=>{var _;return(_=c.value.find(b=>b.value===y))==null?void 0:_.item}):[];s("update:value",m)}else{const m=u===a.id||(g=c.value.find(y=>y.value===u))==null?void 0:g.item;s("update:value",m)}},h=i.useTemplateRef("select-component");return t({focus:()=>{var u;return(u=h.value)==null?void 0:u.focus()},blur:()=>{var u;return(u=h.value)==null?void 0:u.blur()}}),(u,g)=>(i.openBlock(),i.createBlock(i.unref(A.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":u.consistentMenuWidth,disabled:u.disabled||c.value.length===0,filterable:u.filterable,"max-tag-count":u.maxTagCount,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),Df={},Hf=i.defineComponent({...Df,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(e,{emit:t}){var S,x;const n=e,r=t,s=()=>{const v=Y.PriceCoefficient.getRetailPriceCoefficient();return D.unset(v,"isNewRec"),v},o=v=>!v||v.id===s().id,a=i.computed(()=>{var v;return((v=n.catalogItem)==null?void 0:v.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=v=>{var B,k,N,P;return v.id===s().id?(B=l.value)==null?void 0:B.getRetailCost():(P=(N=(k=l.value)==null?void 0:k.priceCoefficients)==null?void 0:N.find(R=>R.coefficient.id===v.id))==null?void 0:P.cost},d=i.computed(()=>{var B;const v=[...((B=Y.useReferencesStore().priceCoefficientsReference)==null?void 0:B.map(k=>structuredClone(i.toRaw(k))))??[],s()];return a.value&&v.forEach(k=>{var P;const N=c(k);N?k.name+=` (${N} ${(P=l.value)==null?void 0:P.currency})`:k.name=""}),v.filter(k=>k.name!=="")}),h=i.ref(n.value.coefficient),f=i.ref(((x=(S=n.value)==null?void 0:S.value)==null?void 0:x.toString())??null),p=i.ref(null),u=i.computed(()=>{var v,B;return(B=(v=l.value)==null?void 0:v.priceCoefficients)==null?void 0:B.find(k=>k.coefficient.slug===Y.PriceCoefficientEnum.K0)}),g=i.ref(void 0),m=()=>{var B,k,N;g.value=void 0;let v=Number.parseFloat(((B=f.value)==null?void 0:B.replace(",","."))??"");if(v=Number.isNaN(v)?void 0:v,a.value)if(h.value||f.value){const P=s(),R=c(h.value??P)??0,W=R+R*((v??0)/100);p.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(W),W>(((k=l.value)==null?void 0:k.getRetailCost())??W)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),u.value&&W<(((N=u.value)==null?void 0:N.cost)??0)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else p.value=null;r("update:value",{value:Number.isNaN(v)?void 0:v,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})},y=v=>{D.isArray(v)||(h.value=v,!h.value&&f.value&&(h.value=s()),m())},_=()=>{h.value||(h.value=s()),m()},b=v=>{var k,N,P,R,W,q;const B=Number.parseFloat((v==null?void 0:v.replace(",","."))??"");if(a.value){let F=0;if(B<=0)h.value=void 0,f.value=null;else if(u.value&&B<(((k=u.value)==null?void 0:k.cost)??0))h.value=(N=u.value)==null?void 0:N.coefficient,F=(B-u.value.cost)*100/u.value.cost,g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(B>(((P=l.value)==null?void 0:P.getRetailCost())??B)){h.value=s();const M=((R=l.value)==null?void 0:R.getRetailCost())??0;F=(B-M)*100/M,g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const M=(q=(W=l.value)==null?void 0:W.priceCoefficients)==null?void 0:q.filter(V=>V.cost<B);if(M&&M.length>0){const V=M.at(-1);h.value=V==null?void 0:V.coefficient,F=(B-((V==null?void 0:V.cost)??0))*100/((V==null?void 0:V.cost)??1)}g.value={validationStatus:void 0,feedback:void 0}}f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(F),r("update:value",{value:Number.isNaN(F)?void 0:F,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 v,B,k,N;n.calculationType===Y.CalculationTypeEnum.m2Cost?p.value=((B=(v=n.value)==null?void 0:v.value)==null?void 0:B.toString())??null:!((k=n.value)!=null&&k.coefficient)&&((N=n.value)!=null&&N.value)&&(h.value=s()),m()}),(v,B)=>{var P,R,W;const k=A.NInput,N=A.NInputGroup;return i.openBlock(),i.createBlock(i.unref(A.NFormItem),{"show-label":!i.unref(D.isNil)(v.label),label:v.label,"show-feedback":!i.unref(D.isNil)(((P=g.value)==null?void 0:P.feedback)??v.feedback),feedback:((R=g.value)==null?void 0:R.feedback)??v.feedback,"validation-status":((W=g.value)==null?void 0:W.validationStatus)??v.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"grid-cols-1":!a.value||v.calculationType===i.unref(Y.CalculationTypeEnum).m2Cost,"grid-cols-3":a.value&&v.calculationType!==i.unref(Y.CalculationTypeEnum).m2Cost},"grid w-full gap-2"])},[v.calculationType!==i.unref(Y.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(N,{key:0,class:i.normalizeClass({"col-span-2":a.value})},{default:i.withCtx(()=>[i.createVNode(Sa,{value:h.value,"reference-list":d.value,clearable:v.clearable,disabled:v.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":y},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(k,{value:f.value,"onUpdate:value":[B[0]||(B[0]=q=>f.value=q),_],clearable:v.clearable,disabled:v.disabled,placeholder:""},i.createSlots({suffix:i.withCtx(()=>[B[3]||(B[3]=i.createTextVNode("%"))]),_:2},[f.value&&!f.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[B[2]||(B[2]=i.createTextVNode(" + "))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||v.calculationType===i.unref(Y.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(k,{key:1,value:p.value,"onUpdate:value":[B[1]||(B[1]=q=>p.value=q),b],clearable:v.clearable,disabled:v.disabled,placeholder:"Стоимость"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var q;return[i.createTextVNode(i.toDisplayString((q=l.value)==null?void 0:q.currency),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),Wf={class:"flex flex-row gap-1"},jf={class:"sc-client-name flex flex-col gap-1 text-base"},Xf=["href"],qf={key:1,class:"text-sc-grey"},Yf={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},Uf={key:0},Gf={key:1,class:"text-sm"},Kf={},Tr=i.defineComponent({...Kf,__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(e,{emit:t}){const n=e,r=t,s=i.computed(()=>n.client.lastLoginAt?Nn.format(n.client.lastLoginAt,Y.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{D.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Bs,d=A.NButton,h=A.NPopover;return i.openBlock(),i.createElementBlock("div",Wf,[a.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=f=>a.$emit("click:client-info",a.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(D.isNil)(a.popoverPosition),placement:a.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",jf,[i.createElementVNode("a",{href:a.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=f=>o(f))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!a.client.isActive})},i.toDisplayString(a.client.name),3),a.showSalesDirection&&a.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!a.client.isActive})}," ("+i.toDisplayString(a.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),a.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",qf," [ Деактивирован ] "))],8,Xf),a.showCityAndRegion&&a.client.city?(i.openBlock(),i.createElementBlock("span",Yf," г. "+i.toDisplayString(a.client.city.name)+", "+i.toDisplayString(a.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[a.client.alternativeName?(i.openBlock(),i.createElementBlock("div",Uf,i.toDisplayString(a.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",Gf," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),Zf={class:"text-base"},Jf={},Ba=i.defineComponent({...Jf,__name:"contragent-with-short-info",props:{contragent:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("span",Zf,i.toDisplayString(t.contragent.name),1))}}),Qf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ep(e,t){return i.openBlock(),i.createElementBlock("svg",Qf,t[0]||(t[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 tp=i.markRaw({name:"tabler-mail",render:ep}),np=["href"],ip={},rp=i.defineComponent({...ip,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(e){return(t,n)=>{const r=tp;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,np)],2)}}}),sp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function op(e,t){return i.openBlock(),i.createElementBlock("svg",sp,t[0]||(t[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 Ta=i.markRaw({name:"fa6-brands-viber",render:op}),ap={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},lp=["id"],cp=["id"],dp=["fill"],hp=["fill"];function up(e,t){return i.openBlock(),i.createElementBlock("svg",ap,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:e.idMap.logosWhatsappIcon0,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},t[0]||(t[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)]),8,lp),i.createElementVNode("linearGradient",{id:e.idMap.logosWhatsappIcon1,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},t[1]||(t[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)]),8,cp)]),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosWhatsappIcon0+")",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,dp),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosWhatsappIcon1+")",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,hp),t[2]||(t[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 Ea=i.markRaw({name:"logos-whatsapp-icon",render:up,setup(){const e=()=>Math.random().toString(36).substr(2,10);return{idMap:{logosWhatsappIcon0:"uicons-"+e(),logosWhatsappIcon1:"uicons-"+e()}}}}),fp={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},pp=["id"],gp=["fill"];function mp(e,t){return i.openBlock(),i.createElementBlock("svg",fp,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:e.idMap.logosTelegram0,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},t[0]||(t[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)]),8,pp)]),i.createElementVNode("path",{fill:"url(#"+e.idMap.logosTelegram0+")",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,gp),t[1]||(t[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 $a=i.markRaw({name:"logos-telegram",render:mp,setup(){return{idMap:{logosTelegram0:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),yp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _p(e,t){return i.openBlock(),i.createElementBlock("svg",yp,t[0]||(t[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 Na=i.markRaw({name:"ion-call",render:_p}),bp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wp(e,t){return i.openBlock(),i.createElementBlock("svg",bp,t[0]||(t[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 vp=i.markRaw({name:"tabler-phone-call",render:wp}),kp={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},xp=["href"],Cp=["href"],Sp=["href"],Bp=["href"],Tp={},Ep=i.defineComponent({...Tp,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{try{return t.phone?Xi.parsePhoneNumberWithError(t.phone,t.defaultCountry):void 0}catch{}return t.phone}),r=i.computed(()=>{var l;return D.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return D.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return D.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=vp,h=Na,f=$a,p=Ea,u=Ta;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":l.showPhoneIcon})},[l.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",kp,[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,xp)):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(f)],8,Cp)):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(p)],8,Sp)):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(u)],8,Bp)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),$p={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Np(e,t){return i.openBlock(),i.createElementBlock("svg",$p,t[0]||(t[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 Rp=i.markRaw({name:"mdi-envelope",render:Np}),Pp={class:"flex flex-col gap-1"},Fp={key:0,class:"mb-2 flex flex-col text-base"},Mp={key:0,class:"text-sc-dark-grey text-sm"},Ap={key:1,class:"whitespace-nowrap text-sm"},Ip={key:2,class:"whitespace-nowrap text-sm"},Vp={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Op=["href"],zp=["href"],Lp=["href"],Dp=["href"],Hp=["href"],Wp={key:0,class:"flex flex-col text-base"},jp={key:0,class:"text-sc-dark-grey text-sm"},Xp={key:1,class:"mt-2 text-sm"},qp={key:0,class:"-mt-1"},Yp={},Up=i.defineComponent({...Yp,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(e){const t=e,n=i.computed(()=>{try{return t.contact.phone?Xi.parsePhoneNumberWithError(t.contact.phone,t.defaultCountry):void 0}catch{}return t.contact.phone}),r=i.computed(()=>{var c;return D.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return D.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return D.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||t.contact.email),l=i.ref(!1);return(c,d)=>{var y,_;const h=Na,f=$a,p=Ea,u=Ta,g=Rp,m=A.NPopover;return i.openBlock(),i.createElementBlock("div",Pp,[i.createVNode(m,{disabled:c.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var b,S,x,v;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(b=c.contact)!=null&&b.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${c.classes}`),style:i.normalizeStyle(c.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,[c.fullView&&(c.contact.name||(S=c.contact)!=null&&S.position)?(i.openBlock(),i.createElementBlock("div",Fp,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(x=c.contact)!=null&&x.position?(i.openBlock(),i.createElementBlock("span",Mp,i.toDisplayString((v=c.contact)==null?void 0:v.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),c.contact.phone?(i.openBlock(),i.createElementBlock("div",Ap,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("div",Ip,i.toDisplayString(c.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",Vp,[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,Op)):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(f)],8,zp)):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(p)],8,Lp)):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(u)],8,Dp)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${c.contact.email}`,class:"hover:text-3xl"},[i.createVNode(g)],8,Hp)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var b,S,x,v;return[c.contact.name?(i.openBlock(),i.createElementBlock("div",Wp,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(b=c.contact)!=null&&b.position?(i.openBlock(),i.createElementBlock("span",jp,i.toDisplayString((S=c.contact)==null?void 0:S.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(x=c.contact)!=null&&x.comment?(i.openBlock(),i.createElementBlock("div",Xp,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((v=c.contact)==null?void 0:v.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),c.fullView&&((y=c.contact)!=null&&y.comment)?(i.openBlock(),i.createElementBlock("div",qp,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((_=c.contact)==null?void 0:_.comment),1)])):i.createCommentVNode("",!0)])}}}),Gp={key:0,class:"flex w-fit items-center gap-2"},Kp={key:1,class:"flex flex-wrap gap-1"},Zp={key:0},Jp={},Ui=i.defineComponent({...Jp,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0}},setup(e){const t=e,n=i.computed(()=>{var r,s;return(s=(r=t.product)==null?void 0:r.properties)==null?void 0:s.planingProductionDate});return(r,s)=>{const o=A.NSpin;return r.isProductSearching?(i.openBlock(),i.createElementBlock("div",Gp,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):r.product.isNewRec()?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Kp,[i.createElementVNode("div",null,i.toDisplayString(r.product.code)+" - "+i.toDisplayString(r.product.name)+" - "+i.toDisplayString(r.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(r.product.unit),1),n.value?(i.openBlock(),i.createElementBlock("div",Zp,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)]))}}}),Qp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function eg(e,t){return i.openBlock(),i.createElementBlock("svg",Qp,t[0]||(t[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 Er=i.markRaw({name:"ion-close",render:eg}),tg={class:"mr-3 flex flex-col gap-2"},ng=["onClick"],ig={class:"h-full p-2"},rg={},sg=i.defineComponent({...rg,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(e,{emit:t}){const n=e,r=i.useTemplateRef("drawing-template-containers"),s=t;return i.onMounted(()=>{n.settings.allTemplates.forEach((o,a)=>{var c;const l=(c=r.value)==null?void 0:c.at(a);l&&s("init-draw-template",l,o)})}),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=Er;return i.openBlock(),i.createBlock(i.unref(A.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",tg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.settings.allTemplates,(c,d)=>(i.openBlock(),i.createElementBlock("div",{key:d,class:"group relative"},[i.createVNode(i.unref(A.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===o.selectTemplateIndex}]),onClick:h=>s("template:select",d)},[i.createElementVNode("div",ig,[i.createElementVNode("div",{ref_for:!0,ref:"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,ng)]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(c.label),1)]),_:2},1024),c.isCustom&&!c.isNewRec()?(i.openBlock(),i.createBlock(i.unref(A.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)]),_:2},1032,["onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),Ra=jn(sg,[["__scopeId","data-v-828c3059"]]),og={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ag(e,t){return i.openBlock(),i.createElementBlock("svg",og,t[0]||(t[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 Pa=i.markRaw({name:"ion-trash",render:ag}),lg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function cg(e,t){return i.openBlock(),i.createElementBlock("svg",lg,t[0]||(t[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)]))}const Fa=i.markRaw({name:"ion-plus",render:cg}),dg={class:"flex flex-col gap-4"},hg={class:"flex flex-col gap-2"},ug={class:"mt-8 font-bold"},fg={class:"grid grow grid-cols-2 items-start gap-2"},pg={class:"flex flex-col gap-4"},gg={class:"flex gap-3"},mg={},Ma=i.defineComponent({...mg,__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","click:view-switch","submit","click:add-line","click:remove-line","click:save-template"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(structuredClone(i.toRaw(n.value.configuratorParams))),o=i.ref(!1),a=()=>{s.value.length>0&&(r("update:params",s.value),l("configuratorParams",s.value))},l=(c,d)=>{const h=new Y.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.watch(()=>n.value.configuratorParams,c=>{s.value=D.cloneDeep(i.toRaw(c))},{deep:!0}),i.watch(()=>n.previewParams,c=>{s.value.linesWidths=c.linesWidths,s.value.linesAngles=c.linesAngles},{deep:!0}),(c,d)=>{const h=Fa,f=Pa,p=A.NInput;return i.openBlock(),i.createBlock(i.unref(A.NForm),{class:"grid gap-2 md:grid-cols-2 md:gap-6"},{default:i.withCtx(()=>{var u,g,m,y,_,b,S,x,v;return[i.createElementVNode("div",dg,[d[10]||(d[10]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),c.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(A.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:s.value.startTailType,"onUpdate:value":[d[0]||(d[0]=B=>s.value.startTailType=B),a],options:c.settings.startTailConfigs.map(({label:B},k)=>({label:B,value:k})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",hg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value.linesAngles,(B,k)=>{var N,P,R,W,q,F;return i.openBlock(),i.createElementBlock("div",{key:k,class:"flex items-start gap-2"},[i.createElementVNode("div",ug,i.toDisplayString(k+1),1),i.createElementVNode("div",fg,[i.createVNode(i.unref(A.NFormItem),{label:"Ширина, мм",required:!0,feedback:((N=c.validation[`lines_widths[${k+1}]`])==null?void 0:N.feedback)||"","show-feedback":((P=c.validation[`lines_widths[${k+1}]`])==null?void 0:P.showFeedback)||!1,"validation-status":(R=c.validation[`lines_widths[${k+1}]`])==null?void 0:R.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:s.value.linesWidths[k],"onUpdate:value":[M=>s.value.linesWidths[k]=M,a],min:s.value.linesWidths.length>1?c.settings.minLineWidth:c.settings.stripMinWidth,max:c.settings.maxLineWidth,step:c.settings.lineWidthStep,validator:M=>M%c.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(A.NFormItem),{label:"Угол сгиба, °",required:!0,feedback:((W=c.validation[`lines_angles[${k+1}]`])==null?void 0:W.feedback)||"","show-feedback":((q=c.validation[`lines_angles[${k+1}]`])==null?void 0:q.showFeedback)||!1,"validation-status":(F=c.validation[`lines_angles[${k+1}]`])==null?void 0:F.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:s.value.linesAngles[k],"onUpdate:value":[M=>s.value.linesAngles[k]=M,a],min:c.settings.minLineAngle,max:c.settings.maxLineAngle,step:c.settings.lineAngleStep,validator:M=>M%c.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(A.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,size:"medium",onClick:M=>r("click:add-line",k)},{default:i.withCtx(()=>[i.createVNode(h)]),_:2},1032,["onClick"])),c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:1,disabled:s.value.linesWidths.length===1,size:"medium",class:"ml-2",onClick:M=>r("click:remove-line",k)},{default:i.withCtx(()=>[i.createVNode(f)]),_:2},1032,["disabled","onClick"]))]),_:2},1024)])}),128))]),c.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(A.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:s.value.endTailType,"onUpdate:value":[d[1]||(d[1]=B=>s.value.endTailType=B),a],options:c.settings.endTailConfigs.map(({label:B},k)=>({label:B,value:k})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Ui,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),c.settings.allowSaveTemplates&&c.selectTemplateIndex===c.settings.allTemplates.length-1?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:2,type:"tertiary",class:"self-start",loading:o.value,onClick:d[2]||(d[2]=B=>r("click:save-template"))},{default:i.withCtx(()=>d[9]||(d[9]=[i.createTextVNode(" Сохранить шаблон ")])),_:1,__:[9]},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",pg,[i.createVNode(i.unref(A.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:s.value.colorSide,"onUpdate:value":[d[3]||(d[3]=B=>s.value.colorSide=B),a],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{required:!0,"show-feedback":((u=c.validation.length)==null?void 0:u.showFeedback)||!1,feedback:((g=c.validation.length)==null?void 0:g.feedback)||"","validation-status":(m=c.validation.length)==null?void 0:m.validationStatus,label:`Метраж${c.settings.stripMinLength?" от "+c.settings.stripMinLength:""}${c.settings.stripMaxLength?" до "+c.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:s.value.length,"onUpdate:value":[d[4]||(d[4]=B=>s.value.length=B),a],required:!0,max:c.settings.stripMaxLength||void 0,min:c.settings.stripMinLength,step:c.settings.lengthStep,validator:B=>B%c.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(A.NFormItem),{required:!0,"show-feedback":((y=c.validation.quantity)==null?void 0:y.showFeedback)||!1,feedback:((_=c.validation.quantity)==null?void 0:_.feedback)||"","validation-status":(b=c.validation.quantity)==null?void 0:b.validationStatus,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:c.value.quantity,"onUpdate:value":d[5]||(d[5]=B=>c.value.quantity=B),min:1,validator:B=>Number.isInteger(B),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createVNode(i.unref(A.NFormItem),{required:!0,"show-feedback":((S=c.validation.marker)==null?void 0:S.showFeedback)||!1,feedback:((x=c.validation.marker)==null?void 0:x.feedback)||"","validation-status":(v=c.validation.marker)==null?void 0:v.validationStatus,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(p,{value:c.value.marker,"onUpdate:value":d[6]||(d[6]=B=>c.value.marker=B),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createElementVNode("div",gg,[i.createVNode(i.unref(A.NButton),{loading:c.isSubmitProcessing,type:"primary",class:"self-start",onClick:d[7]||(d[7]=B=>r("submit",c.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading"]),c.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[8]||(d[8]=B=>r("click:view-switch"))},{default:i.withCtx(()=>d[11]||(d[11]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[11]})):i.createCommentVNode("",!0)])])]}),_:1})}}});var Aa=Object.defineProperty,yg=Object.defineProperties,_g=Object.getOwnPropertyDescriptors,Ia=Object.getOwnPropertySymbols,bg=Object.prototype.hasOwnProperty,wg=Object.prototype.propertyIsEnumerable,Es=(e,t,n)=>t in e?Aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$s=(e,t)=>{for(var n in t||(t={}))bg.call(t,n)&&Es(e,n,t[n]);if(Ia)for(var n of Ia(t))wg.call(t,n)&&Es(e,n,t[n]);return e},Ns=(e,t)=>yg(e,_g(t)),Va=(e,t)=>{for(var n in t)Aa(e,n,{get:t[n],enumerable:!0})},w=(e,t,n)=>(Es(e,typeof t!="symbol"?t+"":t,n),n),Oa=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},$t=(e,t,n)=>(Oa(e,t,"read from private field"),n?n.call(e):t.get(e)),za=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},vg=(e,t,n,r)=>(Oa(e,t,"write to private field"),t.set(e,n),n),kt={Image:null,isHeadless:!1,shim:function(e,t){return e.tagName=e.nodeName=t||"canvas",e.nodeType=1,e.getAttribute=function(n){return this[n]},e.setAttribute=function(n,r){return this[n]=r,this},e},polyfill:function(e,t){return kt.shim(e),typeof t<"u"&&(kt.Image=t),kt.isHeadless=!0,e}},La={};Va(La,{Curve:()=>xi,getAnchorsFromArcData:()=>Cg,getComponentOnCubicBezier:()=>Gi,getControlPoints:()=>Ja,getCurveBoundingBox:()=>Ga,getCurveFromPoints:()=>Za,getCurveLength:()=>Ua,getReflection:()=>Fs,integrate:()=>Ka,subdivide:()=>Ps});var Da={};Va(Da,{HALF_PI:()=>et,NumArray:()=>Qt,TWO_PI:()=>ut,decomposeMatrix:()=>ki,getComputedMatrix:()=>ja,getPoT:()=>Xa,lerp:()=>Mt,mod:()=>At,setMatrix:()=>Wa,toFixed:()=>Ne});var De;typeof window<"u"?De=window:typeof global<"u"?De=global:typeof self<"u"&&(De=self);var Ha,ut=Math.PI*2,et=Math.PI*.5;function ki(e,t,n,r,s,o){let a;return arguments.length<=1?(a=e.a,t=e.b,n=e.c,r=e.d,s=e.e,o=e.f):a=e,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,a)/Math.PI}}function Wa(e){Ha=e}function ja(e,t){t=t&&t.identity()||new Ha;let n=e;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;t.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9])}return t}function Mt(e,t,n){return n*(t-e)+e}var Rs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function Xa(e){let t=0;for(;Rs[t]&&Rs[t]<e;)t++;return Rs[t]}function At(e,t){for(;e<0;)e+=t;return e%t}var Qt=De.Float32Array||Array,kg=Math.floor;function Ne(e){return kg(e*1e6)/1e6}var ee={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},X=class{constructor(){w(this,"_events",{}),w(this,"_bound",!1)}addEventListener(t,n){return(this._events[t]||(this._events[t]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(t,n){if(!this._events)return this;if(!t&&!n)return this._events={},this._bound=!1,this;const r=t?[t]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){t=r[s];let a=this._events[t];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[t]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(t){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[t];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(t,n,r){const s=this;t&&(o.obj=t,o.name=n,o.handler=r,t.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(t,n,r){return t.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 qa={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(X.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(X.Types.change))}}},qt=class extends X{constructor(e=0,t=0){super(),w(this,"_x",0),w(this,"_y",0);for(let n in qa)Object.defineProperty(this,n,qa[n]);this.x=e,this.y=t}static add(e,t){return new qt(e.x+t.x,e.y+t.y)}static sub(e,t){return new qt(e.x-t.x,e.y-t.y)}static subtract(e,t){return qt.sub(e,t)}static ratioBetween(e,t){return(e.x*t.x+e.y*t.y)/(e.length()*t.length())}static angleBetween(e,t){if(arguments.length>=4){const s=arguments[0]-arguments[2],o=arguments[1]-arguments[3];return Math.atan2(o,s)}const n=e.x-t.x,r=e.y-t.y;return Math.atan2(r,n)}static distanceBetween(e,t){return Math.sqrt(qt.distanceBetweenSquared(e,t))}static distanceBetweenSquared(e,t){const n=e.x-t.x,r=e.y-t.y;return n*n+r*r}set(e,t){return this.x=e,this.y=t,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 qt(this.x,this.y)}add(e,t){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+=t),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,t){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-=t),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,t){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*=t),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,t){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/=t),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 t=this.x-e.x,n=this.y-e.y;return t*t+n*n}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,t){return t=typeof t>"u"?1e-4:t,this.distanceTo(e)<t}lerp(e,t){const n=(e.x-this.x)*t+this.x,r=(e.y-this.y)*t+this.y;return this.set(n,r)}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 t=this.x,n=this.y,r=Math.cos(e),s=Math.sin(e);return this.x=t*r-n*s,this.y=t*s+n*r,this}},J=qt;w(J,"zero",new qt),w(J,"left",new qt(-1,0)),w(J,"right",new qt(1,0)),w(J,"up",new qt(0,-1)),w(J,"down",new qt(0,1));var ve=class extends J{constructor(t=0,n=0,r=0,s=0,o=0,a=0,l=ee.move){super(t,n),w(this,"controls",{left:new J,right:new J}),w(this,"_command",ee.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 Ya)Object.defineProperty(this,d,Ya[d]);this.command=l,this.relative=!0;const c=ve.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(t){return n;function n(){t._bound&&t.dispatchEvent(X.Types.change)}}static fromObject(t){return new ve().copy(t)}copy(t){return this.x=t.x,this.y=t.y,typeof t.command=="string"&&(this.command=t.command),t.controls&&(t.controls.left&&this.controls.left.copy(t.controls.left),t.controls.right&&this.controls.right.copy(t.controls.right)),typeof t.relative=="boolean"&&(this.relative=t.relative),typeof t.rx=="number"&&(this.rx=t.rx),typeof t.ry=="number"&&(this.ry=t.ry),typeof t.xAxisRotation=="number"&&(this.xAxisRotation=t.xAxisRotation),typeof t.largeArcFlag=="number"&&(this.largeArcFlag=t.largeArcFlag),typeof t.sweepFlag=="number"&&(this.sweepFlag=t.sweepFlag),this}clone(){return new ve().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())}},Ya={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(X.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(X.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(X.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(X.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(X.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(X.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(X.Types.change))}}},xg=0,xt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.18",PublishDate:"2025-04-07T22:33:48.746Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return xg++}},xi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],weights:[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]]};function Gi(e,t,n,r,s){const o=1-e;return o*o*o*t+3*o*o*e*n+3*o*e*e*r+e*e*e*s}function Ps(e,t,n,r,s,o,a,l,c){c=c||xi.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new ve(a,l)];const h=[];for(let f=0;f<d;f++){const p=f/d,u=Gi(p,e,n,s,a),g=Gi(p,t,r,o,l);h.push(new ve(u,g))}return h}function Ua(e,t,n,r,s,o,a,l,c){if(e===n&&t===r&&s===a&&o===l){const y=a-e,_=l-t;return Math.sqrt(y*y+_*_)}const d=9*(n-s)+3*(a-e),h=6*(e+s)-12*n,f=3*(n-e),p=9*(r-o)+3*(l-t),u=6*(t+o)-12*r,g=3*(r-t);function m(y){const _=(d*y+h)*y+f,b=(p*y+u)*y+g;return Math.sqrt(_*_+b*b)}return Ka(m,0,1,c||xi.RecursionLimit)}function Ga(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,f,p,u,g,m,y,_;for(let v=0;v<2;++v){if(v==0?(f=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,p=3*n-3*e):(f=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,p=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(f)<1e-12)continue;u=-p/f,0<u&&u<1&&c.push(u);continue}y=f*f-4*p*h,_=Math.sqrt(y),!(y<0)&&(g=(-f+_)/(2*h),0<g&&g<1&&c.push(g),m=(-f-_)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,x;for(;b--;)u=c[b],x=1-u,d[0][b]=x*x*x*e+3*x*x*u*n+3*x*u*u*s+u*u*u*a,d[1][b]=x*x*x*t+3*x*x*u*r+3*x*u*u*o+u*u*u*l;return d[0][S]=e,d[1][S]=t,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function Ka(e,t,n,r){let s=xi.abscissas[r-2],o=xi.weights[r-2],a=.5*(n-t),l=a+t,c=0,d=r+1>>1,h=r&1?o[c++]*e(l):0;for(;c<d;){const f=a*s[c];h+=o[c++]*(e(l+f)+e(l-f))}return a*h}function Za(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?At(s-1,n):Math.max(s-1,0),l=t?At(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];Ja(c,d,h),d.command=s===0?ee.move:ee.curve}}function Ja(e,t,n){const r=J.angleBetween(e,t),s=J.angleBetween(n,t);let o=J.distanceBetween(e,t),a=J.distanceBetween(n,t),l=(r+s)/2;return o<1e-4||a<1e-4?(typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(o*=.33,a*=.33,s<r?l+=et:l-=et,t.controls.left.x=Math.cos(l)*o,t.controls.left.y=Math.sin(l)*o,l-=Math.PI,t.controls.right.x=Math.cos(l)*a,t.controls.right.y=Math.sin(l)*a,typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}function Fs(e,t,n){return new J(2*e.x-(t.x+e.x)-(n?e.x:0),2*e.y-(t.y+e.y)-(n?e.y:0))}function Cg(e,t,n,r,s,o,a){const l=xt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,f=n*Math.cos(h),p=r*Math.sin(h),u=new ve(f,p);u.command=ee.line}}var Qa=Array.prototype.slice;function Sg(e){if(e==null)return!1;const t=e.length;return typeof t=="number"&&t>=0&&t<4294967296}var ae={isNaN:function(e){return typeof e=="number"&&e!==+e},isElement:function(e){return!!(e&&e.nodeType===1)},isObject:function(e){const t=typeof e;return t==="function"||t==="object"&&!!e},extend:function(e){const t=Qa.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]=r[s]}return e},defaults:function(e){const t=Qa.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]===void 0&&(e[s]=r[s])}return e},each:function(e,t,n){const r=n||this,s=!Sg(e)&&Object.keys(e),o=(s||e).length;for(let a=0;a<o;a++){const l=s?s[a]:a;t.call(r,e[l],l,e)}return e},performance:De.performance&&De.performance.now?De.performance:Date},It={hasEventListeners:typeof De.addEventListener=="function",bind:function(e,t,n,r){return this.hasEventListeners?e.addEventListener(t,n,!!r):e.attachEvent("on"+t,n),It},unbind:function(e,t,n,r){return It.hasEventListeners?e.removeEventListeners(t,n,!!r):e.detachEvent("on"+t,n),It},getRequestAnimationFrame:function(){const e=["ms","moz","webkit","o"];let t=0,n=De.requestAnimationFrame;if(!n){for(let s=0;s<e.length;s++)n=De[e[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-t)),c=De.setTimeout(d,l);t=a+l;function d(){s(a+l)}return c}return n}},Ci=De.document?De.document.createElement("div"):{};Ci.id="help-two-load",Object.defineProperty(It,"temp",{enumerable:!0,get:function(){return ae.isElement(Ci)&&!De.document.head.contains(Ci)&&(Ci.style.display="none",De.document.head.appendChild(Ci)),Ci}});var Nt=class extends Error{constructor(t){super(),w(this,"name","Two.js"),w(this,"message"),this.message=t}},Bg=De.devicePixelRatio||1;function Tg(e){return e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1}function Ms(e){return Bg/Tg(e)}var $r=class{constructor(){w(this,"map",{})}add(t,n){return this.map[t]=n,this}remove(t){return delete this.map[t],this}get(t){return this.map[t]}contains(t){return t in this.map}},ft,Rn=class extends Array{constructor(){super(),za(this,ft,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 $t(this,ft)}set _events(t){vg(this,ft,t)}get _bound(){return $t(this,ft)._bound}set _bound(t){$t(this,ft)._bound=t}addEventListener(){return $t(this,ft).addEventListener.apply(this,arguments)}on(){return $t(this,ft).on.apply(this,arguments)}bind(){return $t(this,ft).bind.apply(this,arguments)}removeEventListener(){return $t(this,ft).removeEventListener.apply(this,arguments)}off(){return $t(this,ft).off.apply(this,arguments)}unbind(){return $t(this,ft).unbind.apply(this,arguments)}dispatchEvent(){return $t(this,ft).dispatchEvent.apply(this,arguments)}trigger(){return $t(this,ft).trigger.apply(this,arguments)}listen(){return $t(this,ft).listen.apply(this,arguments)}ignore(){return $t(this,ft).ignore.apply(this,arguments)}pop(){const t=super.pop.apply(this,arguments);return this.trigger(X.Types.remove,[t]),t}shift(){const t=super.shift.apply(this,arguments);return this.trigger(X.Types.remove,[t]),t}push(){const t=super.push.apply(this,arguments);return this.trigger(X.Types.insert,arguments),t}unshift(){const t=super.unshift.apply(this,arguments);return this.trigger(X.Types.insert,arguments),t}splice(){const t=super.splice.apply(this,arguments);if(this.trigger(X.Types.remove,t),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 t}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(t,n){const r=[];for(let s=0;s<this.length;s++){const o=this[s];let a;n?a=t.call(n,o,s):a=t(o,s),r.push(a)}return r}};ft=new WeakMap;var el=class extends X{constructor(){super(),w(this,"_flagId",!1),w(this,"_flagClassName",!1),w(this,"_renderer",{}),w(this,"_id",xt.Identifier+xt.uniqueId()),w(this,"_className",""),w(this,"classList",[]);for(let e in tl)Object.defineProperty(this,e,tl[e])}static fromObject(e){const t=new el().copy(e);return"id"in e&&(t.id=e.id),t}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return this.renderer.type=e.renderer.type,this.className=e.className,this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}},Xn=el;w(Xn,"Properties",["renderer","id","className"]);var tl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(e){const t=this._id;e!==this._id&&(this._id=e,this._flagId=!0,this.parent&&(delete this.parent.children.ids[t],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(e){this._className!==e&&(this._flagClassName=!0,this.classList=e.split(/\s+?/),this._className=e)}}},Nr,nl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};De.document&&(Nr=document.createElement("a"));var tt=class extends Xn{constructor(e,t){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 n in il)Object.defineProperty(this,n,il[n]);if(this._renderer.type="texture",this._renderer.flagOffset=Eg.bind(this),this._renderer.flagScale=$g.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new J,typeof t=="function"){const n=(function(){this.unbind(X.Types.load,n),typeof t=="function"&&t()}).bind(this);this.bind(X.Types.load,n)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const n=Object.prototype.toString.call(e);(n==="[object HTMLImageElement]"||n==="[object HTMLCanvasElement]"||n==="[object HTMLVideoElement]"||n==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const t=new tt().copy(e);return"id"in e&&(t.id=e.id),t}static getAbsoluteURL(e){return Nr?(Nr.href=e,Nr.href):e}static loadHeadlessBuffer(e,t){e.image.onload=t,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const t=tt.getAbsoluteURL(e);if(tt.ImageRegistry.contains(t))return tt.ImageRegistry.get(t);let n;return kt.Image?(n=new kt.Image,kt.shim(n,"img")):De.document?nl.video.test(t)?n=document.createElement("video"):n=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),n.crossOrigin="anonymous",n.referrerPolicy="no-referrer",n}static load(e,t){let n=e.image,r=tt.getTag(n);e._flagImage&&(/canvas/i.test(r)?tt.Register.canvas(e,t):(e._src=!kt.isHeadless&&n.getAttribute("two-src")||n.src,tt.Register[r](e,t))),e._flagSrc&&(n||(n=tt.getImage(e.src),e.image=n),r=tt.getTag(n),tt.Register[r](e,t))}clone(){const e=new tt(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 J?e.offset:new J().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof J?e.scale:new J().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,tt.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("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}},Te=tt;w(Te,"Properties",["src","loaded","repeat","scale","offset","image"]),w(Te,"RegularExpressions",nl),w(Te,"ImageRegistry",new $r),w(Te,"Register",{canvas:function(e,t){e._src="#"+e.id,tt.ImageRegistry.add(e.src,e.image),typeof t=="function"&&t()},img:function(e,t){const n=e.image,r=function(o){!kt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),typeof t=="function"&&t()},s=function(o){throw!kt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new Nt("unable to load "+e.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!kt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),e._src=tt.getAbsoluteURL(e._src),!(!kt.isHeadless&&n&&n.getAttribute("two-src"))&&(kt.isHeadless||n.setAttribute("two-src",e.src),tt.ImageRegistry.add(e.src,n),kt.isHeadless?tt.loadHeadlessBuffer(e,r):e.image.src=e.src)},video:function(e,t){if(kt.isHeadless)throw new Nt("video textures are not implemented in headless environments.");const n=function(s){e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",r,!1),e.image.width=e.image.videoWidth,e.image.height=e.image.videoHeight,typeof t=="function"&&t()},r=function(s){throw e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",r,!1),new Nt("unable to load "+e.src)};e._src=tt.getAbsoluteURL(e._src),e.image.getAttribute("two-src")||(e.image.setAttribute("two-src",e.src),tt.ImageRegistry.add(e.src,e.image)),e.image.readyState>=4?n():(e.image.addEventListener("canplaythrough",n,!1),e.image.addEventListener("error",r,!1),e.image.src=e.src,e.image.load())}});var il={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){const t=Te.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}Te.ImageRegistry.contains(n)?this._image=Te.ImageRegistry.get(e.src):this._image=e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(X.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(X.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof J&&this._scale.unbind(X.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof J&&this._scale.bind(X.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Eg(){this._flagOffset=!0}function $g(){this._flagScale=!0}var Yt=class extends Xn{constructor(e,t,n){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 r in rl)Object.defineProperty(this,r,rl[r]);this._renderer.type="stop",this.offset=typeof e=="number"?e:Yt.Index<=0?0:1,this.opacity=typeof n=="number"?n:1,this.color=typeof t=="string"?t:Yt.Index<=0?"#fff":"#000",Yt.Index=(Yt.Index+1)%2}static fromObject(e){const t=new Yt().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Yt.Properties.length;t++){const n=Yt.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Yt;return ae.each(Yt.Properties,function(n){t[n]=this[n]},this),e&&e.stops&&e.stops.push(t),t}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",ae.each(Yt.Properties,t=>{e[t]=this[t]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}},en=Yt;w(en,"Index",0),w(en,"Properties",["offset","opacity","color"]);var rl={offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset=e,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(e){this._color=e,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},qn=class extends Xn{constructor(e){super(),w(this,"_flagStops",!1),w(this,"_flagSpread",!1),w(this,"_flagUnits",!1),w(this,"_spread",""),w(this,"_units","");for(let t in sl)Object.defineProperty(this,t,sl[t]);this._renderer.type="gradient",this._renderer.flagStops=Ng.bind(this),this._renderer.bindStops=Rg.bind(this),this._renderer.unbindStops=Pg.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let t=e.stops;t&&t.length>0&&(t=t.map(r=>r instanceof en?r:new en().copy(r)));const n=new qn().copy(e);return"id"in e&&(n.id=e.id),n}clone(e){const t=this.stops.map(r=>r.clone()),n=new qn(t);return ae.each(qn.Properties,r=>{n[r]=this[r]},this),e&&e.add(n),n}copy(e){super.copy.call(this,e);for(let t=0;t<qn.Properties.length;t++){const n=qn.Properties[t];n in e&&(this[n]=e[n])}return this}toObject(){const e={stops:this.stops.map(t=>t.toObject())};return ae.each(qn.Properties,t=>{e[t]=this[t]},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}},Ye=qn;w(Ye,"Stop",en),w(Ye,"Properties",["spread","stops","units"]);var sl={spread:{enumerable:!0,get:function(){return this._spread},set:function(e){this._spread=e,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(e){this._units=e,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(e){const t=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(X.Types.insert,t).unbind(X.Types.remove,n),this._stops=new Rn((e||[]).slice(0)),this._stops.bind(X.Types.insert,t).bind(X.Types.remove,n),t(this._stops)}}};function Ng(){this._flagStops=!0}function Rg(e){let t=e.length;for(;t--;)e[t].bind(X.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function Pg(e){let t=e.length;for(;t--;)e[t].unbind(X.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}var Ki=class extends Ye{constructor(e,t,n,r,s){super(s),w(this,"_flagEndPoints",!1),w(this,"_left",null),w(this,"_right",null);for(let o in ol)Object.defineProperty(this,o,ol[o]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Fg.bind(this),this.left=new J,this.right=new J,typeof e=="number"&&(this.left.x=e),typeof t=="number"&&(this.left.y=t),typeof n=="number"&&(this.right.x=n),typeof r=="number"&&(this.right.y=r)}static fromObject(e){const t=new Ki().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ki.Properties.length;t++){const n=Ki.Properties[t];n in e&&(this[n]=e[n]instanceof J?e[n]:new J().copy(e[n]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Ki(this.left._x,this.left._y,this.right._x,this.right._y,t);return ae.each(Ye.Properties,function(r){n[r]=this[r]},this),e&&e.add(n),n}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}},Ae=Ki;w(Ae,"Stop",en),w(Ae,"Properties",["left","right"]);var ol={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof J&&this._left.unbind(X.Types.change,this._renderer.flagEndPoints),this._left=e,this._left.bind(X.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(e){this._right instanceof J&&this._right.unbind(X.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(X.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Fg(){this._flagEndPoints=!0}var Yn=class extends Ye{constructor(e,t,n,r,s,o){super(r),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 a in al)Object.defineProperty(this,a,al[a]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Mg.bind(this),this._renderer.flagFocal=Ag.bind(this),this.center=new J,this.radius=typeof n=="number"?n:1,this.focal=new J,typeof e=="number"&&(this.center.x=e),typeof t=="number"&&(this.center.y=t),this.focal.copy(this.center),typeof s=="number"&&(this.focal.x=s),typeof o=="number"&&(this.focal.y=o)}static fromObject(e){const t=new Yn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Yn.Properties.length;t++){const n=Yn.Properties[t];n in e&&(/(center|focal)i/.test(n)?this[n]=e[n]instanceof J?e[n]:new J().copy(e[n]):typeof e[n]=="number"&&(this[n]=e[MediaKeySystemAccess]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Yn(this.center._x,this.center._y,this._radius,t,this.focal._x,this.focal._y);return ae.each(Ye.Properties.concat(Yn.Properties),function(r){n[r]=this[r]},this),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return ae.each(Yn.Properties,function(t){e[t]=this[t]},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}},Ie=Yn;w(Ie,"Stop",en),w(Ie,"Properties",["center","radius","focal"]);var al={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(e){this._center&&this._center.unbind(X.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(X.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(X.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(X.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Mg(){this._flagCenter=!0}function Ag(){this._flagFocal=!0}function ll(e,t){if(t===0||t===1)return!0;const r=e._length*t;let s=0;for(let o=0;o<e._lengths.length;o++){const a=e._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Rr(e,t){const n=e._length;if(t<=0)return 0;if(t>=n)return e._lengths.length-1;for(let r=0,s=0;r<e._lengths.length;r++){if(s+e._lengths[r]>=t)return t-=s,Math.max(r-1,0)+t/e._lengths[r];s+=e._lengths[r]}return-1}function cl(e,t,n){let r,s,o,a,l,c,d,h;const f=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(f||t).x,c=(f||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,f&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Ua(r,l,s,c,o,d,a,h,n)}function dl(e,t,n){let r,s,o,a,l,c,d,h;const f=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(f||t).x,c=(f||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,f&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Ps(r,l,s,c,o,d,a,h,n)}function Un(e){switch(e.renderer.type){case"texture":return Te.fromObject(e);case"gradient":return Ye.fromObject(e);case"linear-gradient":return Ae.fromObject(e);case"radial-gradient":return Ie.fromObject(e)}return e}var Ig=Math.cos,Vg=Math.sin,hl=Math.tan,As=[],Vt=class extends X{constructor(e,t,n,r,s,o){super(),w(this,"elements",new Qt(9)),w(this,"manual",!1);let a=e;Array.isArray(a)||(a=Array.prototype.slice.call(arguments)),this.identity(),a.length>0&&this.set(a)}static Multiply(e,t,n){if(t.length<=3){const v=e;let B,k,N;const P=t[0]||0,R=t[1]||0,W=t[2]||0;return B=v[0]*P+v[1]*R+v[2]*W,k=v[3]*P+v[4]*R+v[5]*W,N=v[6]*P+v[7]*R+v[8]*W,[B,k,N]}const r=e[0],s=e[1],o=e[2],a=e[3],l=e[4],c=e[5],d=e[6],h=e[7],f=e[8],p=t[0],u=t[1],g=t[2],m=t[3],y=t[4],_=t[5],b=t[6],S=t[7],x=t[8];return n=n||new Qt(9),n[0]=r*p+s*m+o*b,n[1]=r*u+s*y+o*S,n[2]=r*g+s*_+o*x,n[3]=a*p+l*m+c*b,n[4]=a*u+l*y+c*S,n[5]=a*g+l*_+c*x,n[6]=d*p+h*m+f*b,n[7]=d*u+h*y+f*S,n[8]=d*g+h*_+f*x,n}static fromObject(e){return new Vt().copy(e)}set(e,t,n,r,s,o,a,l,c){if(typeof t>"u"){const d=e;e=d[0],t=d[1],n=d[2],r=d[3],s=d[4],o=d[5],a=d[6],l=d[7],c=d[8]}return this.elements[0]=e,this.elements[1]=t,this.elements[2]=n,this.elements[3]=r,this.elements[4]=s,this.elements[5]=o,this.elements[6]=a,this.elements[7]=l,this.elements[8]=c,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]=Vt.Identity[0],this.elements[1]=Vt.Identity[1],this.elements[2]=Vt.Identity[2],this.elements[3]=Vt.Identity[3],this.elements[4]=Vt.Identity[4],this.elements[5]=Vt.Identity[5],this.elements[6]=Vt.Identity[6],this.elements[7]=Vt.Identity[7],this.elements[8]=Vt.Identity[8],this.trigger(X.Types.change)}multiply(e,t,n,r,s,o,a,l,c){if(typeof t>"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 n>"u"&&(n=1),typeof r>"u"){e=e||0,t=t||0,n=n||0,s=this.elements;const F=s[0]*e+s[1]*t+s[2]*n,M=s[3]*e+s[4]*t+s[5]*n,V=s[6]*e+s[7]*t+s[8]*n;return[F,M,V]}const d=this.elements,h=[e,t,n,r,s,o,a,l,c],f=d[0],p=d[1],u=d[2],g=d[3],m=d[4],y=d[5],_=d[6],b=d[7],S=d[8],x=h[0],v=h[1],B=h[2],k=h[3],N=h[4],P=h[5],R=h[6],W=h[7],q=h[8];return this.elements[0]=f*x+p*k+u*R,this.elements[1]=f*v+p*N+u*W,this.elements[2]=f*B+p*P+u*q,this.elements[3]=g*x+m*k+y*R,this.elements[4]=g*v+m*N+y*W,this.elements[5]=g*B+m*P+y*q,this.elements[6]=_*x+b*k+S*R,this.elements[7]=_*v+b*N+S*W,this.elements[8]=_*B+b*P+S*q,this.trigger(X.Types.change)}inverse(e){const t=this.elements;e=e||new Vt;const n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],l=t[5],c=t[6],d=t[7],h=t[8],f=h*a-l*d,p=-h*o+l*c,u=d*o-a*c;let g=n*f+r*p+s*u;return g?(g=1/g,e.elements[0]=f*g,e.elements[1]=(-h*r+s*d)*g,e.elements[2]=(l*r-s*a)*g,e.elements[3]=p*g,e.elements[4]=(h*n-s*c)*g,e.elements[5]=(-l*n+s*o)*g,e.elements[6]=u*g,e.elements[7]=(-d*n+r*c)*g,e.elements[8]=(a*n-r*o)*g,e):null}scale(e,t){return arguments.length<=1&&(t=e),this.multiply(e,0,0,0,t,0,0,0,1)}rotate(e){const t=Ig(e),n=Vg(e);return this.multiply(t,-n,0,n,t,0,0,0,1)}translate(e,t){return this.multiply(1,0,e,0,1,t,0,0,1)}skewX(e){const t=hl(e);return this.multiply(1,t,0,0,1,0,0,0,1)}skewY(e){const t=hl(e);return this.multiply(1,0,0,t,1,0,0,0,1)}toString(e){return As.length=0,this.toTransformArray(e,As),As.map(Ne).join(" ")}toTransformArray(e,t){const n=this.elements,r=!!t,s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],d=n[5];if(e){const h=n[6],f=n[7],p=n[8];if(r){t[0]=s,t[1]=l,t[2]=h,t[3]=o,t[4]=c,t[5]=f,t[6]=a,t[7]=d,t[8]=p;return}return[s,l,h,o,c,f,a,d,p]}if(r){t[0]=s,t[1]=l,t[2]=o,t[3]=c,t[4]=a,t[5]=d;return}return[s,l,o,c,a,d]}toArray(e,t){const n=this.elements,r=!!t,s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],d=n[5];if(e){const h=n[6],f=n[7],p=n[8];if(r){t[0]=s,t[1]=o,t[2]=a,t[3]=l,t[4]=c,t[5]=d,t[6]=h,t[7]=f,t[8]=p;return}return[s,o,a,l,c,d,h,f,p]}if(r){t[0]=s,t[1]=o,t[2]=a,t[3]=l,t[4]=c,t[5]=d;return}return[s,o,a,l,c,d]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Vt().copy(this)}},Gn=Vt;w(Gn,"Identity",[1,0,0,0,1,0,0,0,1]),Wa(Gn);var Is=class extends Xn{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 Pr)Object.defineProperty(this,e,Pr[e]);this._renderer.flagMatrix=ul.bind(this),this.isShape=!0,this.matrix=new Gn,this.worldMatrix=new Gn,this.position=new J,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const t=new Is().copy(e);return"id"in e&&(t.id=e.id),t}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return Pr.position.get.apply(this,arguments)}set translation(e){Pr.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 J?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 J?e.scale:new J(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 t=new Is;return t.position.copy(this.position),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._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 J?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 J?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}},mn=Is;w(mn,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Pr={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(X.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(X.Types.change,this._renderer.flagMatrix),ul.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(e){this._rotation=e,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof J&&this._scale.unbind(X.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof J&&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(e){this._skewX=e,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(e){this._skewY=e,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(e){this._matrix=e,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return ja(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function ul(){this._flagMatrix=!0}var Si=Math.min,Bi=Math.max,Og=Math.ceil,zg=Math.floor,Lg=new J,Pn=class extends mn{constructor(e,t,n,r){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,"_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);for(let s in fl)Object.defineProperty(this,s,fl[s]);this._renderer.type="path",this._renderer.flagVertices=pl.bind(this),this._renderer.bindVertices=gl.bind(this),this._renderer.unbindVertices=ml.bind(this),this._renderer.flagFill=yl.bind(this),this._renderer.flagStroke=_l.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!t,this.curved=!!n,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=!r,this.dashes=[],this.dashes.offset=0}static fromObject(e){const t=typeof e.fill=="string"?e.fill:Un(e.fill),n=typeof e.stroke=="string"?e.stroke:Un(e.stroke),r=new Pn().copy(Ns($s({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e),this.vertices=[];for(let t=0;t<e.vertices.length;t++){const n=e.vertices[t];n instanceof ve?this.vertices.push(e.vertices[t].clone()):this.vertices.push(new ve().copy(n))}for(let t=0;t<Pn.Properties.length;t++){const n=Pn.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Pn;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<Pn.Properties.length;n++){const r=Pn.Properties[n];t[r]=this[r]}return t.className=this.className,t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(t=>t.toObject()),ae.each(Pn.Properties,t=>{typeof this[t]<"u"&&(this[t].toObject?e[t]=this[t].toObject():e[t]=this[t])},this),e}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),t=e.width/2,n=e.height/2,r=e.left+e.width/2,s=e.top+e.height/2;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s,a.x+=t,a.y+=n}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.x+=t,this.mask.translation.y-=s,this.mask.translation.y+=n),this}center(){const e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let r=0;r<this.vertices.length;r++){const s=this.vertices[r];s.x-=t,s.y-=n}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getBoundingClientRect(e){let t,n,r,s,o,a,l=1/0,c=-1/0,d=1/0,h=-1/0;if(this._update(!0),t=e?this.matrix:this.worldMatrix,n=(this.linewidth||0)/2,r=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:f,scaleY:p}=ki(t.elements[0],t.elements[3],t.elements[1],t.elements[4],t.elements[2],t.elements[5]);typeof f=="number"&&typeof p=="number"&&(n=Math.max(f,p)*(this.linewidth||0)/2)}else n*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(r<=0)return{width:0,height:0};for(s=0;s<r;s++){a=this._renderer.vertices[s],o=this._renderer.vertices[(s+r-1)%r];const[f,p]=t.multiply(o.x,o.y),[u,g]=t.multiply(a.x,a.y);if(o.controls&&a.controls){let m=o.controls.right.x,y=o.controls.right.y;o.relative&&(m+=o.x,y+=o.y);let[_,b]=t.multiply(m,y),S=a.controls.left.x,x=a.controls.left.y;a.relative&&(S+=a.x,x+=a.y);let[v,B]=t.multiply(S,x);const k=Ga(f,p,_,b,v,B,u,g);d=Si(k.min.y-n,d),l=Si(k.min.x-n,l),c=Bi(k.max.x+n,c),h=Bi(k.max.y+n,h)}else s<=1&&(d=Si(p-n,d),l=Si(f-n,l),c=Bi(f+n,c),h=Bi(p+n,h)),d=Si(g-n,d),l=Si(u-n,l),c=Bi(u+n,c),h=Bi(g+n,h)}return{top:d,left:l,right:c,bottom:h,width:c-l,height:h-d}}getPointAt(e,t){let n,r,s,o,a,l,c,d,h,f,p,u,g,m,y,_=this.length*Math.min(Math.max(e,0),1);const b=this.vertices.length,S=b-1;let x=null,v=null;for(let K=0,T=this._lengths.length,$=0;K<T;K++){if($+this._lengths[K]>=_){this._closed?(n=At(K,b),r=At(K-1,b),K===0&&(n=r,r=K)):(n=K,r=Math.min(Math.max(K-1,0),S)),x=this.vertices[n],v=this.vertices[r],_-=$,this._lengths[K]!==0?e=_/this._lengths[K]:e=0;break}$+=this._lengths[K]}if(x===null||v===null)return null;if(x){if(!v)return x}else return v;y=v.controls&&v.controls.right,m=x.controls&&x.controls.left,a=v.x,f=v.y,l=(y||v).x,p=(y||v).y,c=(m||x).x,u=(m||x).y,d=x.x,g=x.y,y&&v.relative&&(l+=v.x,p+=v.y),m&&x.relative&&(c+=x.x,u+=x.y),o=Gi(e,a,l,c,d),h=Gi(e,f,p,u,g);const B=Mt(a,l,e),k=Mt(f,p,e),N=Mt(l,c,e),P=Mt(p,u,e),R=Mt(c,d,e),W=Mt(u,g,e),q=Mt(B,N,e),F=Mt(k,P,e),M=Mt(N,R,e),V=Mt(P,W,e);return ae.isObject(t)?(t.x=o,t.y=h,t instanceof ve&&(t.controls.left.x=q,t.controls.left.y=F,t.controls.right.x=M,t.controls.right.y=V,(typeof t.relative!="boolean"||t.relative)&&(t.controls.left.x-=o,t.controls.left.y-=h,t.controls.right.x-=o,t.controls.right.y-=h)),t.t=e,t):(s=new ve(o,h,q-o,F-h,M-o,V-h,this._curved?ee.curve:ee.line),s.t=e,s)}plot(){if(this.curved)return Za(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?ee.move:ee.line;return this}subdivide(e){this._update();const t=this.vertices.length-1,n=this._closed||this.vertices[t]._command===ee.close;let r=this.vertices[t],s=[],o;return ae.each(this.vertices,function(a,l){if(l<=0&&!n){r=a;return}if(a.command===ee.move){s.push(new ve(r.x,r.y)),l>0&&(s[s.length-1].command=ee.line),r=a;return}o=dl(a,r,e),s=s.concat(o),ae.each(o,function(c,d){d<=0&&r.command===ee.move?c.command=ee.move:c.command=ee.line}),l>=t&&(this._closed&&this._automatic&&(r=a,o=dl(a,r,e),s=s.concat(o),ae.each(o,function(c,d){d<=0&&r.command===ee.move?c.command=ee.move:c.command=ee.line})),s.push(new ve(a.x,a.y)),s[s.length-1].command=n?ee.close:ee.line),r=a},this),this._automatic=!1,this._curved=!1,this.vertices=s,this}_updateLength(e,t){t||this._update();const r=this.vertices.length-1;let s=this.vertices[r],o=0;return typeof this._lengths>"u"&&(this._lengths=[]),ae.each(this.vertices,function(a,l){if(l<=0||a.command===ee.move){s=a,this._lengths[l]=0;return}this._lengths[l]=cl(a,s,e),o+=this._lengths[l],s=a},this),this._length=o,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,t=this._closed,n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=Rr(this,n*this._length),o=Rr(this,r*this._length),a=Og(s),l=zg(o);let c,d,h,f,p,u;for(this._renderer.vertices.length=0,u=0;u<e;u++)this._renderer.collection.length<=u&&this._renderer.collection.push(new ve),u>l&&!d?(p=this._renderer.collection[u].copy(this._collection[u]),this.getPointAt(r,p),p.command=this._renderer.collection[u].command,this._renderer.vertices.push(p),d=p,h=this._collection[u-1],h&&h.controls&&(p.relative?p.controls.right.clear():p.controls.right.copy(p),h.relative?this._renderer.collection[u-1].controls.right.copy(h.controls.right).lerp(J.zero,1-p.t):this._renderer.collection[u-1].controls.right.copy(h.controls.right).lerp(h,1-p.t))):u>=a&&u<=l&&(p=this._renderer.collection[u].copy(this._collection[u]),this._renderer.vertices.push(p),u===l&&ll(this,r)?(d=p,!t&&d.controls&&(d.relative?d.controls.right.clear():d.controls.right.copy(d))):u===a&&ll(this,n)&&(c=p,c.command=ee.move,!t&&c.controls&&(c.relative?c.controls.left.clear():c.controls.left.copy(c))));a>0&&!c&&(u=a-1,p=this._renderer.collection[u].copy(this._collection[u]),this.getPointAt(n,p),p.command=ee.move,this._renderer.vertices.unshift(p),f=this._collection[u+1],f&&f.controls&&(p.controls.left.clear(),f.relative?this._renderer.collection[u+1].controls.left.copy(f.controls.left).lerp(J.zero,p.t):(Lg.copy(f),this._renderer.collection[u+1].controls.left.copy(f.controls.left).lerp(f,p.t))))}return mn.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=!1,mn.prototype.flagReset.call(this),this}},xe=Pn;w(xe,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),w(xe,"Utils",{getCurveLength:cl});var fl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ie||this._fill instanceof Te)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ie||this._fill instanceof Te)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ie||this._stroke instanceof Te)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ie||this._stroke instanceof Te)&&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(e){this._closed=!!e,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=!!e,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){if(e===this._automatic)return;this._automatic=!!e;const t=this._automatic?"ignore":"listen";ae.each(this.vertices,function(n){n[t]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(X.Types.insert,t).unbind(X.Types.remove,n),e instanceof Rn?this._collection=e:this._collection=new Rn(e||[]),this._collection.bind(X.Types.insert,t).bind(X.Types.remove,n),t(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function pl(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function gl(e){let t=e.length;for(;t--;)e[t].bind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function ml(e){let t=e.length;for(;t--;)e[t].unbind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function yl(){this._flagFill=!0}function _l(){this._flagStroke=!0}var Zi=class extends xe{constructor(e,t,n,r){const s=[new ve,new ve,new ve,new ve];super(s,!0,!1,!0),w(this,"_flagWidth",0),w(this,"_flagHeight",0),w(this,"_width",0),w(this,"_height",0),w(this,"_origin",null),this._renderer.type="rectangle";for(let o in bl)Object.defineProperty(this,o,bl[o]);this.width=typeof n=="number"?n:1,this.height=typeof r=="number"?r:1,this.origin=new J,typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t),this._update()}static fromObject(e){const t=new Zi().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Zi.Properties.length;t++){const n=Zi.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,t=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new ve),this.vertices[0].set(-e,-t).sub(this._origin).command=ee.move,this.vertices[1].set(e,-t).sub(this._origin).command=ee.line,this.vertices[2].set(e,t).sub(this._origin).command=ee.line,this.vertices[3].set(-e,t).sub(this._origin).command=ee.line,this.vertices[4]&&(this.vertices[4].set(-e,-t).sub(this._origin).command=ee.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=new Zi(0,0,this.width,this.height);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}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}},Fn=Zi;w(Fn,"Properties",["width","height"]);var bl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(X.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(X.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Ji=class extends Fn{constructor(e,t,n,r,s,o){super(t,n,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);for(let a in wl)Object.defineProperty(this,a,wl[a]);this.noStroke(),this.noFill(),e instanceof Te?this.texture=e:typeof e=="string"&&(this.texture=new Te(e)),this.origin=new J,this._update(),typeof r=="number"&&(this.columns=r),typeof s=="number"&&(this.rows=s),typeof o=="number"&&(this.frameRate=o),this.index=0}static fromObject(e){const t=new Ji().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ji.Properties.length;t++){const n=Ji.Properties[t];n in e&&(this[n]=e[n])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=ae.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof t=="number"&&(this._lastFrame=t),typeof n=="function"?this._onLastFrame=n: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 t=new Ji(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&t.play(this._firstFrame,this._lastFrame),t.loop=this.loop,t.firstFrame=this.firstFrame,t.lastFrame=this.lastFrame,e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return 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}_update(){const e=this._texture,t=this._columns,n=this._rows;let r,s,o,a,l,c,d,h,f;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)){d=e.image.width,h=e.image.height,r=d/t,s=h/n,a=this._amount,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s),this._playing&&this._frameRate>0&&(ae.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=ae.performance.now()-this._startTime,f=this._lastFrame+1,l=1e3*(f-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),c=Mt(this._firstFrame,f,o/l),c=Math.floor(c),c!==this._index&&(this._index=c,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const p=this._index%t,u=Math.floor(this._index/t),g=-r*p+(d-r)/2,m=-s*u+(h-s)/2;g!==e.offset.x&&(e.offset.x=g),m!==e.offset.y&&(e.offset.y=m)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}},Fr=Ji;w(Fr,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var wl={texture:{enumerable:!0,get:function(){return this._texture},set:function(e){this._texture=e,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(e){this._columns=e,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(e){this._rows=e,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}},Vs,vl=class extends Rn{constructor(t){t=Array.isArray(t)?t:Array.prototype.slice.call(arguments),super(t),za(this,Vs,{}),this.attach(t),this.on(X.Types.insert,this.attach),this.on(X.Types.remove,this.detach)}get ids(){return $t(this,Vs)}attach(t){for(let n=0;n<t.length;n++){const r=t[n];r&&r.id&&(this.ids[r.id]=r)}return this}detach(t){for(let n=0;n<t.length;n++)delete this.ids[t[n].id];return this}};Vs=new WeakMap;var Kn=class extends xe{constructor(e,t,n,r,s,o,a){const l=a||xt.Resolution*3,c=[];for(let d=0;d<l;d++)c.push(new ve);super(c,!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",ut),w(this,"_innerRadius",0),w(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let d in kl)Object.defineProperty(this,d,kl[d]);typeof n=="number"&&(this.innerRadius=n),typeof r=="number"&&(this.outerRadius=r),typeof s=="number"&&(this.startAngle=s),typeof o=="number"&&(this.endAngle=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Kn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Kn.Properties.length;t++){const n=Kn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,t=this._endAngle,n=this._innerRadius,r=this._outerRadius,s=At(e,ut)===At(t,ut),o=n>0,a=this.vertices;let l=o?a.length/2:a.length,c,d=0,h,f,p,u,g,m,y,_,b;for(s?l--:o||(l-=2),h=0,f=l-1;h<l;h++){switch(p=h/f,u=a[d],g=p*(t-e)+e,m=(t-e)/l,y=r*Math.cos(g),_=r*Math.sin(g),h){case 0:c=ee.move;break;default:c=ee.curve}u.command=c,u.x=y,u.y=_,u.controls.left.clear(),u.controls.right.clear(),u.command===ee.curve&&(b=r*m/Math.PI,u.controls.left.x=b*Math.cos(g-et),u.controls.left.y=b*Math.sin(g-et),u.controls.right.x=b*Math.cos(g+et),u.controls.right.y=b*Math.sin(g+et),h===1&&u.controls.left.multiplyScalar(2),h===f&&u.controls.right.multiplyScalar(2)),d++}if(o){for(s?(a[d].command=ee.close,d++):(l--,f=l-1),h=0;h<l;h++)p=h/f,u=a[d],g=(1-p)*(t-e)+e,m=(t-e)/l,y=n*Math.cos(g),_=n*Math.sin(g),c=ee.curve,h<=0&&(c=s?ee.move:ee.line),u.command=c,u.x=y,u.y=_,u.controls.left.clear(),u.controls.right.clear(),u.command===ee.curve&&(b=n*m/Math.PI,u.controls.left.x=b*Math.cos(g+et),u.controls.left.y=b*Math.sin(g+et),u.controls.right.x=b*Math.cos(g-et),u.controls.right.y=b*Math.sin(g-et),h===1&&u.controls.left.multiplyScalar(2),h===f&&u.controls.right.multiplyScalar(2)),d++;a[d].copy(a[0]),a[d].command=ee.line}else s||(a[d].command=ee.line,a[d].x=0,a[d].y=0,d++,a[d].copy(a[0]),a[d].command=ee.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 t=this.innerRadius,n=this.outerRadius,r=this.startAngle,s=this.endAngle,o=this.vertices.length,a=new Kn(0,0,t,n,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<xe.Properties.length;l++){const c=xe.Properties[l];a[c]=this[c]}return e&&e.add(a),a}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let t=0;t<Kn.Properties.length;t++){const n=Kn.Properties[t];e[n]=this[n]}return e}},Mr=Kn;w(Mr,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var kl={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}}},Os=Math.cos,zs=Math.sin,Zn=class extends xe{constructor(e,t,n,r){const s=r?Math.max(r,2):4,o=[];for(let a=0;a<s;a++)o.push(new ve(0,0,0,0,0,0));super(o,!0,!0,!0),w(this,"_flagRadius",!1),w(this,"_radius",0),this._renderer.type="circle";for(let a in xl)Object.defineProperty(this,a,xl[a]);typeof n=="number"&&(this.radius=n),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Zn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Zn.Properties.length;t++){const n=Zn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const t=4/3*Math.tan(Math.PI/(e*2)),n=this._radius,r=n*t;for(let s=0;s<this.vertices.length;s++){const a=s/e*ut,l=n*Os(a),c=n*zs(a),d=r*Os(a-et),h=r*zs(a-et),f=r*Os(a+et),p=r*zs(a+et),u=this.vertices[s];u.command=s===0?ee.move:ee.curve,u.set(l,c),u.controls.left.set(d,h),u.controls.right.set(f,p)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const t=new Zn(0,0,this.radius,this.vertices.length);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let t=0;t<Zn.Properties.length;t++){const n=Zn.Properties[t];e[n]=this[n]}return e}},Qi=Zn;w(Qi,"Properties",["radius"]);var xl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Ls=Math.cos,Ds=Math.sin,Jn=class extends xe{constructor(e,t,n,r,s){typeof r!="number"&&typeof n=="number"&&(r=n);const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new ve);super(a,!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 l in Cl)Object.defineProperty(this,l,Cl[l]);typeof n=="number"&&(this.width=n*2),typeof r=="number"&&(this.height=r*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Jn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Jn.Properties.length;t++){const n=Jn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const t=4/3*Math.tan(Math.PI/(this.vertices.length*2)),n=this._width/2,r=this._height/2;for(let s=0;s<this.vertices.length;s++){const a=s/e*ut,l=n*Ls(a),c=r*Ds(a),d=n*t*Ls(a-et),h=r*t*Ds(a-et),f=n*t*Ls(a+et),p=r*t*Ds(a+et),u=this.vertices[s];u.command=s===0?ee.move:ee.curve,u.set(l,c),u.controls.left.set(d,h),u.controls.right.set(f,p)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=this.width/2,n=this.height/2,r=this.vertices.length,s=new Jn(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let t=0;t<Jn.Properties.length;t++){const n=Jn.Properties[t];e[n]=this[n]}return e}},er=Jn;w(er,"Properties",["width","height"]);var Cl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},Dg=Math.ceil,Hg=Math.floor,Mn=class extends mn{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,"_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,"noFill",xe.prototype.noFill),w(this,"noStroke",xe.prototype.noStroke),w(this,"corner",xe.prototype.corner),w(this,"center",xe.prototype.center),w(this,"getBoundingClientRect",xe.prototype.getBoundingClientRect),w(this,"_updateLength",xe.prototype._updateLength);for(let t in Sl)Object.defineProperty(this,t,Sl[t]);this._renderer.type="points",this._renderer.flagVertices=pl.bind(this),this._renderer.bindVertices=gl.bind(this),this._renderer.unbindVertices=ml.bind(this),this._renderer.flagFill=yl.bind(this),this._renderer.flagStroke=_l.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 t=typeof e.fill=="string"?e.fill:Un(e.fill),n=typeof e.stroke=="string"?e.stroke:Un(e.stroke),r=new Mn().copy(Ns($s({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e);for(let t=0;t<e.vertices.length;t++){const n=e.vertices[t];n instanceof ve?this.vertices.push(e.vertices[t].clone()):this.vertices.push(new ve().copy(n))}for(let t=0;t<Mn.Properties.length;t++){const n=Mn.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Mn;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<Mn.Properties.length;n++){const r=Mn.Properties[n];t[r]=this[r]}return t.className=this.className,t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(t=>t.toObject()),ae.each(Mn.Properties,function(t){typeof this[t]<"u"&&(this[t].toObject?e[t]=this[t].toObject():e[t]=this[t])},this),e}subdivide(e){this._update();let t=[];for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n],s=this.vertices[n-1];if(!s)continue;const o=r.x,a=r.y,l=s.x,c=s.y,d=Ps(o,a,o,a,l,c,l,c,e);t=t.concat(d)}return this.vertices=t,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),t=Math.max(this._beginning,this._ending),n=Rr(this,e*this._length),r=Rr(this,t*this._length),s=Dg(n),o=Hg(r);let a=0,l;this._renderer.vertices=[],this._renderer.collection=[];for(let c=0;c<this._collection.length;c++)c>=s&&c<=o&&(l=this._collection[c],this._renderer.collection.push(l),this._renderer.vertices[a*2+0]=l.x,this._renderer.vertices[a*2+1]=l.y,a++)}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}},Ar=Mn;w(Ar,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);var Sl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ie||this._fill instanceof Te)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ie||this._fill instanceof Te)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ie||this._stroke instanceof Te)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ie||this._stroke instanceof Te)&&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(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(X.Types.insert,t).unbind(X.Types.remove,n),e instanceof Rn?this._collection=e:this._collection=new Rn(e||[]),this._collection.bind(X.Types.insert,t).bind(X.Types.remove,n),t(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}},Wg=Math.cos,jg=Math.sin,Qn=class extends xe{constructor(e,t,n,r){r=Math.max(r||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 s in Bl)Object.defineProperty(this,s,Bl[s]);this.closed=!0,this.automatic=!1,typeof n=="number"&&(this.radius=n),typeof r=="number"&&(this.sides=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Qn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Qn.Properties.length;t++){const n=Qn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,t=e+1;let n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){const s=(r+.5)/e,o=ut*s+Math.PI/2,a=this._width*Wg(o)/2,l=this._height*jg(o)/2;r>=n?this.vertices.push(new ve(a,l)):this.vertices[r].set(a,l),this.vertices[r].command=r===0?ee.move:ee.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const t=new Qn(0,0,0,this.sides);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,t.width=this.width,t.height=this.height,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let t=0;t<Qn.Properties.length;t++){const n=Qn.Properties[t];e[n]=this[n]}return e}},Ir=Qn;w(Ir,"Properties",["width","height","sides"]);var Bl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},ei=class extends xe{constructor(e,t,n,r,s){typeof s>"u"&&typeof n=="number"&&typeof r=="number"&&(s=Math.floor(Math.min(n,r)/12));const o=[];for(let a=0;a<10;a++)o.push(new ve(0,0,0,0,0,0,a===0?ee.move:ee.curve));super(o),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 a in Tl)Object.defineProperty(this,a,Tl[a]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Xg.bind(this),typeof n=="number"&&(this.width=n),typeof r=="number"&&(this.height=r),typeof s=="number"&&(this.radius=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new ei().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<ei.Properties.length;t++){const n=ei.Properties[t];if(n in e){const r=e[n];/radius/i.test(n)?this[n]=typeof r=="number"||r instanceof J?r:new J().copy(r):typeof r=="number"&&(this[n]=r)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,t=this._height;let n,r;this._radius instanceof J?(n=this._radius.x,r=this._radius.y):(n=this._radius,r=this._radius);let s,o=e/2,a=t/2;s=this.vertices[0],s.x=-(o-n),s.y=-a,s=this.vertices[1],s.x=o-n,s.y=-a,s.controls.left.clear(),s.controls.right.x=n,s.controls.right.y=0,s=this.vertices[2],s.x=o,s.y=-(a-r),s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[3],s.x=o,s.y=a-r,s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=r,s=this.vertices[4],s.x=o-n,s.y=a,s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[5],s.x=-(o-n),s.y=a,s.controls.left.clear(),s.controls.right.x=-n,s.controls.right.y=0,s=this.vertices[6],s.x=-o,s.y=a-r,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[7],s.x=-o,s.y=-(a-r),s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=-r,s=this.vertices[8],s.x=-(o-n),s.y=-a,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[9],s.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 t=this.width,n=this.height,r=this.radius,s=new ei(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let t=0;t<ei.Properties.length;t++){const n=ei.Properties[t];e[n]=this[n]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}},tr=ei;w(tr,"Properties",["width","height","radius"]);var Tl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof J&&this._radius.unbind(X.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof J&&this._radius.bind(X.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Xg(){this._flagRadius=!0}var qg=Math.cos,Yg=Math.sin,ti=class extends xe{constructor(e,t,n,r,s){arguments.length<=3&&(r=n,n=r/2),(typeof s!="number"||s<=0)&&(s=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 o in El)Object.defineProperty(this,o,El[o]);this.closed=!0,this.automatic=!1,typeof n=="number"&&(this.innerRadius=n),typeof r=="number"&&(this.outerRadius=r),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new ti().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<ti.Properties.length;t++){const n=ti.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,t=e+1;let n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){const s=(r+.5)/e,o=ut*s,a=(r%2?this._outerRadius:this._innerRadius)/2,l=a*qg(o),c=a*Yg(o);r>=n?this.vertices.push(new ve(l,c)):this.vertices[r].set(l,c),this.vertices[r].command=r===0?ee.move:ee.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const t=this.innerRadius,n=this.outerRadius,r=this.sides,s=new ti(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let t=0;t<ti.Properties.length;t++){const n=ti.Properties[t];e[n]=this[n]}return e}},Vr=ti;w(Vr,"Properties",["innerRadius","outerRadius","sides"]);var El={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},Hs,$l=Math.min,Nl=Math.max;De.document&&(Hs=document.createElement("canvas"));var Ot=class extends mn{constructor(e,t,n,r){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,"_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);for(let s in Rl)Object.defineProperty(this,s,Rl[s]);if(this._renderer.type="text",this._renderer.flagFill=Ug.bind(this),this._renderer.flagStroke=Gg.bind(this),this.value=e,typeof t=="number"&&(this.translation.x=t),typeof n=="number"&&(this.translation.y=n),this.dashes=[],this.dashes.offset=0,!ae.isObject(r))return this;for(let s=0;s<Ot.Properties.length;s++){const o=Ot.Properties[s];o in r&&(this[o]=r[o])}}static Measure(e){if(Hs){const t=Hs.getContext("2d");t.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const n=t.measureText(e.value,0,0),r=n.actualBoundingBoxDescent+n.actualBoundingBoxAscent;return{width:n.width,height:r}}else{const t=this.value.length*this.size*Ot.Ratio,n=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:t,height:n}}}static fromObject(e){const t=typeof e.fill=="string"?e.fill:Un(e.fill),n=typeof e.stroke=="string"?e.stroke:Un(e.stroke),r=new Ot().copy(Ns($s({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e);for(let t=0;t<Ot.Properties.length;t++){const n=Ot.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Ot(this.value);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale;for(let n=0;n<Ot.Properties.length;n++){const r=Ot.Properties[n];t[r]=this[r]}return this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let t=0;t<Ot.Properties.length;t++){const n=Ot.Properties[t];e[n]=this[n]}return e}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let t,n,r,s,o;this._update(!0),t=e?this.matrix:this.worldMatrix;const{width:a,height:l}=Ot.Measure(this),c=(this._linewidth||0)/2;switch(this.alignment){case"left":n=-c,r=a+c;break;case"right":n=-(a+c),r=c;break;default:n=-(a/2+c),r=a/2+c}switch(this.baseline){case"middle":s=-(l/2+c),o=l/2+c;break;default:s=-(l+c),o=c}const[d,h]=t.multiply(n,s),[f,p]=t.multiply(n,o),[u,g]=t.multiply(r,s),[m,y]=t.multiply(r,o);return s=$l(h,p,g,y),n=$l(d,f,u,m),r=Nl(d,f,u,m),o=Nl(h,p,g,y),{top:s,left:n,right:r,bottom:o,width:r-n,height:o-s}}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}},Dt=Ot;w(Dt,"Ratio",.6),w(Dt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);var Rl={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ie||this._fill instanceof Te)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ie||this._fill instanceof Te)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ie||this._stroke instanceof Te)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ie||this._stroke instanceof Te)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function Ug(){this._flagFill=!0}function Gg(){this._flagStroke=!0}var Or=Math.min,zr=Math.max,Ti=class extends mn{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);for(let t in Pl)Object.defineProperty(this,t,Pl[t]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let t=0;t<e.length;t++)Fl.call(this,e[t],this)}static RemoveChildren(e){for(let t=0;t<e.length;t++)Fl.call(this,e[t])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const t=new Ti;for(let r=0;r<Ti.Properties.length;r++){const s=Ti.Properties[r];s in e&&(/(fill|stroke)/i.test(s)?t[s]=typeof e[s]=="string"?e[s]:Un(e[s]):t[s]=e[s])}return"mask"in e&&(t.mask=n(e.mask)),"id"in e&&(t.id=e.id),t.children=e.children.map(n),t;function n(r){if(r&&r.renderer)switch(r.renderer.type){case"arc-segment":return Mr.fromObject(r);case"circle":return Qi.fromObject(r);case"ellipse":return er.fromObject(r);case"points":return Ar.fromObject(r);case"polygon":return Ir.fromObject(r);case"rectangle":return Fn.fromObject(r);case"rounded-rectangle":return tr.fromObject(r);case"star":return Vr.fromObject(r);case"path":return xe.fromObject(r);case"text":return Dt.fromObject(r);case"group":return Ti.fromObject(r);case"shape":return mn.fromObject(r);case"element":return Xn.fromObject(r)}return r}}copy(e){return super.copy.call(this,e),console.warn("Two.Group.copy is not supported yet."),this}clone(e){const t=new Ti,n=this.children.map(function(r){return r.clone()});return t.add(n),t.opacity=this.opacity,this.mask&&(t.mask=this.mask),t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.className=this.className,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._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,ae.each(this.children,(t,n)=>{e.children[n]=t.toObject()},this),e}corner(){const e=this.getBoundingClientRect(!0);for(let t=0;t<this.children.length;t++){const n=this.children[t];n.translation.x-=e.left,n.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),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let r=0;r<this.children.length;r++){const s=this.children[r];s.isShape&&(s.translation.x-=t,s.translation.y-=n)}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getById(e){let t=null;function n(r){if(r.id===e)return r;if(r.children){if(r.children.ids[e])return r.children.ids[e];for(let s=0;s<r.children.length;s++)if(t=n(r.children[s]),t)return t}return null}return n(this)}getByClassName(e){const t=[];function n(r){if(Array.prototype.indexOf.call(r.classList,e)>=0&&t.push(r),r.children)for(let s=0;s<r.children.length;s++){const o=r.children[s];n(o)}return t}return n(this)}getByType(e){const t=[];function n(r){if(r instanceof e&&t.push(r),r.children)for(let s=0;s<r.children.length;s++){const o=r.children[s];n(o)}return t}return n(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let t=0;t<e.length;t++){const n=e[t];if(!(n&&n.id))continue;const r=Array.prototype.indexOf.call(this.children,n);r>=0&&this.children.splice(r,1),this.children.push(n)}return this}remove(e){const t=arguments.length,n=this.parent;if(t<=0&&n)return n.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let r=0;r<e.length;r++){const s=e[r];if(!s||!this.children.ids[s.id])continue;const o=this.children.indexOf(s);o>=0&&this.children.splice(o,1)}return this}getBoundingClientRect(e){let t,n,r,s,o,a;this._update(!0);let l=1/0,c=-1/0,d=1/0,h=-1/0;const f=/texture|gradient/i;n=e?this.matrix:this.worldMatrix;for(let p=0;p<this.children.length;p++){const u=this.children[p];if(!(!u.visible||f.test(u._renderer.type))&&(t=u.getBoundingClientRect(e),r=typeof t.top!="number"||ae.isNaN(t.top)||!isFinite(t.top),s=typeof t.left!="number"||ae.isNaN(t.left)||!isFinite(t.left),o=typeof t.right!="number"||ae.isNaN(t.right)||!isFinite(t.right),a=typeof t.bottom!="number"||ae.isNaN(t.bottom)||!isFinite(t.bottom),!(r||s||o||a)))if(e){const[g,m]=n.multiply(t.left,t.top),[y,_]=n.multiply(t.right,t.top),[b,S]=n.multiply(t.left,t.bottom),[x,v]=n.multiply(t.right,t.bottom);d=Or(m,_,S,v,d),l=Or(g,y,b,x,l),c=zr(g,y,b,x,c),h=zr(m,_,S,v,h)}else d=Or(t.top,d),l=Or(t.left,l),c=zr(t.right,c),h=zr(t.bottom,h)}return{top:d,left:l,right:c,bottom:h,width:c-l,height:h-d}}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(t){t.subdivide.apply(t,e)}),this}_update(){let e,t,n;if(this._flagBeginning||this._flagEnding){const r=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),o=this.length;let a=0;const l=r*o,c=s*o;for(e=0;e<this.children.length;e++)n=this.children[e],t=n.length,l>a+t?(n.beginning=1,n.ending=1):c<a?(n.beginning=0,n.ending=0):l>a&&l<a+t?(n.beginning=(l-a)/t,n.ending=1):c>a&&c<a+t?(n.beginning=0,n.ending=(c-a)/t):(n.beginning=0,n.ending=1),a+=t}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}},Ke=Ti;w(Ke,"Children",vl),w(Ke,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var Pl={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){const t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){const t=Ke.InsertChildren.bind(this),n=Ke.RemoveChildren.bind(this),r=Ke.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new vl(e),this._children.bind(X.Types.insert,t),this._children.bind(X.Types.remove,n),this._children.bind(X.Types.order,r),e.length>0&&t(e)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,ae.isObject(e)&&!e.clip&&(e.clip=!0)}}};function Fl(e,t){const n=e.parent;let r;if(n===t){s();return}if(n&&n.children.ids[e.id]&&(r=Array.prototype.indexOf.call(n.children,e),n.children.splice(r,1),o()),t){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete e.parent;function s(){t.subtractions.length>0&&(r=Array.prototype.indexOf.call(t.subtractions,e),r>=0&&t.subtractions.splice(r,1)),t.additions.length>0&&(r=Array.prototype.indexOf.call(t.additions,e),r>=0&&t.additions.splice(r,1)),e.parent=t,t.additions.push(e),t._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,e),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,e),r<0&&(n.subtractions.push(e),n._flagSubtractions=!0)}}var Ws=class extends xe{constructor(t,n,r,s){const o=[new ve(t,n),new ve(r,s)];super(o);for(let a in Ml)Object.defineProperty(this,a,Ml[a]);this.vertices[0].command=ee.move,this.vertices[1].command=ee.line,this.automatic=!1}},Ml={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(ae.isObject(e))this.vertices.splice(0,1,e);else{const t=new Nt("Two.Line.x argument is not an object.");console.warn(t.name,t.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(ae.isObject(e))this.vertices.splice(1,1,e);else{const t=new Nt("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}},tn={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},Kg={start:"left",middle:"center",end:"right"},Al=["id","class","transform","xmlns","viewBox"],Zg=["x","y","width","height","href","xlink:href"];function Jg(e){return Kg[e]}function Qg(e){const t=e.getAttribute("dominant-baseline"),n=e.getAttribute("alignment-baseline");return t||n}function nr(e){return e.replace(/svg:/gi,"").toLowerCase()}function Il(e,t){if(t.x+=e.translateX,t.y+=e.translateY,t.x*=e.scaleX,t.y*=e.scaleY,e.rotation!==0){const n=t.length();t.x=n*Math.cos(e.rotation),t.y=n*Math.sin(e.rotation)}}function em(e,t){t||(t={});const n=e.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,"");t[l]=c}return t}function tm(e){const t={},n=nm(e),r=Math.max(n.length,e.style.length);for(let s=0;s<r;s++){const o=e.style[s],a=n[s];o&&(t[o]=e.style[o]),a&&(t[a]=e.getAttribute(a))}return t}function nm(e){const t=e.getAttributeNames();for(let n=0;n<Al.length;n++){const r=Al[n],s=Array.prototype.indexOf.call(t,r);s>=0&&t.splice(s,1)}return t}function im(e,t){const n=t.split(/[\s,]/),r=-parseFloat(n[0]),s=-parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&s)for(let f=0;f<e.children.length;f++){const p=e.children[f];"translation"in p?p.translation.add(r,s):"x"in p?p.x=r:"y"in p&&(p.y=s)}const l=typeof e.x=="number",c=typeof e.y=="number",d=typeof e.width=="number",h=typeof e.height=="number";return l&&(e.translation.x+=e.x),c&&(e.translation.y+=e.y),(d||h)&&(e.scale=new J(1,1)),d&&(e.scale.x=e.width/o),h&&(e.scale.y=e.height/a),e.mask=new Fn(0,0,o,a),e.mask.origin.set(-o/2,-a/2),e}function Ht(e,t,n){const r={},s={},o={};let a,l,c,d,h,f,p,u,g,m,y,_,b,S,x,v,B;if(e===null)return r;if(De.getComputedStyle){const k=De.getComputedStyle(e);for(a=k.length;a--;)c=k[a],d=k[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<e.attributes.length;a++)f=e.attributes[a],/style/i.test(f.nodeName)?em(f.value,o):s[f.nodeName]=f.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&ae.defaults(r,n),ae.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=e.gradientTransform&&e.gradientTransform.baseVal&&e.gradientTransform.baseVal.length>0?e.gradientTransform.baseVal[0].matrix:e.getCTM?e.getCTM():null,l===null))break;switch(p=ki(l),t._renderer.type){case"linear-gradient":Il(p,t.left),Il(p,t.right);break;case"radial-gradient":t.center.x+=p.translateX,t.center.y+=p.translateY,t.focal.x+=p.translateX,t.focal.y+=p.translateY,t.radius*=Math.max(p.scaleX,p.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=e.transform&&e.transform.baseVal&&e.transform.baseVal.length>0?e.transform.baseVal[0].matrix:e.getCTM?e.getCTM():null,l===null))break;p=ki(l),t.translation.set(p.translateX,p.translateY),t.rotation=Math.PI*(p.rotation/180),t.scale=new J(p.scaleX,p.scaleY),u=parseFloat((r.x+"").replace("px")),g=parseFloat((r.y+"").replace("px")),u&&(t.translation.x=u),g&&(t.translation.y=g);break;case"visible":if(t instanceof Ke){t._visible=d;break}t.visible=d;break;case"stroke-linecap":if(t instanceof Ke){t._cap=d;break}t.cap=d;break;case"stroke-linejoin":if(t instanceof Ke){t._join=d;break}t.join=d;break;case"stroke-miterlimit":if(t instanceof Ke){t._miter=d;break}t.miter=d;break;case"stroke-width":if(t instanceof Ke){t._linewidth=parseFloat(d);break}t.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(t instanceof Ke){t._opacity=parseFloat(d);break}t.opacity=parseFloat(d);break;case"clip-path":if(tn.cssBackgroundImage.test(d)&&(m=d.replace(tn.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(m)&&(_=ze.defs.current.get(m),_&&_.childNodes.length>0)))switch(_=_.childNodes[0],b=nr(_.nodeName),t.mask=ze[b].call(this,_,{}),t._renderer.type){case"text":case"path":t.position.add(t.mask.position),t.mask.position.clear();break}break;case"fill":case"stroke":h=(t instanceof Ke?"_":"")+c,tn.cssBackgroundImage.test(d)?(m=d.replace(tn.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(m)?(_=ze.defs.current.get(m),_.object||(b=nr(_.nodeName),_.object=ze[b].call(this,_,{})),_=_.object):(y=sm(this),_=y.getById(m)),t[h]=_):t[h]=d;break;case"id":t.id=d;break;case"class":case"className":t.classList=d.split(" "),t._flagClassName=!0;break;case"x":case"y":if(S=t instanceof Ye,x=t instanceof Ae,v=t instanceof Ie,S||x||v)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Nt("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),t.translation[c]=parseFloat(d);break;case"font-family":t instanceof Dt&&(t.family=d);break;case"font-size":t instanceof Dt&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Nt("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),t.size=parseFloat(d));break;case"font-weight":t instanceof Dt&&(t.weight=d);break;case"font-style":t instanceof Dt&&(t.style=d);break;case"text-decoration":t instanceof Dt&&(t.decoration=d);break;case"line-height":t instanceof Dt&&(t.leading=d);break}return Object.keys(e.dataset).length&&(t.dataset=e.dataset),r}function rm(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){const s=e.childNodes[n];!s.id||nr(e.nodeName)==="#text"||t.add(s.id,s)}}function sm(e){for(;e.parent;)e=e.parent;return e.scene}var ze={svg:function(e){const t=ze.defs.current=new $r,n=e.getElementsByTagName("defs");for(let g=0;g<n.length;g++)rm(n[g],t);const r=ze.g.call(this,e),s=e.getAttribute("viewBox"),o=e.getAttribute("x"),a=e.getAttribute("y"),l=e.getAttribute("width"),c=e.getAttribute("height");r.defs=t;const d=s!==null,h=o!==null,f=a!==null,p=l!==null,u=c!==null;return h&&(r.x=parseFloat(o.replace(tn.unitSuffix,""))),f&&(r.y=parseFloat(a.replace(tn.unitSuffix,""))),p&&(r.width=parseFloat(l.replace(tn.unitSuffix,""))),u&&(r.height=parseFloat(c.replace(tn.unitSuffix,""))),d&&im(r,s),delete ze.defs.current,r},defs:function(e){return null},use:function(e,t){let n;const r=e.getAttribute("href")||e.getAttribute("xlink:href");if(!r)return n=new Nt("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 Nt("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<e.attributes.length;c++){const d=e.attributes[c],h=Zg.includes(d.nodeName),f=!a.hasAttribute(d.nodeName);(h||f)&&a.setAttribute(d.nodeName,d.value)}const l=nr(a.nodeName);return ze[l].call(this,a,t)},g:function(e,t){const n=new Ke;Ht.call(this,e,n,t),this.add(n);const r=tm.call(this,e);for(let s=0,o=e.childNodes.length;s<o;s++){const a=e.childNodes[s],l=a.nodeName;if(!l)return;const c=nr(l);if(c in ze){const d=ze[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(e,t){let n;typeof e=="string"?n=e:n=e.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 xe(r,!0);return s.stroke="none",s.fill="black",Ht.call(this,e,s,t),s},polyline:function(e,t){const n=ze.polygon.call(this,e,t);return n.closed=!1,n},path:function(e,t){let n;typeof e=="string"?(n=e,e=null):n=e.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 f=h.length-1;ae.each(h.slice(0),function(p,u){const g=p.slice(1).trim().match(tn.path),m=p[0],y=m.toLowerCase();let _,b,S,x,v;const B=[];switch(u===0&&(h=[]),y){case"h":case"v":g.length>1&&(_=1);break;case"m":case"l":case"t":g.length>2&&(_=2);break;case"s":case"q":g.length>4&&(_=4);break;case"c":g.length>6&&(_=6);break;case"a":g.length>7&&(_=7);break}if(_){for(b=0,S=g.length,v=0;b<S;b+=_){if(x=m,v>0)switch(m){case"m":x="l";break;case"M":x="L";break}B.push(x+g.slice(b,b+_).join(" ")),v++}h=Array.prototype.concat.apply(h,B)}else h.push(p)}),ae.each(h,function(p,u){let g,m,y;const _=p[0],b=_.toLowerCase();d=p.slice(1).trim().match(tn.path),o=_===b;let S,x,v,B,k,N,P,R,W,q,F,M,V,K,T,$,j;switch(b){case"z":if(u>=f)s=!0;else{m=l.x,y=l.y,g=new ve(m,y,void 0,void 0,void 0,void 0,ee.close);for(let z=r.length-1;z>=0;z--){const U=r[z];if(/m/i.test(U.command)){l=U;break}}}break;case"m":case"l":c=void 0,m=parseFloat(d[0]),y=parseFloat(d[1]),g=new ve(m,y,void 0,void 0,void 0,void 0,/m/i.test(b)?ee.move:ee.line),o&&g.addSelf(l),l=g;break;case"h":case"v":q=/h/i.test(b)?"x":"y",F=/x/i.test(q)?"y":"x",g=new ve(void 0,void 0,void 0,void 0,void 0,void 0,ee.line),g[q]=parseFloat(d[0]),g[F]=l[F],o&&(g[q]+=l[q]),l=g;break;case"c":case"s":S=l.x,x=l.y,c||(c=new J),/c/i.test(b)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[2]),N=parseFloat(d[3]),P=parseFloat(d[4]),R=parseFloat(d[5])):(W=Fs(l,c,o),v=W.x,B=W.y,k=parseFloat(d[0]),N=parseFloat(d[1]),P=parseFloat(d[2]),R=parseFloat(d[3])),o&&(v+=S,B+=x,k+=S,N+=x,P+=S,R+=x),l.controls.right.set(v-l.x,B-l.y),g=new ve(P,R,k-P,N-R,void 0,void 0,ee.curve),l=g,c=g.controls.left;break;case"t":case"q":S=l.x,x=l.y,c||(c=new J),/q/i.test(b)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[0]),N=parseFloat(d[1]),P=parseFloat(d[2]),R=parseFloat(d[3])):(W=Fs(l,c,o),v=W.x,B=W.y,k=W.x,N=W.y,P=parseFloat(d[0]),R=parseFloat(d[1])),o&&(v+=S,B+=x,k+=S,N+=x,P+=S,R+=x),l.controls.right.set((v-l.x)*.33,(B-l.y)*.33),g=new ve(P,R,k-P,N-R,void 0,void 0,ee.curve),l=g,c=g.controls.left;break;case"a":S=l.x,x=l.y,V=parseFloat(d[0]),K=parseFloat(d[1]),T=parseFloat(d[2]),$=parseFloat(d[3]),j=parseFloat(d[4]),P=parseFloat(d[5]),R=parseFloat(d[6]),o&&(P+=S,R+=x),M=new ve(P,R),M.command=ee.arc,M.rx=V,M.ry=K,M.xAxisRotation=T,M.largeArcFlag=$,M.sweepFlag=j,g=M,l=M,c=void 0;break}g&&(Array.isArray(g)?r=r.concat(g):r.push(g))})}n=new xe(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},ae.each(n.vertices,function(l){l.subSelf(a.centroid)}),Ht.call(this,e,n,t),n.translation.addSelf(a.centroid),n},circle:function(e,t){const n=parseFloat(e.getAttribute("cx")),r=parseFloat(e.getAttribute("cy")),s=parseFloat(e.getAttribute("r")),o=new Qi(0,0,s);return o.stroke="none",o.fill="black",Ht.call(this,e,o,t),o.translation.x=n,o.translation.y=r,o},ellipse:function(e,t){const n=parseFloat(e.getAttribute("cx")),r=parseFloat(e.getAttribute("cy")),s=parseFloat(e.getAttribute("rx")),o=parseFloat(e.getAttribute("ry")),a=new er(0,0,s,o);return a.stroke="none",a.fill="black",Ht.call(this,e,a,t),a.translation.x=n,a.translation.y=r,a},rect:function(e,t){const n=parseFloat(e.getAttribute("rx")),r=parseFloat(e.getAttribute("ry"));if(!ae.isNaN(n)||!ae.isNaN(r))return ze["rounded-rect"](e);const s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new Fn(0,0,s,o);return c.stroke="none",c.fill="black",Ht.call(this,e,c,t),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(e,t){const n=parseFloat(e.getAttribute("rx"))||0,r=parseFloat(e.getAttribute("ry"))||0,s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new J(n,r),d=new tr(0,0,s,o,c);return d.stroke="none",d.fill="black",Ht.call(this,e,d,t),d.translation.x+=a,d.translation.y+=l,d},line:function(e,t){const n=parseFloat(e.getAttribute("x1")),r=parseFloat(e.getAttribute("y1")),s=parseFloat(e.getAttribute("x2")),o=parseFloat(e.getAttribute("y2")),a=new Ws(n,r,s,o).noFill();return Ht.call(this,e,a,t),a},lineargradient:function(e,t){let n=e.getAttribute("gradientUnits"),r=e.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(e.getAttribute("x1")||0),o=parseFloat(e.getAttribute("y1")||0),a=parseFloat(e.getAttribute("x2")||0),l=parseFloat(e.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 p=0;p<e.children.length;p++){const u=e.children[p];let g=u.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let m=u.getAttribute("stop-color"),y=u.getAttribute("stop-opacity"),_=u.getAttribute("style"),b;m===null&&(b=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,m=b&&b.length>1?b[1]:void 0),y===null?(b=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=b&&b.length>1?parseFloat(b[1]):1):y=parseFloat(y),h.push(new en(g,m,y))}const f=new Ae(s,o,a,l,h);return f.spread=r,f.units=n,Ht.call(this,e,f,t),f},radialgradient:function(e,t){let n=e.getAttribute("gradientUnits"),r=e.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(e.getAttribute("cx"))||0,o=parseFloat(e.getAttribute("cy"))||0,a=parseFloat(e.getAttribute("r")),l=parseFloat(e.getAttribute("fx")),c=parseFloat(e.getAttribute("fy"));ae.isNaN(l)&&(l=s),ae.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 f=[];for(let u=0;u<e.children.length;u++){const g=e.children[u];let m=g.getAttribute("offset");/%/gi.test(m)&&(m=parseFloat(m.replace(/%/gi,""))/100),m=parseFloat(m);let y=g.getAttribute("stop-color"),_=g.getAttribute("stop-opacity"),b=g.getAttribute("style"),S;y===null&&(S=b?b.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,y=S&&S.length>1?S[1]:void 0),_===null?(S=b?b.match(/stop-opacity:\s?([0-9.-]*)/):!1,_=S&&S.length>1?parseFloat(S[1]):1):_=parseFloat(_),f.push(new en(m,y,_))}const p=new Ie(s,o,a,f,l,c);return p.spread=r,p.units=n,Ht.call(this,e,p,t),p},text:function(e,t){const n=Jg(e.getAttribute("text-anchor"))||"left",r=Qg(e)||"baseline";let s="";e.childNodes.length>0&&e.childNodes[0].tagName==="TSPAN"?s=e.childNodes[0].textContent:s=e.textContent;const o=new Dt(s);return Ht.call(this,e,o,t),o.alignment=n,o.baseline=r,o},clippath:function(e,t){return ze.defs.current&&!ze.defs.current.contains(e.id)&&ze.defs.current.add(e.id,e),null},image:function(e,t){let n;const r=e.getAttribute("href")||e.getAttribute("xlink:href");if(!r)return n=new Nt("encountered <image /> with no href."),console.warn(n.name,n.message),null;const s=parseFloat(e.getAttribute("x"))||0,o=parseFloat(e.getAttribute("y"))||0,a=parseFloat(e.getAttribute("width")),l=parseFloat(e.getAttribute("height")),c=new Fr(r,s,o);return ae.isNaN(a)||(c.width=a),ae.isNaN(l)||(c.height=l),Ht.call(this,e,c,t),c}};function Vl(e,t){const n=new XMLHttpRequest;return n.open("GET",e),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&t(n.responseText)},n.send(),n}var Ei=class extends Fn{constructor(e,t,n,r){super(t,n,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);for(let s in Ol)Object.defineProperty(this,s,Ol[s]);this._renderer.flagTextures=om.bind(this),this._renderer.bindTextures=am.bind(this),this._renderer.unbindTextures=lm.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(zl.bind(this)):this.textures=[zl(e)],this.origin=new J,this._update(),typeof r=="number"?this.frameRate=r:this.frameRate=Ei.DefaultFrameRate,this.index=0}static fromObject(e){const t=new Ei().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ei.Properties.length;t++){const n=Ei.Properties[t];n in e&&(this[n]=e[n])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=ae.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof t=="number"&&(this._lastFrame=t),typeof n=="function"?this._onLastFrame=n: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 t=new Ei(this.textures,this.translation.x,this.translation.y,this.frameRate);return t._loop=this._loop,this._playing&&t.play(),e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.textures=this.textures.map(function(t){return t.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}_update(){const e=this._textures;let t,n,r,s,o,a,l,c;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(s=this._amount,ae.isNaN(this._lastFrame)&&(this._lastFrame=s-1),r=ae.performance.now()-this._startTime,c=this._lastFrame+1,o=1e3*(c-this._firstFrame)/this._frameRate,this._loop?r=r%o:r=Math.min(r,o),l=Mt(this._firstFrame,c,r/o),l=Math.floor(l),l!==this._index&&(this._index=l,a=e[this._index],a.loaded&&(t=a.image.width,n=a.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n),this.fill=a,l>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Te))&&(a=e[this._index],a.loaded&&(t=a.image.width,n=a.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n)),this.fill=a)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}},Lr=Ei;w(Lr,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),w(Lr,"DefaultFrameRate",30);var Ol={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(e){const t=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(X.Types.insert,t).unbind(X.Types.remove,n),this._textures=new Rn((e||[]).slice(0)),this._textures.bind(X.Types.insert,t).bind(X.Types.remove,n),t(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}};function om(){this._flagTextures=!0}function am(e){let t=e.length;for(;t--;)e[t].bind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function lm(e){let t=e.length;for(;t--;)e[t].unbind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function zl(e){if(e instanceof Te)return e;if(typeof e=="string")return new Te(e)}var js=[],Xs=Math.max,cm=Math.min,Ll=Math.abs,Dr=Math.sin,Hr=Math.cos,dm=Math.acos,Wr=Math.sqrt,Be={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(e){return e in Be?e:"path"},group:{renderChild:function(e){const t=Be.getRendererType(e._renderer.type);Be[t].render.call(e,this.ctx,!0,this.clip)},render:function(e){if(!this._visible)return this;this._update();const t=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);const r=this._mask,s=jr(t),o=!s||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=e,o&&(e.save(),s||e.transform(t[0],t[3],t[1],t[4],t[2],t[5])),r){const a=Be.getRendererType(r._renderer.type);Be[a].render.call(r,e,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Be.getRendererType(l._renderer.type);Be[c].render.call(l,e)}return o&&e.restore(),this.flagReset()}},path:{render:function(e,t,n){let r,s,o,a,l,c,d,h,f,p,u,g,m,y,_,b,S,x,v,B,k,N,P,R,W,q,F,M,V,K,T,$,j,z;if(z=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,V=this._mask,K=this._clip,l=this._opacity*(z||1),c=this._visible,!t&&(!c||K||l===0))return this;if(this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,d=this._cap,h=this._join,f=this._miter,p=this._closed,u=this._renderer.vertices,g=u.length,m=g-1,T=jr(r),j=this.dashes,T||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),V){const re=Be.getRendererType(V._renderer.type);Be[re].render.call(V,e,!0)}if(a)if(typeof a=="string")e.fillStyle=a;else{const re=Be.getRendererType(a._renderer.type);Be[re].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const re=Be.getRendererType(s._renderer.type);Be[re].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o),f&&(e.miterLimit=f),h&&(e.lineJoin=h),!p&&d&&(e.lineCap=d)}typeof l=="number"&&(e.globalAlpha=l),j&&j.length>0&&(e.lineDashOffset=j.offset||0,e.setLineDash(j)),e.beginPath();let U,I,O,Z,ge,ie,he;for(let re=0;re<g;re++)switch(b=u[re],F=b.x,M=b.y,b.command){case ee.close:e.closePath();break;case ee.arc:U=b.rx,I=b.ry,O=b.xAxisRotation,Z=b.largeArcFlag,ge=b.sweepFlag,y=p?At(re-1,g):Xs(re-1,0),_=u[y],ie=_.x,he=_.y,Be.renderSvgArcCommand(e,ie,he,U,I,Z,ge,O,F,M);break;case ee.curve:y=p?At(re-1,g):Math.max(re-1,0),_=u[y],P=_.controls&&_.controls.right||J.zero,R=b.controls&&b.controls.left||J.zero,_._relative?(k=P.x+_.x,N=P.y+_.y):(k=P.x,N=P.y),b._relative?(v=R.x+b.x,B=R.y+b.y):(v=R.x,B=R.y),e.bezierCurveTo(k,N,v,B,F,M),re>=m&&p&&(S=x,W=b.controls&&b.controls.right||J.zero,q=S.controls&&S.controls.left||J.zero,b._relative?(k=W.x+b.x,N=W.y+b.y):(k=W.x,N=W.y),S._relative?(v=q.x+S.x,B=q.y+S.y):(v=q.x,B=q.y),F=S.x,M=S.y,e.bezierCurveTo(k,N,v,B,F,M));break;case ee.line:e.lineTo(F,M);break;case ee.move:x=b,e.moveTo(F,M);break}return p&&e.closePath(),!K&&!n&&(Be.isHidden.test(a)||($=a._renderer&&a._renderer.offset,$&&(e.save(),e.translate(-a._renderer.offset.x,-a._renderer.offset.y),e.scale(a._renderer.scale.x,a._renderer.scale.y)),e.fill(),$&&e.restore()),Be.isHidden.test(s)||($=s._renderer&&s._renderer.offset,$&&(e.save(),e.translate(-s._renderer.offset.x,-s._renderer.offset.y),e.scale(s._renderer.scale.x,s._renderer.scale.y),e.lineWidth=o/s._renderer.scale.x),e.stroke(),$&&e.restore())),T||e.restore(),K&&!n&&e.clip(),j&&j.length>0&&e.setLineDash(js),this.flagReset()}},points:{render:function(e,t,n){let r,s,o,a,l,c,d,h,f,p,u,g,m,y,_,b;if(b=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(b||1),c=this._visible,!t&&(!c||l===0))return this;if(this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,h=this._renderer.collection,f=h.length,m=jr(r),_=this.dashes,d=this._size,m||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")e.fillStyle=a;else{const v=Be.getRendererType(a._renderer.type);Be[v].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const v=Be.getRendererType(s._renderer.type);Be[v].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o)}typeof l=="number"&&(e.globalAlpha=l),_&&_.length>0&&(e.lineDashOffset=_.offset||0,e.setLineDash(_)),e.beginPath();let S=d*.5,x;this._sizeAttenuation||(x=this.worldMatrix.elements,x=ki(x[0],x[3],x[1],x[4],x[2],x[5]),S/=Math.max(x.scaleX,x.scaleY));for(let v=0;v<f;v++)p=h[v],u=p.x,g=p.y,e.moveTo(u+S,g),e.arc(u,g,S,0,ut);return n||(Be.isHidden.test(a)||(y=a._renderer&&a._renderer.offset,y&&(e.save(),e.translate(-a._renderer.offset.x,-a._renderer.offset.y),e.scale(a._renderer.scale.x,a._renderer.scale.y)),e.fill(),y&&e.restore()),Be.isHidden.test(s)||(y=s._renderer&&s._renderer.offset,y&&(e.save(),e.translate(-s._renderer.offset.x,-s._renderer.offset.y),e.scale(s._renderer.scale.x,s._renderer.scale.y),e.lineWidth=o/s._renderer.scale.x),e.stroke(),y&&e.restore())),m||e.restore(),_&&_.length>0&&e.setLineDash(js),this.flagReset()}},text:{render:function(e,t,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(!t&&(!o||l||s===0))return this;this._update();const c=this._matrix.elements,d=this._stroke,h=this._linewidth,f=this._fill,p=this._decoration,u=this._direction,g=jr(c),m=f._renderer&&f._renderer.offset&&d._renderer&&d._renderer.offset,y=this.dashes,_=Be.alignments[this._alignment]||this._alignment,b=Be.baselines[this._baseline]||this._baseline;let S,x,v,B,k,N,P,R,W,q,F;if(g||(e.save(),e.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const M=Be.getRendererType(a._renderer.type);Be[M].render.call(a,e,!0)}if(m||(e.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),e.textAlign=_,e.textBaseline=b,e.direction=u,f)if(typeof f=="string")e.fillStyle=f;else{const M=Be.getRendererType(f._renderer.type);Be[M].render.call(f,e,this),e.fillStyle=f._renderer.effect}if(d){if(typeof d=="string")e.strokeStyle=d;else{const M=Be.getRendererType(d._renderer.type);Be[M].render.call(d,e,this),e.strokeStyle=d._renderer.effect}h&&(e.lineWidth=h)}if(typeof s=="number"&&(e.globalAlpha=s),y&&y.length>0&&(e.lineDashOffset=y.offset||0,e.setLineDash(y)),!l&&!n&&(Be.isHidden.test(f)||(f._renderer&&f._renderer.offset?(N=f._renderer.scale.x,P=f._renderer.scale.y,e.save(),e.translate(-f._renderer.offset.x,-f._renderer.offset.y),e.scale(N,P),S=this._size/f._renderer.scale.y,x=this._leading/f._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",x+"px",this._family].join(" "),v=f._renderer.offset.x/f._renderer.scale.x,B=f._renderer.offset.y/f._renderer.scale.y,e.fillText(this.value,v,B),e.restore()):e.fillText(this.value,0,0)),Be.isHidden.test(d)||(d._renderer&&d._renderer.offset?(N=d._renderer.scale.x,P=d._renderer.scale.y,e.save(),e.translate(-d._renderer.offset.x,-d._renderer.offset.y),e.scale(N,P),S=this._size/d._renderer.scale.y,x=this._leading/d._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",x+"px",this._family].join(" "),v=d._renderer.offset.x/d._renderer.scale.x,B=d._renderer.offset.y/d._renderer.scale.y,k=h/d._renderer.scale.x,e.lineWidth=k,e.strokeText(this.value,v,B),e.restore()):e.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(p)){const M=e.measureText(this.value);let V=1;switch(p){case"underline":W=M.actualBoundingBoxDescent,F=M.actualBoundingBoxDescent;break;case"strikethrough":W=0,F=0,V=.5;break}switch(b){case"top":W+=this._size*V,F+=this._size*V;break;case"baseline":case"bottom":W-=this._size*V,F-=this._size*V;break}switch(_){case"left":case"start":R=0,q=M.width;break;case"right":case"end":R=-M.width,q=0;break;default:R=-M.width/2,q=M.width/2}e.lineWidth=Math.max(Math.floor(this._size/15),1),e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(R,W),e.lineTo(q,F),e.stroke()}return g||e.restore(),l&&!n&&e.clip(),y&&y.length>0&&e.setLineDash(js),this.flagReset()}},"linear-gradient":{render:function(e,t){if(t){if(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=t.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=e.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 this.flagReset()}}},"radial-gradient":{render:function(e,t){if(t){if(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=t.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=e.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 this.flagReset()}}},texture:{render:function(e){this._update();const t=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=e.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof J||(this._renderer.offset=new J),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,t&&(this._renderer.offset.x+=t.width/2,this._renderer.offset.y+=t.height/2,this._scale instanceof J?(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 J||(this._renderer.scale=new J),this._scale instanceof J?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),this.flagReset()}},renderSvgArcCommand:function(e,t,n,r,s,o,a,l,c,d){l=l*Math.PI/180,r=Ll(r),s=Ll(s);const h=(t-c)/2,f=(n-d)/2,p=Hr(l)*h+Dr(l)*f,u=-Dr(l)*h+Hr(l)*f,g=p*p,m=u*u;let y=r*r,_=s*s;const b=g/y+m/_;if(b>1){const M=Wr(b);r=M*r,s=M*s,y=r*r,_=s*s}const S=y*m+_*g,x=(y*_-S)/S;let v=Wr(Xs(0,x));o===a&&(v=-v);const B=v*r*u/s,k=-v*s*p/r,N=Hr(l)*B-Dr(l)*k+(t+c)/2,P=Dr(l)*B+Hr(l)*k+(n+d)/2,R=Dl(1,0,(p-B)/r,(u-k)/s),W=Dl((p-B)/r,(u-k)/s,(-p-B)/r,(-u-k)/s)%ut,q=R+W;hm(e,N,P,r,s,R,q,a===0,l)}},pt=class extends X{constructor(e){super();const t=e.smoothing!==!1;this.domElement=e.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=e.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=t),this.scene=new Ke,this.scene.parent=this}setSize(e,t,n){return this.width=e,this.height=t,this.ratio=typeof n>"u"?Ms(this.ctx):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,this.domElement.style&&ae.extend(this.domElement.style,{width:e+"px",height:t+"px"}),this.trigger(X.Types.resize,e,t,n)}render(){const e=this.ratio===1;return e||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Be.group.render.call(this.scene,this.ctx),e||this.ctx.restore(),this}};w(pt,"Utils",Be);function hm(e,t,n,r,s,o,a,l,c){const d=a-o,h=xi.Tolerance.epsilon,f=Math.abs(d)<h;let p=At(d,ut);p<h&&(f?p=0:p=ut),l===!0&&!f&&(p===ut?p=-ut:p=p-ut);for(let u=0;u<xt.Resolution;u++){const g=u/(xt.Resolution-1),m=o+g*p;let y=t+r*Math.cos(m),_=n+s*Math.sin(m);if(c!==0){const b=Math.cos(c),S=Math.sin(c),x=y-t,v=_-n;y=x*b-v*S+t,_=x*S+v*b+n}e.lineTo(y,_)}}function Dl(e,t,n,r){const s=e*n+t*r,o=Wr(e*e+t*t)*Wr(n*n+r*r);let a=dm(Xs(-1,cm(1,s/o)));return e*r-t*n<0&&(a=-a),a}function jr(e){return e[0]==1&&e[3]==0&&e[1]==0&&e[4]==1&&e[2]==0&&e[5]==0}var se={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(e,t){const n=e,r=document.createElementNS(se.ns,n);return n==="svg"&&(t=ae.defaults(t||{},{version:se.version})),t&&Object.keys(t).length>0&&se.setAttributes(r,t),r},setAttributes:function(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r++)/href/.test(n[r])?e.setAttributeNS(se.xlink,n[r],t[n[r]]):e.setAttribute(n[r],t[n[r]]);return this},removeAttributes:function(e,t){for(let n in t)e.removeAttribute(n);return this},toString:function(e,t){let n=e.length,r=n-1,s,o="";for(let a=0;a<n;a++){const l=e[a],c=t?At(a-1,n):Math.max(a-1,0),d=e[c];let h,f,p,u,g,m,y,_,b,S,x,v,B,k,N,P=Ne(l.x),R=Ne(l.y);switch(l.command){case ee.close:h=ee.close;break;case ee.arc:x=l.rx,v=l.ry,B=l.xAxisRotation,k=l.largeArcFlag,N=l.sweepFlag,h=ee.arc+" "+x+" "+v+" "+B+" "+k+" "+N+" "+P+" "+R;break;case ee.curve:y=d.controls&&d.controls.right||J.zero,_=l.controls&&l.controls.left||J.zero,d.relative?(p=Ne(y.x+d.x),u=Ne(y.y+d.y)):(p=Ne(y.x),u=Ne(y.y)),l.relative?(g=Ne(_.x+l.x),m=Ne(_.y+l.y)):(g=Ne(_.x),m=Ne(_.y)),h=(a===0?ee.move:ee.curve)+" "+p+" "+u+" "+g+" "+m+" "+P+" "+R;break;case ee.move:s=l,h=ee.move+" "+P+" "+R;break;default:h=l.command+" "+P+" "+R}a>=r&&t&&(l.command===ee.curve&&(f=s,b=l.controls&&l.controls.right||l,S=f.controls&&f.controls.left||f,l.relative?(p=Ne(b.x+l.x),u=Ne(b.y+l.y)):(p=Ne(b.x),u=Ne(b.y)),f.relative?(g=Ne(S.x+f.x),m=Ne(S.y+f.y)):(g=Ne(S.x),m=Ne(S.y)),P=Ne(f.x),R=Ne(f.y),h+=" C "+p+" "+u+" "+g+" "+m+" "+P+" "+R),l.command!==ee.close&&(h+=" Z")),o+=h+" "}return o},pointsToString:function(e,t){let n="";const r=t*.5;for(let s=0;s<e.length;s++){const o=e[s].x,a=e[s].y-r;n+=ee.move+" "+o+" "+a+" ",n+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return n},getClip:function(e,t){let n=e._renderer.clip;return n||(n=e._renderer.clip=se.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&t.defs.appendChild(n),n},getRendererType:function(e){return e in se?e:"path"},defs:{update:function(e){const{defs:t}=e;if(t._flagUpdate){const n=Array.prototype.slice.call(t.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})"]`;e.querySelector(a)||t.removeChild(s)}t._flagUpdate=!1}}},group:{appendChild:function(e){const t=e._renderer.elem;if(!t)return;const n=t.nodeName;!n||/(radial|linear)gradient/i.test(n)||e._clip||this.elem.appendChild(t)},removeChild:function(e){const t=e._renderer.elem;!t||t.parentNode!=this.elem||!t.nodeName||e._clip||this.elem.removeChild(t)},orderChild:function(e){this.elem.appendChild(e._renderer.elem)},renderChild:function(e){const t=se.getRendererType(e._renderer.type);se[t].render.call(e,this)},render:function(e){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;this._update(),this._renderer.elem||(this._renderer.elem=se.createElement("g",{id:this.id}),e.appendChild(this._renderer.elem));const t=this._matrix.manual||this._flagMatrix,n={domElement:e,elem:this._renderer.elem};t&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const s=this.children[r],o=se.getRendererType(s._renderer.type);se[o].render.call(s,e)}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(se.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(se.group.removeChild,n),this._flagOrder&&this.children.forEach(se.group.orderChild,n),this._flagMask)if(this._mask){const r=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),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),this.flagReset()}},path:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagVertices){const r=se.toString(this._renderer.vertices,this._closed);t.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}if(this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t["stroke-opacity"]=this._opacity,t["fill-opacity"]=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this._flagCap&&(t["stroke-linecap"]=this._cap),this._flagJoin&&(t["stroke-linejoin"]=this._join),this._flagMiter&&(t["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("path",t),e.appendChild(this._renderer.elem)),this._flagClip){const r=se.getClip(this,e),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=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.flagReset()}},points:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const o=this.worldMatrix.elements,a=ki(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=se.pointsToString(this._renderer.collection,r);t.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}return this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t["stroke-opacity"]=this._opacity,t["fill-opacity"]=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("path",t),e.appendChild(this._renderer.elem)),this.flagReset()}},text:{render:function(e){this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagFamily&&(t["font-family"]=this._family),this._flagSize&&(t["font-size"]=this._size),this._flagLeading&&(t["line-height"]=this._leading),this._flagAlignment&&(t["text-anchor"]=se.alignments[this._alignment]||this._alignment),this._flagBaseline&&(t["dominant-baseline"]=se.baselines[this._baseline]||this._baseline),this._flagStyle&&(t["font-style"]=this._style),this._flagWeight&&(t["font-weight"]=this._weight),this._flagDecoration&&(t["text-decoration"]=this._decoration),this._flagDirection&&(t.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=se.getRendererType(this._fill._renderer.type);se[r].render.call(this._fill,e,!0)}if(this._flagFill&&(t.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=se.getRendererType(this._stroke._renderer.type);se[r].render.call(this._stroke,e,!0)}if(this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t["stroke-width"]=this._linewidth),this._flagOpacity&&(t.opacity=this._opacity),this._flagClassName&&(t.class=this.classList.join(" ")),this._flagVisible&&(t.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(t["stroke-dasharray"]=this.dashes.join(" "),t["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?se.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=se.createElement("text",t),e.appendChild(this._renderer.elem)),this._flagClip){const r=se.getClip(this,e),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=se.getRendererType(this._mask._renderer.type);se[r].render.call(this._mask,e),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(e,t){t||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?se.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=se.createElement("linearGradient",n)),this._renderer.elem.parentNode===null&&e.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?se.setAttributes(o._renderer.elem,a):o._renderer.elem=se.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return this.flagReset()}},"radial-gradient":{render:function(e,t){t||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?se.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=se.createElement("radialGradient",n)),this._renderer.elem.parentNode===null&&e.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?se.setAttributes(o._renderer.elem,a):o._renderer.elem=se.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return this.flagReset()}},texture:{render:function(e,t){t||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 J?(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 J?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?se.setAttributes(this._renderer.image,r):this._renderer.image=se.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&se.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=se.createElement("pattern",n)),this._renderer.elem.parentNode===null&&e.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),this.flagReset()}}},Hl=class extends X{constructor(e){super(),this.domElement=e.domElement||se.createElement("svg"),this.scene=new Ke,this.scene.parent=this,this.defs=se.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(e,t){return this.width=e,this.height=t,se.setAttributes(this.domElement,{width:e,height:t}),this.trigger(X.Types.resize,e,t)}render(){return se.group.render.call(this.scene,this.domElement),se.defs.update(this.domElement),this}};w(Hl,"Utils",se);var Wt={create:function(e,t,n){const r=e.createShader(e[n]);if(e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){const o=e.getShaderInfoLog(r);throw e.deleteShader(r),new Nt("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,30 +100,30 @@
100
100
  }
101
101
  gl_FragColor = texel;
102
102
  }
103
- `}},Xr=Yn.Multiply,lm=[1,0,0,0,1,0,0,0,1],Pn=new Zt(9),cm=ft.Utils,Wl=new Z,qs=new Zt([0,0,1,0,0,1,0,1,1,0,1,1]),ye={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 Yn,group:{removeChild:function(e,t){if(e.children)for(let n=0;n<e.children.length;n++)ye.group.removeChild(e.children[n],t);e._renderer.texture&&(t.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(t.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer)},render:function(e,t){if(!this._visible)return;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 Zt(9)),this._matrix.toTransformArray(!0,Pn),Xr(Pn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z),this._scale instanceof Z?(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){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const a=ft.Utils.getRendererType(this._mask._renderer.type);ye[a].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.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++)ye.group.removeChild(this.subtractions[o],e);for(o=0;o<this.children.length;o++){const a=this.children[o],l=ft.Utils.getRendererType(a._renderer.type);ye[l].render.call(a,e,t)}return this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},path:{updateCanvas:function(e,t){let n,r,s,o,a,l,c,d,h,f,p,u,g,m;const _=t._renderer.vertices,y=this.canvas,b=this.ctx,S=e.renderer.ratio,C=Wl.copy(t._renderer.scale).multiply(S),v=t._stroke,B=t._linewidth,k=t._fill,E=t._renderer.opacity||t._opacity,P=t._cap,R=t._join,j=t._miter,q=t._closed,M=t.dashes,A=_.length,$=A-1;y.width=Math.max(Math.ceil(t._renderer.rect.width*C.x),1),y.height=Math.max(Math.ceil(t._renderer.rect.height*C.y),1);const X=t._renderer.rect.centroid,F=X.x,N=X.y;if(b.clearRect(0,0,y.width,y.height),k)if(typeof k=="string")b.fillStyle=k;else{const ge=ft.Utils.getRendererType(k._renderer.type);ye[ge].render.call(k,b,t),b.fillStyle=k._renderer.effect}if(v){if(typeof v=="string")b.strokeStyle=v;else{const ge=ft.Utils.getRendererType(v._renderer.type);ye[ge].render.call(v,b,t),b.strokeStyle=v._renderer.effect}B&&(b.lineWidth=B),j&&(b.miterLimit=j),R&&(b.lineJoin=R),!q&&P&&(b.lineCap=P)}typeof E=="number"&&(b.globalAlpha=E),M&&M.length>0&&(b.lineDashOffset=M.offset||0,b.setLineDash(M));let W,z,G,V,O,J,he,ie;b.save(),b.scale(C.x,C.y),b.translate(F,N),b.beginPath();for(let ge=0;ge<_.length;ge++){const re=_[ge];switch(u=re.x,g=re.y,re.command){case ee.close:b.closePath();break;case ee.arc:z=re.rx,G=re.ry,V=re.xAxisRotation,O=re.largeArcFlag,J=re.sweepFlag,n=q?Mt(ge-1,A):Math.max(ge-1,0),r=_[n],he=r.x,ie=r.y,cm.renderSvgArcCommand(b,he,ie,z,G,O,J,V,u,g);break;case ee.curve:n=q?Mt(ge-1,A):Math.max(ge-1,0),r=_[n],d=r.controls&&r.controls.right||Z.zero,h=re.controls&&re.controls.left||Z.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),b.bezierCurveTo(l,c,o,a,u,g),ge>=$&&q&&(s=W,f=re.controls&&re.controls.right||Z.zero,p=s.controls&&s.controls.left||Z.zero,re._relative?(l=f.x+re.x,c=f.y+re.y):(l=f.x,c=f.y),s._relative?(o=p.x+s.x,a=p.y+s.y):(o=p.x,a=p.y),u=s.x,g=s.y,b.bezierCurveTo(l,c,o,a,u,g));break;case ee.line:b.lineTo(u,g);break;case ee.move:W=re,b.moveTo(u,g);break}}q&&b.closePath(),ye.isHidden.test(k)||(m=k._renderer&&k._renderer.offset,m&&(b.save(),b.translate(-k._renderer.offset.x,-k._renderer.offset.y),b.scale(k._renderer.scale.x,k._renderer.scale.y)),b.fill(),m&&b.restore()),ye.isHidden.test(v)||(m=v._renderer&&v._renderer.offset,m&&(b.save(),b.translate(-v._renderer.offset.x,-v._renderer.offset.y),b.scale(v._renderer.scale.x,v._renderer.scale.y),b.lineWidth=B/v._renderer.scale.x),b.stroke(),m&&b.restore()),b.restore()},getBoundingClientRect:function(e,t,n){let r=1/0,s=-1/0,o=1/0,a=-1/0,l,c;e.forEach(function(d){const h=d.x,f=d.y,p=d.controls;let u,g,m,_,y,b;o=Math.min(f,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(f,a),d.controls&&(y=p.left,b=p.right,!(!y||!b)&&(u=d._relative?y.x+h:y.x,g=d._relative?y.y+f:y.y,m=d._relative?b.x+h:b.x,_=d._relative?b.y+f:b.y,!(!u||!g||!m||!_)&&(o=Math.min(g,_,o),r=Math.min(u,m,r),s=Math.max(u,m,s),a=Math.max(g,_,a))))}),typeof t=="number"&&(o-=t,r-=t,s+=t,a+=t),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(e,t,n){if(!this._visible||!this._opacity)return this;this._update();const r=n||this.parent,s=ft.Utils.getRendererType(this._renderer.type),o=t[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 Ie&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Be&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ie&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Be&&(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 Zt(9)),this._matrix.toTransformArray(!0,Pn),Xr(Pn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let f,p;this._scale instanceof Z?(f=this._scale.x*r._renderer.scale.x,p=this._scale.y*r._renderer.scale.y):(f=this._scale*r._renderer.scale.x,p=this._scale*r._renderer.scale.y),this._renderer.scale.x=f<0?-f:f,this._renderer.scale.y=p<0?-p:p,c&&(this._renderer.parent=r)}if(this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const f=ft.Utils.getRendererType(this._mask._renderer.type);ye[f].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,ye.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),ye.updateTexture.call(ye,e,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;t.current!==o&&(e.useProgram(o),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position),e.bufferData(e.ARRAY_BUFFER,qs,e.STATIC_DRAW),t.resolution.flagged||e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),t.current=o),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture);const h=this._renderer.rect;return e.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),e.uniform4f(o.rect,h.left,h.top,h.right,h.bottom),e.drawArrays(e.TRIANGLES,0,6),this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},points:{updateCanvas:function(e,t){let n;const r=this.canvas,s=this.ctx,o=e.renderer.ratio,a=t._stroke,l=t._linewidth,c=t._fill,d=t._renderer.opacity||t._opacity,h=t.dashes,f=t._size*o;let p=f;ye.isHidden.test(a)||(p+=l),r.width=Xa(p),r.height=r.width;const u=p/r.width,g=r.width/2,m=r.height/2;if(s.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")s.fillStyle=c;else{const _=ft.Utils.getRendererType(c._renderer.type);ye[_].render.call(c,s,t),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const _=ft.Utils.getRendererType(a._renderer.type);ye[_].render.call(a,s,t),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=l/u)}typeof d=="number"&&(s.globalAlpha=d),h&&h.length>0&&(s.lineDashOffset=h.offset||0,s.setLineDash(h)),s.save(),s.translate(g,m),s.scale(ye.precision,ye.precision),s.beginPath(),s.arc(0,0,f/u*.5,0,ht),s.restore(),closed&&s.closePath(),ye.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()),ye.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(e,t,n){if(!this._visible||!this._opacity)return this;this._update();let r=this._size;const s=n||this.parent,o=t[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=s._matrix.manual||s._flagMatrix,h=this._matrix.manual||this._flagMatrix,f=this._renderer.parent!==s,p=this._renderer.vertices,u=this._renderer.collection.length,g=this._flagVertices,m=this._flagFill||this._fill instanceof Ie&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Be&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ie&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Be&&(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||f){this._renderer.matrix||(this._renderer.matrix=new Zt(9)),this._matrix.toTransformArray(!0,Pn),Xr(Pn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let _,y;this._scale instanceof Z?(_=this._scale.x*s._renderer.scale.x,y=this._scale.y*s._renderer.scale.y):(_=this._scale*s._renderer.scale.x,y=this._scale*s._renderer.scale.y),this._renderer.scale.x=_<0?-_:_,this._renderer.scale.y=y<0?-y:y,f&&(this._renderer.parent=s)}if(g){const _=this._renderer.positionBuffer;_&&e.deleteBuffer(_),this._renderer.positionBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this._renderer.positionBuffer),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position),e.bufferData(e.ARRAY_BUFFER,p,e.STATIC_DRAW)}return m?(this._renderer.opacity=this._opacity*s._renderer.opacity,ye.updateTexture.call(ye,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(ye.isHidden.test(l)||(r+=c),r/=ye.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),t.current!==o&&(e.useProgram(o),t.resolution.flagged||e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),t.current=o),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture),e.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),e.uniform1f(o.size,r*t.resolution.ratio),e.drawArrays(e.POINTS,0,u),this.flagReset())}},text:{updateCanvas:function(e,t){const n=this.canvas,r=this.ctx,s=e.renderer.ratio,o=Wl.copy(t._renderer.scale).multiply(s),a=t._stroke,l=t._linewidth,c=t._fill,d=t._renderer.opacity||t._opacity,h=t.dashes,f=t._decoration,p=t._direction;n.width=Math.max(Math.ceil(t._renderer.rect.width*o.x),1),n.height=Math.max(Math.ceil(t._renderer.rect.height*o.y),1);const u=t._renderer.rect.centroid,g=u.x,m=u.y;let _,y,b,S,C,v,B,k,E,P,R;const j=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),j||(r.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=p,c)if(typeof c=="string")r.fillStyle=c;else{const q=ft.Utils.getRendererType(c._renderer.type);ye[q].render.call(c,r,t),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const q=ft.Utils.getRendererType(a._renderer.type);ye[q].render.call(a,r,t),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=l)}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,m),ye.isHidden.test(c)||(c._renderer&&c._renderer.offset?(v=c._renderer.scale.x,B=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(v,B),_=t._size/c._renderer.scale.y,y=t._leading/c._renderer.scale.y,r.font=[t._style,t._weight,_+"px/",y+"px",t._family].join(" "),b=c._renderer.offset.x/c._renderer.scale.x,S=c._renderer.offset.y/c._renderer.scale.y,r.fillText(t.value,b,S),r.restore()):r.fillText(t.value,0,0)),ye.isHidden.test(a)||(a._renderer&&a._renderer.offset?(v=a._renderer.scale.x,B=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(v,B),_=t._size/a._renderer.scale.y,y=t._leading/a._renderer.scale.y,r.font=[t._style,t._weight,_+"px/",y+"px",t._family].join(" "),b=a._renderer.offset.x/a._renderer.scale.x,S=a._renderer.offset.y/a._renderer.scale.y,C=l/a._renderer.scale.x,r.lineWidth=C,r.strokeText(t.value,b,S),r.restore()):r.strokeText(t.value,0,0)),/(underline|strikethrough)/i.test(f)){const q=r.measureText(t.value);switch(f){case"underline":E=q.actualBoundingBoxDescent,R=q.actualBoundingBoxDescent;break;case"strikethrough":E=0,R=0;break}k=-q.width/2,P=q.width/2,r.lineWidth=Math.max(Math.floor(t._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(k,E),r.lineTo(P,R),r.stroke()}r.restore()},getBoundingClientRect:function(e,t){const n=ye.ctx;n.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" "),n.textAlign="center",n.textBaseline=ft.Utils.baselines[e._baseline]||e._baseline;const r=n.measureText(e._value);let s=r.width,o=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!ye.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(ye.alignments[e._alignment]||e._alignment){case ye.alignments.left:e.direction==="ltr"?(t.left=0,t.right=s):(t.left=-s,t.right=0);break;case ye.alignments.right:e.direction==="ltr"?(t.left=-s,t.right=0):(t.left=0,t.right=s);break;default:t.left=-a,t.right=a}switch(e._baseline){case"bottom":t.top=-o,t.bottom=0;break;case"top":t.top=0,t.bottom=o;break;case"baseline":t.top=-l*1.5,t.bottom=l*.5;break;default:t.top=-l,t.bottom=l}t.width=s,t.height=o,t.centroid||(t.centroid={}),t.centroid.x=a,t.centroid.y=l},render:function(e,t,n){if(!this._visible||!this._opacity)return this;this._update();const r=n||this.parent,s=t[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 Ie&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Be&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ie&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Be&&(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 Zt(9)),this._matrix.toTransformArray(!0,Pn),Xr(Pn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let h,f;this._scale instanceof Z?(h=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=f<0?-f:f,l&&(this._renderer.parent=r)}if(this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const h=ft.Utils.getRendererType(this._mask._renderer.type);ye[h].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,ye.text.getBoundingClientRect(this,this._renderer.rect),ye.updateTexture.call(ye,e,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;t.current!==s&&(e.useProgram(s),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(s.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(s.position),e.bufferData(e.ARRAY_BUFFER,qs,e.STATIC_DRAW),t.resolution.flagged||e.uniform2f(e.getUniformLocation(s,"u_resolution"),t.resolution.width,t.resolution.height),t.current=s),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(s,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return e.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),e.uniform4f(s.rect,d.left,d.top,d.right,d.bottom),e.drawArrays(e.TRIANGLES,0,6),this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},"linear-gradient":{render:function(e,t){if(!(!e.canvas.getContext("2d")||!t)){if(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=t.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=e.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 this.flagReset()}}},"radial-gradient":{render:function(e,t){if(!(!e.canvas.getContext("2d")||!t)){if(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=t.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=e.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 this.flagReset()}}},texture:{render:function(e,t){if(!e.canvas.getContext("2d"))return;this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=e.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Z||(this._renderer.offset=new Z),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 Z?(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 Z||(this._renderer.scale=new Z);let r,s;this._scale instanceof Z?(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 this.flagReset()}},updateTexture:function(e,t){const n=ft.Utils.getRendererType(t._renderer.type);if(this[n].updateCanvas.call(ye,e,t),this.canvas.width<=0||this.canvas.height<=0){t._renderer.texture&&e.deleteTexture(t._renderer.texture),delete t._renderer.texture;return}t._renderer.texture||(t._renderer.texture=e.createTexture()),e.bindTexture(e.TEXTURE_2D,t._renderer.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.canvas),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)},program:{create:function(e,t){let n,r,s;if(n=e.createProgram(),ae.each(t,function(o){e.attachShader(n,o)}),e.linkProgram(n),r=e.getProgramParameter(n,e.LINK_STATUS),!r)throw s=e.getProgramInfoLog(n),e.deleteProgram(n),new $t("unable to link program: "+s);return n}},extensions:{init:function(e){const t={},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];t[s]=ye.extensions.get(e,s)}return t},get:function(e,t){return e.getExtension(t)||e.getExtension(`MOZ_${t}`)||e.getExtension(`WEBKIT_${t}`)}},TextureRegistry:new $r};ye.ctx=ye.canvas.getContext("2d");var jl=class extends Y{constructor(e){super();let t,n,r,s;if(this.domElement=e.domElement||document.createElement("canvas"),typeof e.offscreenElement<"u"&&(ye.canvas=e.offscreenElement,ye.ctx=ye.canvas.getContext("2d")),this.scene=new Ze,this.scene.parent=this,this._renderer={type:"renderer",matrix:new Zt(lm),scale:1,opacity:1},this._flagMatrix=!0,e=ae.defaults(e||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=e.overdraw,t=this.ctx=this.domElement.getContext("webgl",e)||this.domElement.getContext("experimental-webgl",e),!this.ctx)throw new $t("unable to create a webgl context. Try using another renderer.");r=Ht.create(t,Ht.path.vertex,Ht.types.vertex),s=Ht.create(t,Ht.path.fragment,Ht.types.fragment),this.programs={current:null,buffers:{position:t.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=ye.program.create(t,[r,s]),this.programs.text=this.programs.path,t.extensions=ye.extensions.init(t),t.renderer=this,n.position=t.getAttribLocation(n,"a_position"),n.matrix=t.getUniformLocation(n,"u_matrix"),n.rect=t.getUniformLocation(n,"u_rect");const o=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,o),t.vertexAttribPointer(n.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(n.position),t.bufferData(t.ARRAY_BUFFER,qs,t.STATIC_DRAW),r=Ht.create(t,Ht.points.vertex,Ht.types.vertex),s=Ht.create(t,Ht.points.fragment,Ht.types.fragment),n=this.programs.points=ye.program.create(t,[r,s]),n.position=t.getAttribLocation(n,"a_position"),n.matrix=t.getUniformLocation(n,"u_matrix"),n.size=t.getUniformLocation(n,"u_size"),t.enable(t.BLEND),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA)}setSize(e,t,n){let r,s;const o=this.ctx;return this.width=e,this.height=t,this.ratio=typeof n>"u"?Ms(o):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,ae.isObject(this.domElement.style)&&ae.extend(this.domElement.style,{width:e+"px",height:t+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=e*this.ratio,s=t*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(Y.Types.resize,e,t,n)}render(){const e=this.ctx;return this.overdraw||e.clear(e.COLOR_BUFFER_BIT),ye.group.render.call(this.scene,e,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};w(jl,"Utils",ye);var dm=ae.extend({Error:$t,getRatio:Ms,read:ze,xhr:Vl},ae,vt,La,Da),ir=class{constructor(e){w(this,"_events",new Y),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 t=ae.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:ir.Types.svg,autostart:!1});if(ae.each(t,function(n,r){/fullscreen/i.test(r)||/autostart/i.test(r)||(this[r]=n)},this),ae.isElement(t.domElement)){const n=t.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+n)||(this.type=ir.Types[n])}this.renderer=new ir[this.type](this),this.setPlaying(t.autostart),this.frameCount=0,t.fullscreen?(this.fit=hm.bind(this),this.fit.domElement=window,this.fit.attached=!0,ae.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),ae.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),At.bind(this.fit.domElement,"resize",this.fit),this.fit()):t.fitted?(this.fit=um.bind(this),ae.extend(this.renderer.domElement.style,{display:"block"})):typeof t.width=="number"&&typeof t.height=="number"&&(this.renderer.setSize(t.width,t.height,this.ratio),this.width=t.width,this.height=t.height),this.renderer.bind(Y.Types.resize,fm.bind(this)),this.scene=this.renderer.scene,ir.Instances.push(this),t.autostart&&rr.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,rr.init(),this.trigger(Y.Types.play)}pause(){return this.playing=!1,this.trigger(Y.Types.pause)}setPlaying(e){this.playing=e}release(e){let t,n,r;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)for(typeof e.vertices.unbind=="function"&&e.vertices.unbind(),t=0;t<e.vertices.length;t++)n=e.vertices[t],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());if(e.children){for(t=0;t<e.children.length;t++)r=e.children[t],this.release(r);typeof e.children.unbind=="function"&&e.children.unbind()}return e}update(){const e=!!this._lastFrame,t=ae.performance.now();e&&(this.timeDelta=parseFloat((t-this._lastFrame).toFixed(3))),this._lastFrame=t,this.fit&&this.fit.domElement&&!this.fit.attached&&(At.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const n=this.width,r=this.height,s=this.renderer;return(n!==s.width||r!==s.height)&&s.setSize(n,r,this.ratio),this.trigger(Y.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(Y.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,t,n,r){const s=new Ws(e,t,n,r);return this.scene.add(s),s}makeArrow(e,t,n,r,s){const o=typeof s=="number"?s:10,a=Math.atan2(r-t,n-e),l=[new ve(e,t,void 0,void 0,void 0,void 0,ee.move),new ve(n,r,void 0,void 0,void 0,void 0,ee.line),new ve(n-o*Math.cos(a-Math.PI/4),r-o*Math.sin(a-Math.PI/4),void 0,void 0,void 0,void 0,ee.line),new ve(n,r,void 0,void 0,void 0,void 0,ee.move),new ve(n-o*Math.cos(a+Math.PI/4),r-o*Math.sin(a+Math.PI/4),void 0,void 0,void 0,void 0,ee.line)],c=new xe(l,!1,!1,!0);return c.noFill(),c.cap="round",c.join="round",this.scene.add(c),c}makeRectangle(e,t,n,r){const s=new Nn(e,t,n,r);return this.scene.add(s),s}makeRoundedRectangle(e,t,n,r,s){const o=new tr(e,t,n,r,s);return this.scene.add(o),o}makeCircle(e,t,n,r){const s=new Qi(e,t,n,r);return this.scene.add(s),s}makeEllipse(e,t,n,r,s){const o=new er(e,t,n,r,s);return this.scene.add(o),o}makeStar(e,t,n,r,s){const o=new Vr(e,t,n,r,s);return this.scene.add(o),o}makeCurve(e){const t=arguments.length;if(!Array.isArray(e)){e=[];for(let o=0;o<t;o+=2){const a=arguments[o];if(typeof a!="number")break;const l=arguments[o+1];e.push(new ve(a,l))}}const n=arguments[t-1],r=new xe(e,!(typeof n=="boolean"&&n),!0),s=r.getBoundingClientRect();return r.center().translation.set(s.left+s.width/2,s.top+s.height/2),this.scene.add(r),r}makePolygon(e,t,n,r){const s=new Ir(e,t,n,r);return this.scene.add(s),s}makeArcSegment(e,t,n,r,s,o,a){const l=new Mr(e,t,n,r,s,o,a);return this.scene.add(l),l}makePoints(e){const t=arguments.length;let n=e;if(!Array.isArray(e)){n=[];for(let s=0;s<t;s+=2){const o=arguments[s];if(typeof o!="number")break;const a=arguments[s+1];n.push(new Z(o,a))}}const r=new Ar(n);return this.scene.add(r),r}makePath(e){const t=arguments.length;let n=e;if(!Array.isArray(e)){n=[];for(let a=0;a<t;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];n.push(new ve(l,c))}}const r=arguments[t-1],s=new xe(n,!(typeof r=="boolean"&&r)),o=s.getBoundingClientRect();return typeof o.top=="number"&&typeof o.left=="number"&&typeof o.right=="number"&&typeof o.bottom=="number"&&s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makeText(e,t,n,r){const s=new Lt(e,t,n,r);return this.add(s),s}makeLinearGradient(e,t,n,r){const s=Array.prototype.slice.call(arguments,4),o=new Ie(e,t,n,r,s);return this.add(o),o}makeRadialGradient(e,t,n){const r=Array.prototype.slice.call(arguments,3),s=new Ve(e,t,n,r);return this.add(s),s}makeSprite(e,t,n,r,s,o,a){const l=new Fr(e,t,n,r,s,o);return a&&l.play(),this.add(l),l}makeImageSequence(e,t,n,r,s){const o=new Lr(e,t,n,r);return s&&o.play(),this.add(o),o}makeTexture(e,t){return new Be(e,t)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const t=new Ze;return this.scene.add(t),t.add(e),t}interpret(e,t,n){const r=e.tagName.toLowerCase();if(n=typeof n<"u"?n:!0,!(r in ze))return null;const s=ze[r].call(this,e);return n?this.add(t&&s instanceof Ze?s.children:s):s.parent&&s.remove(),s}load(e,t){const n=new Ze;let r,s,o;const a=(function(l){for(At.temp.innerHTML=l,s=0;s<At.temp.children.length;s++)r=At.temp.children[s],o=this.interpret(r,!1,!1),o!==null&&n.add(o);if(typeof t=="function"){const c=At.temp.children.length<=1?At.temp.children[0]:At.temp.children;t(n,c)}}).bind(this);return/\.svg$/i.test(e)?(Vl(e,a),n):(a(e),n)}},ue=ir;w(ue,"NextFrameId",kt.NextFrameId),w(ue,"Types",kt.Types),w(ue,"Version",kt.Version),w(ue,"PublishDate",kt.PublishDate),w(ue,"Identifier",kt.Identifier),w(ue,"Resolution",kt.Resolution),w(ue,"AutoCalculateImportedMatrices",kt.AutoCalculateImportedMatrices),w(ue,"Instances",kt.Instances),w(ue,"uniqueId",kt.uniqueId),w(ue,"Anchor",ve),w(ue,"Collection",En),w(ue,"Events",Y),w(ue,"Group",Ze),w(ue,"Matrix",Yn),w(ue,"Path",xe),w(ue,"Registry",$r),w(ue,"Element",Wn),w(ue,"Shape",fn),w(ue,"Text",Lt),w(ue,"Vector",Z),w(ue,"Gradient",Ue),w(ue,"ImageSequence",Lr),w(ue,"LinearGradient",Ie),w(ue,"RadialGradient",Ve),w(ue,"Sprite",Fr),w(ue,"Stop",Jt),w(ue,"Texture",Be),w(ue,"ArcSegment",Mr),w(ue,"Circle",Qi),w(ue,"Ellipse",er),w(ue,"Line",Ws),w(ue,"Points",Ar),w(ue,"Polygon",Ir),w(ue,"Rectangle",Nn),w(ue,"RoundedRectangle",tr),w(ue,"Star",Vr),w(ue,"CanvasRenderer",ft),w(ue,"SVGRenderer",Hl),w(ue,"WebGLRenderer",jl),w(ue,"Commands",ee),w(ue,"Utils",dm);function hm(){const e=document.body.getBoundingClientRect(),t=this.width=e.width,n=this.height=e.height;this.renderer.setSize(t,n,this.ratio)}function um(){const e=this.renderer.domElement.parentElement;if(!e){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const t=e.getBoundingClientRect(),n=this.width=t.width,r=this.height=t.height;this.renderer.setSize(n,r,this.ratio)}function fm(e,t){this.width=e,this.height=t,this.trigger(Y.Types.resize,e,t)}var rr=At.getRequestAnimationFrame();function Xl(){for(let e=0;e<ue.Instances.length;e++){const t=ue.Instances[e];t.playing&&t.update()}ue.NextFrameId=rr(Xl)}rr.init=function(){Xl(),rr.init=function(){}};let en;typeof window<"u"?en=window:typeof global<"u"?en=global:typeof self<"u"&&(en=self);let ql;const ei=Math.PI*2,it=Math.PI*.5;function pm(e,t,n,r,s,o){let a;return arguments.length<=1?(a=e.a,t=e.b,n=e.c,r=e.d,s=e.e,o=e.f):a=e,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,a)/Math.PI}}function gm(e){ql=e}function mm(e,t){t=t&&t.identity()||new ql;let n=e;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;t.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9])}return t}function tn(e,t,n){return n*(t-e)+e}function $i(e,t){for(;e<0;)e+=t;return e%t}const Yl=en.Float32Array||Array,_m=Math.floor;function nn(e){return _m(e*1e6)/1e6}const pe={move:"M",line:"L",curve:"C",close:"Z"};class K{constructor(){x(this,"_events",{});x(this,"_bound",!1)}addEventListener(t,n){return(this._events[t]||(this._events[t]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(t,n){if(!this._events)return this;if(!t&&!n)return this._events={},this._bound=!1,this;const r=t?[t]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){t=r[s];let a=this._events[t];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[t]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(t){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[t];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(t,n,r){const s=this;t&&(o.obj=t,o.name=n,o.handler=r,t.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(t,n,r){return t.off(n,r),this}}x(K,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),x(K,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Ul={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(K.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(K.Types.change))}}},at=class at extends K{constructor(n=0,r=0){super();x(this,"_x",0);x(this,"_y",0);for(let s in Ul)Object.defineProperty(this,s,Ul[s]);this.x=n,this.y=r}static add(n,r){return new at(n.x+r.x,n.y+r.y)}static sub(n,r){return new at(n.x-r.x,n.y-r.y)}static subtract(n,r){return at.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(at.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 at(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:nn(this.x),y:nn(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(at,"zero",new at),x(at,"left",new at(-1,0)),x(at,"right",new at(1,0)),x(at,"up",new at(0,-1)),x(at,"down",new at(0,1));let we=at;class Te extends we{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=pe.move){super(n,r);x(this,"controls",{left:new we,right:new we});x(this,"_command",pe.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 Gl)Object.defineProperty(this,h,Gl[h]);this.command=c,this.relative=!0;const d=Te.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(K.Types.change,d),this.controls.right.set(a,l).addEventListener(K.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(K.Types.change)}}static fromObject(n){return new Te().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 Te().copy(this)}toObject(){return{x:nn(this.x),y:nn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:nn(this.rx),ry:nn(this.ry),xAxisRotation:nn(this.xAxisRotation),largeArcFlag:nn(this.largeArcFlag),sweepFlag:nn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Gl={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(K.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(K.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(K.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(K.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(K.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(K.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(K.Types.change))}}};let ym=0;const Ys={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return ym++}},qr={RecursionLimit:16,abscissas:[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],weights:[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]]};function Yr(e,t,n,r,s){const o=1-e;return o*o*o*t+3*o*o*e*n+3*o*e*e*r+e*e*e*s}function Kl(e,t,n,r,s,o,a,l,c){c=c||qr.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new Te(a,l)];const h=[];for(let f=0;f<d;f++){const p=f/d,u=Yr(p,e,n,s,a),g=Yr(p,t,r,o,l);h.push(new Te(u,g))}return h}function bm(e,t,n,r,s,o,a,l,c){if(e===n&&t===r&&s===a&&o===l){const _=a-e,y=l-t;return Math.sqrt(_*_+y*y)}const d=9*(n-s)+3*(a-e),h=6*(e+s)-12*n,f=3*(n-e),p=9*(r-o)+3*(l-t),u=6*(t+o)-12*r,g=3*(r-t);function m(_){const y=(d*_+h)*_+f,b=(p*_+u)*_+g;return Math.sqrt(y*y+b*b)}return vm(m,0,1,c||qr.RecursionLimit)}function wm(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,f,p,u,g,m,_,y;for(let v=0;v<2;++v){if(v==0?(f=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,p=3*n-3*e):(f=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,p=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(f)<1e-12)continue;u=-p/f,0<u&&u<1&&c.push(u);continue}_=f*f-4*p*h,y=Math.sqrt(_),!(_<0)&&(g=(-f+y)/(2*h),0<g&&g<1&&c.push(g),m=(-f-y)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,C;for(;b--;)u=c[b],C=1-u,d[0][b]=C*C*C*e+3*C*C*u*n+3*C*u*u*s+u*u*u*a,d[1][b]=C*C*C*t+3*C*C*u*r+3*C*u*u*o+u*u*u*l;return d[0][S]=e,d[1][S]=t,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function vm(e,t,n,r){let s=qr.abscissas[r-2],o=qr.weights[r-2],a=.5*(n-t),l=a+t,c=0,d=r+1>>1,h=r&1?o[c++]*e(l):0;for(;c<d;){const f=a*s[c];h+=o[c++]*(e(l+f)+e(l-f))}return a*h}function km(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?$i(s-1,n):Math.max(s-1,0),l=t?$i(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];xm(c,d,h),d.command=s===0?pe.move:pe.curve}}function xm(e,t,n){const r=we.angleBetween(e,t),s=we.angleBetween(n,t);let o=we.distanceBetween(e,t),a=we.distanceBetween(n,t),l=(r+s)/2;return o<1e-4||a<1e-4?(typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(o*=.33,a*=.33,s<r?l+=it:l-=it,t.controls.left.x=Math.cos(l)*o,t.controls.left.y=Math.sin(l)*o,l-=Math.PI,t.controls.right.x=Math.cos(l)*a,t.controls.right.y=Math.sin(l)*a,typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}let sr=(mi=class extends K{constructor(){super();x(this,"_flagId",!1);x(this,"_flagClassName",!1);x(this,"_renderer",{});x(this,"_id",Ys.Identifier+Ys.uniqueId());x(this,"_className","");x(this,"classList",[]);for(let n in Zl)Object.defineProperty(this,n,Zl[n])}static fromObject(n){const r=new mi().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return this.renderer.type=n.renderer.type,this.className=n.className,this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}},x(mi,"Properties",["renderer","id","className"]),mi);const Zl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(e){const t=this._id;e!==this._id&&(this._id=e,this._flagId=!0,this.parent&&(delete this.parent.children.ids[t],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(e){this._className!==e&&(this._flagClassName=!0,this.classList=e.split(/\s+?/),this._className=e)}}};class Ur extends Error{constructor(n){super();x(this,"name","Two.js");x(this,"message");this.message=n}}class Cm{constructor(){x(this,"map",{})}add(t,n){return this.map[t]=n,this}remove(t){return delete this.map[t],this}get(t){return this.map[t]}contains(t){return t in this.map}}let Gr;const Jl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};en.document&&(Gr=document.createElement("a"));const We=class We extends sr{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 Ql)Object.defineProperty(this,s,Ql[s]);if(this._renderer.type="texture",this._renderer.flagOffset=Sm.bind(this),this._renderer.flagScale=Bm.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new we,typeof r=="function"){const s=(function(){this.unbind(K.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(K.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 We().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return Gr?(Gr.href=n,Gr.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=We.getAbsoluteURL(n);if(We.ImageRegistry.contains(r))return We.ImageRegistry.get(r);let s;return en.document?Jl.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=We.getTag(s);n._flagImage&&(/canvas/i.test(o)?We.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,We.Register[o](n,r))),n._flagSrc&&(s||(s=We.getImage(n.src),n.image=s),o=We.getTag(s),We.Register[o](n,r))}clone(){const n=new We(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 we?n.offset:new we().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof we?n.scale:new we().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(K.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,We.load(this,(function(){this.loaded=!0,this.trigger(K.Types.change).trigger(K.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("elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};x(We,"Properties",["src","loaded","repeat","scale","offset","image"]),x(We,"RegularExpressions",Jl),x(We,"ImageRegistry",new Cm),x(We,"Register",{canvas:function(n,r){n._src="#"+n.id,We.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 Ur("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=We.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),We.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 Ur("unable to load "+n.src)};n._src=We.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),We.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 rt=We;const Ql={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){const t=rt.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}rt.ImageRegistry.contains(n)?this._image=rt.ImageRegistry.get(e.src):this._image=e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(K.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(K.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof we&&this._scale.unbind(K.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof we&&this._scale.bind(K.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Sm(){this._flagOffset=!0}function Bm(){this._flagScale=!0}class Ni extends Array{constructor(){super();pa(this,lt,new K);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(n){Hh(this,lt,n)}get _bound(){return Tt(this,lt)._bound}set _bound(n){Tt(this,lt)._bound=n}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 n=super.pop.apply(this,arguments);return this.trigger(K.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(K.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(K.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(K.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(K.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(K.Types.insert,r),this.trigger(K.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(K.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(K.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}}lt=new WeakMap;const ec=Array.prototype.slice;function Tm(e){if(e==null)return!1;const t=e.length;return typeof t=="number"&&t>=0&&t<4294967296}const Ae={isNaN:function(e){return typeof e=="number"&&e!==+e},isElement:function(e){return!!(e&&e.nodeType===1)},isObject:function(e){const t=typeof e;return t==="function"||t==="object"&&!!e},extend:function(e){const t=ec.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]=r[s]}return e},defaults:function(e){const t=ec.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]===void 0&&(e[s]=r[s])}return e},each:function(e,t,n){const r=n||this,s=!Tm(e)&&Object.keys(e),o=(s||e).length;for(let a=0;a<o;a++){const l=s?s[a]:a;t.call(r,e[l],l,e)}return e},performance:en.performance&&en.performance.now?en.performance:Date},Rt=class Rt extends sr{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 tc)Object.defineProperty(this,o,tc[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Rt.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Rt.Index<=0?"#fff":"#000",Rt.Index=(Rt.Index+1)%2}static fromObject(n){const r=new Rt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Rt.Properties.length;r++){const s=Rt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Rt;return Ae.each(Rt.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",Ae.each(Rt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};x(Rt,"Index",0),x(Rt,"Properties",["offset","opacity","color"]);let ti=Rt;const tc={offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset=e,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(e){this._color=e,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},an=class an extends sr{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 nc)Object.defineProperty(this,r,nc[r]);this._renderer.type="gradient",this._renderer.flagStops=Em.bind(this),this._renderer.bindStops=$m.bind(this),this._renderer.unbindStops=Nm.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 ti?o:new ti().copy(o)));const s=new an().copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new an(r);return Ae.each(an.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<an.Properties.length;r++){const s=an.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Ae.each(an.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(K.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(an,"Stop",ti),x(an,"Properties",["spread","stops","units"]);let et=an;const nc={spread:{enumerable:!0,get:function(){return this._spread},set:function(e){this._spread=e,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(e){this._units=e,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(e){const t=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(K.Types.insert,t).unbind(K.Types.remove,n),this._stops=new Ni((e||[]).slice(0)),this._stops.bind(K.Types.insert,t).bind(K.Types.remove,n),t(this._stops)}}};function Em(){this._flagStops=!0}function $m(e){let t=e.length;for(;t--;)e[t].bind(K.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function Nm(e){let t=e.length;for(;t--;)e[t].unbind(K.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}const On=class On extends et{constructor(n,r,s,o,a){super(a);x(this,"_flagEndPoints",!1);x(this,"_left",null);x(this,"_right",null);for(let l in ic)Object.defineProperty(this,l,ic[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Rm.bind(this),this.left=new we,this.right=new we,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 On().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<On.Properties.length;r++){const s=On.Properties[r];s in n&&(this[s]=n[s]instanceof we?n[s]:new we().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new On(this.left._x,this.left._y,this.right._x,this.right._y,r);return Ae.each(et.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(K.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};x(On,"Stop",ti),x(On,"Properties",["left","right"]);let xt=On;const ic={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof we&&this._left.unbind(K.Types.change,this._renderer.flagEndPoints),this._left=e,this._left.bind(K.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(e){this._right instanceof we&&this._right.unbind(K.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(K.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Rm(){this._flagEndPoints=!0}const ln=class ln extends et{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 rc)Object.defineProperty(this,c,rc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Pm.bind(this),this._renderer.flagFocal=Fm.bind(this),this.center=new we,this.radius=typeof s=="number"?s:1,this.focal=new we,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 ln().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<ln.Properties.length;r++){const s=ln.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof we?n[s]:new we().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 ln(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Ae.each(et.Properties.concat(ln.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Ae.each(ln.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(K.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};x(ln,"Stop",ti),x(ln,"Properties",["center","radius","focal"]);let Ct=ln;const rc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(e){this._center&&this._center.unbind(K.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(K.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(K.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(K.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Pm(){this._flagCenter=!0}function Fm(){this._flagFocal=!0}function sc(e,t){if(t===0||t===1)return!0;const r=e._length*t;let s=0;for(let o=0;o<e._lengths.length;o++){const a=e._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Kr(e,t){const n=e._length;if(t<=0)return 0;if(t>=n)return e._lengths.length-1;for(let r=0,s=0;r<e._lengths.length;r++){if(s+e._lengths[r]>=t)return t-=s,Math.max(r-1,0)+t/e._lengths[r];s+=e._lengths[r]}return-1}function oc(e,t,n){let r,s,o,a,l,c,d,h;const f=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(f||t).x,c=(f||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,f&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),bm(r,l,s,c,o,d,a,h,n)}function ac(e,t,n){let r,s,o,a,l,c,d,h;const f=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(f||t).x,c=(f||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,f&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Kl(r,l,s,c,o,d,a,h,n)}function ni(e){switch(e.renderer.type){case"texture":return rt.fromObject(e);case"gradient":return et.fromObject(e);case"linear-gradient":return xt.fromObject(e);case"radial-gradient":return Ct.fromObject(e)}return e}const Mm=Math.cos,Am=Math.sin,lc=Math.tan,Us=[],Bt=class Bt extends K{constructor(n,r,s,o,a,l){super();x(this,"elements",new Yl(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 k=n;let E,P,R;const j=r[0]||0,q=r[1]||0,M=r[2]||0;return E=k[0]*j+k[1]*q+k[2]*M,P=k[3]*j+k[4]*q+k[5]*M,R=k[6]*j+k[7]*q+k[8]*M,[E,P,R]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],f=n[6],p=n[7],u=n[8],g=r[0],m=r[1],_=r[2],y=r[3],b=r[4],S=r[5],C=r[6],v=r[7],B=r[8];return s=s||new Yl(9),s[0]=o*g+a*y+l*C,s[1]=o*m+a*b+l*v,s[2]=o*_+a*S+l*B,s[3]=c*g+d*y+h*C,s[4]=c*m+d*b+h*v,s[5]=c*_+d*S+h*B,s[6]=f*g+p*y+u*C,s[7]=f*m+p*b+u*v,s[8]=f*_+p*S+u*B,s}static fromObject(n){return new Bt().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const f=n;n=f[0],r=f[1],s=f[2],o=f[3],a=f[4],l=f[5],c=f[6],d=f[7],h=f[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(K.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(K.Types.change)}identity(){return this.elements[0]=Bt.Identity[0],this.elements[1]=Bt.Identity[1],this.elements[2]=Bt.Identity[2],this.elements[3]=Bt.Identity[3],this.elements[4]=Bt.Identity[4],this.elements[5]=Bt.Identity[5],this.elements[6]=Bt.Identity[6],this.elements[7]=Bt.Identity[7],this.elements[8]=Bt.Identity[8],this.trigger(K.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(K.Types.change);if(typeof s>"u"&&(s=1),typeof o>"u"){n=n||0,r=r||0,s=s||0,a=this.elements;const $=a[0]*n+a[1]*r+a[2]*s,X=a[3]*n+a[4]*r+a[5]*s,F=a[6]*n+a[7]*r+a[8]*s;return[$,X,F]}const f=this.elements,p=[n,r,s,o,a,l,c,d,h],u=f[0],g=f[1],m=f[2],_=f[3],y=f[4],b=f[5],S=f[6],C=f[7],v=f[8],B=p[0],k=p[1],E=p[2],P=p[3],R=p[4],j=p[5],q=p[6],M=p[7],A=p[8];return this.elements[0]=u*B+g*P+m*q,this.elements[1]=u*k+g*R+m*M,this.elements[2]=u*E+g*j+m*A,this.elements[3]=_*B+y*P+b*q,this.elements[4]=_*k+y*R+b*M,this.elements[5]=_*E+y*j+b*A,this.elements[6]=S*B+C*P+v*q,this.elements[7]=S*k+C*R+v*M,this.elements[8]=S*E+C*j+v*A,this.trigger(K.Types.change)}inverse(n){const r=this.elements;n=n||new Bt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],f=r[7],p=r[8],u=p*c-d*f,g=-p*l+d*h,m=f*l-c*h;let _=s*u+o*g+a*m;return _?(_=1/_,n.elements[0]=u*_,n.elements[1]=(-p*o+a*f)*_,n.elements[2]=(d*o-a*c)*_,n.elements[3]=g*_,n.elements[4]=(p*s-a*h)*_,n.elements[5]=(-d*s+a*l)*_,n.elements[6]=m*_,n.elements[7]=(-f*s+o*h)*_,n.elements[8]=(c*s-o*l)*_,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=Mm(n),s=Am(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=lc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=lc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return Us.length=0,this.toTransformArray(n,Us),Us.map(nn).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],f=s[5];if(n){const p=s[6],u=s[7],g=s[8];if(o){r[0]=a,r[1]=d,r[2]=p,r[3]=l,r[4]=h,r[5]=u,r[6]=c,r[7]=f,r[8]=g;return}return[a,d,p,l,h,u,c,f,g]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=f;return}return[a,d,l,h,c,f]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],f=s[5];if(n){const p=s[6],u=s[7],g=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=f,r[6]=p,r[7]=u,r[8]=g;return}return[a,l,c,d,h,f,p,u,g]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=f;return}return[a,l,c,d,h,f]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Bt().copy(this)}};x(Bt,"Identity",[1,0,0,0,1,0,0,0,1]);let or=Bt;gm(or);const vr=class vr extends sr{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 Zr)Object.defineProperty(this,n,Zr[n]);this._renderer.flagMatrix=cc.bind(this),this.isShape=!0,this.matrix=new or,this.worldMatrix=new or,this.position=new we,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new vr().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 Zr.position.get.apply(this,arguments)}set translation(n){Zr.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 we?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 we?n.scale:new we(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 vr;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 we?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 we?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(vr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let pn=vr;const Zr={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(K.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(K.Types.change,this._renderer.flagMatrix),cc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(e){this._rotation=e,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof we&&this._scale.unbind(K.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof we&&this._scale.bind(K.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(e){this._skewX=e,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(e){this._skewY=e,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(e){this._matrix=e,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return mm(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function cc(){this._flagMatrix=!0}const Ri=Math.min,Pi=Math.max,Im=Math.ceil,Vm=Math.floor,Om=new we,Gt=class Gt extends pn{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,"_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);for(let a in dc)Object.defineProperty(this,a,dc[a]);this._renderer.type="path",this._renderer.flagVertices=hc.bind(this),this._renderer.bindVertices=uc.bind(this),this._renderer.unbindVertices=fc.bind(this),this._renderer.flagFill=pc.bind(this),this._renderer.flagStroke=gc.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:ni(n.fill),s=typeof n.stroke=="string"?n.stroke:ni(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),this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Te?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Te().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()),Ae.each(Gt.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}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,f=1/0,p=-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:u,scaleY:g}=pm(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof u=="number"&&typeof g=="number"&&(s=Math.max(u,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[u,g]=r.multiply(l.x,l.y),[m,_]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,b=l.controls.right.y;l.relative&&(y+=l.x,b+=l.y);let[S,C]=r.multiply(y,b),v=c.controls.left.x,B=c.controls.left.y;c.relative&&(v+=c.x,B+=c.y);let[k,E]=r.multiply(v,B);const P=wm(u,g,S,C,k,E,m,_);f=Ri(P.min.y-s,f),d=Ri(P.min.x-s,d),h=Pi(P.max.x+s,h),p=Pi(P.max.y+s,p)}else a<=1&&(f=Ri(g-s,f),d=Ri(u-s,d),h=Pi(u+s,h),p=Pi(g+s,p)),f=Ri(_-s,f),d=Ri(m-s,d),h=Pi(m+s,h),p=Pi(_+s,p)}return{top:f,left:d,right:h,bottom:p,width:h-d,height:p-f}}getPointAt(n,r){let s,o,a,l,c,d,h,f,p,u,g,m,_,y,b,S=this.length*Math.min(Math.max(n,0),1);const C=this.vertices.length,v=C-1;let B=null,k=null;for(let N=0,W=this._lengths.length,z=0;N<W;N++){if(z+this._lengths[N]>=S){this._closed?(s=$i(N,C),o=$i(N-1,C),N===0&&(s=o,o=N)):(s=N,o=Math.min(Math.max(N-1,0),v)),B=this.vertices[s],k=this.vertices[o],S-=z,this._lengths[N]!==0?n=S/this._lengths[N]:n=0;break}z+=this._lengths[N]}if(B===null||k===null)return null;if(B){if(!k)return B}else return k;b=k.controls&&k.controls.right,y=B.controls&&B.controls.left,c=k.x,u=k.y,d=(b||k).x,g=(b||k).y,h=(y||B).x,m=(y||B).y,f=B.x,_=B.y,b&&k.relative&&(d+=k.x,g+=k.y),y&&B.relative&&(h+=B.x,m+=B.y),l=Yr(n,c,d,h,f),p=Yr(n,u,g,m,_);const E=tn(c,d,n),P=tn(u,g,n),R=tn(d,h,n),j=tn(g,m,n),q=tn(h,f,n),M=tn(m,_,n),A=tn(E,R,n),$=tn(P,j,n),X=tn(R,q,n),F=tn(j,M,n);return Ae.isObject(r)?(r.x=l,r.y=p,r instanceof Te&&(r.controls.left.x=A,r.controls.left.y=$,r.controls.right.x=X,r.controls.right.y=F,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=p,r.controls.right.x-=l,r.controls.right.y-=p)),r.t=n,r):(a=new Te(l,p,A-l,$-p,X-l,F-p,this._curved?pe.curve:pe.line),a.t=n,a)}plot(){if(this.curved)return km(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?pe.move:pe.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===pe.close;let o=this.vertices[r],a=[],l;return Ae.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===pe.move){a.push(new Te(o.x,o.y)),d>0&&(a[a.length-1].command=pe.line),o=c;return}l=ac(c,o,n),a=a.concat(l),Ae.each(l,function(h,f){f<=0&&o.command===pe.move?h.command=pe.move:h.command=pe.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=ac(c,o,n),a=a.concat(l),Ae.each(l,function(h,f){f<=0&&o.command===pe.move?h.command=pe.move:h.command=pe.line})),a.push(new Te(c.x,c.y)),a[a.length-1].command=s?pe.close:pe.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=[]),Ae.each(this.vertices,function(c,d){if(d<=0||c.command===pe.move){a=c,this._lengths[d]=0;return}this._lengths[d]=oc(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=Kr(this,s*this._length),l=Kr(this,o*this._length),c=Im(a),d=Vm(l);let h,f,p,u,g,m;for(this._renderer.vertices.length=0,m=0;m<n;m++)this._renderer.collection.length<=m&&this._renderer.collection.push(new Te),m>d&&!f?(g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(o,g),g.command=this._renderer.collection[m].command,this._renderer.vertices.push(g),f=g,p=this._collection[m-1],p&&p.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),p.relative?this._renderer.collection[m-1].controls.right.copy(p.controls.right).lerp(we.zero,1-g.t):this._renderer.collection[m-1].controls.right.copy(p.controls.right).lerp(p,1-g.t))):m>=c&&m<=d&&(g=this._renderer.collection[m].copy(this._collection[m]),this._renderer.vertices.push(g),m===d&&sc(this,o)?(f=g,!r&&f.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f))):m===c&&sc(this,s)&&(h=g,h.command=pe.move,!r&&h.controls&&(h.relative?h.controls.left.clear():h.controls.left.copy(h))));c>0&&!h&&(m=c-1,g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(s,g),g.command=pe.move,this._renderer.vertices.unshift(g),u=this._collection[m+1],u&&u.controls&&(g.controls.left.clear(),u.relative?this._renderer.collection[m+1].controls.left.copy(u.controls.left).lerp(we.zero,g.t):(Om.copy(u),this._renderer.collection[m+1].controls.left.copy(u.controls.left).lerp(u,g.t))))}return pn.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=!1,pn.prototype.flagReset.call(this),this}};x(Gt,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),x(Gt,"Utils",{getCurveLength:oc});let Ee=Gt;const dc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof et||this._fill instanceof xt||this._fill instanceof Ct||this._fill instanceof rt)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof xt||this._fill instanceof Ct||this._fill instanceof rt)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof et||this._stroke instanceof xt||this._stroke instanceof Ct||this._stroke instanceof rt)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof xt||this._stroke instanceof Ct||this._stroke instanceof rt)&&this._stroke.bind(K.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(e){this._closed=!!e,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=!!e,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){if(e===this._automatic)return;this._automatic=!!e;const t=this._automatic?"ignore":"listen";Ae.each(this.vertices,function(n){n[t]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(K.Types.insert,t).unbind(K.Types.remove,n),e instanceof Ni?this._collection=e:this._collection=new Ni(e||[]),this._collection.bind(K.Types.insert,t).bind(K.Types.remove,n),t(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function hc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function uc(e){let t=e.length;for(;t--;)e[t].bind(K.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function fc(e){let t=e.length;for(;t--;)e[t].unbind(K.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function pc(){this._flagFill=!0}function gc(){this._flagStroke=!0}const zm=Math.ceil,Lm=Math.floor,cn=class cn extends pn{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,"_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,"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 mc)Object.defineProperty(this,r,mc[r]);this._renderer.type="points",this._renderer.flagVertices=hc.bind(this),this._renderer.bindVertices=uc.bind(this),this._renderer.unbindVertices=fc.bind(this),this._renderer.flagFill=pc.bind(this),this._renderer.flagStroke=gc.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:ni(n.fill),s=typeof n.stroke=="string"?n.stroke:ni(n.stroke),o=new cn().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Te?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Te().copy(s))}for(let r=0;r<cn.Properties.length;r++){const s=cn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new cn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<cn.Properties.length;s++){const o=cn.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="points",n.vertices=this.vertices.map(r=>r.toObject()),Ae.each(cn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}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,f=Kl(l,c,l,c,d,h,d,h,n);r=r.concat(f)}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=Kr(this,n*this._length),o=Kr(this,r*this._length),a=zm(s),l=Lm(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(cn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);let Jr=cn;const mc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof et||this._fill instanceof xt||this._fill instanceof Ct||this._fill instanceof rt)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof xt||this._fill instanceof Ct||this._fill instanceof rt)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof et||this._stroke instanceof xt||this._stroke instanceof Ct||this._stroke instanceof rt)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof xt||this._stroke instanceof Ct||this._stroke instanceof rt)&&this._stroke.bind(K.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(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(K.Types.insert,t).unbind(K.Types.remove,n),e instanceof Ni?this._collection=e:this._collection=new Ni(e||[]),this._collection.bind(K.Types.insert,t).bind(K.Types.remove,n),t(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};class _c extends Ni{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);pa(this,xs,{});this.attach(n),this.on(K.Types.insert,this.attach),this.on(K.Types.remove,this.detach)}get ids(){return Tt(this,xs)}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}}xs=new WeakMap;const bn=class bn extends Ee{constructor(n,r,s,o,a,l,c){const d=c||Ys.Resolution*3,h=[];for(let f=0;f<d;f++)h.push(new Te);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 f in yc)Object.defineProperty(this,f,yc[f]);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 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._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,s=this._innerRadius,o=this._outerRadius,a=$i(n,ei)===$i(r,ei),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,f=0,p,u,g,m,_,y,b,S,C;for(a?d--:l||(d-=2),p=0,u=d-1;p<d;p++){switch(g=p/u,m=c[f],_=g*(r-n)+n,y=(r-n)/d,b=o*Math.cos(_),S=o*Math.sin(_),p){case 0:h=pe.move;break;default:h=pe.curve}m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===pe.curve&&(C=o*y/Math.PI,m.controls.left.x=C*Math.cos(_-it),m.controls.left.y=C*Math.sin(_-it),m.controls.right.x=C*Math.cos(_+it),m.controls.right.y=C*Math.sin(_+it),p===1&&m.controls.left.multiplyScalar(2),p===u&&m.controls.right.multiplyScalar(2)),f++}if(l){for(a?(c[f].command=pe.close,f++):(d--,u=d-1),p=0;p<d;p++)g=p/u,m=c[f],_=(1-g)*(r-n)+n,y=(r-n)/d,b=s*Math.cos(_),S=s*Math.sin(_),h=pe.curve,p<=0&&(h=a?pe.move:pe.line),m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===pe.curve&&(C=s*y/Math.PI,m.controls.left.x=C*Math.cos(_+it),m.controls.left.y=C*Math.sin(_+it),m.controls.right.x=C*Math.cos(_-it),m.controls.right.y=C*Math.sin(_-it),p===1&&m.controls.left.multiplyScalar(2),p===u&&m.controls.right.multiplyScalar(2)),f++;c[f].copy(c[0]),c[f].command=pe.line}else a||(c[f].command=pe.line,c[f].x=0,c[f].y=0,f++,c[f].copy(c[0]),c[f].command=pe.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 bn(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<bn.Properties.length;r++){const s=bn.Properties[r];n[s]=this[s]}return n}};x(bn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Gs=bn;const yc={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}}},Ks=Math.cos,Zs=Math.sin,wn=class wn 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 Te(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 bc)Object.defineProperty(this,c,bc[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 wn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<wn.Properties.length;r++){const s=wn.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*Ks(c),h=s*Zs(c),f=o*Ks(c-it),p=o*Zs(c-it),u=o*Ks(c+it),g=o*Zs(c+it),m=this.vertices[a];m.command=a===0?pe.move:pe.curve,m.set(d,h),m.controls.left.set(f,p),m.controls.right.set(u,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new wn(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<wn.Properties.length;r++){const s=wn.Properties[r];n[s]=this[s]}return n}};x(wn,"Properties",["radius"]);let Js=wn;const bc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Qs=Math.cos,eo=Math.sin,vn=class vn 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 Te);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 wc)Object.defineProperty(this,d,wc[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 vn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<vn.Properties.length;r++){const s=vn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){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*Qs(c),h=o*eo(c),f=s*r*Qs(c-it),p=o*r*eo(c-it),u=s*r*Qs(c+it),g=o*r*eo(c+it),m=this.vertices[a];m.command=a===0?pe.move:pe.curve,m.set(d,h),m.controls.left.set(f,p),m.controls.right.set(u,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 vn(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<vn.Properties.length;r++){const s=vn.Properties[r];n[s]=this[s]}return n}};x(vn,"Properties",["width","height"]);let to=vn;const wc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},Dm=Math.cos,Hm=Math.sin,kn=class kn 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 vc)Object.defineProperty(this,a,vc[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 kn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<kn.Properties.length;r++){const s=kn.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*Dm(l)/2,d=this._height*Hm(l)/2;o>=s?this.vertices.push(new Te(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?pe.move:pe.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 kn(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<kn.Properties.length;r++){const s=kn.Properties[r];n[s]=this[s]}return n}};x(kn,"Properties",["width","height","sides"]);let no=kn;const vc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},_i=class _i extends Ee{constructor(n,r,s,o){const a=[new Te,new Te,new Te,new Te];super(a,!0,!1,!0);x(this,"_flagWidth",0);x(this,"_flagHeight",0);x(this,"_width",0);x(this,"_height",0);x(this,"_origin",null);this._renderer.type="rectangle";for(let l in kc)Object.defineProperty(this,l,kc[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new we,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}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&&typeof n[s]=="number"&&(this[s]=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 Te),this.vertices[0].set(-n,-r).sub(this._origin).command=pe.move,this.vertices[1].set(n,-r).sub(this._origin).command=pe.line,this.vertices[2].set(n,r).sub(this._origin).command=pe.line,this.vertices[3].set(-n,r).sub(this._origin).command=pe.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=pe.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new _i(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]=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(_i,"Properties",["width","height"]);let io=_i;const kc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(K.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(K.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},xn=class xn 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 Te(0,0,0,0,0,0,c===0?pe.move:pe.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 xc)Object.defineProperty(this,c,xc[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Wm.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),typeof a=="number"&&(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 xn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<xn.Properties.length;r++){const s=xn.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof we?o:new we().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 we?(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 xn(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<xn.Properties.length;r++){const s=xn.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};x(xn,"Properties",["width","height","radius"]);let ro=xn;const xc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof we&&this._radius.unbind(K.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof we&&this._radius.bind(K.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Wm(){this._flagRadius=!0}const jm=Math.cos,Xm=Math.sin,Cn=class Cn 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 Cc)Object.defineProperty(this,l,Cc[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 Cn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Cn.Properties.length;r++){const s=Cn.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*jm(l),h=c*Xm(l);o>=s?this.vertices.push(new Te(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?pe.move:pe.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 Cn(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<Cn.Properties.length;r++){const s=Cn.Properties[r];n[s]=this[s]}return n}};x(Cn,"Properties",["innerRadius","outerRadius","sides"]);let so=Cn;const Cc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}};let oo;const Sc=Math.min,Bc=Math.max;en.document&&(oo=document.createElement("canvas"));const yt=class yt extends pn{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,"_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);for(let a in Tc)Object.defineProperty(this,a,Tc[a]);if(this._renderer.type="text",this._renderer.flagFill=qm.bind(this),this._renderer.flagStroke=Ym.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,!Ae.isObject(o))return this;for(let a=0;a<yt.Properties.length;a++){const l=yt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(oo){const r=oo.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*yt.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:ni(n.fill),s=typeof n.stroke=="string"?n.stroke:ni(n.stroke),o=new yt().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<yt.Properties.length;r++){const s=yt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new yt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<yt.Properties.length;s++){const o=yt.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<yt.Properties.length;r++){const s=yt.Properties[r];n[s]=this[s]}return n}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}=yt.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[f,p]=r.multiply(s,a),[u,g]=r.multiply(s,l),[m,_]=r.multiply(o,a),[y,b]=r.multiply(o,l);return a=Sc(p,g,_,b),s=Sc(f,u,m,y),o=Bc(f,u,m,y),l=Bc(p,g,_,b),{top:a,left:s,right:o,bottom:l,width:o-s,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};x(yt,"Ratio",.6),x(yt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);let Fi=yt;const Tc={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof et||this._fill instanceof xt||this._fill instanceof Ct||this._fill instanceof rt)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof xt||this._fill instanceof Ct||this._fill instanceof rt)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof et||this._stroke instanceof xt||this._stroke instanceof Ct||this._stroke instanceof rt)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof xt||this._stroke instanceof Ct||this._stroke instanceof rt)&&this._stroke.bind(K.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function qm(){this._flagFill=!0}function Ym(){this._flagStroke=!0}const Qr=Math.min,es=Math.max,Sn=class Sn extends pn{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);for(let r in Ec)Object.defineProperty(this,r,Ec[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++)$c.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)$c.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new Sn;for(let o=0;o<Sn.Properties.length;o++){const a=Sn.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:ni(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 Gs.fromObject(o);case"circle":return Js.fromObject(o);case"ellipse":return to.fromObject(o);case"points":return Jr.fromObject(o);case"polygon":return no.fromObject(o);case"rectangle":return io.fromObject(o);case"rounded-rectangle":return ro.fromObject(o);case"star":return so.fromObject(o);case"path":return Ee.fromObject(o);case"text":return Fi.fromObject(o);case"group":return Sn.fromObject(o);case"shape":return pn.fromObject(o);case"element":return sr.fromObject(o)}return o}}copy(n){return super.copy.call(this,n),console.warn("Two.Group.copy is not supported yet."),this}clone(n){const r=new Sn,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,Ae.each(this.children,(r,s)=>{n.children[s]=r.toObject()},this),n}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,f=1/0,p=-1/0;const u=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const m=this.children[g];if(!(!m.visible||u.test(m._renderer.type))&&(r=m.getBoundingClientRect(n),o=typeof r.top!="number"||Ae.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Ae.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Ae.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Ae.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[_,y]=s.multiply(r.left,r.top),[b,S]=s.multiply(r.right,r.top),[C,v]=s.multiply(r.left,r.bottom),[B,k]=s.multiply(r.right,r.bottom);f=Qr(y,S,v,k,f),d=Qr(_,b,C,B,d),h=es(_,b,C,B,h),p=es(y,S,v,k,p)}else f=Qr(r.top,f),d=Qr(r.left,d),h=es(r.right,h),p=es(r.bottom,p)}return{top:f,left:d,right:h,bottom:p,width:h-d,height:p-f}}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(Sn,"Children",_c),x(Sn,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let gn=Sn;const Ec={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){const t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){const t=gn.InsertChildren.bind(this),n=gn.RemoveChildren.bind(this),r=gn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new _c(e),this._children.bind(K.Types.insert,t),this._children.bind(K.Types.remove,n),this._children.bind(K.Types.order,r),e.length>0&&t(e)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Ae.isObject(e)&&!e.clip&&(e.clip=!0)}}};function $c(e,t){const n=e.parent;let r;if(n===t){s();return}if(n&&n.children.ids[e.id]&&(r=Array.prototype.indexOf.call(n.children,e),n.children.splice(r,1),o()),t){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete e.parent;function s(){t.subtractions.length>0&&(r=Array.prototype.indexOf.call(t.subtractions,e),r>=0&&t.subtractions.splice(r,1)),t.additions.length>0&&(r=Array.prototype.indexOf.call(t.additions,e),r>=0&&t.additions.splice(r,1)),e.parent=t,t.additions.push(e),t._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,e),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,e),r<0&&(n.subtractions.push(e),n._flagSubtractions=!0)}}class ao extends Ee{constructor(t,n,r,s){const o=[new Te(t,n),new Te(r,s)];super(o);for(let a in Nc)Object.defineProperty(this,a,Nc[a]);this.vertices[0].command=pe.move,this.vertices[1].command=pe.line,this.automatic=!1}}const Nc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(Ae.isObject(e))this.vertices.splice(0,1,e);else{const t=new Ur("Two.Line.x argument is not an object.");console.warn(t.name,t.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(Ae.isObject(e))this.vertices.splice(1,1,e);else{const t=new Ur("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}};class lo{constructor(t=0,n=0){this.x=t,this.y=n}}class ii{constructor(t=10,n=0,r="A"){x(this,"start",new lo);x(this,"end",new lo);this.width=t,this.angle=n,this.label=r}}const Oe={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"}},Um={class:"flex gap-3"},Gm={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},Km={ref:"drawing-container",class:"size-full"},Zm={},Rc=i.defineComponent({...Zm,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select"],setup(e,{emit:t}){const n=e,r=t,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,h=i.computed(()=>n.value.configuratorParams.linesAngles.map((F,N)=>new ii(n.value.configuratorParams.linesWidths[N],F,`A-${N+1}`))),f=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),p=i.computed(()=>{var F,N;return n.value.configuratorParams.startTailType&&((F=n.settings.startTailConfigs)!=null&&F[n.value.configuratorParams.startTailType])?(N=n.settings.startTailConfigs)==null?void 0:N[n.value.configuratorParams.startTailType].points:[]}),u=i.computed(()=>{var F,N;return n.value.configuratorParams.endTailType&&((F=n.settings.endTailConfigs)!=null&&F[n.value.configuratorParams.endTailType])?(N=n.settings.endTailConfigs)==null?void 0:N[n.value.configuratorParams.endTailType].points:[]}),g=(F,N=!1)=>{F[0].start.x=0,F[0].start.y=0;let W=0;for(let z=0;z<F.length;z++){const G=F[z],V=F[z-1]??new ii(0,W);W+=!N||z>1?V.angle:0;const O=(!N||z>0?G.angle:0)+W;if(F[z].end.x=G.width*Math.cos(O*Math.PI/180)+F[z].start.x,F[z].end.y=G.width*Math.sin(O*Math.PI/180)+F[z].start.y,z<F.length-1){const J=z+1;F[J].start.x=F[z].end.x,F[J].start.y=F[z].end.y}}return F},m=(F,N,W,z,G=!1)=>{let V=g([...W,...z]);N.length>0&&(V=[...g(N),...V]);let O=0,J=0,he=0,ie=0;V.forEach(Me=>{O=Math.min(O,Me.start.x,Me.end.x),J=Math.min(J,Me.start.y,Me.end.y),he=Math.max(he,Me.start.x,Me.end.x),ie=Math.max(ie,Me.start.y,Me.end.y)});let ge,re;O===0&&J===0&&he===0&&ie===0?(ge=1,re=1):(ge=F.width/Math.abs(he-O),re=(G?F.height:F.height-Oe.colorSideLabel.size)/Math.abs(ie-J));const Fe=Math.min(ge,re);return O=O<0?-O*Fe:0,J=J<0?-J*Fe:0,[Fe,O,J]},_=F=>{const N=new Jr([F]);return N._size=Oe.anchorPoint.size,N.fill=Oe.anchorPoint.color,N.stroke="transparent",N._linewidth=Oe.anchorPoint.strokeSize,l.push(N),N},y=(F,N)=>{if(l=[],n.settings.allowChangeFirstPoint){const W=F[0],z=new we(W.vertices[0].x,W.vertices[0].y);z.bind(K.Types.change,()=>{W.vertices[0].copy(z)});const G=_(z);N.add(G)}F.forEach((W,z)=>{const G=F[z+1],V=new we(W.vertices[1].x,W.vertices[1].y);V.bind(K.Types.change,()=>{W.vertices[1].copy(V),G!==void 0&&G.vertices[0].copy(V)});const O=_(V);N.add(O)})},b=F=>F*(Math.PI/180),S=(F,N,W)=>{const z=N.vertices.length-1;F.position.x=N.vertices[z].x,F.position.y=N.vertices[z].y;const G=Math.atan2(N.vertices[z].y-N.vertices[0].y,N.vertices[z].x-N.vertices[0].x);F.rotation=b(W)+G},C=(F,N,W)=>{if(N.vertices[0]===void 0)return;F.position.x=N.vertices[0].x,F.position.y=N.vertices[0].y;const z=N.vertices.length-1,G=Math.atan2(N.vertices[z].y-N.vertices[0].y,N.vertices[z].x-N.vertices[0].x);F.rotation=b(W)+G},v=(F,N,W)=>{const z=new gn;if(F.length===0)return z;const G=[];return[...F].reverse().forEach((V,O)=>{O!==0&&V.angle>0&&(V.angle*=-1),G.push(V)}),F=g(G,!0),C(z,N,F[0].angle),[N.vertices[0],N.vertices[1]].forEach(V=>{V.bind(K.Types.change,()=>{C(z,N,F[0].angle)})}),F.forEach(V=>{const O=V.start.x*W,J=V.end.x*W,he=V.start.y*W,ie=V.end.y*W,ge=new ao(O,he,J,ie);ge.linewidth=Oe.line.size,ge.stroke=Oe.line.color,z.add(ge)}),z},B=(F,N,W)=>{const z=new gn;return F.length===0||(F=g(F,!0),S(z,N,F[0].angle),[N.vertices[0],N.vertices[1]].forEach(G=>{G.bind(K.Types.change,()=>{S(z,N,F[0].angle)})}),F.forEach(G=>{const V=G.start.x*W,O=G.end.x*W,J=G.start.y*W,he=G.end.y*W,ie=new ao(V,J,O,he);ie.linewidth=Oe.line.size,ie.stroke=Oe.line.color,z.add(ie)})),z},k=(F,N,W,z)=>{const G=N.vertices[0].x+(N.vertices[1].x-N.vertices[0].x)/2-8*Math.sin(F.angle*Math.PI/180),V=N.vertices[0].y+(N.vertices[1].y-N.vertices[0].y)/2-8*Math.cos(F.angle*Math.PI/180),O=new Fi(F.label,G+10,V-10);let J;O.size=Oe.lineLabel.size,O.weight=600,O.fill=Oe.lineLabel.color,O.id+=1,O.rotation=Oe.lineLabel.rotation,z>0&&(J=new Fi(`${F.angle}°`,N.vertices[0].x+25,N.vertices[0].y-25),J.size=Oe.angleLabel.size,J.weight=600,J.fill=Oe.angleLabel.color,J.rotation=Oe.angleLabel.rotation,J.id+=z,o.push(J),W.add(J)),W.add(O),P(O,N,0,J),P(O,N,1)},E=()=>{const{size:F}=Oe.colorSideLabel,N=0,W=0,z=f.value?F/2:F/2-F,G=f.value?F/2-F:F/2,V=new gn;if(!c)return V;const O=5,J=Math.atan2(G-z,W-N),he=[new Te(N,z,0,0,0,0,ue.Commands.move),new Te(W,G,0,0,0,0,ue.Commands.line),new Te(W-O*Math.cos(J-Math.PI/4),G-O*Math.sin(J-Math.PI/4),0,0,0,0,ue.Commands.line),new Te(W,G,0,0,0,0,ue.Commands.move),new Te(W-O*Math.cos(J+Math.PI/4),G-O*Math.sin(J+Math.PI/4),0,0,0,0,ue.Commands.line)],ie=new Ee(he,!1,!1,!0);ie.noFill(),ie.cap="round",ie.join="round",ie.linewidth=F/7,ie.stroke=Oe.colorSideLabel.color,V.add(ie);const ge=new Fi(f.value?"Цвет снизу":"Цвет сверху",10,0);ge.size=F,ge.weight=600,ge.fill=Oe.colorSideLabel.color,ge.alignment="left",V.add(ge);const re=V.getBoundingClientRect();return V.position.x=(c.width-re.width)*d+10,V.position.y=f.value?c.height+re.height*2:re.height/2,V},P=(F,N,W,z)=>{N.vertices[W].bind(K.Types.change,()=>{const G=N.vertices.length-1,V=Math.atan2(N.vertices[0].y-N.vertices[G].y,N.vertices[0].x-N.vertices[G].x)*180/Math.PI,O=N.vertices[0].x+(N.vertices[G].x-N.vertices[0].x)/2-8*Math.sin(V*Math.PI/180),J=N.vertices[0].y+(N.vertices[G].y-N.vertices[0].y)/2-8*Math.cos(V*Math.PI/180);F.position.x=O+10,F.position.y=J-10,F.rotation=-.5,z&&(z.position.x=N.vertices[0].x+25,z.position.y=N.vertices[0].y-25)})},R=(F,N,W,z,G=!1)=>{var Ge;if(F.clear(),W.length===0){F.update();return}const V=g(W),[O,J,he]=m(F,N,V,z,G),ie=new gn,ge=new Array,re=new Array;G||(o=[],a=[]),V.forEach((Le,Pe)=>{const $e=Le.start.x*O+J,ot=Le.end.x*O+J,De=Le.start.y*O+he,ct=Le.end.y*O+he,Pt=new ao($e,De,ot,ct);Pt.linewidth=G?Oe.previewLine.size:Oe.line.size,Pt.stroke=G?Oe.previewLine.color:Oe.line.color,a.push(Pt),ge.push(Pt),ie.add(Pt),!G&&Le.label!==""&&k(Le,Pt,ie,Pe)});const Fe=ge.at(-1);let Me=ie.getBoundingClientRect();if(!G){const Le=E();re.push(Le)}if(N.length>0){const Le=v(N,ge[0],O);ie.add(Le)}if(z.length>0&&Fe){const Le=B(z,Fe,O);ie.add(Le)}if(re.push(ie),F.makeGroup(re),Me=ie.getBoundingClientRect(),ie.position.x=0-Me.left+(F.width-Me.width)/(2*(G?1:d)),ie.position.y=0-Me.top+(F.height-Me.height)/(2*(G?1:d)),F.update(),!G){const Le=((Ge=n.value.configuratorParams)==null?void 0:Ge.colorSide)==="top";ie.position.y=ie.position.y+Oe.colorSideLabel.size*Number(Le),y(ge,ie),F.update()}},j=(F,N)=>{if(F&&!N.isNewRec()){const W=new ue({width:F.scrollWidth,height:F.scrollHeight});W.appendTo(F),R(W,[],N.points,[],!0)}},q=()=>{c&&R(c,p.value,h.value,u.value,!1)},M=F=>F*(180/Math.PI),A=(F,N)=>{const W=F[1].x-F[0].x,z=F[1].y-F[0].y,G=N[1].x-N[0].x,V=N[1].y-N[0].y;let O=Math.atan2(W*V-z*G,W*G+z*V);return O=M(O),Math.round(O)*-1},$=F=>{const N=a.map((W,z,G)=>{const V=G[z-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let O=Math.ceil(W._length/F/n.settings.lineWidthStep)*n.settings.lineWidthStep;const J=o[z-1];O<(G.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(O=G.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),O>n.settings.maxLineWidth&&(O=n.settings.maxLineWidth);const he=A(W.vertices,V.vertices);return J&&(J.value=`${he}°`),new ii(O,he,`A-${z+1}`)});r("pointer:move",N)},X=F=>{let N=null,W;const z=J=>{N=l.find(he=>{const ie=he.renderer;return(ie==null?void 0:ie.elem)===J.target}),[W]=m(F,p.value,h.value.map(he=>he),u.value)},G=J=>{if(N){const he=N.renderer,ie=he==null?void 0:he.elem;if(!ie)return;const ge=ie.getBoundingClientRect();N.vertices[0].x-=ge.x-(J instanceof MouseEvent?J.clientX:J.targetTouches[0].clientX)+Oe.anchorPoint.size/2,N.vertices[0].y-=ge.y-(J instanceof MouseEvent?J.clientY:J.targetTouches[0].clientY)+Oe.anchorPoint.size/2,$(W),F.update()}},V=()=>{N&&r("pointer:up",h.value),N=null},O=s.value;O&&(O.addEventListener("touchstart",z),O.addEventListener("touchend",V),O.addEventListener("mousedown",z),O.addEventListener("mouseup",V),O.addEventListener("mousemove",G),O.addEventListener("touchmove",G))};return i.onMounted(()=>{s.value&&(c=new ue({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{q()},{deep:!0,immediate:!0}),X(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(F,N)=>(i.openBlock(),i.createElementBlock("div",Um,[i.createVNode(Ra,{"select-template-index":F.selectTemplateIndex,settings:F.settings,"onTemplate:select":N[0]||(N[0]=W=>r("template:select",W)),onInitDrawTemplate:j},null,8,["select-template-index","settings"]),i.createElementVNode("div",Gm,[i.createElementVNode("div",Km,null,512)])]))}}),Jm={class:"flex max-w-[50rem] flex-col gap-3"},Qm={},e0=i.defineComponent({...Qm,__name:"kozyrek-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,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:{}}),f=i.ref(0),p=(v=0)=>{const B=c.value.allTemplates.at(v);B!==void 0&&(f.value=v,l.value.configuratorParams.linesWidths=B.points.map(k=>D.isArray(k)?k[0]:k.width),l.value.configuratorParams.linesAngles=B.points.map(k=>D.isArray(k)?k[1]:k.angle),y()),m(l.value.configuratorParams)},u=async()=>{const v=prompt("Введите название шаблона:");if(!v)return;a.value=!0;const B={label:v,points:l.value.configuratorParams.linesWidths.map((k,E)=>[k,l.value.configuratorParams.linesAngles[E]])};await U.HttpRequester.getInstance(U.ConfiguratorProvider).createTemplate(n.cartItem.category,B,h.value).then(()=>{c.value.addCustomTemplate(B),f.value=c.value.allTemplates.length-1}).catch(()=>{a.value=!1}),a.value=!1},g=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(f.value=c.value.allTemplates.length-1)},m=async v=>{y(),s.value=!0,await U.HttpRequester.getInstance(U.ConfiguratorProvider).searchProduct(n.cartItem.category,v,h.value).then(B=>{l.value.product=B}).catch(()=>{s.value=!1}),s.value=!1},_=async()=>{o.value=!0,await(l.value.isNewRec()?U.HttpRequester.getInstance(U.CartProvider).addCartItem(n.client,l.value).then(v=>{r("submit-success",v)}).catch(()=>{o.value=!1}):U.HttpRequester.getInstance(U.CartProvider).patchCartItem(n.client,l.value).then(v=>{r("submit-success",v)}).catch(()=>{o.value=!1})),o.value=!1},y=()=>{const v={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach((B,k)=>{v[`lines_widths[${k+1}]`]={},v[`lines_angles[${k+1}]`]={}}),h.value=v},b=v=>{d.value.linesWidths=v.map(B=>B.width),d.value.linesAngles=v.map(B=>B.angle)},S=v=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,y(),g(),m(l.value.configuratorParams)},C=(v,B)=>{d.value.linesWidths=v,d.value.linesAngles=B};return i.onBeforeMount(()=>{p()}),(v,B)=>(i.openBlock(),i.createElementBlock("div",Jm,[i.createVNode(Rc,{value:l.value,"select-template-index":f.value,settings:c.value,"onPointer:up":S,"onPointer:move":b,"onTemplate:select":p},null,8,["value","select-template-index","settings"]),i.createVNode(Ma,{value:l.value,"onUpdate:value":B[0]||(B[0]=k=>l.value=k),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":f.value,"onUpdate:params":B[1]||(B[1]=k=>m(k)),"onUpdate:preview":C,onSubmit:_,"onClick:saveTemplate":u},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])]))}});class Mi 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)=>D.isArray(s)?new ii(s[0],s[1],`A-${o+1}`):new ii(s.width,s.angle,`A-${o+1}`))):(this.label="-- Новая конфигурация --",this.points=[new ii(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class co extends Mi{constructor(n){super(n);x(this,"isDefault");this.isDefault=n.isDefault??!1}}class t0{constructor(t){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");this.minLineWidth=t.minLineWidth,this.maxLineWidth=t.maxLineWidth,this.lineWidthStep=t.lineWidthStep,this.minLineAngle=t.minLineAngle,this.maxLineAngle=t.maxLineAngle,this.lineAngleStep=t.lineAngleStep,this.stripMinWidth=t.stripMinWidth,this.stripMaxWidth=t.stripMaxWidth,this.stripMinLength=t.stripMinLength,this.stripMaxLength=t.stripMaxLength,this.allowShowTable=t.allowShowTable,this.showOnlyTemplates=t.showOnlyTemplates,this.templates=t.templates.map(n=>new Mi(n)),this.templates.forEach((n,r)=>{n.id=r}),this.startTailConfigs=t.startTailConfigs.map(n=>new co(n)),this.endTailConfigs=t.endTailConfigs.map(n=>new co(n)),this.bendCountForExtended=t.bendCountForExtended,this.extendedProductCatalog=t.extendedProductCatalog,this.allowChangeFirstPoint=t.allowChangeFirstPoint,this.allowSaveTemplates=t.allowSaveTemplates,this.userTemplatesPrefix=t.userTemplatesPrefix,this.lengthStep=t.lengthStep,this.showOnlyTemplates||(this.customTemplates=t.customTemplates?Object.entries(t.customTemplates).map(([n,r])=>{const s=new Mi(r);return s.isCustom=!0,s.id=+n,s}):[],this.customTemplates.push(new Mi))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(t){var r,s;if(!this.allowSaveTemplates)return;const n=new Mi(t);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(t){if(this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===t);n&&n!==-1&&this.customTemplates.splice(n,1)}}const n0={},Ai=i.defineComponent({...n0,__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(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=D.debounce(()=>s("update:value",o.value),a.value),c=u=>{o.value=u,l()};i.watch(()=>r.value,u=>{o.value=u});const d=i.ref(null);return t({focus:()=>{var u;return(u=d.value)==null?void 0:u.focus()},blur:()=>{var u;return(u=d.value)==null?void 0:u.blur()},select:()=>{var u;return(u=d.value)==null?void 0:u.select()}}),(u,g)=>(i.openBlock(),i.createBlock(i.unref(I.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value,"onUpdate:value":[g[0]||(g[0]=m=>o.value=m),c],clearable:u.clearable,placeholder:u.placeholder,min:u.min,max:u.max,step:u.step,validator:u.validator},{prefix:i.withCtx(()=>[i.renderSlot(u.$slots,"prefix")]),_:3},8,["value","clearable","placeholder","min","max","step","validator"]))}}),i0={class:"flex flex-col gap-3"},r0={},Pc=i.defineComponent({...r0,__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","click:view-switch","submit"],setup(e,{emit:t}){const n=e,r=t,s=i.useTemplateRef("first-input-element"),o=i.ref(D.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=I.NInput;return i.openBlock(),i.createBlock(i.unref(I.NForm),{disabled:c.isSubmitProcessing,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NFormItem),{required:!0,feedback:c.validation.width.feedback||"","show-feedback":c.validation.width.showFeedback||!1,"validation-status":c.validation.width.validationStatus||void 0,label:`Ширина, ${c.settings.minWidth?" от "+c.settings.minWidth:""}${c.settings.maxWidth?" до "+c.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(Ai,{ref:"first-input-element",value:o.value.width,"onUpdate:value":[d[0]||(d[0]=f=>o.value.width=f),a],class:"w-full",max:c.settings.maxWidth??void 0,min:c.settings.minWidth,validator:f=>!!f&&f>=c.settings.minWidth&&(!c.settings.maxWidth||f<=c.settings.maxWidth),placeholder:"Введите ширину"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(I.NFormItem),{required:!0,feedback:c.validation.length.feedback||"","show-feedback":c.validation.length.showFeedback||!1,"validation-status":c.validation.length.validationStatus||void 0,label:`Длина, ${c.settings.minLength?" от "+c.settings.minLength:""}${c.settings.maxLength?" до "+c.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(Ai,{value:o.value.length,"onUpdate:value":[d[1]||(d[1]=f=>o.value.length=f),a],placeholder:"Введите длину",max:c.settings.maxLength,min:c.settings.minLength,validator:f=>f>=c.settings.minLength&&f<=c.settings.maxLength,class:"w-full"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(I.NFormItem),{required:!0,feedback:c.validation.quantity.feedback||"","show-feedback":c.validation.quantity.showFeedback||!1,"validation-status":c.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:c.value.quantity,placeholder:"Введите количество",min:1,validator:f=>f>0,class:"w-full","onUpdate:value":d[2]||(d[2]=f=>l("quantity",f??0))},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(I.NFormItem),{feedback:c.validation.marker.feedback||"","show-feedback":c.validation.marker.showFeedback||!1,"validation-status":c.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(h,{value:c.value.marker,placeholder:"Введите маркировку","onUpdate:value":d[3]||(d[3]=f=>l("marker",f))},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(Ui,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",i0,[i.createVNode(i.unref(I.NButton),{disabled:c.value.product.isNewRec()||c.isProductSearching||c.isSubmitProcessing||c.value.length===0||c.value.width===0||c.value.quantity===0,type:"primary",class:"self-start",onClick:d[4]||(d[4]=f=>r("submit",c.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"]),c.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[5]||(d[5]=f=>r("click:view-switch"))},{default:i.withCtx(()=>d[6]||(d[6]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[6]})):i.createCommentVNode("",!0)])]),_:1},8,["disabled"])}}}),s0={class:"w-104 px-5"},o0={},a0=i.defineComponent({...o0,__name:"metal-for-doors-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,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(f=>{s.value.product=f}).catch(()=>{a.value=!1}),a.value=!1},d=async()=>{l.value=!0,await(s.value.isNewRec()?U.HttpRequester.getInstance(U.CartProvider).addCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1}):U.HttpRequester.getInstance(U.CartProvider).patchCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1})),l.value=!1};return(h,f)=>(i.openBlock(),i.createElementBlock("div",s0,[i.createVNode(Pc,{value:s.value,"onUpdate:value":f[0]||(f[0]=p=>s.value=p),validation:o.value,settings:h.settings,"is-submit-processing":l.value,"onUpdate:params":f[1]||(f[1]=p=>c(p)),onSubmit:f[2]||(f[2]=p=>d())},null,8,["value","validation","settings","is-submit-processing"])]))}}),l0={key:0,class:"flex items-baseline gap-1"},c0={key:0,class:"flex items-baseline gap-1"},d0={class:"flex gap-3"},h0={},Fc=i.defineComponent({...h0,__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(e,{emit:t}){const n=e,r=t,s=i.computed(()=>wt.isPhoneDevice()),o=i.ref(D.cloneDeep(i.toRaw(n.value.configuratorParams))),a=i.computed(()=>n.settings.widthOverlaps[o.value.mountType]??0),l=i.computed(()=>n.settings.heightOverlaps[o.value.mountType]??0),c=i.computed(()=>n.settings.maxWidths[o.value.netType]),d=i.computed(()=>n.settings.maxHeights[o.value.netType]-l.value),h=(p,u)=>{p&&p in o.value&&(o.value[p]=u??0),r("update:params",o.value),f("configuratorParams",o.value)},f=(p,u)=>{const g=new U.CartItemBase(n.value);g[p]=u,r("update:value",g)};return(p,u)=>{const g=I.NInput;return i.openBlock(),i.createBlock(i.unref(I.NForm),{class:"flex flex-col gap-2 px-4 md:max-w-96"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:o.value.netType,"onUpdate:value":[u[0]||(u[0]=m=>o.value.netType=m),h],options:p.settings.netType.map(m=>({label:p.settings.descriptions.net_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:o.value.color,"onUpdate:value":u[1]||(u[1]=m=>o.value.color=m),options:p.settings.color.map(m=>({label:p.settings.descriptions.color[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:o.value.mountType,"onUpdate:value":[u[2]||(u[2]=m=>o.value.mountType=m),h],options:p.settings.mountType.map(m=>({label:p.settings.descriptions.mount_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(I.NFormItem),{required:!0,feedback:p.validation.width.feedback||"","show-feedback":p.validation.width.showFeedback||o.value.width>=p.settings.minWidth&&o.value.width<=p.settings.maxWidths[o.value.netType],"validation-status":p.validation.width.validationStatus||void 0,label:`Ширина светового проёма от ${p.settings.minWidth-a.value} ${c.value?" до "+c.value:""} мм.`},{feedback:i.withCtx(()=>[!p.validation.width.showFeedback&&o.value.width>=p.settings.minWidth&&o.value.width<=p.settings.maxWidths[o.value.netType]?(i.openBlock(),i.createElementBlock("div",l0,[i.createVNode(i.unref(I.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(o.value.width+a.value),1)]),_:1}),i.createVNode(i.unref(I.NButton),{quaternary:"",type:"info",size:"tiny",onClick:u[4]||(u[4]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>u[11]||(u[11]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])),_:1,__:[11]})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Ai,{value:o.value.width&&o.value.width-a.value,max:c.value,min:p.settings.minWidth-a.value,placeholder:"Введите ширину светового проёма",class:"w-full","onUpdate:value":u[3]||(u[3]=m=>h("width",(m&&m+a.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(I.NFormItem),{required:!0,feedback:p.validation.height.feedback||"","show-feedback":p.validation.height.showFeedback||o.value.height>=p.settings.minHeight&&o.value.height<=p.settings.maxHeights[o.value.netType],"validation-status":p.validation.height.validationStatus||void 0,label:`Высота светового проёма от ${p.settings.minHeight-l.value} ${d.value?" до "+d.value:""} мм.`},{feedback:i.withCtx(()=>[!p.validation.height.showFeedback&&o.value.height>=p.settings.minHeight&&o.value.height<=p.settings.maxHeights[o.value.netType]?(i.openBlock(),i.createElementBlock("div",c0,[i.createVNode(i.unref(I.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(o.value.height+l.value),1)]),_:1}),i.createVNode(i.unref(I.NButton),{quaternary:"",type:"info",size:"tiny",onClick:u[6]||(u[6]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>u[12]||(u[12]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])),_:1,__:[12]})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Ai,{value:o.value.height&&o.value.height-l.value,max:d.value,min:p.settings.minHeight-l.value,placeholder:"Введите высоту светового проёма",class:"w-full","onUpdate:value":u[5]||(u[5]=m=>h("height",(m&&m+l.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(I.NFormItem),{required:!0,feedback:p.validation.quantity.feedback||"","show-feedback":p.validation.quantity.showFeedback||!1,"validation-status":p.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:p.value.quantity,"onUpdate:value":u[7]||(u[7]=m=>p.value.quantity=m),min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(I.NFormItem),{feedback:p.validation.marker.feedback||"","show-feedback":p.validation.marker.showFeedback||!1,"validation-status":p.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(g,{value:p.value.marker,"onUpdate:value":u[8]||(u[8]=m=>p.value.marker=m),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(Ui,{"is-product-searching":p.isProductSearching,product:p.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",d0,[i.createVNode(i.unref(I.NButton),{loading:p.isSubmitProcessing,disabled:p.isProductSearching||!p.value.product||p.value.product.isNewRec()||o.value.width<p.settings.minHeight-l.value||o.value.height<p.settings.minHeight-l.value,type:"primary",class:"self-start",onClick:u[9]||(u[9]=m=>r("submit",p.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(p.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:0,type:"default",onClick:u[10]||(u[10]=m=>r("click:show-preview-drawer"))},{default:i.withCtx(()=>u[13]||(u[13]=[i.createTextVNode(" Предварительный просмотр ")])),_:1,__:[13]})):i.createCommentVNode("",!0)])]),_:1})}}}),u0="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",f0="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",p0="/img/configurators/mosquitto/measurement-instructions/mount.png",g0="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",m0="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",_0={class:"flex flex-col gap-6"},y0={class:"flex gap-4"},b0={class:"flex flex-col gap-2"},w0={class:"flex gap-4"},v0={class:"flex flex-col gap-2"},k0={class:"flex gap-4"},x0={class:"flex flex-col gap-2"},C0={},Mc=i.defineComponent({...C0,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(e,{emit:t}){const n=wt.initRefDependingOnDeviceResolution("small","small","medium"),r=wt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=t;return(a,l)=>{const c=I.NText;return i.openBlock(),i.createBlock(i.unref(I.NModal),{show:a.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",_0,[i.createVNode(c,{type:"error",class:"text-base font-medium"},{default:i.withCtx(()=>l[3]||(l[3]=[i.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ")])),_:1,__:[3]}),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:u0,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:f0,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",y0,[l[9]||(l[9]=i.createElementVNode("img",{src:p0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",b0,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ")),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.frame)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=i.createElementVNode("br",null,null,-1)),l[7]||(l[7]=i.createTextVNode(" Крепления находятся на раме сетки. "))])])]),i.createElementVNode("div",w0,[l[15]||(l[15]=i.createElementVNode("img",{src:g0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",v0,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:")),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=i.createElementVNode("br",null,null,-1)),l[13]||(l[13]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. "))])])]),i.createElementVNode("div",k0,[l[21]||(l[21]=i.createElementVNode("img",{src:m0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",x0,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ")),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.external_metal)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=i.createElementVNode("br",null,null,-1)),l[19]||(l[19]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. "))])])])])]),_:1},8,["show","size","style"])}}}),S0={class:"flex flex-col items-center justify-between rounded-xl"},B0={class:"img-preview relative flex justify-center"},T0={},E0=i.defineComponent({...T0,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(e,{emit:t}){const n=e,r=i.computed(()=>D.keys(n.settings.crossbarCount).find(o=>n.settings.crossbarCount[Number(o)]&&(!n.settings.crossbarCount[Number(o)+1]||n.configuratorParams.height<n.settings.crossbarCount[Number(o)+1]-n.settings.heightOverlaps[n.configuratorParams.mountType]))),s=t;return(o,a)=>{const l=I.NButton;return i.openBlock(),i.createElementBlock("div",S0,[i.createElementVNode("div",B0,[a[1]||(a[1]=i.createElementVNode("div",{class:"window"},null,-1)),i.createElementVNode("div",{class:i.normalizeClass(["net",`net-${o.configuratorParams.netType}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["frame",`frame-${o.configuratorParams.color}`])},null,2),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${o.configuratorParams.color}`])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["mount",`mount-${o.configuratorParams.mountType}-${o.configuratorParams.color}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["cut-preview",`cut-preview-${o.configuratorParams.mountType}-${o.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,__:[2]})])}}}),ho=Hn(E0,[["__scopeId","data-v-8b43aa68"]]),$0={class:"grid md:grid-cols-2"},N0={},R0=i.defineComponent({...N0,__name:"mosquito-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>wt.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),f=async u=>{u.height>0&&u.width>0&&(d.value=!0,await U.HttpRequester.getInstance(U.ConfiguratorProvider).searchProduct(n.cartItem.category,u,c.value).then(g=>{l.value.product=g}).catch(()=>{d.value=!1}),d.value=!1)},p=async()=>{h.value=!0,await(l.value.isNewRec()?U.HttpRequester.getInstance(U.CartProvider).addCartItem(n.client,l.value).then(u=>{r("submit-success",u)}).catch(()=>{h.value=!1}):U.HttpRequester.getInstance(U.CartProvider).patchCartItem(n.client,l.value).then(u=>{r("submit-success",u)}).catch(()=>{h.value=!1})),h.value=!1};return(u,g)=>{const m=Er;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(Mc,{show:a.value,"onUpdate:show":g[0]||(g[0]=_=>a.value=_),"height-overlaps":u.settings.heightOverlaps,"width-overlaps":u.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",$0,[s.value?(i.openBlock(),i.createBlock(i.unref(I.NDrawer),{key:1,show:o.value,"onUpdate:show":g[4]||(g[4]=_=>o.value=_),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(I.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:g[2]||(g[2]=_=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(m)]),_:1})]),default:i.withCtx(()=>[i.createVNode(ho,{"configurator-params":l.value.configuratorParams,settings:u.settings,onOpenInstructions:g[3]||(g[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(ho,{key:0,"configurator-params":l.value.configuratorParams,settings:u.settings,onOpenInstructions:g[1]||(g[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(Fc,{value:l.value,"onUpdate:value":g[5]||(g[5]=_=>l.value=_),validation:c.value,settings:u.settings,"is-product-searching":d.value,"is-submit-processing":h.value,"onUpdate:params":g[6]||(g[6]=_=>f(_)),onSubmit:g[7]||(g[7]=_=>p()),"onClick:instructionsToggle":g[8]||(g[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":g[9]||(g[9]=_=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),P0={},Ac=i.defineComponent({...P0,__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(e,{expose:t,emit:n}){const r=e,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 t({focusWidthInput:c}),(d,h)=>{const f=Fa,p=Pa;return i.openBlock(),i.createBlock(i.unref(I.NFormItem),{label:`Полоса №${d.index+1}, мм`,required:!0},{feedback:i.withCtx(()=>[i.createVNode(Ui,{"is-product-searching":a.value,product:d.product},null,8,["is-product-searching","product"])]),default:i.withCtx(()=>[i.createVNode(i.unref(I.NDropdown),{trigger:"click",options:d.suggestionOption,placement:"bottom-start",size:"large",onSelect:l},{default:i.withCtx(()=>[i.createVNode(Ai,{ref:"width-input-element",value:d.value,class:"w-full",step:d.value<d.settings.minLineWidth?d.settings.minLineWidth-d.value:d.settings.lineWidthStep,validator:u=>!!u&&u>=d.settings.minLineWidth&&u%d.settings.lineWidthStep===0,placeholder:"Введите ширину","onUpdate:value":l},null,8,["value","step","validator"])]),_:1},8,["options"]),i.createVNode(i.unref(I.NButton),{disabled:d.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[0]||(h[0]=u=>s("click:add-line",d.index))},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"]),i.createVNode(i.unref(I.NButton),{disabled:d.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[1]||(h[1]=u=>s("click:remove-line",d.index))},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),_:1},8,["label"])}}}),F0={class:"my-2 flex w-full flex-col"},M0={class:"flex gap-3"},A0={},Ic=i.defineComponent({...A0,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","click:view-switch","submit","click:add-line","click:remove-line"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>n.value[0].configuratorParams.linesWidths.map(h=>h).reduce((h,f)=>h+f,0)),o=i.computed(()=>n.settings.width-s.value),a=i.computed(()=>!n.value.some(({product:h})=>!h)),l=i.computed(()=>o.value===0?void 0:[{label:`${(o.value>0?"Остаток +":"Излишек ")+o.value} мм.`,key:o.value}]),c=(h,f,p)=>{const u=n.value.at(f);if(u)if(h&&h>=n.settings.minLineWidth&&h%n.settings.lineWidthStep===0){const g={linesWidths:u.configuratorParams.linesWidths.toSpliced(f,1,h)};r("update:params",g,f,p),d("configuratorParams",g)}else u.product.id=-1},d=(h,f)=>{const p=n.value.map(u=>new U.CartItemBase(u));p.forEach(u=>{u[h]=f}),r("update:value",p)};return(h,f)=>{const p=I.NText,u=I.NInput;return i.openBlock(),i.createBlock(i.unref(I.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>{var g;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,(m,_)=>(i.openBlock(),i.createBlock(Ac,{key:_,"auto-focus":!0,index:_,value:m.configuratorParams.linesWidths.at(_)??0,product:m.product,settings:h.settings,"suggestion-option":l.value,"add-line-button-disabled":o.value<=0||h.value.length>=h.settings.maxLinesCount,"remove-line-button-disabled":h.value.length===1,"onUpdate:value":c,"onClick:addLine":f[0]||(f[0]=y=>r("click:add-line",y)),"onClick:removeLine":f[1]||(f[1]=y=>r("click:remove-line",y))},null,8,["index","value","product","settings","suggestion-option","add-line-button-disabled","remove-line-button-disabled"]))),128)),i.createElementVNode("div",F0,[o.value<0?(i.openBlock(),i.createBlock(p,{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(h.settings.width),1)]),_:1})):i.createCommentVNode("",!0),a.value&&h.value.length===h.settings.maxLinesCount&&o.value>0?(i.openBlock(),i.createBlock(p,{key:1,type:"error"},{default:i.withCtx(()=>f[8]||(f[8]=[i.createTextVNode(" Остаток резки должен быть равен 0 ")])),_:1,__:[8]})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[f[9]||(f[9]=i.createTextVNode(" Остаток для резки: ")),i.createVNode(p,{type:o.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(o.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(h.settings.width)+" мм ",1)])]),i.createVNode(i.unref(I.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value<=0||h.value.length>=h.settings.maxLinesCount,type:"primary",class:"self-center",onClick:f[2]||(f[2]=m=>r("click:add-line",h.value.length))},{default:i.withCtx(()=>f[10]||(f[10]=[i.createTextVNode(" Добавить полосу ")])),_:1,__:[10]},8,["loading","disabled"]),i.createVNode(i.unref(I.NFormItem),{required:!0,label:`Метраж ${h.settings.minLength?" от "+h.settings.minLength:""} ${h.settings.maxLength?" до "+h.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:n.value[0].length,max:h.settings.maxLength||void 0,min:h.settings.minLength,step:h.settings.lengthStep,validator:m=>m%h.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full","onUpdate:value":f[3]||(f[3]=m=>d("length",m??0))},null,8,["value","max","min","step","validator"])]),_:1},8,["label"]),i.createVNode(i.unref(I.NFormItem),{required:!0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:n.value[0].quantity,min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full","onUpdate:value":f[4]||(f[4]=m=>d("quantity",m??0))},null,8,["value","validator"])]),_:1}),i.createVNode(i.unref(I.NFormItem),{label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(u,{value:n.value[0].marker,placeholder:"Введите маркировку","onUpdate:value":f[5]||(f[5]=m=>d("marker",m))},null,8,["value"])]),_:1}),i.createElementVNode("div",M0,[i.createVNode(i.unref(I.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value!=0||!((g=h.value[0])!=null&&g.length)||h.value[0].length>h.settings.maxLength||h.value[0].length<h.settings.minLength||h.value[0].quantity===0,type:"primary",class:"self-start",onClick:f[6]||(f[6]=m=>r("submit",h.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),h.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:0,type:"tertiary",class:"self-start",onClick:f[7]||(f[7]=m=>r("click:view-switch"))},{default:i.withCtx(()=>f[11]||(f[11]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[11]})):i.createCommentVNode("",!0)])]}),_:1})}}}),I0={class:"flex grow flex-col"},V0=["src"],O0={class:"w-full"},z0={},Vc=i.defineComponent({...z0,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",I0,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,V0),i.createElementVNode("div",O0,[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)])]))}}),L0={class:"w-104 flex grow flex-col px-5"},D0={},H0=i.defineComponent({...D0,__name:"strip-configurator",props:{settings:{},cartItems:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.cartItems),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.computed(()=>s.value[0].configuratorParams.linesWidths.map(p=>p).reduce((p,u)=>p+u,0)),c=p=>{p===void 0&&(p=s.value.length-1);const u=s.value.at(0);if(!u)return;u.configuratorParams.linesWidths=u.configuratorParams.linesWidths.toSpliced(p+1,0,0),s.value.forEach(m=>{m.configuratorParams.linesWidths=u.configuratorParams.linesWidths});const g=new U.CartItemBase({quantity:(u==null?void 0:u.quantity)??1,category:u==null?void 0:u.category,length:(u==null?void 0:u.length)??n.settings.minLength,marker:u==null?void 0:u.marker,configuratorParams:{linesWidths:u==null?void 0:u.configuratorParams.linesWidths}});s.value=s.value.toSpliced(p+1,0,g)},d=p=>{const u=s.value.at(0);u&&(u.configuratorParams.linesWidths=u.configuratorParams.linesWidths.toSpliced(p,1),s.value.forEach(g=>{g.configuratorParams.linesWidths=u.configuratorParams.linesWidths}),s.value=s.value.toSpliced(p,1),delete o[`linesWidths.${p}`],delete o[`linesWidths.${p}`])},h=async(p,u,g)=>{g.value=!0,await U.HttpRequester.getInstance(U.ConfiguratorProvider).searchProduct(s.value[u].category,{linesWidths:p.linesWidths.at(u)},o.value).then(m=>{s.value[u].product=m,s.value.length<n.settings.maxLinesCount&&l.value<n.settings.width&&c()}).catch(()=>{s.value[u].product=new U.Product,g.value=!1}),g.value=!1},f=async()=>{a.value=!0,await(s.value[0].isNewRec()?U.HttpRequester.getInstance(U.CartProvider).addCartItem(n.client,s.value[0]).then(p=>{r("submit-success",p)}).catch(()=>{a.value=!1}):U.HttpRequester.getInstance(U.CartProvider).patchCartItem(n.client,s.value[0]).then(p=>{r("submit-success",p)}).catch(()=>{a.value=!1})),a.value=!1};return(p,u)=>(i.openBlock(),i.createElementBlock("div",L0,[i.createVNode(Vc,{value:s.value,"onUpdate:value":u[0]||(u[0]=g=>s.value=g),settings:p.settings},null,8,["value","settings"]),i.createVNode(Ic,{value:s.value,"onUpdate:value":u[1]||(u[1]=g=>s.value=g),validation:o.value,settings:p.settings,"is-submit-processing":a.value,"onUpdate:params":h,onSubmit:f,"onClick:addLine":c,"onClick:removeLine":d},null,8,["value","validation","settings","is-submit-processing"])]))}}),W0={class:"flex flex-row gap-2.5"},j0={class:"flex flex-col"},X0={class:"flex flex-col"},q0={},Y0=i.defineComponent({...q0,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>U.AppConfigProvider.getConfig().dateFormats.uiDate},predefinedDateRanges:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1}},emits:["update:date-range"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>{if(n.predefinedDateRanges)return n.predefinedDateRanges;if(n.useDefaultPredefinedDateRanges){const a={};return D.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?Tn.startOfDay(new Date(a)):void 0,to:l?Tn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,f,p,u;const c=I.NButton,d=I.NDatePicker;return i.openBlock(),i.createElementBlock("div",W0,[i.createVNode(d,{value:(f=(h=a.dateRange)==null?void 0:h.from)==null?void 0:f.getTime(),clearable:a.clearable,"is-date-disabled":g=>{var m,_;return((m=a.dateRange)==null?void 0:m.to)&&g>((_=a.dateRange)==null?void 0:_.to)},format:a.dateFormat,type:"date",onUpdateValue:l[0]||(l[0]=g=>{var m,_;return o(g,(_=(m=a.dateRange)==null?void 0:m.to)==null?void 0:_.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",j0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(g,m)=>(i.openBlock(),i.createBlock(c,{key:m,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var y,b;return o((y=g==null?void 0:g.from)==null?void 0:y.getTime(),(b=g==null?void 0:g.to)==null?void 0:b.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(g.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","format"]),i.createVNode(d,{value:(u=(p=a.dateRange)==null?void 0:p.to)==null?void 0:u.getTime(),clearable:a.clearable,"is-date-disabled":g=>{var m,_;return((m=a.dateRange)==null?void 0:m.from)&&g<((_=a.dateRange)==null?void 0:_.from)},format:a.dateFormat,type:"date",onUpdateValue:l[1]||(l[1]=g=>{var m,_;return o((_=(m=a.dateRange)==null?void 0:m.from)==null?void 0:_.getTime(),g)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",X0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(g,m)=>(i.openBlock(),i.createBlock(c,{key:m,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var y,b;return o((y=g==null?void 0:g.from)==null?void 0:y.getTime(),(b=g==null?void 0:g.to)==null?void 0:b.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(g.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","format"])])}}}),U0={class:"sc-lbl-date text-nowrap"},G0={},uo=i.defineComponent({...G0,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>Tn.format(t.date,U.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Tn.format(t.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":s.isTimeOnSecondLine})},[i.createElementVNode("span",U0,i.toDisplayString(n.value),1),i.createElementVNode("span",{class:i.normalizeClass([{"text-sc-grey":s.isTimeSecondary,"ml-1":!s.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)],2))}}),K0={class:"flex flex-row gap-2.5"},Z0={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},J0={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},Q0={class:"mb-0.5 sm:mb-0 sm:ml-3"},e_={},t_=i.defineComponent({...e_,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(e){return(t,n)=>{const r=Er,s=I.NButton,o=I.NPopover;return i.openBlock(),i.createElementBlock("div",K0,[i.createElementVNode("div",Z0,[i.renderSlot(t.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",J0,[i.renderSlot(t.$slots,"extra-buttons"),i.createElementVNode("div",Q0,[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=>t.$emit("close"))},{default:i.withCtx(()=>[i.createVNode(r)]),_:1})]),default:i.withCtx(()=>[n[1]||(n[1]=i.createTextVNode(" Закрыть "))]),_:1,__:[1]})):i.createCommentVNode("",!0)])])])])}}}),n_={key:0,class:"flex flex-row gap-2.5"},i_={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},r_={},s_=i.defineComponent({...r_,__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:"Отмена"})}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=wt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=wt.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)},f=(u="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let g=!1;s("closing",u,()=>{g=!0}),g||(o.value=!1,s("update:show",o.value))},p=()=>{s("accept",g=>{a.value=g})};return i.watch(()=>r.show,u=>{u?h():f("other")}),i.watch(()=>r.processing,u=>{a.value=u}),t({open:h,close:f}),(u,g)=>{const m=I.NButton,_=I.NModal;return i.openBlock(),i.createBlock(_,{loading:a.value,show:o.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:u.title,"action-class":u.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:g[1]||(g[1]=y=>f("header")),onEsc:g[2]||(g[2]=y=>f("esc")),onMaskClick:g[3]||(g[3]=y=>f("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(u.$slots,"default")]),_:2},[u.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(u.$slots,"header")]),key:"0"}:void 0,u.$slots.action||u.$slots["extra-action"]||u.acceptButton.show||u.cancelButton.show?{name:"action",fn:i.withCtx(()=>[u.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",n_,[i.renderSlot(u.$slots,"extra-action")])):i.createCommentVNode("",!0),u.$slots.action||u.acceptButton.show||u.cancelButton.show?(i.openBlock(),i.createElementBlock("div",i_,[i.renderSlot(u.$slots,"action",{disabled:a.value}),u.acceptButton.show??!0?(i.openBlock(),i.createBlock(m,{key:0,disabled:a.value||!u.valid,size:i.unref(l),type:"primary",onClick:p},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(u.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),u.cancelButton.show??!0?(i.openBlock(),i.createBlock(m,{key:1,size:i.unref(l),type:"default",onClick:g[0]||(g[0]=y=>f("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(u.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","action-class"])}}}),o_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function a_(e,t){return i.openBlock(),i.createElementBlock("svg",o_,t[0]||(t[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 l_=i.markRaw({name:"ion-download-outline",render:a_}),c_={},d_=i.defineComponent({...c_,__name:"single-file-upload-selector",props:{draggedAreaText:{}},emits:["update:file"],setup(e,{emit:t}){const n=t,r=i.ref({name:"",content:""}),s=o=>{if(r.value={name:"",content:""},o.length===0)return;const a=o[0];r.value.name=a.name;const l=new FileReader;l.addEventListener("load",()=>{r.value.content=l.result??"",n("update:file",r.value)}),l.readAsDataURL(a.file)};return(o,a)=>{const l=l_,c=I.NUploadDragger,d=I.NUpload;return i.openBlock(),i.createBlock(d,{"default-upload":!1,max:1,action:"","directory-dnd":"",class:"content-center","onUpdate:fileList":s},{default:i.withCtx(()=>[i.createVNode(c,null,{default:i.withCtx(()=>[i.renderSlot(o.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(l,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(o.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3})}}}),h_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function u_(e,t){return i.openBlock(),i.createElementBlock("svg",h_,t[0]||(t[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 f_=i.markRaw({name:"ion-checkmark-done-sharp",render:u_}),p_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function g_(e,t){return i.openBlock(),i.createElementBlock("svg",p_,t[0]||(t[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 m_=i.markRaw({name:"ion-options-outline",render:g_}),__={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},y_={class:"flex-auto"},b_={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"},w_={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"},v_={},fo=i.defineComponent({...v_,__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(e,{emit:t}){const n=t,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=m_,f=I.NButton,p=I.NPopover,u=f_,g=Er;return i.openBlock(),i.createElementBlock("div",__,[i.createElementVNode("div",y_,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",b_,[i.createElementVNode("div",w_,[c.showEditButton?(i.openBlock(),i.createBlock(p,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:c.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,__:[0]})):i.createCommentVNode("",!0),c.showApplyButton?(i.openBlock(),i.createBlock(p,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:c.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения "))]),_:1,__:[1]},8,["disabled"])):i.createCommentVNode("",!0),c.showCancelButton?(i.openBlock(),i.createBlock(p,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:c.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,__:[2]})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),k_={},Oc=i.defineComponent({...k_,__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(e,{emit:t}){const n=e,r=t,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(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[s.value?(i.openBlock(),i.createBlock(fo,{key:1,disabled:l.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:l.disabled,"show-edit-button":l.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"]))]))}}),x_={},C_=i.defineComponent({...x_,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.value),o=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=D.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(I.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:c.clearable,placeholder:c.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),S_={},B_=i.defineComponent({...S_,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref((n.value??"").replaceAll(/\D*/g,"")),o=D.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(D.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(D.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof Xi.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=Xi.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof Xi.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(Wh.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=h=>s.value=h),a],"auto-default-country":!1,"auto-format":!0,"default-country":c.defaultCountry,disabled:c.disabled,"input-options":{placeholder:c.placeholder},"preferred-countries":c.preferredCountries,"only-countries":c.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),T_=Hn(B_,[["__scopeId","data-v-751dbb0e"]]),E_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $_(e,t){return i.openBlock(),i.createElementBlock("svg",E_,t[0]||(t[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 N_=i.markRaw({name:"tabler-external-link",render:$_}),R_={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},P_=["href"],F_={},M_=i.defineComponent({...F_,__name:"external-link",props:{text:{},url:{},description:{}},setup(e){return(t,n)=>{const r=N_,s=I.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(D.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",R_,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,P_),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),A_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function I_(e,t){return i.openBlock(),i.createElementBlock("svg",A_,t[0]||(t[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 V_=i.markRaw({name:"ion-remove-circle-outline",render:I_});let ts=[];const zc=new WeakMap;function O_(){ts.forEach(e=>e(...zc.get(e))),ts=[]}function Lc(e,...t){zc.set(e,t),!ts.includes(e)&&ts.push(e)===1&&requestAnimationFrame(O_)}function ar(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function lr(e){return e.composedPath()[0]||null}function cr(e){return typeof e=="string"?e.endsWith("px")?Number(e.slice(0,e.length-2)):Number(e):e}function dr(e){if(e!=null)return typeof e=="number"?`${e}px`:e.endsWith("px")?e:`${e}px`}function Yt(e,t){const n=e.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]:"+e+" is not a valid value.")}return t===void 0?r:r[t]}const Dc={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 z_(e,t,n){t/=100,n/=100;let r=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function L_(e,t,n){t/=100,n/=100;let r=t*Math.min(n,1-n),s=(o,a=(o+e/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 rn="^\\s*",sn="\\s*$",Fn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Ot="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",ri="([0-9A-Fa-f])",si="([0-9A-Fa-f]{2})",Hc=new RegExp(`${rn}hsl\\s*\\(${Ot},${Fn},${Fn}\\)${sn}`),Wc=new RegExp(`${rn}hsv\\s*\\(${Ot},${Fn},${Fn}\\)${sn}`),jc=new RegExp(`${rn}hsla\\s*\\(${Ot},${Fn},${Fn},${Ot}\\)${sn}`),Xc=new RegExp(`${rn}hsva\\s*\\(${Ot},${Fn},${Fn},${Ot}\\)${sn}`),D_=new RegExp(`${rn}rgb\\s*\\(${Ot},${Ot},${Ot}\\)${sn}`),H_=new RegExp(`${rn}rgba\\s*\\(${Ot},${Ot},${Ot},${Ot}\\)${sn}`),W_=new RegExp(`${rn}#${ri}${ri}${ri}${sn}`),j_=new RegExp(`${rn}#${si}${si}${si}${sn}`),X_=new RegExp(`${rn}#${ri}${ri}${ri}${ri}${sn}`),q_=new RegExp(`${rn}#${si}${si}${si}${si}${sn}`);function Nt(e){return parseInt(e,16)}function Y_(e){try{let t;if(t=jc.exec(e))return[is(t[1]),Mn(t[5]),Mn(t[9]),ai(t[13])];if(t=Hc.exec(e))return[is(t[1]),Mn(t[5]),Mn(t[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${e}.`)}catch(t){throw t}}function U_(e){try{let t;if(t=Xc.exec(e))return[is(t[1]),Mn(t[5]),Mn(t[9]),ai(t[13])];if(t=Wc.exec(e))return[is(t[1]),Mn(t[5]),Mn(t[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${e}.`)}catch(t){throw t}}function oi(e){try{let t;if(t=j_.exec(e))return[Nt(t[1]),Nt(t[2]),Nt(t[3]),1];if(t=D_.exec(e))return[pt(t[1]),pt(t[5]),pt(t[9]),1];if(t=H_.exec(e))return[pt(t[1]),pt(t[5]),pt(t[9]),ai(t[13])];if(t=W_.exec(e))return[Nt(t[1]+t[1]),Nt(t[2]+t[2]),Nt(t[3]+t[3]),1];if(t=q_.exec(e))return[Nt(t[1]),Nt(t[2]),Nt(t[3]),ai(Nt(t[4])/255)];if(t=X_.exec(e))return[Nt(t[1]+t[1]),Nt(t[2]+t[2]),Nt(t[3]+t[3]),ai(Nt(t[4]+t[4])/255)];if(e in Dc)return oi(Dc[e]);if(Hc.test(e)||jc.test(e)){const[n,r,s,o]=Y_(e);return[...L_(n,r,s),o]}else if(Wc.test(e)||Xc.test(e)){const[n,r,s,o]=U_(e);return[...z_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(t){throw t}}function G_(e){return e>1?1:e<0?0:e}function po(e,t,n,r){return`rgba(${pt(e)}, ${pt(t)}, ${pt(n)}, ${G_(r)})`}function go(e,t,n,r,s){return pt((e*t*(1-r)+n*r)/s)}function K_(e,t){Array.isArray(e)||(e=oi(e)),Array.isArray(t)||(t=oi(t));const n=e[3],r=t[3],s=ai(n+r-n*r);return po(go(e[0],n,t[0],r,s),go(e[1],n,t[1],r,s),go(e[2],n,t[2],r,s),s)}function Re(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:oi(e);return typeof t.alpha=="number"?po(n,r,s,t.alpha):po(n,r,s,o)}function ns(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:oi(e),{lightness:a=1,alpha:l=1}=t;return Z_([n*a,r*a,s*a,o*l])}function ai(e){const t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function is(e){const t=Math.round(Number(e));return t>=360||t<0?0:t}function pt(e){const t=Math.round(Number(e));return t>255?255:t<0?0:t}function Mn(e){const t=Math.round(Number(e));return t>100?100:t<0?0:t}function Z_(e){const[t,n,r]=e;return 3 in e?`rgba(${pt(t)}, ${pt(n)}, ${pt(r)}, ${ai(e[3])})`:`rgba(${pt(t)}, ${pt(n)}, ${pt(r)}, 1)`}function J_(e=8){return Math.random().toString(16).slice(2,2+e)}function qc(e){return Array.isArray(e)?e:[e]}const mo={STOP:"STOP"};function Yc(e,t){const n=t(e);e.children!==void 0&&n!==mo.STOP&&e.children.forEach(r=>Yc(r,t))}function Q_(e,t={}){const{preserveGroup:n=!1}=t,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(e),r}function ey(e,t){const{isLeaf:n}=e;return n!==void 0?n:!t(e)}function ty(e){return e.children}function ny(e){return e.key}function iy(){return!1}function ry(e,t){const{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function sy(e){return e.disabled===!0}function oy(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function ay(e,t){if(e.isLeaf===!0){const n=t(e);if(Array.isArray(n)&&n.length>0)return!0}return!1}function _o(e){var t;return e==null?[]:Array.isArray(e)?e:(t=e.checkedKeys)!==null&&t!==void 0?t:[]}function yo(e){var t;return e==null||Array.isArray(e)?[]:(t=e.indeterminateKeys)!==null&&t!==void 0?t:[]}function ly(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function cy(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function dy(e){return(e==null?void 0:e.type)==="group"}function hy(e){const t=new Map;return e.forEach((n,r)=>{t.set(n.key,r)}),n=>{var r;return(r=t.get(n))!==null&&r!==void 0?r:null}}class uy extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function fy(e,t,n,r){return rs(t.concat(e),n,r,!1)}function py(e,t){const n=new Set;return e.forEach(r=>{const s=t.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 gy(e,t,n,r){const s=rs(t,n,r,!1),o=rs(e,n,r,!0),a=py(e,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function bo(e,t){const{checkedKeys:n,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=e;if(!a)return r!==void 0?{checkedKeys:ly(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:cy(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=t;let f;s!==void 0?f=gy(s,n,t,d):r!==void 0?f=fy(r,n,t,d):f=rs(n,t,d,!1);const p=c==="parent",u=c==="child"||l,g=f,m=new Set,_=Math.max.apply(null,Array.from(h.keys()));for(let y=_;y>=0;y-=1){const b=y===0,S=h.get(y);for(const C of S){if(C.isLeaf)continue;const{key:v,shallowLoaded:B}=C;if(u&&B&&C.children.forEach(R=>{!R.disabled&&!R.isLeaf&&R.shallowLoaded&&g.has(R.key)&&g.delete(R.key)}),C.disabled||!B)continue;let k=!0,E=!1,P=!0;for(const R of C.children){const j=R.key;if(!R.disabled){if(P&&(P=!1),g.has(j))E=!0;else if(m.has(j)){E=!0,k=!1;break}else if(k=!1,E)break}}k&&!P?(p&&C.children.forEach(R=>{!R.disabled&&g.has(R.key)&&g.delete(R.key)}),g.add(v)):E&&m.add(v),b&&u&&g.has(v)&&g.delete(v)}}return{checkedKeys:Array.from(g),indeterminateKeys:Array.from(m)}}function rs(e,t,n,r){const{treeNodeMap:s,getChildren:o}=t,a=new Set,l=new Set(e);return e.forEach(c=>{const d=s.get(c);d!==void 0&&Yc(d,h=>{if(h.disabled)return mo.STOP;const{key:f}=h;if(!a.has(f)&&(a.add(f),l.add(f),oy(h.rawNode,o))){if(r)return mo.STOP;if(!n)throw new uy}})}),l}function my(e,{includeGroup:t=!1,includeSelf:n=!0},r){var s;const o=r.treeNodeMap;let a=e==null?null:(s=o.get(e))!==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&&(t||!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 _y(e){if(e.length===0)return null;const t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function yy(e,t){const n=e.siblings,r=n.length,{index:s}=e;return t?n[(s+1)%r]:s===n.length-1?null:n[s+1]}function Uc(e,t,{loop:n=!1,includeDisabled:r=!1}={}){const s=t==="prev"?by:yy,o={reverse:t==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===e){if(!a)a=!0;else if(!e.disabled&&!e.isGroup){l=e;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const h=wo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const f=wy(d);f!=null&&f.isGroup?c(s(f,n)):n&&c(s(d,!0))}}}}return c(e),l}function by(e,t){const n=e.siblings,r=n.length,{index:s}=e;return t?n[(s-1+r)%r]:s===0?null:n[s-1]}function wy(e){return e.parent}function wo(e,t={}){const{reverse:n=!1}=t,{children:r}=e;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=wo(d,t);if(h!==null)return h}else return d}}return null}const vy={getChild(){return this.ignored?null:wo(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return Uc(this,"next",e)},getPrev(e={}){return Uc(this,"prev",e)}};function ky(e,t){const n=t?new Set(t):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(e),r}function xy(e,t){const n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}var Cy={};function Gc(e,t,n,r,s,o=null,a=0){const l=[];return e.forEach((c,d)=>{var h;Cy.NODE_ENV!=="production"&&ay(c,s)&&console.error("[treemate]: node",c,"is invalid");const f=Object.create(r);if(f.rawNode=c,f.siblings=l,f.level=a,f.index=d,f.isFirstChild=d===0,f.isLastChild=d+1===e.length,f.parent=o,!f.ignored){const p=s(c);Array.isArray(p)&&(f.children=Gc(p,t,n,r,s,f,a+1))}l.push(f),t.set(f.key,f),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(f)}),l}function Sy(e,t={}){var n;const r=new Map,s=new Map,{getDisabled:o=sy,getIgnored:a=iy,getIsGroup:l=dy,getKey:c=ny}=t,d=(n=t.getChildren)!==null&&n!==void 0?n:ty,h=t.ignoreEmptyChildren?C=>{const v=d(C);return Array.isArray(v)?v.length?v:null:v}:d,f=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return ey(this.rawNode,h)},get shallowLoaded(){return ry(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(C){return xy(this,C)}},vy),p=Gc(e,r,s,f,h);function u(C){if(C==null)return null;const v=r.get(C);return v&&!v.isGroup&&!v.ignored?v:null}function g(C){if(C==null)return null;const v=r.get(C);return v&&!v.ignored?v:null}function m(C,v){const B=g(C);return B?B.getPrev(v):null}function _(C,v){const B=g(C);return B?B.getNext(v):null}function y(C){const v=g(C);return v?v.getParent():null}function b(C){const v=g(C);return v?v.getChild():null}const S={treeNodes:p,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(C){return ky(p,C)},getNode:u,getPrev:m,getNext:_,getParent:y,getChild:b,getFirstAvailableNode(){return _y(p)},getPath(C,v={}){return my(C,v,S)},getCheckedKeys(C,v={}){const{cascade:B=!0,leafOnly:k=!1,checkStrategy:E="all",allowNotLoaded:P=!1}=v;return bo({checkedKeys:_o(C),indeterminateKeys:yo(C),cascade:B,leafOnly:k,checkStrategy:E,allowNotLoaded:P},S)},check(C,v,B={}){const{cascade:k=!0,leafOnly:E=!1,checkStrategy:P="all",allowNotLoaded:R=!1}=B;return bo({checkedKeys:_o(v),indeterminateKeys:yo(v),keysToCheck:C==null?[]:qc(C),cascade:k,leafOnly:E,checkStrategy:P,allowNotLoaded:R},S)},uncheck(C,v,B={}){const{cascade:k=!0,leafOnly:E=!1,checkStrategy:P="all",allowNotLoaded:R=!1}=B;return bo({checkedKeys:_o(v),indeterminateKeys:yo(v),keysToUncheck:C==null?[]:qc(C),cascade:k,leafOnly:E,checkStrategy:P,allowNotLoaded:R},S)},getNonLeafKeys(C={}){return Q_(p,C)}};return S}function ss(e){return e.composedPath()[0]}const By={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function Ty(e,t,n){if(e==="mousemoveoutside"){const r=s=>{t.contains(ss(s))||n(s)};return{mousemove:r,touchstart:r}}else if(e==="clickoutside"){let r=!1;const s=a=>{r=!t.contains(ss(a))},o=a=>{r&&(t.contains(ss(a))||n(a))};return{mousedown:s,mouseup:o,touchstart:s,touchend:o}}return console.error(`[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`),{}}function Kc(e,t,n){const r=By[e];let s=r.get(t);s===void 0&&r.set(t,s=new WeakMap);let o=s.get(n);return o===void 0&&s.set(n,o=Ty(e,t,n)),o}function Ey(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=Kc(e,t,n);return Object.keys(s).forEach(o=>{St(o,document,s[o],r)}),!0}return!1}function $y(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=Kc(e,t,n);return Object.keys(s).forEach(o=>{tt(o,document,s[o],r)}),!0}return!1}function Ny(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const e=new WeakMap,t=new WeakMap;function n(){e.set(this,!0)}function r(){e.set(this,!0),t.set(this,!0)}function s(k,E,P){const R=k[E];return k[E]=function(){return P.apply(k,arguments),R.apply(k,arguments)},k}function o(k,E){k[E]=Event.prototype[E]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var k;return(k=a.get(this))!==null&&k!==void 0?k:null}function d(k,E){l!==void 0&&Object.defineProperty(k,"currentTarget",{configurable:!0,enumerable:!0,get:E??l.get})}const h={bubble:{},capture:{}},f={};function p(){const k=function(E){const{type:P,eventPhase:R,bubbles:j}=E,q=ss(E);if(R===2)return;const M=R===1?"capture":"bubble";let A=q;const $=[];for(;A===null&&(A=window),$.push(A),A!==window;)A=A.parentNode||null;const X=h.capture[P],F=h.bubble[P];if(s(E,"stopPropagation",n),s(E,"stopImmediatePropagation",r),d(E,c),M==="capture"){if(X===void 0)return;for(let N=$.length-1;N>=0&&!e.has(E);--N){const W=$[N],z=X.get(W);if(z!==void 0){a.set(E,W);for(const G of z){if(t.has(E))break;G(E)}}if(N===0&&!j&&F!==void 0){const G=F.get(W);if(G!==void 0)for(const V of G){if(t.has(E))break;V(E)}}}}else if(M==="bubble"){if(F===void 0)return;for(let N=0;N<$.length&&!e.has(E);++N){const W=$[N],z=F.get(W);if(z!==void 0){a.set(E,W);for(const G of z){if(t.has(E))break;G(E)}}}}o(E,"stopPropagation"),o(E,"stopImmediatePropagation"),d(E)};return k.displayName="evtdUnifiedHandler",k}function u(){const k=function(E){const{type:P,eventPhase:R}=E;if(R!==2)return;const j=f[P];j!==void 0&&j.forEach(q=>q(E))};return k.displayName="evtdUnifiedWindowEventHandler",k}const g=p(),m=u();function _(k,E){const P=h[k];return P[E]===void 0&&(P[E]=new Map,window.addEventListener(E,g,k==="capture")),P[E]}function y(k){return f[k]===void 0&&(f[k]=new Set,window.addEventListener(k,m)),f[k]}function b(k,E){let P=k.get(E);return P===void 0&&k.set(E,P=new Set),P}function S(k,E,P,R){const j=h[E][P];if(j!==void 0){const q=j.get(k);if(q!==void 0&&q.has(R))return!0}return!1}function C(k,E){const P=f[k];return!!(P!==void 0&&P.has(E))}function v(k,E,P,R){let j;if(typeof R=="object"&&R.once===!0?j=X=>{B(k,E,j,R),P(X)}:j=P,Ey(k,E,j,R))return;const M=R===!0||typeof R=="object"&&R.capture===!0?"capture":"bubble",A=_(M,k),$=b(A,E);if($.has(j)||$.add(j),E===window){const X=y(k);X.has(j)||X.add(j)}}function B(k,E,P,R){if($y(k,E,P,R))return;const q=R===!0||typeof R=="object"&&R.capture===!0,M=q?"capture":"bubble",A=_(M,k),$=b(A,E);if(E===window&&!S(E,q?"bubble":"capture",k,P)&&C(k,P)){const F=f[k];F.delete(P),F.size===0&&(window.removeEventListener(k,m),f[k]=void 0)}$.has(P)&&$.delete(P),$.size===0&&A.delete(E),A.size===0&&(window.removeEventListener(k,g,M==="capture"),h[M][k]=void 0)}return{on:v,off:B}}const{on:St,off:tt}=Ny(),Ii="@@mmoContext",Ry={mounted(e,{value:t}){e[Ii]={handler:void 0},typeof t=="function"&&(e[Ii].handler=t,St("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[Ii];typeof t=="function"?n.handler?n.handler!==t&&(tt("mousemoveoutside",e,n.handler),n.handler=t,St("mousemoveoutside",e,t)):(e[Ii].handler=t,St("mousemoveoutside",e,t)):n.handler&&(tt("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[Ii];t&&tt("mousemoveoutside",e,t),e[Ii].handler=void 0}},Vi="@@coContext",os={mounted(e,{value:t,modifiers:n}){e[Vi]={handler:void 0},typeof t=="function"&&(e[Vi].handler=t,St("clickoutside",e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){const r=e[Vi];typeof t=="function"?r.handler?r.handler!==t&&(tt("clickoutside",e,r.handler,{capture:n.capture}),r.handler=t,St("clickoutside",e,t,{capture:n.capture})):(e[Vi].handler=t,St("clickoutside",e,t,{capture:n.capture})):r.handler&&(tt("clickoutside",e,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:n}=e[Vi];n&&tt("clickoutside",e,n,{capture:t.capture}),e[Vi].handler=void 0}};function Py(e,t){console.error(`[vdirs/${e}]: ${t}`)}class Fy{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(t,n){const{elementZIndex:r}=this;if(n!==void 0){t.style.zIndex=`${n}`,r.delete(t);return}const{nextZIndex:s}=this;r.has(t)&&r.get(t)+1===this.nextZIndex||(t.style.zIndex=`${s}`,r.set(t,s),this.nextZIndex=s+1,this.squashState())}unregister(t,n){const{elementZIndex:r}=this;r.has(t)?r.delete(t):n===void 0&&Py("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:t}=this;t||(this.nextZIndex=2e3),this.nextZIndex-t>2500&&this.rearrange()}rearrange(){const t=Array.from(this.elementZIndex.entries());t.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,t.forEach(n=>{const r=n[0],s=this.nextZIndex++;`${s}`!==r.style.zIndex&&(r.style.zIndex=`${s}`)})}}const vo=new Fy,Oi="@@ziContext",Zc={mounted(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n;e[Oi]={enabled:!!s,initialized:!1},s&&(vo.ensureZIndex(e,r),e[Oi].initialized=!0)},updated(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n,o=e[Oi].enabled;s&&!o&&(vo.ensureZIndex(e,r),e[Oi].initialized=!0),e[Oi].enabled=!!s},unmounted(e,t){if(!e[Oi].initialized)return;const{value:n={}}=t,{zIndex:r}=n;vo.unregister(e,r)}};function My(e){const t=i.ref(!!e.value);if(t.value)return i.readonly(t);const n=i.watch(e,r=>{r&&(t.value=!0,n())});return i.readonly(t)}function Wt(e){const t=i.computed(e),n=i.ref(t.value);return i.watch(t,r=>{n.value=r}),typeof e=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){e.set(r)}}}const Ay=typeof window<"u";let zi,hr;(()=>{var e,t;zi=Ay?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,hr=!1,zi!==void 0?zi.then(()=>{hr=!0}):hr=!0})();function Iy(e){if(hr)return;let t=!1;i.onMounted(()=>{hr||zi==null||zi.then(()=>{t||e()})}),i.onBeforeUnmount(()=>{t=!0})}function ko(e,t){return i.watch(e,n=>{n!==void 0&&(t.value=n)}),i.computed(()=>e.value===void 0?t.value:e.value)}function as(){const e=i.ref(!1);return i.onMounted(()=>{e.value=!0}),i.readonly(e)}function Jc(e,t){return i.computed(()=>{for(const n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}const Vy=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function Oy(){return Vy}function xo(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function Co(e,t=!0,n=[]){return e.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)){Co(r,t,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Co(r.children,t,n)}else r.type!==i.Comment&&n.push(r)}}),n}function Qc(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);const s=Co(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}let An=null;function ed(){if(An===null&&(An=document.getElementById("v-binder-view-measurer"),An===null)){An=document.createElement("div"),An.id="v-binder-view-measurer";const{style:e}=An;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(An)}return An.getBoundingClientRect()}function zy(e,t){const n=ed();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function So(e){const t=e.getBoundingClientRect(),n=ed();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function Ly(e){return e.nodeType===9?null:e.parentNode}function td(e){if(e===null)return null;const t=Ly(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(n+s+r))return t}return td(t)}const nd=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;i.provide("VBinder",(t=i.getCurrentInstance())===null||t===void 0?void 0:t.proxy);const n=i.inject("VBinder",null),r=i.ref(null),s=y=>{r.value=y,n&&e.syncTargetWithParent&&n.setTargetRef(y)};let o=[];const a=()=>{let y=r.value;for(;y=td(y),y!==null;)o.push(y);for(const b of o)St("scroll",b,f,!0)},l=()=>{for(const y of o)tt("scroll",y,f,!0);o=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},h=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},f=()=>{Lc(p)},p=()=>{c.forEach(y=>y())},u=new Set,g=y=>{u.size===0&&St("resize",window,_),u.has(y)||u.add(y)},m=y=>{u.has(y)&&u.delete(y),u.size===0&&tt("resize",window,_)},_=()=>{u.forEach(y=>y())};return i.onBeforeUnmount(()=>{tt("resize",window,_),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:g,removeResizeListener:m}},render(){return xo("binder",this.$slots)}}),id=i.defineComponent({name:"Target",setup(){const{setTargetRef:e,syncTarget:t}=i.inject("VBinder");return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){const{syncTarget:e,setTargetDirective:t}=this;return e?i.withDirectives(Qc("follower",this.$slots),[[t]]):Qc("follower",this.$slots)}}),Dy="@css-render/vue3-ssr";function Hy(e,t){return`<style cssr-id="${e}">
103
+ `}},Xr=Gn.Multiply,um=[1,0,0,0,1,0,0,0,1],An=new Qt(9),fm=pt.Utils,Wl=new J,qs=new Qt([0,0,1,0,0,1,0,1,1,0,1,1]),_e={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:De.document?De.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Gn,group:{removeChild:function(e,t){if(e.children)for(let n=0;n<e.children.length;n++)_e.group.removeChild(e.children[n],t);e._renderer.texture&&(t.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(t.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer)},render:function(e,t){if(!this._visible)return;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 Qt(9)),this._matrix.toTransformArray(!0,An),Xr(An,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof J||(this._renderer.scale=new J),this._scale instanceof J?(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){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const a=pt.Utils.getRendererType(this._mask._renderer.type);_e[a].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}this._flagOpacity=n._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);let o;if(this._flagSubtractions)for(o=0;o<this.subtractions.length;o++)_e.group.removeChild(this.subtractions[o],e);for(o=0;o<this.children.length;o++){const a=this.children[o],l=pt.Utils.getRendererType(a._renderer.type);_e[l].render.call(a,e,t)}return this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},path:{updateCanvas:function(e,t){let n,r,s,o,a,l,c,d,h,f,p,u,g,m;const y=t._renderer.vertices,_=this.canvas,b=this.ctx,S=e.renderer.ratio,x=Wl.copy(t._renderer.scale).multiply(S),v=t._stroke,B=t._linewidth,k=t._fill,N=t._renderer.opacity||t._opacity,P=t._cap,R=t._join,W=t._miter,q=t._closed,F=t.dashes,M=y.length,V=M-1;_.width=Math.max(Math.ceil(t._renderer.rect.width*x.x),1),_.height=Math.max(Math.ceil(t._renderer.rect.height*x.y),1);const K=t._renderer.rect.centroid,T=K.x,$=K.y;if(b.clearRect(0,0,_.width,_.height),k)if(typeof k=="string")b.fillStyle=k;else{const he=pt.Utils.getRendererType(k._renderer.type);_e[he].render.call(k,b,t),b.fillStyle=k._renderer.effect}if(v){if(typeof v=="string")b.strokeStyle=v;else{const he=pt.Utils.getRendererType(v._renderer.type);_e[he].render.call(v,b,t),b.strokeStyle=v._renderer.effect}B&&(b.lineWidth=B),W&&(b.miterLimit=W),R&&(b.lineJoin=R),!q&&P&&(b.lineCap=P)}typeof N=="number"&&(b.globalAlpha=N),F&&F.length>0&&(b.lineDashOffset=F.offset||0,b.setLineDash(F));let j,z,U,I,O,Z,ge,ie;b.save(),b.scale(x.x,x.y),b.translate(T,$),b.beginPath();for(let he=0;he<y.length;he++){const re=y[he];switch(u=re.x,g=re.y,re.command){case ee.close:b.closePath();break;case ee.arc:z=re.rx,U=re.ry,I=re.xAxisRotation,O=re.largeArcFlag,Z=re.sweepFlag,n=q?At(he-1,M):Math.max(he-1,0),r=y[n],ge=r.x,ie=r.y,fm.renderSvgArcCommand(b,ge,ie,z,U,O,Z,I,u,g);break;case ee.curve:n=q?At(he-1,M):Math.max(he-1,0),r=y[n],d=r.controls&&r.controls.right||J.zero,h=re.controls&&re.controls.left||J.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),b.bezierCurveTo(l,c,o,a,u,g),he>=V&&q&&(s=j,f=re.controls&&re.controls.right||J.zero,p=s.controls&&s.controls.left||J.zero,re._relative?(l=f.x+re.x,c=f.y+re.y):(l=f.x,c=f.y),s._relative?(o=p.x+s.x,a=p.y+s.y):(o=p.x,a=p.y),u=s.x,g=s.y,b.bezierCurveTo(l,c,o,a,u,g));break;case ee.line:b.lineTo(u,g);break;case ee.move:j=re,b.moveTo(u,g);break}}q&&b.closePath(),_e.isHidden.test(k)||(m=k._renderer&&k._renderer.offset,m&&(b.save(),b.translate(-k._renderer.offset.x,-k._renderer.offset.y),b.scale(k._renderer.scale.x,k._renderer.scale.y)),b.fill(),m&&b.restore()),_e.isHidden.test(v)||(m=v._renderer&&v._renderer.offset,m&&(b.save(),b.translate(-v._renderer.offset.x,-v._renderer.offset.y),b.scale(v._renderer.scale.x,v._renderer.scale.y),b.lineWidth=B/v._renderer.scale.x),b.stroke(),m&&b.restore()),b.restore()},getBoundingClientRect:function(e,t,n){let r=1/0,s=-1/0,o=1/0,a=-1/0,l,c;e.forEach(function(d){const h=d.x,f=d.y,p=d.controls;let u,g,m,y,_,b;o=Math.min(f,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(f,a),d.controls&&(_=p.left,b=p.right,!(!_||!b)&&(u=d._relative?_.x+h:_.x,g=d._relative?_.y+f:_.y,m=d._relative?b.x+h:b.x,y=d._relative?b.y+f:b.y,!(!u||!g||!m||!y)&&(o=Math.min(g,y,o),r=Math.min(u,m,r),s=Math.max(u,m,s),a=Math.max(g,y,a))))}),typeof t=="number"&&(o-=t,r-=t,s+=t,a+=t),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(e,t,n){if(!this._visible||!this._opacity)return this;this._update();const r=n||this.parent,s=pt.Utils.getRendererType(this._renderer.type),o=t[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 Ae&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ie&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Te&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ae&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ie&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Te&&(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 Qt(9)),this._matrix.toTransformArray(!0,An),Xr(An,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof J||(this._renderer.scale=new J);let f,p;this._scale instanceof J?(f=this._scale.x*r._renderer.scale.x,p=this._scale.y*r._renderer.scale.y):(f=this._scale*r._renderer.scale.x,p=this._scale*r._renderer.scale.y),this._renderer.scale.x=f<0?-f:f,this._renderer.scale.y=p<0?-p:p,c&&(this._renderer.parent=r)}if(this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const f=pt.Utils.getRendererType(this._mask._renderer.type);_e[f].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,_e.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),_e.updateTexture.call(_e,e,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;t.current!==o&&(e.useProgram(o),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position),e.bufferData(e.ARRAY_BUFFER,qs,e.STATIC_DRAW),t.resolution.flagged||e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),t.current=o),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture);const h=this._renderer.rect;return e.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),e.uniform4f(o.rect,h.left,h.top,h.right,h.bottom),e.drawArrays(e.TRIANGLES,0,6),this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},points:{updateCanvas:function(e,t){let n;const r=this.canvas,s=this.ctx,o=e.renderer.ratio,a=t._stroke,l=t._linewidth,c=t._fill,d=t._renderer.opacity||t._opacity,h=t.dashes,f=t._size*o;let p=f;_e.isHidden.test(a)||(p+=l),r.width=Xa(p),r.height=r.width;const u=p/r.width,g=r.width/2,m=r.height/2;if(s.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")s.fillStyle=c;else{const y=pt.Utils.getRendererType(c._renderer.type);_e[y].render.call(c,s,t),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const y=pt.Utils.getRendererType(a._renderer.type);_e[y].render.call(a,s,t),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=l/u)}typeof d=="number"&&(s.globalAlpha=d),h&&h.length>0&&(s.lineDashOffset=h.offset||0,s.setLineDash(h)),s.save(),s.translate(g,m),s.scale(_e.precision,_e.precision),s.beginPath(),s.arc(0,0,f/u*.5,0,ut),s.restore(),closed&&s.closePath(),_e.isHidden.test(c)||(n=c._renderer&&c._renderer.offset,n&&(s.save(),s.translate(-c._renderer.offset.x,-c._renderer.offset.y),s.scale(c._renderer.scale.x,c._renderer.scale.y)),s.fill(),n&&s.restore()),_e.isHidden.test(a)||(n=a._renderer&&a._renderer.offset,n&&(s.save(),s.translate(-a._renderer.offset.x,-a._renderer.offset.y),s.scale(a._renderer.scale.x,a._renderer.scale.y),s.lineWidth=l/a._renderer.scale.x),s.stroke(),n&&s.restore())},render:function(e,t,n){if(!this._visible||!this._opacity)return this;this._update();let r=this._size;const s=n||this.parent,o=t[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=s._matrix.manual||s._flagMatrix,h=this._matrix.manual||this._flagMatrix,f=this._renderer.parent!==s,p=this._renderer.vertices,u=this._renderer.collection.length,g=this._flagVertices,m=this._flagFill||this._fill instanceof Ae&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ie&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Te&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ae&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ie&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Te&&(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||f){this._renderer.matrix||(this._renderer.matrix=new Qt(9)),this._matrix.toTransformArray(!0,An),Xr(An,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof J||(this._renderer.scale=new J);let y,_;this._scale instanceof J?(y=this._scale.x*s._renderer.scale.x,_=this._scale.y*s._renderer.scale.y):(y=this._scale*s._renderer.scale.x,_=this._scale*s._renderer.scale.y),this._renderer.scale.x=y<0?-y:y,this._renderer.scale.y=_<0?-_:_,f&&(this._renderer.parent=s)}if(g){const y=this._renderer.positionBuffer;y&&e.deleteBuffer(y),this._renderer.positionBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this._renderer.positionBuffer),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position),e.bufferData(e.ARRAY_BUFFER,p,e.STATIC_DRAW)}return m?(this._renderer.opacity=this._opacity*s._renderer.opacity,_e.updateTexture.call(_e,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(_e.isHidden.test(l)||(r+=c),r/=_e.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),t.current!==o&&(e.useProgram(o),t.resolution.flagged||e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),t.current=o),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture),e.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),e.uniform1f(o.size,r*t.resolution.ratio),e.drawArrays(e.POINTS,0,u),this.flagReset())}},text:{updateCanvas:function(e,t){const n=this.canvas,r=this.ctx,s=e.renderer.ratio,o=Wl.copy(t._renderer.scale).multiply(s),a=t._stroke,l=t._linewidth,c=t._fill,d=t._renderer.opacity||t._opacity,h=t.dashes,f=t._decoration,p=t._direction;n.width=Math.max(Math.ceil(t._renderer.rect.width*o.x),1),n.height=Math.max(Math.ceil(t._renderer.rect.height*o.y),1);const u=t._renderer.rect.centroid,g=u.x,m=u.y;let y,_,b,S,x,v,B,k,N,P,R;const W=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),W||(r.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=p,c)if(typeof c=="string")r.fillStyle=c;else{const q=pt.Utils.getRendererType(c._renderer.type);_e[q].render.call(c,r,t),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const q=pt.Utils.getRendererType(a._renderer.type);_e[q].render.call(a,r,t),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=l)}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,m),_e.isHidden.test(c)||(c._renderer&&c._renderer.offset?(v=c._renderer.scale.x,B=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(v,B),y=t._size/c._renderer.scale.y,_=t._leading/c._renderer.scale.y,r.font=[t._style,t._weight,y+"px/",_+"px",t._family].join(" "),b=c._renderer.offset.x/c._renderer.scale.x,S=c._renderer.offset.y/c._renderer.scale.y,r.fillText(t.value,b,S),r.restore()):r.fillText(t.value,0,0)),_e.isHidden.test(a)||(a._renderer&&a._renderer.offset?(v=a._renderer.scale.x,B=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(v,B),y=t._size/a._renderer.scale.y,_=t._leading/a._renderer.scale.y,r.font=[t._style,t._weight,y+"px/",_+"px",t._family].join(" "),b=a._renderer.offset.x/a._renderer.scale.x,S=a._renderer.offset.y/a._renderer.scale.y,x=l/a._renderer.scale.x,r.lineWidth=x,r.strokeText(t.value,b,S),r.restore()):r.strokeText(t.value,0,0)),/(underline|strikethrough)/i.test(f)){const q=r.measureText(t.value);switch(f){case"underline":N=q.actualBoundingBoxDescent,R=q.actualBoundingBoxDescent;break;case"strikethrough":N=0,R=0;break}k=-q.width/2,P=q.width/2,r.lineWidth=Math.max(Math.floor(t._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(k,N),r.lineTo(P,R),r.stroke()}r.restore()},getBoundingClientRect:function(e,t){const n=_e.ctx;n.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" "),n.textAlign="center",n.textBaseline=pt.Utils.baselines[e._baseline]||e._baseline;const r=n.measureText(e._value);let s=r.width,o=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!_e.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(_e.alignments[e._alignment]||e._alignment){case _e.alignments.left:e.direction==="ltr"?(t.left=0,t.right=s):(t.left=-s,t.right=0);break;case _e.alignments.right:e.direction==="ltr"?(t.left=-s,t.right=0):(t.left=0,t.right=s);break;default:t.left=-a,t.right=a}switch(e._baseline){case"bottom":t.top=-o,t.bottom=0;break;case"top":t.top=0,t.bottom=o;break;case"baseline":t.top=-l*1.5,t.bottom=l*.5;break;default:t.top=-l,t.bottom=l}t.width=s,t.height=o,t.centroid||(t.centroid={}),t.centroid.x=a,t.centroid.y=l},render:function(e,t,n){if(!this._visible||!this._opacity)return this;this._update();const r=n||this.parent,s=t[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 Ae&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ie&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Te&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ae&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ie&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Te&&(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 Qt(9)),this._matrix.toTransformArray(!0,An),Xr(An,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof J||(this._renderer.scale=new J);let h,f;this._scale instanceof J?(h=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=f<0?-f:f,l&&(this._renderer.parent=r)}if(this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const h=pt.Utils.getRendererType(this._mask._renderer.type);_e[h].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,_e.text.getBoundingClientRect(this,this._renderer.rect),_e.updateTexture.call(_e,e,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;t.current!==s&&(e.useProgram(s),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(s.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(s.position),e.bufferData(e.ARRAY_BUFFER,qs,e.STATIC_DRAW),t.resolution.flagged||e.uniform2f(e.getUniformLocation(s,"u_resolution"),t.resolution.width,t.resolution.height),t.current=s),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(s,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return e.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),e.uniform4f(s.rect,d.left,d.top,d.right,d.bottom),e.drawArrays(e.TRIANGLES,0,6),this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},"linear-gradient":{render:function(e,t){if(!(!e.canvas.getContext("2d")||!t)){if(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=t.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=e.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 this.flagReset()}}},"radial-gradient":{render:function(e,t){if(!(!e.canvas.getContext("2d")||!t)){if(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=t.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=e.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 this.flagReset()}}},texture:{render:function(e,t){if(!e.canvas.getContext("2d"))return;this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=e.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof J||(this._renderer.offset=new J),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 J?(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 J||(this._renderer.scale=new J);let r,s;this._scale instanceof J?(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 this.flagReset()}},updateTexture:function(e,t){const n=pt.Utils.getRendererType(t._renderer.type);if(this[n].updateCanvas.call(_e,e,t),this.canvas.width<=0||this.canvas.height<=0){t._renderer.texture&&e.deleteTexture(t._renderer.texture),delete t._renderer.texture;return}t._renderer.texture||(t._renderer.texture=e.createTexture()),e.bindTexture(e.TEXTURE_2D,t._renderer.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.canvas),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)},program:{create:function(e,t){let n,r,s;if(n=e.createProgram(),ae.each(t,function(o){e.attachShader(n,o)}),e.linkProgram(n),r=e.getProgramParameter(n,e.LINK_STATUS),!r)throw s=e.getProgramInfoLog(n),e.deleteProgram(n),new Nt("unable to link program: "+s);return n}},extensions:{init:function(e){const t={},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];t[s]=_e.extensions.get(e,s)}return t},get:function(e,t){return e.getExtension(t)||e.getExtension(`MOZ_${t}`)||e.getExtension(`WEBKIT_${t}`)}},TextureRegistry:new $r};_e.ctx=_e.canvas.getContext("2d");var jl=class extends X{constructor(e){super();let t,n,r,s;if(this.domElement=e.domElement||document.createElement("canvas"),typeof e.offscreenElement<"u"&&(_e.canvas=e.offscreenElement,_e.ctx=_e.canvas.getContext("2d")),this.scene=new Ke,this.scene.parent=this,this._renderer={type:"renderer",matrix:new Qt(um),scale:1,opacity:1},this._flagMatrix=!0,e=ae.defaults(e||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=e.overdraw,t=this.ctx=this.domElement.getContext("webgl",e)||this.domElement.getContext("experimental-webgl",e),!this.ctx)throw new Nt("unable to create a webgl context. Try using another renderer.");r=Wt.create(t,Wt.path.vertex,Wt.types.vertex),s=Wt.create(t,Wt.path.fragment,Wt.types.fragment),this.programs={current:null,buffers:{position:t.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=_e.program.create(t,[r,s]),this.programs.text=this.programs.path,t.extensions=_e.extensions.init(t),t.renderer=this,n.position=t.getAttribLocation(n,"a_position"),n.matrix=t.getUniformLocation(n,"u_matrix"),n.rect=t.getUniformLocation(n,"u_rect");const o=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,o),t.vertexAttribPointer(n.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(n.position),t.bufferData(t.ARRAY_BUFFER,qs,t.STATIC_DRAW),r=Wt.create(t,Wt.points.vertex,Wt.types.vertex),s=Wt.create(t,Wt.points.fragment,Wt.types.fragment),n=this.programs.points=_e.program.create(t,[r,s]),n.position=t.getAttribLocation(n,"a_position"),n.matrix=t.getUniformLocation(n,"u_matrix"),n.size=t.getUniformLocation(n,"u_size"),t.enable(t.BLEND),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA)}setSize(e,t,n){let r,s;const o=this.ctx;return this.width=e,this.height=t,this.ratio=typeof n>"u"?Ms(o):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,ae.isObject(this.domElement.style)&&ae.extend(this.domElement.style,{width:e+"px",height:t+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=e*this.ratio,s=t*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,e,t,n)}render(){const e=this.ctx;return this.overdraw||e.clear(e.COLOR_BUFFER_BIT),_e.group.render.call(this.scene,e,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};w(jl,"Utils",_e);var pm=ae.extend({Error:Nt,getRatio:Ms,read:ze,xhr:Vl},ae,kt,La,Da),ir=class{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 t=ae.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:ir.Types.svg,autostart:!1});if(ae.each(t,function(n,r){/fullscreen/i.test(r)||/autostart/i.test(r)||(this[r]=n)},this),ae.isElement(t.domElement)){const n=t.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+n)||(this.type=ir.Types[n])}this.renderer=new ir[this.type](this),this.setPlaying(t.autostart),this.frameCount=0,t.fullscreen?(this.fit=gm.bind(this),this.fit.domElement=window,this.fit.attached=!0,ae.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),ae.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),It.bind(this.fit.domElement,"resize",this.fit),this.fit()):t.fitted?(this.fit=mm.bind(this),ae.extend(this.renderer.domElement.style,{display:"block"})):typeof t.width=="number"&&typeof t.height=="number"&&(this.renderer.setSize(t.width,t.height,this.ratio),this.width=t.width,this.height=t.height),this.renderer.bind(X.Types.resize,ym.bind(this)),this.scene=this.renderer.scene,ir.Instances.push(this),t.autostart&&rr.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,rr.init(),this.trigger(X.Types.play)}pause(){return this.playing=!1,this.trigger(X.Types.pause)}setPlaying(e){this.playing=e}release(e){let t,n,r;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)for(typeof e.vertices.unbind=="function"&&e.vertices.unbind(),t=0;t<e.vertices.length;t++)n=e.vertices[t],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());if(e.children){for(t=0;t<e.children.length;t++)r=e.children[t],this.release(r);typeof e.children.unbind=="function"&&e.children.unbind()}return e}update(){const e=!!this._lastFrame,t=ae.performance.now();e&&(this.timeDelta=parseFloat((t-this._lastFrame).toFixed(3))),this._lastFrame=t,this.fit&&this.fit.domElement&&!this.fit.attached&&(It.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const n=this.width,r=this.height,s=this.renderer;return(n!==s.width||r!==s.height)&&s.setSize(n,r,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,t,n,r){const s=new Ws(e,t,n,r);return this.scene.add(s),s}makeArrow(e,t,n,r,s){const o=typeof s=="number"?s:10,a=Math.atan2(r-t,n-e),l=[new ve(e,t,void 0,void 0,void 0,void 0,ee.move),new ve(n,r,void 0,void 0,void 0,void 0,ee.line),new ve(n-o*Math.cos(a-Math.PI/4),r-o*Math.sin(a-Math.PI/4),void 0,void 0,void 0,void 0,ee.line),new ve(n,r,void 0,void 0,void 0,void 0,ee.move),new ve(n-o*Math.cos(a+Math.PI/4),r-o*Math.sin(a+Math.PI/4),void 0,void 0,void 0,void 0,ee.line)],c=new xe(l,!1,!1,!0);return c.noFill(),c.cap="round",c.join="round",this.scene.add(c),c}makeRectangle(e,t,n,r){const s=new Fn(e,t,n,r);return this.scene.add(s),s}makeRoundedRectangle(e,t,n,r,s){const o=new tr(e,t,n,r,s);return this.scene.add(o),o}makeCircle(e,t,n,r){const s=new Qi(e,t,n,r);return this.scene.add(s),s}makeEllipse(e,t,n,r,s){const o=new er(e,t,n,r,s);return this.scene.add(o),o}makeStar(e,t,n,r,s){const o=new Vr(e,t,n,r,s);return this.scene.add(o),o}makeCurve(e){const t=arguments.length;if(!Array.isArray(e)){e=[];for(let o=0;o<t;o+=2){const a=arguments[o];if(typeof a!="number")break;const l=arguments[o+1];e.push(new ve(a,l))}}const n=arguments[t-1],r=new xe(e,!(typeof n=="boolean"&&n),!0),s=r.getBoundingClientRect();return r.center().translation.set(s.left+s.width/2,s.top+s.height/2),this.scene.add(r),r}makePolygon(e,t,n,r){const s=new Ir(e,t,n,r);return this.scene.add(s),s}makeArcSegment(e,t,n,r,s,o,a){const l=new Mr(e,t,n,r,s,o,a);return this.scene.add(l),l}makePoints(e){const t=arguments.length;let n=e;if(!Array.isArray(e)){n=[];for(let s=0;s<t;s+=2){const o=arguments[s];if(typeof o!="number")break;const a=arguments[s+1];n.push(new J(o,a))}}const r=new Ar(n);return this.scene.add(r),r}makePath(e){const t=arguments.length;let n=e;if(!Array.isArray(e)){n=[];for(let a=0;a<t;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];n.push(new ve(l,c))}}const r=arguments[t-1],s=new xe(n,!(typeof r=="boolean"&&r)),o=s.getBoundingClientRect();return typeof o.top=="number"&&typeof o.left=="number"&&typeof o.right=="number"&&typeof o.bottom=="number"&&s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makeText(e,t,n,r){const s=new Dt(e,t,n,r);return this.add(s),s}makeLinearGradient(e,t,n,r){const s=Array.prototype.slice.call(arguments,4),o=new Ae(e,t,n,r,s);return this.add(o),o}makeRadialGradient(e,t,n){const r=Array.prototype.slice.call(arguments,3),s=new Ie(e,t,n,r);return this.add(s),s}makeSprite(e,t,n,r,s,o,a){const l=new Fr(e,t,n,r,s,o);return a&&l.play(),this.add(l),l}makeImageSequence(e,t,n,r,s){const o=new Lr(e,t,n,r);return s&&o.play(),this.add(o),o}makeTexture(e,t){return new Te(e,t)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const t=new Ke;return this.scene.add(t),t.add(e),t}interpret(e,t,n){const r=e.tagName.toLowerCase();if(n=typeof n<"u"?n:!0,!(r in ze))return null;const s=ze[r].call(this,e);return n?this.add(t&&s instanceof Ke?s.children:s):s.parent&&s.remove(),s}load(e,t){const n=new Ke;let r,s,o;const a=(function(l){for(It.temp.innerHTML=l,s=0;s<It.temp.children.length;s++)r=It.temp.children[s],o=this.interpret(r,!1,!1),o!==null&&n.add(o);if(typeof t=="function"){const c=It.temp.children.length<=1?It.temp.children[0]:It.temp.children;t(n,c)}}).bind(this);return/\.svg$/i.test(e)?(Vl(e,a),n):(a(e),n)}},ue=ir;w(ue,"NextFrameId",xt.NextFrameId),w(ue,"Types",xt.Types),w(ue,"Version",xt.Version),w(ue,"PublishDate",xt.PublishDate),w(ue,"Identifier",xt.Identifier),w(ue,"Resolution",xt.Resolution),w(ue,"AutoCalculateImportedMatrices",xt.AutoCalculateImportedMatrices),w(ue,"Instances",xt.Instances),w(ue,"uniqueId",xt.uniqueId),w(ue,"Anchor",ve),w(ue,"Collection",Rn),w(ue,"Events",X),w(ue,"Group",Ke),w(ue,"Matrix",Gn),w(ue,"Path",xe),w(ue,"Registry",$r),w(ue,"Element",Xn),w(ue,"Shape",mn),w(ue,"Text",Dt),w(ue,"Vector",J),w(ue,"Gradient",Ye),w(ue,"ImageSequence",Lr),w(ue,"LinearGradient",Ae),w(ue,"RadialGradient",Ie),w(ue,"Sprite",Fr),w(ue,"Stop",en),w(ue,"Texture",Te),w(ue,"ArcSegment",Mr),w(ue,"Circle",Qi),w(ue,"Ellipse",er),w(ue,"Line",Ws),w(ue,"Points",Ar),w(ue,"Polygon",Ir),w(ue,"Rectangle",Fn),w(ue,"RoundedRectangle",tr),w(ue,"Star",Vr),w(ue,"CanvasRenderer",pt),w(ue,"SVGRenderer",Hl),w(ue,"WebGLRenderer",jl),w(ue,"Commands",ee),w(ue,"Utils",pm);function gm(){const e=document.body.getBoundingClientRect(),t=this.width=e.width,n=this.height=e.height;this.renderer.setSize(t,n,this.ratio)}function mm(){const e=this.renderer.domElement.parentElement;if(!e){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const t=e.getBoundingClientRect(),n=this.width=t.width,r=this.height=t.height;this.renderer.setSize(n,r,this.ratio)}function ym(e,t){this.width=e,this.height=t,this.trigger(X.Types.resize,e,t)}var rr=It.getRequestAnimationFrame();function Xl(){for(let e=0;e<ue.Instances.length;e++){const t=ue.Instances[e];t.playing&&t.update()}ue.NextFrameId=rr(Xl)}rr.init=function(){Xl(),rr.init=function(){}};let nn;typeof window<"u"?nn=window:typeof global<"u"?nn=global:typeof self<"u"&&(nn=self);let ql;const ni=Math.PI*2,st=Math.PI*.5;function _m(e,t,n,r,s,o){let a;return arguments.length<=1?(a=e.a,t=e.b,n=e.c,r=e.d,s=e.e,o=e.f):a=e,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,a)/Math.PI}}function bm(e){ql=e}function wm(e,t){t=t&&t.identity()||new ql;let n=e;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;t.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9])}return t}function rn(e,t,n){return n*(t-e)+e}function $i(e,t){for(;e<0;)e+=t;return e%t}const Yl=nn.Float32Array||Array,vm=Math.floor;function sn(e){return vm(e*1e6)/1e6}const pe={move:"M",line:"L",curve:"C",close:"Z"};class G{constructor(){C(this,"_events",{});C(this,"_bound",!1)}addEventListener(t,n){return(this._events[t]||(this._events[t]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(t,n){if(!this._events)return this;if(!t&&!n)return this._events={},this._bound=!1,this;const r=t?[t]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){t=r[s];let a=this._events[t];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[t]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(t){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[t];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(t,n,r){const s=this;t&&(o.obj=t,o.name=n,o.handler=r,t.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(t,n,r){return t.off(n,r),this}}C(G,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),C(G,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Ul={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(G.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(G.Types.change))}}},lt=class lt extends G{constructor(n=0,r=0){super();C(this,"_x",0);C(this,"_y",0);for(let s in Ul)Object.defineProperty(this,s,Ul[s]);this.x=n,this.y=r}static add(n,r){return new lt(n.x+r.x,n.y+r.y)}static sub(n,r){return new lt(n.x-r.x,n.y-r.y)}static subtract(n,r){return lt.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(lt.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 lt(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:sn(this.x),y:sn(this.y)}}rotate(n){const r=this.x,s=this.y,o=Math.cos(n),a=Math.sin(n);return this.x=r*o-s*a,this.y=r*a+s*o,this}};C(lt,"zero",new lt),C(lt,"left",new lt(-1,0)),C(lt,"right",new lt(1,0)),C(lt,"up",new lt(0,-1)),C(lt,"down",new lt(0,1));let we=lt;class Ee extends we{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=pe.move){super(n,r);C(this,"controls",{left:new we,right:new we});C(this,"_command",pe.move);C(this,"_relative",!0);C(this,"_rx",0);C(this,"_ry",0);C(this,"_xAxisRotation",0);C(this,"_largeArcFlag",0);C(this,"_sweepFlag",1);for(let h in Gl)Object.defineProperty(this,h,Gl[h]);this.command=c,this.relative=!0;const d=Ee.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 Ee().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 Ee().copy(this)}toObject(){return{x:sn(this.x),y:sn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:sn(this.rx),ry:sn(this.ry),xAxisRotation:sn(this.xAxisRotation),largeArcFlag:sn(this.largeArcFlag),sweepFlag:sn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Gl={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(G.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(G.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(G.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(G.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(G.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(G.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(G.Types.change))}}};let km=0;const Ys={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return km++}},qr={RecursionLimit:16,abscissas:[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],weights:[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]]};function Yr(e,t,n,r,s){const o=1-e;return o*o*o*t+3*o*o*e*n+3*o*e*e*r+e*e*e*s}function Kl(e,t,n,r,s,o,a,l,c){c=c||qr.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new Ee(a,l)];const h=[];for(let f=0;f<d;f++){const p=f/d,u=Yr(p,e,n,s,a),g=Yr(p,t,r,o,l);h.push(new Ee(u,g))}return h}function xm(e,t,n,r,s,o,a,l,c){if(e===n&&t===r&&s===a&&o===l){const y=a-e,_=l-t;return Math.sqrt(y*y+_*_)}const d=9*(n-s)+3*(a-e),h=6*(e+s)-12*n,f=3*(n-e),p=9*(r-o)+3*(l-t),u=6*(t+o)-12*r,g=3*(r-t);function m(y){const _=(d*y+h)*y+f,b=(p*y+u)*y+g;return Math.sqrt(_*_+b*b)}return Sm(m,0,1,c||qr.RecursionLimit)}function Cm(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,f,p,u,g,m,y,_;for(let v=0;v<2;++v){if(v==0?(f=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,p=3*n-3*e):(f=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,p=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(f)<1e-12)continue;u=-p/f,0<u&&u<1&&c.push(u);continue}y=f*f-4*p*h,_=Math.sqrt(y),!(y<0)&&(g=(-f+_)/(2*h),0<g&&g<1&&c.push(g),m=(-f-_)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,x;for(;b--;)u=c[b],x=1-u,d[0][b]=x*x*x*e+3*x*x*u*n+3*x*u*u*s+u*u*u*a,d[1][b]=x*x*x*t+3*x*x*u*r+3*x*u*u*o+u*u*u*l;return d[0][S]=e,d[1][S]=t,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function Sm(e,t,n,r){let s=qr.abscissas[r-2],o=qr.weights[r-2],a=.5*(n-t),l=a+t,c=0,d=r+1>>1,h=r&1?o[c++]*e(l):0;for(;c<d;){const f=a*s[c];h+=o[c++]*(e(l+f)+e(l-f))}return a*h}function Bm(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?$i(s-1,n):Math.max(s-1,0),l=t?$i(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];Tm(c,d,h),d.command=s===0?pe.move:pe.curve}}function Tm(e,t,n){const r=we.angleBetween(e,t),s=we.angleBetween(n,t);let o=we.distanceBetween(e,t),a=we.distanceBetween(n,t),l=(r+s)/2;return o<1e-4||a<1e-4?(typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(o*=.33,a*=.33,s<r?l+=st:l-=st,t.controls.left.x=Math.cos(l)*o,t.controls.left.y=Math.sin(l)*o,l-=Math.PI,t.controls.right.x=Math.cos(l)*a,t.controls.right.y=Math.sin(l)*a,typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}let sr=(_i=class extends G{constructor(){super();C(this,"_flagId",!1);C(this,"_flagClassName",!1);C(this,"_renderer",{});C(this,"_id",Ys.Identifier+Ys.uniqueId());C(this,"_className","");C(this,"classList",[]);for(let n in Zl)Object.defineProperty(this,n,Zl[n])}static fromObject(n){const r=new _i().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return this.renderer.type=n.renderer.type,this.className=n.className,this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}},C(_i,"Properties",["renderer","id","className"]),_i);const Zl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(e){const t=this._id;e!==this._id&&(this._id=e,this._flagId=!0,this.parent&&(delete this.parent.children.ids[t],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(e){this._className!==e&&(this._flagClassName=!0,this.classList=e.split(/\s+?/),this._className=e)}}};class Ur extends Error{constructor(n){super();C(this,"name","Two.js");C(this,"message");this.message=n}}class Em{constructor(){C(this,"map",{})}add(t,n){return this.map[t]=n,this}remove(t){return delete this.map[t],this}get(t){return this.map[t]}contains(t){return t in this.map}}let Gr;const Jl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};nn.document&&(Gr=document.createElement("a"));const He=class He extends sr{constructor(n,r){super();C(this,"_flagSrc",!1);C(this,"_flagImage",!1);C(this,"_flagVideo",!1);C(this,"_flagLoaded",!1);C(this,"_flagRepeat",!1);C(this,"_flagOffset",!1);C(this,"_flagScale",!1);C(this,"_src","");C(this,"_image",null);C(this,"_loaded",!1);C(this,"_repeat","no-repeat");C(this,"_scale",1);C(this,"_offset",null);for(let s in Ql)Object.defineProperty(this,s,Ql[s]);if(this._renderer.type="texture",this._renderer.flagOffset=$m.bind(this),this._renderer.flagScale=Nm.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new we,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 He().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return Gr?(Gr.href=n,Gr.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=He.getAbsoluteURL(n);if(He.ImageRegistry.contains(r))return He.ImageRegistry.get(r);let s;return nn.document?Jl.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=He.getTag(s);n._flagImage&&(/canvas/i.test(o)?He.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,He.Register[o](n,r))),n._flagSrc&&(s||(s=He.getImage(n.src),n.image=s),o=He.getTag(s),He.Register[o](n,r))}clone(){const n=new He(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 we?n.offset:new we().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof we?n.scale:new we().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,He.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("elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};C(He,"Properties",["src","loaded","repeat","scale","offset","image"]),C(He,"RegularExpressions",Jl),C(He,"ImageRegistry",new Em),C(He,"Register",{canvas:function(n,r){n._src="#"+n.id,He.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 Ur("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=He.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),He.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 Ur("unable to load "+n.src)};n._src=He.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),He.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 ot=He;const Ql={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){const t=ot.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}ot.ImageRegistry.contains(n)?this._image=ot.ImageRegistry.get(e.src):this._image=e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(G.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(G.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof we&&this._scale.unbind(G.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof we&&this._scale.bind(G.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function $m(){this._flagOffset=!0}function Nm(){this._flagScale=!0}class Ni extends Array{constructor(){super();pa(this,ct,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 Et(this,ct)}set _events(n){Hh(this,ct,n)}get _bound(){return Et(this,ct)._bound}set _bound(n){Et(this,ct)._bound=n}addEventListener(){return Et(this,ct).addEventListener.apply(this,arguments)}on(){return Et(this,ct).on.apply(this,arguments)}bind(){return Et(this,ct).bind.apply(this,arguments)}removeEventListener(){return Et(this,ct).removeEventListener.apply(this,arguments)}off(){return Et(this,ct).off.apply(this,arguments)}unbind(){return Et(this,ct).unbind.apply(this,arguments)}dispatchEvent(){return Et(this,ct).dispatchEvent.apply(this,arguments)}trigger(){return Et(this,ct).trigger.apply(this,arguments)}listen(){return Et(this,ct).listen.apply(this,arguments)}ignore(){return Et(this,ct).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}}ct=new WeakMap;const ec=Array.prototype.slice;function Rm(e){if(e==null)return!1;const t=e.length;return typeof t=="number"&&t>=0&&t<4294967296}const Me={isNaN:function(e){return typeof e=="number"&&e!==+e},isElement:function(e){return!!(e&&e.nodeType===1)},isObject:function(e){const t=typeof e;return t==="function"||t==="object"&&!!e},extend:function(e){const t=ec.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]=r[s]}return e},defaults:function(e){const t=ec.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]===void 0&&(e[s]=r[s])}return e},each:function(e,t,n){const r=n||this,s=!Rm(e)&&Object.keys(e),o=(s||e).length;for(let a=0;a<o;a++){const l=s?s[a]:a;t.call(r,e[l],l,e)}return e},performance:nn.performance&&nn.performance.now?nn.performance:Date},Pt=class Pt extends sr{constructor(n,r,s){super();C(this,"_flagOffset",!0);C(this,"_flagOpacity",!0);C(this,"_flagColor",!0);C(this,"_offset",0);C(this,"_opacity",1);C(this,"_color","#fff");for(let o in tc)Object.defineProperty(this,o,tc[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Pt.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Pt.Index<=0?"#fff":"#000",Pt.Index=(Pt.Index+1)%2}static fromObject(n){const r=new Pt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Pt.Properties.length;r++){const s=Pt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Pt;return Me.each(Pt.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",Me.each(Pt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};C(Pt,"Index",0),C(Pt,"Properties",["offset","opacity","color"]);let ii=Pt;const tc={offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset=e,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(e){this._color=e,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},cn=class cn extends sr{constructor(n){super();C(this,"_flagStops",!1);C(this,"_flagSpread",!1);C(this,"_flagUnits",!1);C(this,"_spread","");C(this,"_units","");for(let r in nc)Object.defineProperty(this,r,nc[r]);this._renderer.type="gradient",this._renderer.flagStops=Pm.bind(this),this._renderer.bindStops=Fm.bind(this),this._renderer.unbindStops=Mm.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 ii?o:new ii().copy(o)));const s=new cn().copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new cn(r);return Me.each(cn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<cn.Properties.length;r++){const s=cn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Me.each(cn.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}};C(cn,"Stop",ii),C(cn,"Properties",["spread","stops","units"]);let nt=cn;const nc={spread:{enumerable:!0,get:function(){return this._spread},set:function(e){this._spread=e,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(e){this._units=e,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(e){const t=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(G.Types.insert,t).unbind(G.Types.remove,n),this._stops=new Ni((e||[]).slice(0)),this._stops.bind(G.Types.insert,t).bind(G.Types.remove,n),t(this._stops)}}};function Pm(){this._flagStops=!0}function Fm(e){let t=e.length;for(;t--;)e[t].bind(G.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function Mm(e){let t=e.length;for(;t--;)e[t].unbind(G.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}const Dn=class Dn extends nt{constructor(n,r,s,o,a){super(a);C(this,"_flagEndPoints",!1);C(this,"_left",null);C(this,"_right",null);for(let l in ic)Object.defineProperty(this,l,ic[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Am.bind(this),this.left=new we,this.right=new we,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 Dn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Dn.Properties.length;r++){const s=Dn.Properties[r];s in n&&(this[s]=n[s]instanceof we?n[s]:new we().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new Dn(this.left._x,this.left._y,this.right._x,this.right._y,r);return Me.each(nt.Properties,function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return n.left=this.left.toObject(),n.right=this.right.toObject(),n}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(G.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};C(Dn,"Stop",ii),C(Dn,"Properties",["left","right"]);let Ct=Dn;const ic={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof we&&this._left.unbind(G.Types.change,this._renderer.flagEndPoints),this._left=e,this._left.bind(G.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(e){this._right instanceof we&&this._right.unbind(G.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(G.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Am(){this._flagEndPoints=!0}const dn=class dn extends nt{constructor(n,r,s,o,a,l){super(o);C(this,"_flagRadius",!1);C(this,"_flagCenter",!1);C(this,"_flagFocal",!1);C(this,"_radius",0);C(this,"_center",null);C(this,"_focal",null);for(let c in rc)Object.defineProperty(this,c,rc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Im.bind(this),this._renderer.flagFocal=Vm.bind(this),this.center=new we,this.radius=typeof s=="number"?s:1,this.focal=new we,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 dn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<dn.Properties.length;r++){const s=dn.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof we?n[s]:new we().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 dn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Me.each(nt.Properties.concat(dn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Me.each(dn.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}};C(dn,"Stop",ii),C(dn,"Properties",["center","radius","focal"]);let St=dn;const rc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(e){this._center&&this._center.unbind(G.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(G.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(G.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(G.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Im(){this._flagCenter=!0}function Vm(){this._flagFocal=!0}function sc(e,t){if(t===0||t===1)return!0;const r=e._length*t;let s=0;for(let o=0;o<e._lengths.length;o++){const a=e._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Kr(e,t){const n=e._length;if(t<=0)return 0;if(t>=n)return e._lengths.length-1;for(let r=0,s=0;r<e._lengths.length;r++){if(s+e._lengths[r]>=t)return t-=s,Math.max(r-1,0)+t/e._lengths[r];s+=e._lengths[r]}return-1}function oc(e,t,n){let r,s,o,a,l,c,d,h;const f=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(f||t).x,c=(f||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,f&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),xm(r,l,s,c,o,d,a,h,n)}function ac(e,t,n){let r,s,o,a,l,c,d,h;const f=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(f||t).x,c=(f||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,f&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Kl(r,l,s,c,o,d,a,h,n)}function ri(e){switch(e.renderer.type){case"texture":return ot.fromObject(e);case"gradient":return nt.fromObject(e);case"linear-gradient":return Ct.fromObject(e);case"radial-gradient":return St.fromObject(e)}return e}const Om=Math.cos,zm=Math.sin,lc=Math.tan,Us=[],Tt=class Tt extends G{constructor(n,r,s,o,a,l){super();C(this,"elements",new Yl(9));C(this,"manual",!1);let c=n;Array.isArray(c)||(c=Array.prototype.slice.call(arguments)),this.identity(),c.length>0&&this.set(c)}static Multiply(n,r,s){if(r.length<=3){const k=n;let N,P,R;const W=r[0]||0,q=r[1]||0,F=r[2]||0;return N=k[0]*W+k[1]*q+k[2]*F,P=k[3]*W+k[4]*q+k[5]*F,R=k[6]*W+k[7]*q+k[8]*F,[N,P,R]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],f=n[6],p=n[7],u=n[8],g=r[0],m=r[1],y=r[2],_=r[3],b=r[4],S=r[5],x=r[6],v=r[7],B=r[8];return s=s||new Yl(9),s[0]=o*g+a*_+l*x,s[1]=o*m+a*b+l*v,s[2]=o*y+a*S+l*B,s[3]=c*g+d*_+h*x,s[4]=c*m+d*b+h*v,s[5]=c*y+d*S+h*B,s[6]=f*g+p*_+u*x,s[7]=f*m+p*b+u*v,s[8]=f*y+p*S+u*B,s}static fromObject(n){return new Tt().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const f=n;n=f[0],r=f[1],s=f[2],o=f[3],a=f[4],l=f[5],c=f[6],d=f[7],h=f[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]=Tt.Identity[0],this.elements[1]=Tt.Identity[1],this.elements[2]=Tt.Identity[2],this.elements[3]=Tt.Identity[3],this.elements[4]=Tt.Identity[4],this.elements[5]=Tt.Identity[5],this.elements[6]=Tt.Identity[6],this.elements[7]=Tt.Identity[7],this.elements[8]=Tt.Identity[8],this.trigger(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 V=a[0]*n+a[1]*r+a[2]*s,K=a[3]*n+a[4]*r+a[5]*s,T=a[6]*n+a[7]*r+a[8]*s;return[V,K,T]}const f=this.elements,p=[n,r,s,o,a,l,c,d,h],u=f[0],g=f[1],m=f[2],y=f[3],_=f[4],b=f[5],S=f[6],x=f[7],v=f[8],B=p[0],k=p[1],N=p[2],P=p[3],R=p[4],W=p[5],q=p[6],F=p[7],M=p[8];return this.elements[0]=u*B+g*P+m*q,this.elements[1]=u*k+g*R+m*F,this.elements[2]=u*N+g*W+m*M,this.elements[3]=y*B+_*P+b*q,this.elements[4]=y*k+_*R+b*F,this.elements[5]=y*N+_*W+b*M,this.elements[6]=S*B+x*P+v*q,this.elements[7]=S*k+x*R+v*F,this.elements[8]=S*N+x*W+v*M,this.trigger(G.Types.change)}inverse(n){const r=this.elements;n=n||new Tt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],f=r[7],p=r[8],u=p*c-d*f,g=-p*l+d*h,m=f*l-c*h;let y=s*u+o*g+a*m;return y?(y=1/y,n.elements[0]=u*y,n.elements[1]=(-p*o+a*f)*y,n.elements[2]=(d*o-a*c)*y,n.elements[3]=g*y,n.elements[4]=(p*s-a*h)*y,n.elements[5]=(-d*s+a*l)*y,n.elements[6]=m*y,n.elements[7]=(-f*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=Om(n),s=zm(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=lc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=lc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return Us.length=0,this.toTransformArray(n,Us),Us.map(sn).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],f=s[5];if(n){const p=s[6],u=s[7],g=s[8];if(o){r[0]=a,r[1]=d,r[2]=p,r[3]=l,r[4]=h,r[5]=u,r[6]=c,r[7]=f,r[8]=g;return}return[a,d,p,l,h,u,c,f,g]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=f;return}return[a,d,l,h,c,f]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],f=s[5];if(n){const p=s[6],u=s[7],g=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=f,r[6]=p,r[7]=u,r[8]=g;return}return[a,l,c,d,h,f,p,u,g]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=f;return}return[a,l,c,d,h,f]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Tt().copy(this)}};C(Tt,"Identity",[1,0,0,0,1,0,0,0,1]);let or=Tt;bm(or);const vr=class vr extends sr{constructor(){super();C(this,"_flagMatrix",!0);C(this,"_flagScale",!1);C(this,"_matrix",null);C(this,"_worldMatrix",null);C(this,"_position",null);C(this,"_rotation",0);C(this,"_scale",1);C(this,"_skewX",0);C(this,"_skewY",0);for(let n in Zr)Object.defineProperty(this,n,Zr[n]);this._renderer.flagMatrix=cc.bind(this),this.isShape=!0,this.matrix=new or,this.worldMatrix=new or,this.position=new we,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new vr().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 Zr.position.get.apply(this,arguments)}set translation(n){Zr.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 we?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 we?n.scale:new we(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 vr;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 we?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 we?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),n&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};C(vr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let yn=vr;const Zr={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(G.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(G.Types.change,this._renderer.flagMatrix),cc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(e){this._rotation=e,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof we&&this._scale.unbind(G.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof we&&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(e){this._skewX=e,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(e){this._skewY=e,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(e){this._matrix=e,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return wm(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function cc(){this._flagMatrix=!0}const Ri=Math.min,Pi=Math.max,Lm=Math.ceil,Dm=Math.floor,Hm=new we,Kt=class Kt extends yn{constructor(n,r,s,o){super();C(this,"_flagVertices",!0);C(this,"_flagLength",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagCap",!0);C(this,"_flagJoin",!0);C(this,"_flagMiter",!0);C(this,"_flagMask",!1);C(this,"_flagClip",!1);C(this,"_length",0);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_cap","round");C(this,"_join","round");C(this,"_miter",4);C(this,"_closed",!0);C(this,"_curved",!1);C(this,"_automatic",!0);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_mask",null);C(this,"_clip",!1);C(this,"_dashes",null);for(let a in dc)Object.defineProperty(this,a,dc[a]);this._renderer.type="path",this._renderer.flagVertices=hc.bind(this),this._renderer.bindVertices=uc.bind(this),this._renderer.unbindVertices=fc.bind(this),this._renderer.flagFill=pc.bind(this),this._renderer.flagStroke=gc.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:ri(n.fill),s=typeof n.stroke=="string"?n.stroke:ri(n.stroke),o=new Kt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n),this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Ee?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Ee().copy(s))}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;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<Kt.Properties.length;s++){const o=Kt.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()),Me.each(Kt.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}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,f=1/0,p=-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:u,scaleY:g}=_m(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof u=="number"&&typeof g=="number"&&(s=Math.max(u,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[u,g]=r.multiply(l.x,l.y),[m,y]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let _=l.controls.right.x,b=l.controls.right.y;l.relative&&(_+=l.x,b+=l.y);let[S,x]=r.multiply(_,b),v=c.controls.left.x,B=c.controls.left.y;c.relative&&(v+=c.x,B+=c.y);let[k,N]=r.multiply(v,B);const P=Cm(u,g,S,x,k,N,m,y);f=Ri(P.min.y-s,f),d=Ri(P.min.x-s,d),h=Pi(P.max.x+s,h),p=Pi(P.max.y+s,p)}else a<=1&&(f=Ri(g-s,f),d=Ri(u-s,d),h=Pi(u+s,h),p=Pi(g+s,p)),f=Ri(y-s,f),d=Ri(m-s,d),h=Pi(m+s,h),p=Pi(y+s,p)}return{top:f,left:d,right:h,bottom:p,width:h-d,height:p-f}}getPointAt(n,r){let s,o,a,l,c,d,h,f,p,u,g,m,y,_,b,S=this.length*Math.min(Math.max(n,0),1);const x=this.vertices.length,v=x-1;let B=null,k=null;for(let $=0,j=this._lengths.length,z=0;$<j;$++){if(z+this._lengths[$]>=S){this._closed?(s=$i($,x),o=$i($-1,x),$===0&&(s=o,o=$)):(s=$,o=Math.min(Math.max($-1,0),v)),B=this.vertices[s],k=this.vertices[o],S-=z,this._lengths[$]!==0?n=S/this._lengths[$]:n=0;break}z+=this._lengths[$]}if(B===null||k===null)return null;if(B){if(!k)return B}else return k;b=k.controls&&k.controls.right,_=B.controls&&B.controls.left,c=k.x,u=k.y,d=(b||k).x,g=(b||k).y,h=(_||B).x,m=(_||B).y,f=B.x,y=B.y,b&&k.relative&&(d+=k.x,g+=k.y),_&&B.relative&&(h+=B.x,m+=B.y),l=Yr(n,c,d,h,f),p=Yr(n,u,g,m,y);const N=rn(c,d,n),P=rn(u,g,n),R=rn(d,h,n),W=rn(g,m,n),q=rn(h,f,n),F=rn(m,y,n),M=rn(N,R,n),V=rn(P,W,n),K=rn(R,q,n),T=rn(W,F,n);return Me.isObject(r)?(r.x=l,r.y=p,r instanceof Ee&&(r.controls.left.x=M,r.controls.left.y=V,r.controls.right.x=K,r.controls.right.y=T,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=p,r.controls.right.x-=l,r.controls.right.y-=p)),r.t=n,r):(a=new Ee(l,p,M-l,V-p,K-l,T-p,this._curved?pe.curve:pe.line),a.t=n,a)}plot(){if(this.curved)return Bm(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?pe.move:pe.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===pe.close;let o=this.vertices[r],a=[],l;return Me.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===pe.move){a.push(new Ee(o.x,o.y)),d>0&&(a[a.length-1].command=pe.line),o=c;return}l=ac(c,o,n),a=a.concat(l),Me.each(l,function(h,f){f<=0&&o.command===pe.move?h.command=pe.move:h.command=pe.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=ac(c,o,n),a=a.concat(l),Me.each(l,function(h,f){f<=0&&o.command===pe.move?h.command=pe.move:h.command=pe.line})),a.push(new Ee(c.x,c.y)),a[a.length-1].command=s?pe.close:pe.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=[]),Me.each(this.vertices,function(c,d){if(d<=0||c.command===pe.move){a=c,this._lengths[d]=0;return}this._lengths[d]=oc(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=Kr(this,s*this._length),l=Kr(this,o*this._length),c=Lm(a),d=Dm(l);let h,f,p,u,g,m;for(this._renderer.vertices.length=0,m=0;m<n;m++)this._renderer.collection.length<=m&&this._renderer.collection.push(new Ee),m>d&&!f?(g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(o,g),g.command=this._renderer.collection[m].command,this._renderer.vertices.push(g),f=g,p=this._collection[m-1],p&&p.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),p.relative?this._renderer.collection[m-1].controls.right.copy(p.controls.right).lerp(we.zero,1-g.t):this._renderer.collection[m-1].controls.right.copy(p.controls.right).lerp(p,1-g.t))):m>=c&&m<=d&&(g=this._renderer.collection[m].copy(this._collection[m]),this._renderer.vertices.push(g),m===d&&sc(this,o)?(f=g,!r&&f.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f))):m===c&&sc(this,s)&&(h=g,h.command=pe.move,!r&&h.controls&&(h.relative?h.controls.left.clear():h.controls.left.copy(h))));c>0&&!h&&(m=c-1,g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(s,g),g.command=pe.move,this._renderer.vertices.unshift(g),u=this._collection[m+1],u&&u.controls&&(g.controls.left.clear(),u.relative?this._renderer.collection[m+1].controls.left.copy(u.controls.left).lerp(we.zero,g.t):(Hm.copy(u),this._renderer.collection[m+1].controls.left.copy(u.controls.left).lerp(u,g.t))))}return yn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=!1,yn.prototype.flagReset.call(this),this}};C(Kt,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),C(Kt,"Utils",{getCurveLength:oc});let $e=Kt;const dc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof ot)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof ot)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof ot)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof ot)&&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(e){this._closed=!!e,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=!!e,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){if(e===this._automatic)return;this._automatic=!!e;const t=this._automatic?"ignore":"listen";Me.each(this.vertices,function(n){n[t]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(G.Types.insert,t).unbind(G.Types.remove,n),e instanceof Ni?this._collection=e:this._collection=new Ni(e||[]),this._collection.bind(G.Types.insert,t).bind(G.Types.remove,n),t(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Me.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function hc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function uc(e){let t=e.length;for(;t--;)e[t].bind(G.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function fc(e){let t=e.length;for(;t--;)e[t].unbind(G.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function pc(){this._flagFill=!0}function gc(){this._flagStroke=!0}const Wm=Math.ceil,jm=Math.floor,hn=class hn extends yn{constructor(n){super();C(this,"_flagVertices",!0);C(this,"_flagLength",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagSize",!0);C(this,"_flagSizeAttenuation",!0);C(this,"_length",0);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_size",1);C(this,"_sizeAttenuation",!1);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_dashes",null);C(this,"noFill",$e.prototype.noFill);C(this,"noStroke",$e.prototype.noStroke);C(this,"corner",$e.prototype.corner);C(this,"center",$e.prototype.center);C(this,"getBoundingClientRect",$e.prototype.getBoundingClientRect);C(this,"_updateLength",$e.prototype._updateLength);for(let r in mc)Object.defineProperty(this,r,mc[r]);this._renderer.type="points",this._renderer.flagVertices=hc.bind(this),this._renderer.bindVertices=uc.bind(this),this._renderer.unbindVertices=fc.bind(this),this._renderer.flagFill=pc.bind(this),this._renderer.flagStroke=gc.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:ri(n.fill),s=typeof n.stroke=="string"?n.stroke:ri(n.stroke),o=new hn().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 Ee?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Ee().copy(s))}for(let r=0;r<hn.Properties.length;r++){const s=hn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new hn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<hn.Properties.length;s++){const o=hn.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()),Me.each(hn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}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,f=Kl(l,c,l,c,d,h,d,h,n);r=r.concat(f)}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=Kr(this,n*this._length),o=Kr(this,r*this._length),a=Wm(s),l=jm(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}};C(hn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);let Jr=hn;const mc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof ot)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof ot)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof ot)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof ot)&&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(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(G.Types.insert,t).unbind(G.Types.remove,n),e instanceof Ni?this._collection=e:this._collection=new Ni(e||[]),this._collection.bind(G.Types.insert,t).bind(G.Types.remove,n),t(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};class yc extends Ni{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);pa(this,xs,{});this.attach(n),this.on(G.Types.insert,this.attach),this.on(G.Types.remove,this.detach)}get ids(){return Et(this,xs)}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}}xs=new WeakMap;const kn=class kn extends $e{constructor(n,r,s,o,a,l,c){const d=c||Ys.Resolution*3,h=[];for(let f=0;f<d;f++)h.push(new Ee);super(h,!0,!1,!0);C(this,"_flagStartAngle",!1);C(this,"_flagEndAngle",!1);C(this,"_flagInnerRadius",!1);C(this,"_flagOuterRadius",!1);C(this,"_startAngle",0);C(this,"_endAngle",ni);C(this,"_innerRadius",0);C(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let f in _c)Object.defineProperty(this,f,_c[f]);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 kn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<kn.Properties.length;r++){const s=kn.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=$i(n,ni)===$i(r,ni),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,f=0,p,u,g,m,y,_,b,S,x;for(a?d--:l||(d-=2),p=0,u=d-1;p<d;p++){switch(g=p/u,m=c[f],y=g*(r-n)+n,_=(r-n)/d,b=o*Math.cos(y),S=o*Math.sin(y),p){case 0:h=pe.move;break;default:h=pe.curve}m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===pe.curve&&(x=o*_/Math.PI,m.controls.left.x=x*Math.cos(y-st),m.controls.left.y=x*Math.sin(y-st),m.controls.right.x=x*Math.cos(y+st),m.controls.right.y=x*Math.sin(y+st),p===1&&m.controls.left.multiplyScalar(2),p===u&&m.controls.right.multiplyScalar(2)),f++}if(l){for(a?(c[f].command=pe.close,f++):(d--,u=d-1),p=0;p<d;p++)g=p/u,m=c[f],y=(1-g)*(r-n)+n,_=(r-n)/d,b=s*Math.cos(y),S=s*Math.sin(y),h=pe.curve,p<=0&&(h=a?pe.move:pe.line),m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===pe.curve&&(x=s*_/Math.PI,m.controls.left.x=x*Math.cos(y+st),m.controls.left.y=x*Math.sin(y+st),m.controls.right.x=x*Math.cos(y-st),m.controls.right.y=x*Math.sin(y-st),p===1&&m.controls.left.multiplyScalar(2),p===u&&m.controls.right.multiplyScalar(2)),f++;c[f].copy(c[0]),c[f].command=pe.line}else a||(c[f].command=pe.line,c[f].x=0,c[f].y=0,f++,c[f].copy(c[0]),c[f].command=pe.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 kn(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<$e.Properties.length;d++){const h=$e.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<kn.Properties.length;r++){const s=kn.Properties[r];n[s]=this[s]}return n}};C(kn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Gs=kn;const _c={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}}},Ks=Math.cos,Zs=Math.sin,xn=class xn extends $e{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new Ee(0,0,0,0,0,0));super(l,!0,!0,!0);C(this,"_flagRadius",!1);C(this,"_radius",0);this._renderer.type="circle";for(let c in bc)Object.defineProperty(this,c,bc[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 xn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<xn.Properties.length;r++){const s=xn.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*ni,d=s*Ks(c),h=s*Zs(c),f=o*Ks(c-st),p=o*Zs(c-st),u=o*Ks(c+st),g=o*Zs(c+st),m=this.vertices[a];m.command=a===0?pe.move:pe.curve,m.set(d,h),m.controls.left.set(f,p),m.controls.right.set(u,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new xn(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<$e.Properties.length;s++){const o=$e.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<xn.Properties.length;r++){const s=xn.Properties[r];n[s]=this[s]}return n}};C(xn,"Properties",["radius"]);let Js=xn;const bc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Qs=Math.cos,eo=Math.sin,Cn=class Cn extends $e{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 Ee);super(c,!0,!0,!0);C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_width",0);C(this,"_height",0);this._renderer.type="ellipse";for(let d in wc)Object.defineProperty(this,d,wc[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 Cn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Cn.Properties.length;r++){const s=Cn.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*ni,d=s*Qs(c),h=o*eo(c),f=s*r*Qs(c-st),p=o*r*eo(c-st),u=s*r*Qs(c+st),g=o*r*eo(c+st),m=this.vertices[a];m.command=a===0?pe.move:pe.curve,m.set(d,h),m.controls.left.set(f,p),m.controls.right.set(u,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 Cn(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<$e.Properties.length;l++){const c=$e.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<Cn.Properties.length;r++){const s=Cn.Properties[r];n[s]=this[s]}return n}};C(Cn,"Properties",["width","height"]);let to=Cn;const wc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},Xm=Math.cos,qm=Math.sin,Sn=class Sn extends $e{constructor(n,r,s,o){o=Math.max(o||0,3);super();C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_flagSides",!1);C(this,"_radius",0);C(this,"_width",0);C(this,"_height",0);C(this,"_sides",0);this._renderer.type="polygon";for(let a in vc)Object.defineProperty(this,a,vc[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 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._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=ni*a+Math.PI/2,c=this._width*Xm(l)/2,d=this._height*qm(l)/2;o>=s?this.vertices.push(new Ee(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?pe.move:pe.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 Sn(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<$e.Properties.length;s++){const o=$e.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<Sn.Properties.length;r++){const s=Sn.Properties[r];n[s]=this[s]}return n}};C(Sn,"Properties",["width","height","sides"]);let no=Sn;const vc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},bi=class bi extends $e{constructor(n,r,s,o){const a=[new Ee,new Ee,new Ee,new Ee];super(a,!0,!1,!0);C(this,"_flagWidth",0);C(this,"_flagHeight",0);C(this,"_width",0);C(this,"_height",0);C(this,"_origin",null);this._renderer.type="rectangle";for(let l in kc)Object.defineProperty(this,l,kc[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new we,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])}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 Ee),this.vertices[0].set(-n,-r).sub(this._origin).command=pe.move,this.vertices[1].set(n,-r).sub(this._origin).command=pe.line,this.vertices[2].set(n,r).sub(this._origin).command=pe.line,this.vertices[3].set(-n,r).sub(this._origin).command=pe.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=pe.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<$e.Properties.length;s++){const o=$e.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="rectangle",n.width=this.width,n.height=this.height,n.origin=this.origin.toObject(),n}};C(bi,"Properties",["width","height"]);let io=bi;const kc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(G.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(G.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Bn=class Bn extends $e{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 Ee(0,0,0,0,0,0,c===0?pe.move:pe.curve));super(l);C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_flagRadius",!1);C(this,"_width",0);C(this,"_height",0);C(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in xc)Object.defineProperty(this,c,xc[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Ym.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),typeof a=="number"&&(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 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];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof we?o:new we().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 we?(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 Bn(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<$e.Properties.length;l++){const c=$e.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<Bn.Properties.length;r++){const s=Bn.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};C(Bn,"Properties",["width","height","radius"]);let ro=Bn;const xc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof we&&this._radius.unbind(G.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof we&&this._radius.bind(G.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Ym(){this._flagRadius=!0}const Um=Math.cos,Gm=Math.sin,Tn=class Tn extends $e{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();C(this,"_flagInnerRadius",!1);C(this,"_flagOuterRadius",!1);C(this,"_flagSides",!1);C(this,"_innerRadius",0);C(this,"_outerRadius",0);C(this,"_sides",0);this._renderer.type="star";for(let l in Cc)Object.defineProperty(this,l,Cc[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 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._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=ni*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*Um(l),h=c*Gm(l);o>=s?this.vertices.push(new Ee(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?pe.move:pe.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 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<$e.Properties.length;l++){const c=$e.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<Tn.Properties.length;r++){const s=Tn.Properties[r];n[s]=this[s]}return n}};C(Tn,"Properties",["innerRadius","outerRadius","sides"]);let so=Tn;const Cc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}};let oo;const Sc=Math.min,Bc=Math.max;nn.document&&(oo=document.createElement("canvas"));const bt=class bt extends yn{constructor(n,r,s,o){super();C(this,"_flagValue",!0);C(this,"_flagFamily",!0);C(this,"_flagSize",!0);C(this,"_flagLeading",!0);C(this,"_flagAlignment",!0);C(this,"_flagBaseline",!0);C(this,"_flagStyle",!0);C(this,"_flagWeight",!0);C(this,"_flagDecoration",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagMask",!1);C(this,"_flagClip",!1);C(this,"_flagDirection",!0);C(this,"_value","");C(this,"_family","sans-serif");C(this,"_size",13);C(this,"_leading",17);C(this,"_alignment","center");C(this,"_baseline","middle");C(this,"_style","normal");C(this,"_weight",500);C(this,"_decoration","none");C(this,"_direction","ltr");C(this,"_fill","#000");C(this,"_stroke","none");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_mask",null);C(this,"_clip",!1);C(this,"_dashes",null);for(let a in Tc)Object.defineProperty(this,a,Tc[a]);if(this._renderer.type="text",this._renderer.flagFill=Km.bind(this),this._renderer.flagStroke=Zm.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,!Me.isObject(o))return this;for(let a=0;a<bt.Properties.length;a++){const l=bt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(oo){const r=oo.getContext("2d");r.font=[n._style,n._weight,`${n._size}px/${n._leading}px`,n._family].join(" ");const s=r.measureText(n.value,0,0),o=s.actualBoundingBoxDescent+s.actualBoundingBoxAscent;return{width:s.width,height:o}}else{const r=this.value.length*this.size*bt.Ratio,s=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:s}}}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ri(n.fill),s=typeof n.stroke=="string"?n.stroke:ri(n.stroke),o=new bt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<bt.Properties.length;r++){const s=bt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new bt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<bt.Properties.length;s++){const o=bt.Properties[s];r[o]=this[o]}return this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);n.renderer.type="text";for(let r=0;r<bt.Properties.length;r++){const s=bt.Properties[r];n[s]=this[s]}return n}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(n){let r,s,o,a,l;this._update(!0),r=n?this.matrix:this.worldMatrix;const{width:c,height:d}=bt.Measure(this),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[f,p]=r.multiply(s,a),[u,g]=r.multiply(s,l),[m,y]=r.multiply(o,a),[_,b]=r.multiply(o,l);return a=Sc(p,g,y,b),s=Sc(f,u,m,_),o=Bc(f,u,m,_),l=Bc(p,g,y,b),{top:a,left:s,right:o,bottom:l,width:o-s,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};C(bt,"Ratio",.6),C(bt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);let Fi=bt;const Tc={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof ot)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof ot)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof ot)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof ot)&&this._stroke.bind(G.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Me.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function Km(){this._flagFill=!0}function Zm(){this._flagStroke=!0}const Qr=Math.min,es=Math.max,En=class En extends yn{constructor(n){super();C(this,"_flagAdditions",!1);C(this,"_flagSubtractions",!1);C(this,"_flagOrder",!1);C(this,"_flagOpacity",!0);C(this,"_flagBeginning",!1);C(this,"_flagEnding",!1);C(this,"_flagLength",!1);C(this,"_flagMask",!1);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_cap","round");C(this,"_join","round");C(this,"_miter",4);C(this,"_closed",!0);C(this,"_curved",!1);C(this,"_automatic",!0);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_length",0);C(this,"_mask",null);for(let r in Ec)Object.defineProperty(this,r,Ec[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++)$c.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)$c.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new En;for(let o=0;o<En.Properties.length;o++){const a=En.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:ri(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 Gs.fromObject(o);case"circle":return Js.fromObject(o);case"ellipse":return to.fromObject(o);case"points":return Jr.fromObject(o);case"polygon":return no.fromObject(o);case"rectangle":return io.fromObject(o);case"rounded-rectangle":return ro.fromObject(o);case"star":return so.fromObject(o);case"path":return $e.fromObject(o);case"text":return Fi.fromObject(o);case"group":return En.fromObject(o);case"shape":return yn.fromObject(o);case"element":return sr.fromObject(o)}return o}}copy(n){return super.copy.call(this,n),console.warn("Two.Group.copy is not supported yet."),this}clone(n){const r=new En,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,Me.each(this.children,(r,s)=>{n.children[s]=r.toObject()},this),n}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,f=1/0,p=-1/0;const u=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const m=this.children[g];if(!(!m.visible||u.test(m._renderer.type))&&(r=m.getBoundingClientRect(n),o=typeof r.top!="number"||Me.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Me.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Me.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Me.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[y,_]=s.multiply(r.left,r.top),[b,S]=s.multiply(r.right,r.top),[x,v]=s.multiply(r.left,r.bottom),[B,k]=s.multiply(r.right,r.bottom);f=Qr(_,S,v,k,f),d=Qr(y,b,x,B,d),h=es(y,b,x,B,h),p=es(_,S,v,k,p)}else f=Qr(r.top,f),d=Qr(r.left,d),h=es(r.right,h),p=es(r.bottom,p)}return{top:f,left:d,right:h,bottom:p,width:h-d,height:p-f}}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}};C(En,"Children",yc),C(En,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let _n=En;const Ec={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){const t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){const t=_n.InsertChildren.bind(this),n=_n.RemoveChildren.bind(this),r=_n.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new yc(e),this._children.bind(G.Types.insert,t),this._children.bind(G.Types.remove,n),this._children.bind(G.Types.order,r),e.length>0&&t(e)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Me.isObject(e)&&!e.clip&&(e.clip=!0)}}};function $c(e,t){const n=e.parent;let r;if(n===t){s();return}if(n&&n.children.ids[e.id]&&(r=Array.prototype.indexOf.call(n.children,e),n.children.splice(r,1),o()),t){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete e.parent;function s(){t.subtractions.length>0&&(r=Array.prototype.indexOf.call(t.subtractions,e),r>=0&&t.subtractions.splice(r,1)),t.additions.length>0&&(r=Array.prototype.indexOf.call(t.additions,e),r>=0&&t.additions.splice(r,1)),e.parent=t,t.additions.push(e),t._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,e),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,e),r<0&&(n.subtractions.push(e),n._flagSubtractions=!0)}}class ao extends $e{constructor(t,n,r,s){const o=[new Ee(t,n),new Ee(r,s)];super(o);for(let a in Nc)Object.defineProperty(this,a,Nc[a]);this.vertices[0].command=pe.move,this.vertices[1].command=pe.line,this.automatic=!1}}const Nc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(Me.isObject(e))this.vertices.splice(0,1,e);else{const t=new Ur("Two.Line.x argument is not an object.");console.warn(t.name,t.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(Me.isObject(e))this.vertices.splice(1,1,e);else{const t=new Ur("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}};class lo{constructor(t=0,n=0){this.x=t,this.y=n}}class si{constructor(t=10,n=0,r="A"){C(this,"start",new lo);C(this,"end",new lo);this.width=t,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"}},Jm={class:"flex gap-3"},Qm={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},e0={ref:"drawing-container",class:"size-full"},t0={},Rc=i.defineComponent({...t0,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select"],setup(e,{emit:t}){const n=e,r=t,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,h=i.computed(()=>n.value.configuratorParams.linesAngles.map((T,$)=>new si(n.value.configuratorParams.linesWidths[$],T,`A-${$+1}`))),f=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),p=i.computed(()=>{var T,$;return n.value.configuratorParams.startTailType&&((T=n.settings.startTailConfigs)!=null&&T[n.value.configuratorParams.startTailType])?($=n.settings.startTailConfigs)==null?void 0:$[n.value.configuratorParams.startTailType].points:[]}),u=i.computed(()=>{var T,$;return n.value.configuratorParams.endTailType&&((T=n.settings.endTailConfigs)!=null&&T[n.value.configuratorParams.endTailType])?($=n.settings.endTailConfigs)==null?void 0:$[n.value.configuratorParams.endTailType].points:[]}),g=(T,$=!1)=>{T[0].start.x=0,T[0].start.y=0;let j=0;for(let z=0;z<T.length;z++){const U=T[z],I=T[z-1]??new si(0,j);j+=!$||z>1?I.angle:0;const O=(!$||z>0?U.angle:0)+j;if(T[z].end.x=U.width*Math.cos(O*Math.PI/180)+T[z].start.x,T[z].end.y=U.width*Math.sin(O*Math.PI/180)+T[z].start.y,z<T.length-1){const Z=z+1;T[Z].start.x=T[z].end.x,T[Z].start.y=T[z].end.y}}return T},m=(T,$,j,z,U=!1)=>{let I=g([...j,...z]);$.length>0&&(I=[...g($),...I]);let O=0,Z=0,ge=0,ie=0;I.forEach(Fe=>{O=Math.min(O,Fe.start.x,Fe.end.x),Z=Math.min(Z,Fe.start.y,Fe.end.y),ge=Math.max(ge,Fe.start.x,Fe.end.x),ie=Math.max(ie,Fe.start.y,Fe.end.y)});let he,re;O===0&&Z===0&&ge===0&&ie===0?(he=1,re=1):(he=T.width/Math.abs(ge-O),re=(U?T.height:T.height-Ve.colorSideLabel.size)/Math.abs(ie-Z));const Pe=Math.min(he,re);return O=O<0?-O*Pe:0,Z=Z<0?-Z*Pe:0,[Pe,O,Z]},y=T=>{const $=new Jr([T]);return $._size=Ve.anchorPoint.size,$.fill=Ve.anchorPoint.color,$.stroke="transparent",$._linewidth=Ve.anchorPoint.strokeSize,l.push($),$},_=(T,$)=>{if(l=[],n.settings.allowChangeFirstPoint){const j=T[0],z=new we(j.vertices[0].x,j.vertices[0].y);z.bind(G.Types.change,()=>{j.vertices[0].copy(z)});const U=y(z);$.add(U)}T.forEach((j,z)=>{const U=T[z+1],I=new we(j.vertices[1].x,j.vertices[1].y);I.bind(G.Types.change,()=>{j.vertices[1].copy(I),U!==void 0&&U.vertices[0].copy(I)});const O=y(I);$.add(O)})},b=T=>T*(Math.PI/180),S=(T,$,j)=>{const z=$.vertices.length-1;T.position.x=$.vertices[z].x,T.position.y=$.vertices[z].y;const U=Math.atan2($.vertices[z].y-$.vertices[0].y,$.vertices[z].x-$.vertices[0].x);T.rotation=b(j)+U},x=(T,$,j)=>{if($.vertices[0]===void 0)return;T.position.x=$.vertices[0].x,T.position.y=$.vertices[0].y;const z=$.vertices.length-1,U=Math.atan2($.vertices[z].y-$.vertices[0].y,$.vertices[z].x-$.vertices[0].x);T.rotation=b(j)+U},v=(T,$,j)=>{const z=new _n;if(T.length===0)return z;const U=[];return[...T].reverse().forEach((I,O)=>{O!==0&&I.angle>0&&(I.angle*=-1),U.push(I)}),T=g(U,!0),x(z,$,T[0].angle),[$.vertices[0],$.vertices[1]].forEach(I=>{I.bind(G.Types.change,()=>{x(z,$,T[0].angle)})}),T.forEach(I=>{const O=I.start.x*j,Z=I.end.x*j,ge=I.start.y*j,ie=I.end.y*j,he=new ao(O,ge,Z,ie);he.linewidth=Ve.line.size,he.stroke=Ve.line.color,z.add(he)}),z},B=(T,$,j)=>{const z=new _n;return T.length===0||(T=g(T,!0),S(z,$,T[0].angle),[$.vertices[0],$.vertices[1]].forEach(U=>{U.bind(G.Types.change,()=>{S(z,$,T[0].angle)})}),T.forEach(U=>{const I=U.start.x*j,O=U.end.x*j,Z=U.start.y*j,ge=U.end.y*j,ie=new ao(I,Z,O,ge);ie.linewidth=Ve.line.size,ie.stroke=Ve.line.color,z.add(ie)})),z},k=(T,$,j,z)=>{const U=$.vertices[0].x+($.vertices[1].x-$.vertices[0].x)/2-8*Math.sin(T.angle*Math.PI/180),I=$.vertices[0].y+($.vertices[1].y-$.vertices[0].y)/2-8*Math.cos(T.angle*Math.PI/180),O=new Fi(T.label,U+10,I-10);let Z;O.size=Ve.lineLabel.size,O.weight=600,O.fill=Ve.lineLabel.color,O.id+=1,O.rotation=Ve.lineLabel.rotation,z>0&&(Z=new Fi(`${T.angle}°`,$.vertices[0].x+25,$.vertices[0].y-25),Z.size=Ve.angleLabel.size,Z.weight=600,Z.fill=Ve.angleLabel.color,Z.rotation=Ve.angleLabel.rotation,Z.id+=z,o.push(Z),j.add(Z)),j.add(O),P(O,$,0,Z),P(O,$,1)},N=()=>{const{size:T}=Ve.colorSideLabel,$=0,j=0,z=f.value?T/2:T/2-T,U=f.value?T/2-T:T/2,I=new _n;if(!c)return I;const O=5,Z=Math.atan2(U-z,j-$),ge=[new Ee($,z,0,0,0,0,ue.Commands.move),new Ee(j,U,0,0,0,0,ue.Commands.line),new Ee(j-O*Math.cos(Z-Math.PI/4),U-O*Math.sin(Z-Math.PI/4),0,0,0,0,ue.Commands.line),new Ee(j,U,0,0,0,0,ue.Commands.move),new Ee(j-O*Math.cos(Z+Math.PI/4),U-O*Math.sin(Z+Math.PI/4),0,0,0,0,ue.Commands.line)],ie=new $e(ge,!1,!1,!0);ie.noFill(),ie.cap="round",ie.join="round",ie.linewidth=T/7,ie.stroke=Ve.colorSideLabel.color,I.add(ie);const he=new Fi(f.value?"Цвет снизу":"Цвет сверху",10,0);he.size=T,he.weight=600,he.fill=Ve.colorSideLabel.color,he.alignment="left",I.add(he);const re=I.getBoundingClientRect();return I.position.x=(c.width-re.width)*d+10,I.position.y=f.value?c.height+re.height*2:re.height/2,I},P=(T,$,j,z)=>{$.vertices[j].bind(G.Types.change,()=>{const U=$.vertices.length-1,I=Math.atan2($.vertices[0].y-$.vertices[U].y,$.vertices[0].x-$.vertices[U].x)*180/Math.PI,O=$.vertices[0].x+($.vertices[U].x-$.vertices[0].x)/2-8*Math.sin(I*Math.PI/180),Z=$.vertices[0].y+($.vertices[U].y-$.vertices[0].y)/2-8*Math.cos(I*Math.PI/180);T.position.x=O+10,T.position.y=Z-10,T.rotation=-.5,z&&(z.position.x=$.vertices[0].x+25,z.position.y=$.vertices[0].y-25)})},R=(T,$,j,z,U=!1)=>{var Ze;if(T.clear(),j.length===0){T.update();return}const I=g(j),[O,Z,ge]=m(T,$,I,z,U),ie=new _n,he=new Array,re=new Array;U||(o=[],a=[]),I.forEach((Le,dt)=>{const Zt=Le.start.x*O+Z,Oe=Le.end.x*O+Z,Ce=Le.start.y*O+ge,Je=Le.end.y*O+ge,Qe=new ao(Zt,Ce,Oe,Je);Qe.linewidth=U?Ve.previewLine.size:Ve.line.size,Qe.stroke=U?Ve.previewLine.color:Ve.line.color,a.push(Qe),he.push(Qe),ie.add(Qe),!U&&Le.label!==""&&k(Le,Qe,ie,dt)});const Pe=he.at(-1);let Fe=ie.getBoundingClientRect();if(!U){const Le=N();re.push(Le)}if($.length>0){const Le=v($,he[0],O);ie.add(Le)}if(z.length>0&&Pe){const Le=B(z,Pe,O);ie.add(Le)}if(re.push(ie),T.makeGroup(re),Fe=ie.getBoundingClientRect(),ie.position.x=0-Fe.left+(T.width-Fe.width)/(2*(U?1:d)),ie.position.y=0-Fe.top+(T.height-Fe.height)/(2*(U?1:d)),T.update(),!U){const Le=((Ze=n.value.configuratorParams)==null?void 0:Ze.colorSide)==="top";ie.position.y=ie.position.y+Ve.colorSideLabel.size*Number(Le),_(he,ie),T.update()}},W=(T,$)=>{if(T&&!$.isNewRec()){const j=new ue({width:T.scrollWidth,height:T.scrollHeight});j.appendTo(T),R(j,[],$.points,[],!0)}},q=()=>{c&&R(c,p.value,h.value,u.value,!1)},F=T=>T*(180/Math.PI),M=(T,$)=>{const j=T[1].x-T[0].x,z=T[1].y-T[0].y,U=$[1].x-$[0].x,I=$[1].y-$[0].y;let O=Math.atan2(j*I-z*U,j*U+z*I);return O=F(O),Math.round(O)*-1},V=T=>{const $=a.map((j,z,U)=>{const I=U[z-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let O=Math.ceil(j._length/T/n.settings.lineWidthStep)*n.settings.lineWidthStep;const Z=o[z-1];O<(U.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(O=U.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),O>n.settings.maxLineWidth&&(O=n.settings.maxLineWidth);const ge=M(j.vertices,I.vertices);return Z&&(Z.value=`${ge}°`),new si(O,ge,`A-${z+1}`)});r("pointer:move",$)},K=T=>{let $=null,j;const z=Z=>{$=l.find(ge=>{const ie=ge.renderer;return(ie==null?void 0:ie.elem)===Z.target}),[j]=m(T,p.value,h.value.map(ge=>ge),u.value)},U=Z=>{if($){const ge=$.renderer,ie=ge==null?void 0:ge.elem;if(!ie)return;const he=ie.getBoundingClientRect();$.vertices[0].x-=he.x-(Z instanceof MouseEvent?Z.clientX:Z.targetTouches[0].clientX)+Ve.anchorPoint.size/2,$.vertices[0].y-=he.y-(Z instanceof MouseEvent?Z.clientY:Z.targetTouches[0].clientY)+Ve.anchorPoint.size/2,V(j),T.update()}},I=()=>{$&&r("pointer:up",h.value),$=null},O=s.value;O&&(O.addEventListener("touchstart",z),O.addEventListener("touchend",I),O.addEventListener("mousedown",z),O.addEventListener("mouseup",I),O.addEventListener("mousemove",U),O.addEventListener("touchmove",U))};return i.onMounted(()=>{s.value&&(c=new ue({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{q()},{deep:!0,immediate:!0}),K(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(T,$)=>(i.openBlock(),i.createElementBlock("div",Jm,[i.createVNode(Ra,{"select-template-index":T.selectTemplateIndex,settings:T.settings,"onTemplate:select":$[0]||($[0]=j=>r("template:select",j)),onInitDrawTemplate:W},null,8,["select-template-index","settings"]),i.createElementVNode("div",Qm,[i.createElementVNode("div",e0,null,512)])]))}}),n0={class:"flex max-w-[50rem] flex-col gap-3"},i0={},r0=i.defineComponent({...i0,__name:"kozyrek-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,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:{}}),f=i.ref(0),p=(v=0)=>{const B=c.value.allTemplates.at(v);B!==void 0&&(f.value=v,l.value.configuratorParams.linesWidths=B.points.map(k=>D.isArray(k)?k[0]:k.width),l.value.configuratorParams.linesAngles=B.points.map(k=>D.isArray(k)?k[1]:k.angle),_()),m(l.value.configuratorParams)},u=async()=>{const v=prompt("Введите название шаблона:");if(!v)return;a.value=!0;const B={label:v,points:l.value.configuratorParams.linesWidths.map((k,N)=>[k,l.value.configuratorParams.linesAngles[N]])};await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).createTemplate(n.cartItem.category,B,h.value).then(()=>{c.value.addCustomTemplate(B),f.value=c.value.allTemplates.length-1}).catch(()=>{a.value=!1}),a.value=!1},g=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(f.value=c.value.allTemplates.length-1)},m=async v=>{_(),s.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(n.cartItem.category,v,h.value).then(B=>{l.value.product=B}).catch(()=>{s.value=!1}),s.value=!1},y=async()=>{o.value=!0,await(l.value.isNewRec()?Y.HttpRequester.getInstance(Y.CartProvider).addCartItem(n.client,l.value).then(v=>{r("submit-success",v)}).catch(()=>{o.value=!1}):Y.HttpRequester.getInstance(Y.CartProvider).patchCartItem(n.client,l.value).then(v=>{r("submit-success",v)}).catch(()=>{o.value=!1})),o.value=!1},_=()=>{const v={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach((B,k)=>{v[`lines_widths[${k+1}]`]={},v[`lines_angles[${k+1}]`]={}}),h.value=v},b=v=>{d.value.linesWidths=v.map(B=>B.width),d.value.linesAngles=v.map(B=>B.angle)},S=v=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,_(),g(),m(l.value.configuratorParams)},x=(v,B)=>{d.value.linesWidths=v,d.value.linesAngles=B};return i.onBeforeMount(()=>{p()}),(v,B)=>(i.openBlock(),i.createElementBlock("div",n0,[i.createVNode(Rc,{value:l.value,"select-template-index":f.value,settings:c.value,"onPointer:up":S,"onPointer:move":b,"onTemplate:select":p},null,8,["value","select-template-index","settings"]),i.createVNode(Ma,{value:l.value,"onUpdate:value":B[0]||(B[0]=k=>l.value=k),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":f.value,"onUpdate:params":B[1]||(B[1]=k=>m(k)),"onUpdate:preview":x,onSubmit:y,"onClick:saveTemplate":u},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])]))}});class Mi extends Y.Identity{constructor(n,r){super();C(this,"label","");C(this,"points",[]);C(this,"isCustom",!1);C(this,"id",-1);C(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>D.isArray(s)?new si(s[0],s[1],`A-${o+1}`):new si(s.width,s.angle,`A-${o+1}`))):(this.label="-- Новая конфигурация --",this.points=[new si(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class co extends Mi{constructor(n){super(n);C(this,"isDefault");this.isDefault=n.isDefault??!1}}class s0{constructor(t){C(this,"minLineWidth");C(this,"maxLineWidth");C(this,"lineWidthStep");C(this,"minLineAngle");C(this,"maxLineAngle");C(this,"lineAngleStep");C(this,"stripMinWidth");C(this,"stripMaxWidth");C(this,"stripMinLength");C(this,"stripMaxLength");C(this,"allowShowTable");C(this,"showOnlyTemplates");C(this,"templates");C(this,"customTemplates",[]);C(this,"startTailConfigs");C(this,"endTailConfigs");C(this,"bendCountForExtended");C(this,"extendedProductCatalog");C(this,"allowChangeFirstPoint");C(this,"allowSaveTemplates");C(this,"userTemplatesPrefix");C(this,"lengthStep");this.minLineWidth=t.minLineWidth,this.maxLineWidth=t.maxLineWidth,this.lineWidthStep=t.lineWidthStep,this.minLineAngle=t.minLineAngle,this.maxLineAngle=t.maxLineAngle,this.lineAngleStep=t.lineAngleStep,this.stripMinWidth=t.stripMinWidth,this.stripMaxWidth=t.stripMaxWidth,this.stripMinLength=t.stripMinLength,this.stripMaxLength=t.stripMaxLength,this.allowShowTable=t.allowShowTable,this.showOnlyTemplates=t.showOnlyTemplates,this.templates=t.templates.map(n=>new Mi(n)),this.templates.forEach((n,r)=>{n.id=r}),this.startTailConfigs=t.startTailConfigs.map(n=>new co(n)),this.endTailConfigs=t.endTailConfigs.map(n=>new co(n)),this.bendCountForExtended=t.bendCountForExtended,this.extendedProductCatalog=t.extendedProductCatalog,this.allowChangeFirstPoint=t.allowChangeFirstPoint,this.allowSaveTemplates=t.allowSaveTemplates,this.userTemplatesPrefix=t.userTemplatesPrefix,this.lengthStep=t.lengthStep,this.showOnlyTemplates||(this.customTemplates=t.customTemplates?Object.entries(t.customTemplates).map(([n,r])=>{const s=new Mi(r);return s.isCustom=!0,s.id=+n,s}):[],this.customTemplates.push(new Mi))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(t){var r,s;if(!this.allowSaveTemplates)return;const n=new Mi(t);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(t){if(this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===t);n&&n!==-1&&this.customTemplates.splice(n,1)}}const o0={},Ai=i.defineComponent({...o0,__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(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=D.debounce(()=>s("update:value",o.value),a.value),c=u=>{o.value=u,l()};i.watch(()=>r.value,u=>{o.value=u});const d=i.ref(null);return t({focus:()=>{var u;return(u=d.value)==null?void 0:u.focus()},blur:()=>{var u;return(u=d.value)==null?void 0:u.blur()},select:()=>{var u;return(u=d.value)==null?void 0:u.select()}}),(u,g)=>(i.openBlock(),i.createBlock(i.unref(A.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value,"onUpdate:value":[g[0]||(g[0]=m=>o.value=m),c],clearable:u.clearable,placeholder:u.placeholder,min:u.min,max:u.max,step:u.step,validator:u.validator},{prefix:i.withCtx(()=>[i.renderSlot(u.$slots,"prefix")]),_:3},8,["value","clearable","placeholder","min","max","step","validator"]))}}),a0={class:"flex flex-col gap-3"},l0={},Pc=i.defineComponent({...l0,__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","click:view-switch","submit"],setup(e,{emit:t}){const n=e,r=t,s=i.useTemplateRef("first-input-element"),o=i.ref(D.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()})}),(c,d)=>{const h=A.NInput;return i.openBlock(),i.createBlock(i.unref(A.NForm),{disabled:c.isSubmitProcessing,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NFormItem),{required:!0,feedback:c.validation.width.feedback||"","show-feedback":c.validation.width.showFeedback||!1,"validation-status":c.validation.width.validationStatus||void 0,label:`Ширина, ${c.settings.minWidth?" от "+c.settings.minWidth:""}${c.settings.maxWidth?" до "+c.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(Ai,{ref:"first-input-element",value:o.value.width,"onUpdate:value":[d[0]||(d[0]=f=>o.value.width=f),a],class:"w-full",max:c.settings.maxWidth??void 0,min:c.settings.minWidth,validator:f=>!!f&&f>=c.settings.minWidth&&(!c.settings.maxWidth||f<=c.settings.maxWidth),placeholder:"Введите ширину"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(A.NFormItem),{required:!0,feedback:c.validation.length.feedback||"","show-feedback":c.validation.length.showFeedback||!1,"validation-status":c.validation.length.validationStatus||void 0,label:`Длина, ${c.settings.minLength?" от "+c.settings.minLength:""}${c.settings.maxLength?" до "+c.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(Ai,{value:o.value.length,"onUpdate:value":[d[1]||(d[1]=f=>o.value.length=f),a],placeholder:"Введите длину",max:c.settings.maxLength,min:c.settings.minLength,validator:f=>f>=c.settings.minLength&&f<=c.settings.maxLength,class:"w-full"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(A.NFormItem),{required:!0,feedback:c.validation.quantity.feedback||"","show-feedback":c.validation.quantity.showFeedback||!1,"validation-status":c.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:c.value.quantity,placeholder:"Введите количество",min:1,validator:f=>f>0,class:"w-full","onUpdate:value":d[2]||(d[2]=f=>l("quantity",f??0))},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(A.NFormItem),{feedback:c.validation.marker.feedback||"","show-feedback":c.validation.marker.showFeedback||!1,"validation-status":c.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(h,{value:c.value.marker,placeholder:"Введите маркировку","onUpdate:value":d[3]||(d[3]=f=>l("marker",f))},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(Ui,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",a0,[i.createVNode(i.unref(A.NButton),{disabled:c.value.product.isNewRec()||c.isProductSearching||c.isSubmitProcessing||c.value.length===0||c.value.width===0||c.value.quantity===0,type:"primary",class:"self-start",onClick:d[4]||(d[4]=f=>r("submit",c.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"]),c.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[5]||(d[5]=f=>r("click:view-switch"))},{default:i.withCtx(()=>d[6]||(d[6]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[6]})):i.createCommentVNode("",!0)])]),_:1},8,["disabled"])}}}),c0={class:"w-104 px-5"},d0={},h0=i.defineComponent({...d0,__name:"metal-for-doors-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,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(f=>{s.value.product=f}).catch(()=>{a.value=!1}),a.value=!1},d=async()=>{l.value=!0,await(s.value.isNewRec()?Y.HttpRequester.getInstance(Y.CartProvider).addCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1}):Y.HttpRequester.getInstance(Y.CartProvider).patchCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1})),l.value=!1};return(h,f)=>(i.openBlock(),i.createElementBlock("div",c0,[i.createVNode(Pc,{value:s.value,"onUpdate:value":f[0]||(f[0]=p=>s.value=p),validation:o.value,settings:h.settings,"is-submit-processing":l.value,"onUpdate:params":f[1]||(f[1]=p=>c(p)),onSubmit:f[2]||(f[2]=p=>d())},null,8,["value","validation","settings","is-submit-processing"])]))}}),u0={key:0,class:"flex items-baseline gap-1"},f0={key:0,class:"flex items-baseline gap-1"},p0={class:"flex gap-3"},g0={},Fc=i.defineComponent({...g0,__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(e,{emit:t}){const n=e,r=t,s=i.computed(()=>vt.isPhoneDevice()),o=i.ref(D.cloneDeep(i.toRaw(n.value.configuratorParams))),a=i.computed(()=>n.settings.widthOverlaps[o.value.mountType]??0),l=i.computed(()=>n.settings.heightOverlaps[o.value.mountType]??0),c=i.computed(()=>n.settings.maxWidths[o.value.netType]),d=i.computed(()=>n.settings.maxHeights[o.value.netType]-l.value),h=(p,u)=>{p&&p in o.value&&(o.value[p]=u??0),r("update:params",o.value),f("configuratorParams",o.value)},f=(p,u)=>{const g=new Y.CartItemBase(n.value);g[p]=u,r("update:value",g)};return(p,u)=>{const g=A.NInput;return i.openBlock(),i.createBlock(i.unref(A.NForm),{class:"flex flex-col gap-2 px-4 md:max-w-96"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:o.value.netType,"onUpdate:value":[u[0]||(u[0]=m=>o.value.netType=m),h],options:p.settings.netType.map(m=>({label:p.settings.descriptions.net_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:o.value.color,"onUpdate:value":u[1]||(u[1]=m=>o.value.color=m),options:p.settings.color.map(m=>({label:p.settings.descriptions.color[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:o.value.mountType,"onUpdate:value":[u[2]||(u[2]=m=>o.value.mountType=m),h],options:p.settings.mountType.map(m=>({label:p.settings.descriptions.mount_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{required:!0,feedback:p.validation.width.feedback||"","show-feedback":p.validation.width.showFeedback||o.value.width>=p.settings.minWidth&&o.value.width<=p.settings.maxWidths[o.value.netType],"validation-status":p.validation.width.validationStatus||void 0,label:`Ширина светового проёма от ${p.settings.minWidth-a.value} ${c.value?" до "+c.value:""} мм.`},{feedback:i.withCtx(()=>[!p.validation.width.showFeedback&&o.value.width>=p.settings.minWidth&&o.value.width<=p.settings.maxWidths[o.value.netType]?(i.openBlock(),i.createElementBlock("div",u0,[i.createVNode(i.unref(A.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(o.value.width+a.value),1)]),_:1}),i.createVNode(i.unref(A.NButton),{quaternary:"",type:"info",size:"tiny",onClick:u[4]||(u[4]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>u[11]||(u[11]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])),_:1,__:[11]})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Ai,{value:o.value.width&&o.value.width-a.value,max:c.value,min:p.settings.minWidth-a.value,placeholder:"Введите ширину светового проёма",class:"w-full","onUpdate:value":u[3]||(u[3]=m=>h("width",(m&&m+a.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(A.NFormItem),{required:!0,feedback:p.validation.height.feedback||"","show-feedback":p.validation.height.showFeedback||o.value.height>=p.settings.minHeight&&o.value.height<=p.settings.maxHeights[o.value.netType],"validation-status":p.validation.height.validationStatus||void 0,label:`Высота светового проёма от ${p.settings.minHeight-l.value} ${d.value?" до "+d.value:""} мм.`},{feedback:i.withCtx(()=>[!p.validation.height.showFeedback&&o.value.height>=p.settings.minHeight&&o.value.height<=p.settings.maxHeights[o.value.netType]?(i.openBlock(),i.createElementBlock("div",f0,[i.createVNode(i.unref(A.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(o.value.height+l.value),1)]),_:1}),i.createVNode(i.unref(A.NButton),{quaternary:"",type:"info",size:"tiny",onClick:u[6]||(u[6]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>u[12]||(u[12]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])),_:1,__:[12]})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Ai,{value:o.value.height&&o.value.height-l.value,max:d.value,min:p.settings.minHeight-l.value,placeholder:"Введите высоту светового проёма",class:"w-full","onUpdate:value":u[5]||(u[5]=m=>h("height",(m&&m+l.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(A.NFormItem),{required:!0,feedback:p.validation.quantity.feedback||"","show-feedback":p.validation.quantity.showFeedback||!1,"validation-status":p.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:p.value.quantity,"onUpdate:value":u[7]||(u[7]=m=>p.value.quantity=m),min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(A.NFormItem),{feedback:p.validation.marker.feedback||"","show-feedback":p.validation.marker.showFeedback||!1,"validation-status":p.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(g,{value:p.value.marker,"onUpdate:value":u[8]||(u[8]=m=>p.value.marker=m),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(Ui,{"is-product-searching":p.isProductSearching,product:p.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",p0,[i.createVNode(i.unref(A.NButton),{loading:p.isSubmitProcessing,disabled:p.isProductSearching||!p.value.product||p.value.product.isNewRec()||o.value.width<p.settings.minHeight-l.value||o.value.height<p.settings.minHeight-l.value,type:"primary",class:"self-start",onClick:u[9]||(u[9]=m=>r("submit",p.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(p.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,type:"default",onClick:u[10]||(u[10]=m=>r("click:show-preview-drawer"))},{default:i.withCtx(()=>u[13]||(u[13]=[i.createTextVNode(" Предварительный просмотр ")])),_:1,__:[13]})):i.createCommentVNode("",!0)])]),_:1})}}}),m0="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",y0="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",_0="/img/configurators/mosquitto/measurement-instructions/mount.png",b0="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",w0="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",v0={class:"flex flex-col gap-6"},k0={class:"flex gap-4"},x0={class:"flex flex-col gap-2"},C0={class:"flex gap-4"},S0={class:"flex flex-col gap-2"},B0={class:"flex gap-4"},T0={class:"flex flex-col gap-2"},E0={},Mc=i.defineComponent({...E0,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(e,{emit:t}){const n=vt.initRefDependingOnDeviceResolution("small","small","medium"),r=vt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=t;return(a,l)=>{const c=A.NText;return i.openBlock(),i.createBlock(i.unref(A.NModal),{show:a.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",v0,[i.createVNode(c,{type:"error",class:"text-base font-medium"},{default:i.withCtx(()=>l[3]||(l[3]=[i.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ")])),_:1,__:[3]}),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:m0,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:y0,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",k0,[l[9]||(l[9]=i.createElementVNode("img",{src:_0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",x0,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ")),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.frame)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=i.createElementVNode("br",null,null,-1)),l[7]||(l[7]=i.createTextVNode(" Крепления находятся на раме сетки. "))])])]),i.createElementVNode("div",C0,[l[15]||(l[15]=i.createElementVNode("img",{src:b0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",S0,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:")),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=i.createElementVNode("br",null,null,-1)),l[13]||(l[13]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. "))])])]),i.createElementVNode("div",B0,[l[21]||(l[21]=i.createElementVNode("img",{src:w0,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(" Расчетные размеры москитной сетки: ")),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.external_metal)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=i.createElementVNode("br",null,null,-1)),l[19]||(l[19]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. "))])])])])]),_:1},8,["show","size","style"])}}}),$0={class:"flex flex-col items-center justify-between rounded-xl"},N0={class:"img-preview relative flex justify-center"},R0={},P0=i.defineComponent({...R0,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(e,{emit:t}){const n=e,r=i.computed(()=>D.keys(n.settings.crossbarCount).find(o=>n.settings.crossbarCount[Number(o)]&&(!n.settings.crossbarCount[Number(o)+1]||n.configuratorParams.height<n.settings.crossbarCount[Number(o)+1]-n.settings.heightOverlaps[n.configuratorParams.mountType]))),s=t;return(o,a)=>{const l=A.NButton;return i.openBlock(),i.createElementBlock("div",$0,[i.createElementVNode("div",N0,[a[1]||(a[1]=i.createElementVNode("div",{class:"window"},null,-1)),i.createElementVNode("div",{class:i.normalizeClass(["net",`net-${o.configuratorParams.netType}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["frame",`frame-${o.configuratorParams.color}`])},null,2),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${o.configuratorParams.color}`])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["mount",`mount-${o.configuratorParams.mountType}-${o.configuratorParams.color}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["cut-preview",`cut-preview-${o.configuratorParams.mountType}-${o.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,__:[2]})])}}}),ho=jn(P0,[["__scopeId","data-v-8b43aa68"]]),F0={class:"grid md:grid-cols-2"},M0={},A0=i.defineComponent({...M0,__name:"mosquito-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>vt.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),f=async u=>{u.height>0&&u.width>0&&(d.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(n.cartItem.category,u,c.value).then(g=>{l.value.product=g}).catch(()=>{d.value=!1}),d.value=!1)},p=async()=>{h.value=!0,await(l.value.isNewRec()?Y.HttpRequester.getInstance(Y.CartProvider).addCartItem(n.client,l.value).then(u=>{r("submit-success",u)}).catch(()=>{h.value=!1}):Y.HttpRequester.getInstance(Y.CartProvider).patchCartItem(n.client,l.value).then(u=>{r("submit-success",u)}).catch(()=>{h.value=!1})),h.value=!1};return(u,g)=>{const m=Er;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(Mc,{show:a.value,"onUpdate:show":g[0]||(g[0]=y=>a.value=y),"height-overlaps":u.settings.heightOverlaps,"width-overlaps":u.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",F0,[s.value?(i.openBlock(),i.createBlock(i.unref(A.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(A.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(A.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:g[2]||(g[2]=y=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(m)]),_:1})]),default:i.withCtx(()=>[i.createVNode(ho,{"configurator-params":l.value.configuratorParams,settings:u.settings,onOpenInstructions:g[3]||(g[3]=y=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(ho,{key:0,"configurator-params":l.value.configuratorParams,settings:u.settings,onOpenInstructions:g[1]||(g[1]=y=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(Fc,{value:l.value,"onUpdate:value":g[5]||(g[5]=y=>l.value=y),validation:c.value,settings:u.settings,"is-product-searching":d.value,"is-submit-processing":h.value,"onUpdate:params":g[6]||(g[6]=y=>f(y)),onSubmit:g[7]||(g[7]=y=>p()),"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)}}}),I0={},Ac=i.defineComponent({...I0,__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(e,{expose:t,emit:n}){const r=e,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 t({focusWidthInput:c}),(d,h)=>{const f=Fa,p=Pa;return i.openBlock(),i.createBlock(i.unref(A.NFormItem),{label:`Полоса №${d.index+1}, мм`,required:!0},{feedback:i.withCtx(()=>[i.createVNode(Ui,{"is-product-searching":a.value,product:d.product},null,8,["is-product-searching","product"])]),default:i.withCtx(()=>[i.createVNode(i.unref(A.NDropdown),{trigger:"click",options:d.suggestionOption,placement:"bottom-start",size:"large",onSelect:l},{default:i.withCtx(()=>[i.createVNode(Ai,{ref:"width-input-element",value:d.value,class:"w-full",step:d.value<d.settings.minLineWidth?d.settings.minLineWidth-d.value:d.settings.lineWidthStep,validator:u=>!!u&&u>=d.settings.minLineWidth&&u%d.settings.lineWidthStep===0,placeholder:"Введите ширину","onUpdate:value":l},null,8,["value","step","validator"])]),_:1},8,["options"]),i.createVNode(i.unref(A.NButton),{disabled:d.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[0]||(h[0]=u=>s("click:add-line",d.index))},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"]),i.createVNode(i.unref(A.NButton),{disabled:d.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[1]||(h[1]=u=>s("click:remove-line",d.index))},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),_:1},8,["label"])}}}),V0={class:"my-2 flex w-full flex-col"},O0={class:"flex gap-3"},z0={},Ic=i.defineComponent({...z0,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","click:view-switch","submit","click:add-line","click:remove-line"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>n.value[0].configuratorParams.linesWidths.map(h=>h).reduce((h,f)=>h+f,0)),o=i.computed(()=>n.settings.width-s.value),a=i.computed(()=>!n.value.some(({product:h})=>!h)),l=i.computed(()=>o.value===0?void 0:[{label:`${(o.value>0?"Остаток +":"Излишек ")+o.value} мм.`,key:o.value}]),c=(h,f,p)=>{const u=n.value.at(f);if(u)if(h&&h>=n.settings.minLineWidth&&h%n.settings.lineWidthStep===0){const g={linesWidths:u.configuratorParams.linesWidths.toSpliced(f,1,h)};r("update:params",g,f,p),d("configuratorParams",g)}else u.product.id=-1},d=(h,f)=>{const p=n.value.map(u=>new Y.CartItemBase(u));p.forEach(u=>{u[h]=f}),r("update:value",p)};return(h,f)=>{const p=A.NText,u=A.NInput;return i.openBlock(),i.createBlock(i.unref(A.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>{var g;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,(m,y)=>(i.openBlock(),i.createBlock(Ac,{key:y,"auto-focus":!0,index:y,value:m.configuratorParams.linesWidths.at(y)??0,product:m.product,settings:h.settings,"suggestion-option":l.value,"add-line-button-disabled":o.value<=0||h.value.length>=h.settings.maxLinesCount,"remove-line-button-disabled":h.value.length===1,"onUpdate:value":c,"onClick:addLine":f[0]||(f[0]=_=>r("click:add-line",_)),"onClick:removeLine":f[1]||(f[1]=_=>r("click:remove-line",_))},null,8,["index","value","product","settings","suggestion-option","add-line-button-disabled","remove-line-button-disabled"]))),128)),i.createElementVNode("div",V0,[o.value<0?(i.openBlock(),i.createBlock(p,{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(h.settings.width),1)]),_:1})):i.createCommentVNode("",!0),a.value&&h.value.length===h.settings.maxLinesCount&&o.value>0?(i.openBlock(),i.createBlock(p,{key:1,type:"error"},{default:i.withCtx(()=>f[8]||(f[8]=[i.createTextVNode(" Остаток резки должен быть равен 0 ")])),_:1,__:[8]})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[f[9]||(f[9]=i.createTextVNode(" Остаток для резки: ")),i.createVNode(p,{type:o.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(o.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(h.settings.width)+" мм ",1)])]),i.createVNode(i.unref(A.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value<=0||h.value.length>=h.settings.maxLinesCount,type:"primary",class:"self-center",onClick:f[2]||(f[2]=m=>r("click:add-line",h.value.length))},{default:i.withCtx(()=>f[10]||(f[10]=[i.createTextVNode(" Добавить полосу ")])),_:1,__:[10]},8,["loading","disabled"]),i.createVNode(i.unref(A.NFormItem),{required:!0,label:`Метраж ${h.settings.minLength?" от "+h.settings.minLength:""} ${h.settings.maxLength?" до "+h.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:n.value[0].length,max:h.settings.maxLength||void 0,min:h.settings.minLength,step:h.settings.lengthStep,validator:m=>m%h.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full","onUpdate:value":f[3]||(f[3]=m=>d("length",m??0))},null,8,["value","max","min","step","validator"])]),_:1},8,["label"]),i.createVNode(i.unref(A.NFormItem),{required:!0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:n.value[0].quantity,min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full","onUpdate:value":f[4]||(f[4]=m=>d("quantity",m??0))},null,8,["value","validator"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(u,{value:n.value[0].marker,placeholder:"Введите маркировку","onUpdate:value":f[5]||(f[5]=m=>d("marker",m))},null,8,["value"])]),_:1}),i.createElementVNode("div",O0,[i.createVNode(i.unref(A.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value!=0||!((g=h.value[0])!=null&&g.length)||h.value[0].length>h.settings.maxLength||h.value[0].length<h.settings.minLength||h.value[0].quantity===0,type:"primary",class:"self-start",onClick:f[6]||(f[6]=m=>r("submit",h.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),h.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,type:"tertiary",class:"self-start",onClick:f[7]||(f[7]=m=>r("click:view-switch"))},{default:i.withCtx(()=>f[11]||(f[11]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[11]})):i.createCommentVNode("",!0)])]}),_:1})}}}),L0={class:"flex grow flex-col"},D0=["src"],H0={class:"w-full"},W0={},Vc=i.defineComponent({...W0,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",L0,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,D0),i.createElementVNode("div",H0,[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)])]))}}),j0={class:"w-104 flex grow flex-col px-5"},X0={},q0=i.defineComponent({...X0,__name:"strip-configurator",props:{settings:{},cartItems:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.cartItems),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.computed(()=>s.value[0].configuratorParams.linesWidths.map(p=>p).reduce((p,u)=>p+u,0)),c=p=>{p===void 0&&(p=s.value.length-1);const u=s.value.at(0);if(!u)return;u.configuratorParams.linesWidths=u.configuratorParams.linesWidths.toSpliced(p+1,0,0),s.value.forEach(m=>{m.configuratorParams.linesWidths=u.configuratorParams.linesWidths});const g=new Y.CartItemBase({quantity:(u==null?void 0:u.quantity)??1,category:u==null?void 0:u.category,length:(u==null?void 0:u.length)??n.settings.minLength,marker:u==null?void 0:u.marker,configuratorParams:{linesWidths:u==null?void 0:u.configuratorParams.linesWidths}});s.value=s.value.toSpliced(p+1,0,g)},d=p=>{const u=s.value.at(0);u&&(u.configuratorParams.linesWidths=u.configuratorParams.linesWidths.toSpliced(p,1),s.value.forEach(g=>{g.configuratorParams.linesWidths=u.configuratorParams.linesWidths}),s.value=s.value.toSpliced(p,1),delete o[`linesWidths.${p}`],delete o[`linesWidths.${p}`])},h=async(p,u,g)=>{g.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(s.value[u].category,{linesWidths:p.linesWidths.at(u)},o.value).then(m=>{s.value[u].product=m,s.value.length<n.settings.maxLinesCount&&l.value<n.settings.width&&c()}).catch(()=>{s.value[u].product=new Y.Product,g.value=!1}),g.value=!1},f=async()=>{a.value=!0,await(s.value[0].isNewRec()?Y.HttpRequester.getInstance(Y.CartProvider).addCartItem(n.client,s.value[0]).then(p=>{r("submit-success",p)}).catch(()=>{a.value=!1}):Y.HttpRequester.getInstance(Y.CartProvider).patchCartItem(n.client,s.value[0]).then(p=>{r("submit-success",p)}).catch(()=>{a.value=!1})),a.value=!1};return(p,u)=>(i.openBlock(),i.createElementBlock("div",j0,[i.createVNode(Vc,{value:s.value,"onUpdate:value":u[0]||(u[0]=g=>s.value=g),settings:p.settings},null,8,["value","settings"]),i.createVNode(Ic,{value:s.value,"onUpdate:value":u[1]||(u[1]=g=>s.value=g),validation:o.value,settings:p.settings,"is-submit-processing":a.value,"onUpdate:params":h,onSubmit:f,"onClick:addLine":c,"onClick:removeLine":d},null,8,["value","validation","settings","is-submit-processing"])]))}}),Y0={class:"flex flex-row gap-2.5"},U0={class:"flex flex-col"},G0={class:"flex flex-col"},K0={},Z0=i.defineComponent({...K0,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>Y.AppConfigProvider.getConfig().dateFormats.uiDate},predefinedDateRanges:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1}},emits:["update:date-range"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>{if(n.predefinedDateRanges)return n.predefinedDateRanges;if(n.useDefaultPredefinedDateRanges){const a={};return D.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?Nn.startOfDay(new Date(a)):void 0,to:l?Nn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,f,p,u;const c=A.NButton,d=A.NDatePicker;return i.openBlock(),i.createElementBlock("div",Y0,[i.createVNode(d,{value:(f=(h=a.dateRange)==null?void 0:h.from)==null?void 0:f.getTime(),clearable:a.clearable,"is-date-disabled":g=>{var m,y;return((m=a.dateRange)==null?void 0:m.to)&&g>((y=a.dateRange)==null?void 0:y.to)},format:a.dateFormat,type:"date",onUpdateValue:l[0]||(l[0]=g=>{var m,y;return o(g,(y=(m=a.dateRange)==null?void 0:m.to)==null?void 0:y.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",U0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(g,m)=>(i.openBlock(),i.createBlock(c,{key:m,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:y=>{var _,b;return o((_=g==null?void 0:g.from)==null?void 0:_.getTime(),(b=g==null?void 0:g.to)==null?void 0:b.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(g.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","format"]),i.createVNode(d,{value:(u=(p=a.dateRange)==null?void 0:p.to)==null?void 0:u.getTime(),clearable:a.clearable,"is-date-disabled":g=>{var m,y;return((m=a.dateRange)==null?void 0:m.from)&&g<((y=a.dateRange)==null?void 0:y.from)},format:a.dateFormat,type:"date",onUpdateValue:l[1]||(l[1]=g=>{var m,y;return o((y=(m=a.dateRange)==null?void 0:m.from)==null?void 0:y.getTime(),g)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",G0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(g,m)=>(i.openBlock(),i.createBlock(c,{key:m,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:y=>{var _,b;return o((_=g==null?void 0:g.from)==null?void 0:_.getTime(),(b=g==null?void 0:g.to)==null?void 0:b.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(g.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","format"])])}}}),J0={class:"sc-lbl-date text-nowrap"},Q0={},uo=i.defineComponent({...Q0,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>Nn.format(t.date,Y.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Nn.format(t.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":s.isTimeOnSecondLine})},[i.createElementVNode("span",J0,i.toDisplayString(n.value),1),i.createElementVNode("span",{class:i.normalizeClass([{"text-sc-grey":s.isTimeSecondary,"ml-1":!s.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)],2))}}),ey={class:"flex flex-row gap-2.5"},ty={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},ny={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},iy={class:"mb-0.5 sm:mb-0 sm:ml-3"},ry={},sy=i.defineComponent({...ry,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(e){return(t,n)=>{const r=Er,s=A.NButton,o=A.NPopover;return i.openBlock(),i.createElementBlock("div",ey,[i.createElementVNode("div",ty,[i.renderSlot(t.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",ny,[i.renderSlot(t.$slots,"extra-buttons"),i.createElementVNode("div",iy,[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=>t.$emit("close"))},{default:i.withCtx(()=>[i.createVNode(r)]),_:1})]),default:i.withCtx(()=>[n[1]||(n[1]=i.createTextVNode(" Закрыть "))]),_:1,__:[1]})):i.createCommentVNode("",!0)])])])])}}}),oy={key:0,class:"flex flex-row gap-2.5"},ay={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},ly={},cy=i.defineComponent({...ly,__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:"Отмена"})}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=vt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=vt.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)},f=(u="other")=>{if(a.value){s("processing:cancel",_=>{a.value=_});return}let g=!1;s("closing",u,()=>{g=!0}),g||(o.value=!1,s("update:show",o.value))},p=()=>{s("accept",g=>{a.value=g})};return i.watch(()=>r.show,u=>{u?h():f("other")}),i.watch(()=>r.processing,u=>{a.value=u}),t({open:h,close:f}),(u,g)=>{const m=A.NButton,y=A.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:u.title,"action-class":u.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:g[1]||(g[1]=_=>f("header")),onEsc:g[2]||(g[2]=_=>f("esc")),onMaskClick:g[3]||(g[3]=_=>f("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(u.$slots,"default")]),_:2},[u.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(u.$slots,"header")]),key:"0"}:void 0,u.$slots.action||u.$slots["extra-action"]||u.acceptButton.show||u.cancelButton.show?{name:"action",fn:i.withCtx(()=>[u.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",oy,[i.renderSlot(u.$slots,"extra-action")])):i.createCommentVNode("",!0),u.$slots.action||u.acceptButton.show||u.cancelButton.show?(i.openBlock(),i.createElementBlock("div",ay,[i.renderSlot(u.$slots,"action",{disabled:a.value}),u.acceptButton.show??!0?(i.openBlock(),i.createBlock(m,{key:0,disabled:a.value||!u.valid,size:i.unref(l),type:"primary",onClick:p},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(u.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),u.cancelButton.show??!0?(i.openBlock(),i.createBlock(m,{key:1,size:i.unref(l),type:"default",onClick:g[0]||(g[0]=_=>f("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(u.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","action-class"])}}}),dy={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function hy(e,t){return i.openBlock(),i.createElementBlock("svg",dy,t[0]||(t[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 uy=i.markRaw({name:"ion-download-outline",render:hy}),fy={},py=i.defineComponent({...fy,__name:"single-file-upload-selector",props:{draggedAreaText:{}},emits:["update:file"],setup(e,{emit:t}){const n=t,r=i.ref({name:"",content:""}),s=o=>{if(r.value={name:"",content:""},o.length===0)return;const a=o[0];r.value.name=a.name;const l=new FileReader;l.addEventListener("load",()=>{r.value.content=l.result??"",n("update:file",r.value)}),l.readAsDataURL(a.file)};return(o,a)=>{const l=uy,c=A.NUploadDragger,d=A.NUpload;return i.openBlock(),i.createBlock(d,{"default-upload":!1,max:1,action:"","directory-dnd":"",class:"content-center","onUpdate:fileList":s},{default:i.withCtx(()=>[i.createVNode(c,null,{default:i.withCtx(()=>[i.renderSlot(o.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(l,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(o.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3})}}}),gy={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function my(e,t){return i.openBlock(),i.createElementBlock("svg",gy,t[0]||(t[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 yy=i.markRaw({name:"ion-checkmark-done-sharp",render:my}),_y={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function by(e,t){return i.openBlock(),i.createElementBlock("svg",_y,t[0]||(t[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 wy=i.markRaw({name:"ion-options-outline",render:by}),vy={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},ky={class:"flex-auto"},xy={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"},Cy={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"},Sy={},fo=i.defineComponent({...Sy,__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(e,{emit:t}){const n=t,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=wy,f=A.NButton,p=A.NPopover,u=yy,g=Er;return i.openBlock(),i.createElementBlock("div",vy,[i.createElementVNode("div",ky,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",xy,[i.createElementVNode("div",Cy,[c.showEditButton?(i.openBlock(),i.createBlock(p,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:c.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,__:[0]})):i.createCommentVNode("",!0),c.showApplyButton?(i.openBlock(),i.createBlock(p,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:c.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения "))]),_:1,__:[1]},8,["disabled"])):i.createCommentVNode("",!0),c.showCancelButton?(i.openBlock(),i.createBlock(p,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:c.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,__:[2]})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),By={},Oc=i.defineComponent({...By,__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(e,{emit:t}){const n=e,r=t,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(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[s.value?(i.openBlock(),i.createBlock(fo,{key:1,disabled:l.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:l.disabled,"show-edit-button":l.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"]))]))}}),Ty={},Ey=i.defineComponent({...Ty,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.value),o=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=D.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(A.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:c.clearable,placeholder:c.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),$y={},Ny=i.defineComponent({...$y,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref((n.value??"").replaceAll(/\D*/g,"")),o=D.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(D.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(D.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof Xi.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=Xi.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof Xi.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(Wh.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=h=>s.value=h),a],"auto-default-country":!1,"auto-format":!0,"default-country":c.defaultCountry,disabled:c.disabled,"input-options":{placeholder:c.placeholder},"preferred-countries":c.preferredCountries,"only-countries":c.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),Ry=jn(Ny,[["__scopeId","data-v-751dbb0e"]]),Py={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Fy(e,t){return i.openBlock(),i.createElementBlock("svg",Py,t[0]||(t[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 My=i.markRaw({name:"tabler-external-link",render:Fy}),Ay={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},Iy=["href"],Vy={},Oy=i.defineComponent({...Vy,__name:"external-link",props:{text:{},url:{},description:{}},setup(e){return(t,n)=>{const r=My,s=A.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(D.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",Ay,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,Iy),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),zy={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ly(e,t){return i.openBlock(),i.createElementBlock("svg",zy,t[0]||(t[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 Dy=i.markRaw({name:"ion-remove-circle-outline",render:Ly});let ts=[];const zc=new WeakMap;function Hy(){ts.forEach(e=>e(...zc.get(e))),ts=[]}function Lc(e,...t){zc.set(e,t),!ts.includes(e)&&ts.push(e)===1&&requestAnimationFrame(Hy)}function ar(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function lr(e){return e.composedPath()[0]||null}function cr(e){return typeof e=="string"?e.endsWith("px")?Number(e.slice(0,e.length-2)):Number(e):e}function dr(e){if(e!=null)return typeof e=="number"?`${e}px`:e.endsWith("px")?e:`${e}px`}function Ut(e,t){const n=e.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]:"+e+" is not a valid value.")}return t===void 0?r:r[t]}const Dc={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 Wy(e,t,n){t/=100,n/=100;let r=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function jy(e,t,n){t/=100,n/=100;let r=t*Math.min(n,1-n),s=(o,a=(o+e/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 on="^\\s*",an="\\s*$",In="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",zt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",oi="([0-9A-Fa-f])",ai="([0-9A-Fa-f]{2})",Hc=new RegExp(`${on}hsl\\s*\\(${zt},${In},${In}\\)${an}`),Wc=new RegExp(`${on}hsv\\s*\\(${zt},${In},${In}\\)${an}`),jc=new RegExp(`${on}hsla\\s*\\(${zt},${In},${In},${zt}\\)${an}`),Xc=new RegExp(`${on}hsva\\s*\\(${zt},${In},${In},${zt}\\)${an}`),Xy=new RegExp(`${on}rgb\\s*\\(${zt},${zt},${zt}\\)${an}`),qy=new RegExp(`${on}rgba\\s*\\(${zt},${zt},${zt},${zt}\\)${an}`),Yy=new RegExp(`${on}#${oi}${oi}${oi}${an}`),Uy=new RegExp(`${on}#${ai}${ai}${ai}${an}`),Gy=new RegExp(`${on}#${oi}${oi}${oi}${oi}${an}`),Ky=new RegExp(`${on}#${ai}${ai}${ai}${ai}${an}`);function Rt(e){return parseInt(e,16)}function Zy(e){try{let t;if(t=jc.exec(e))return[is(t[1]),Vn(t[5]),Vn(t[9]),ci(t[13])];if(t=Hc.exec(e))return[is(t[1]),Vn(t[5]),Vn(t[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${e}.`)}catch(t){throw t}}function Jy(e){try{let t;if(t=Xc.exec(e))return[is(t[1]),Vn(t[5]),Vn(t[9]),ci(t[13])];if(t=Wc.exec(e))return[is(t[1]),Vn(t[5]),Vn(t[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${e}.`)}catch(t){throw t}}function li(e){try{let t;if(t=Uy.exec(e))return[Rt(t[1]),Rt(t[2]),Rt(t[3]),1];if(t=Xy.exec(e))return[gt(t[1]),gt(t[5]),gt(t[9]),1];if(t=qy.exec(e))return[gt(t[1]),gt(t[5]),gt(t[9]),ci(t[13])];if(t=Yy.exec(e))return[Rt(t[1]+t[1]),Rt(t[2]+t[2]),Rt(t[3]+t[3]),1];if(t=Ky.exec(e))return[Rt(t[1]),Rt(t[2]),Rt(t[3]),ci(Rt(t[4])/255)];if(t=Gy.exec(e))return[Rt(t[1]+t[1]),Rt(t[2]+t[2]),Rt(t[3]+t[3]),ci(Rt(t[4]+t[4])/255)];if(e in Dc)return li(Dc[e]);if(Hc.test(e)||jc.test(e)){const[n,r,s,o]=Zy(e);return[...jy(n,r,s),o]}else if(Wc.test(e)||Xc.test(e)){const[n,r,s,o]=Jy(e);return[...Wy(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(t){throw t}}function Qy(e){return e>1?1:e<0?0:e}function po(e,t,n,r){return`rgba(${gt(e)}, ${gt(t)}, ${gt(n)}, ${Qy(r)})`}function go(e,t,n,r,s){return gt((e*t*(1-r)+n*r)/s)}function e_(e,t){Array.isArray(e)||(e=li(e)),Array.isArray(t)||(t=li(t));const n=e[3],r=t[3],s=ci(n+r-n*r);return po(go(e[0],n,t[0],r,s),go(e[1],n,t[1],r,s),go(e[2],n,t[2],r,s),s)}function Re(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:li(e);return typeof t.alpha=="number"?po(n,r,s,t.alpha):po(n,r,s,o)}function ns(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:li(e),{lightness:a=1,alpha:l=1}=t;return t_([n*a,r*a,s*a,o*l])}function ci(e){const t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function is(e){const t=Math.round(Number(e));return t>=360||t<0?0:t}function gt(e){const t=Math.round(Number(e));return t>255?255:t<0?0:t}function Vn(e){const t=Math.round(Number(e));return t>100?100:t<0?0:t}function t_(e){const[t,n,r]=e;return 3 in e?`rgba(${gt(t)}, ${gt(n)}, ${gt(r)}, ${ci(e[3])})`:`rgba(${gt(t)}, ${gt(n)}, ${gt(r)}, 1)`}function n_(e=8){return Math.random().toString(16).slice(2,2+e)}function qc(e){return Array.isArray(e)?e:[e]}const mo={STOP:"STOP"};function Yc(e,t){const n=t(e);e.children!==void 0&&n!==mo.STOP&&e.children.forEach(r=>Yc(r,t))}function i_(e,t={}){const{preserveGroup:n=!1}=t,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(e),r}function r_(e,t){const{isLeaf:n}=e;return n!==void 0?n:!t(e)}function s_(e){return e.children}function o_(e){return e.key}function a_(){return!1}function l_(e,t){const{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function c_(e){return e.disabled===!0}function d_(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function h_(e,t){if(e.isLeaf===!0){const n=t(e);if(Array.isArray(n)&&n.length>0)return!0}return!1}function yo(e){var t;return e==null?[]:Array.isArray(e)?e:(t=e.checkedKeys)!==null&&t!==void 0?t:[]}function _o(e){var t;return e==null||Array.isArray(e)?[]:(t=e.indeterminateKeys)!==null&&t!==void 0?t:[]}function u_(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function f_(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function p_(e){return(e==null?void 0:e.type)==="group"}function g_(e){const t=new Map;return e.forEach((n,r)=>{t.set(n.key,r)}),n=>{var r;return(r=t.get(n))!==null&&r!==void 0?r:null}}class m_ extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function y_(e,t,n,r){return rs(t.concat(e),n,r,!1)}function __(e,t){const n=new Set;return e.forEach(r=>{const s=t.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 b_(e,t,n,r){const s=rs(t,n,r,!1),o=rs(e,n,r,!0),a=__(e,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function bo(e,t){const{checkedKeys:n,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=e;if(!a)return r!==void 0?{checkedKeys:u_(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:f_(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=t;let f;s!==void 0?f=b_(s,n,t,d):r!==void 0?f=y_(r,n,t,d):f=rs(n,t,d,!1);const p=c==="parent",u=c==="child"||l,g=f,m=new Set,y=Math.max.apply(null,Array.from(h.keys()));for(let _=y;_>=0;_-=1){const b=_===0,S=h.get(_);for(const x of S){if(x.isLeaf)continue;const{key:v,shallowLoaded:B}=x;if(u&&B&&x.children.forEach(R=>{!R.disabled&&!R.isLeaf&&R.shallowLoaded&&g.has(R.key)&&g.delete(R.key)}),x.disabled||!B)continue;let k=!0,N=!1,P=!0;for(const R of x.children){const W=R.key;if(!R.disabled){if(P&&(P=!1),g.has(W))N=!0;else if(m.has(W)){N=!0,k=!1;break}else if(k=!1,N)break}}k&&!P?(p&&x.children.forEach(R=>{!R.disabled&&g.has(R.key)&&g.delete(R.key)}),g.add(v)):N&&m.add(v),b&&u&&g.has(v)&&g.delete(v)}}return{checkedKeys:Array.from(g),indeterminateKeys:Array.from(m)}}function rs(e,t,n,r){const{treeNodeMap:s,getChildren:o}=t,a=new Set,l=new Set(e);return e.forEach(c=>{const d=s.get(c);d!==void 0&&Yc(d,h=>{if(h.disabled)return mo.STOP;const{key:f}=h;if(!a.has(f)&&(a.add(f),l.add(f),d_(h.rawNode,o))){if(r)return mo.STOP;if(!n)throw new m_}})}),l}function w_(e,{includeGroup:t=!1,includeSelf:n=!0},r){var s;const o=r.treeNodeMap;let a=e==null?null:(s=o.get(e))!==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&&(t||!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 v_(e){if(e.length===0)return null;const t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function k_(e,t){const n=e.siblings,r=n.length,{index:s}=e;return t?n[(s+1)%r]:s===n.length-1?null:n[s+1]}function Uc(e,t,{loop:n=!1,includeDisabled:r=!1}={}){const s=t==="prev"?x_:k_,o={reverse:t==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===e){if(!a)a=!0;else if(!e.disabled&&!e.isGroup){l=e;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const h=wo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const f=C_(d);f!=null&&f.isGroup?c(s(f,n)):n&&c(s(d,!0))}}}}return c(e),l}function x_(e,t){const n=e.siblings,r=n.length,{index:s}=e;return t?n[(s-1+r)%r]:s===0?null:n[s-1]}function C_(e){return e.parent}function wo(e,t={}){const{reverse:n=!1}=t,{children:r}=e;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=wo(d,t);if(h!==null)return h}else return d}}return null}const S_={getChild(){return this.ignored?null:wo(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return Uc(this,"next",e)},getPrev(e={}){return Uc(this,"prev",e)}};function B_(e,t){const n=t?new Set(t):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(e),r}function T_(e,t){const n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}var E_={};function Gc(e,t,n,r,s,o=null,a=0){const l=[];return e.forEach((c,d)=>{var h;E_.NODE_ENV!=="production"&&h_(c,s)&&console.error("[treemate]: node",c,"is invalid");const f=Object.create(r);if(f.rawNode=c,f.siblings=l,f.level=a,f.index=d,f.isFirstChild=d===0,f.isLastChild=d+1===e.length,f.parent=o,!f.ignored){const p=s(c);Array.isArray(p)&&(f.children=Gc(p,t,n,r,s,f,a+1))}l.push(f),t.set(f.key,f),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(f)}),l}function $_(e,t={}){var n;const r=new Map,s=new Map,{getDisabled:o=c_,getIgnored:a=a_,getIsGroup:l=p_,getKey:c=o_}=t,d=(n=t.getChildren)!==null&&n!==void 0?n:s_,h=t.ignoreEmptyChildren?x=>{const v=d(x);return Array.isArray(v)?v.length?v:null:v}:d,f=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return r_(this.rawNode,h)},get shallowLoaded(){return l_(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(x){return T_(this,x)}},S_),p=Gc(e,r,s,f,h);function u(x){if(x==null)return null;const v=r.get(x);return v&&!v.isGroup&&!v.ignored?v:null}function g(x){if(x==null)return null;const v=r.get(x);return v&&!v.ignored?v:null}function m(x,v){const B=g(x);return B?B.getPrev(v):null}function y(x,v){const B=g(x);return B?B.getNext(v):null}function _(x){const v=g(x);return v?v.getParent():null}function b(x){const v=g(x);return v?v.getChild():null}const S={treeNodes:p,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(x){return B_(p,x)},getNode:u,getPrev:m,getNext:y,getParent:_,getChild:b,getFirstAvailableNode(){return v_(p)},getPath(x,v={}){return w_(x,v,S)},getCheckedKeys(x,v={}){const{cascade:B=!0,leafOnly:k=!1,checkStrategy:N="all",allowNotLoaded:P=!1}=v;return bo({checkedKeys:yo(x),indeterminateKeys:_o(x),cascade:B,leafOnly:k,checkStrategy:N,allowNotLoaded:P},S)},check(x,v,B={}){const{cascade:k=!0,leafOnly:N=!1,checkStrategy:P="all",allowNotLoaded:R=!1}=B;return bo({checkedKeys:yo(v),indeterminateKeys:_o(v),keysToCheck:x==null?[]:qc(x),cascade:k,leafOnly:N,checkStrategy:P,allowNotLoaded:R},S)},uncheck(x,v,B={}){const{cascade:k=!0,leafOnly:N=!1,checkStrategy:P="all",allowNotLoaded:R=!1}=B;return bo({checkedKeys:yo(v),indeterminateKeys:_o(v),keysToUncheck:x==null?[]:qc(x),cascade:k,leafOnly:N,checkStrategy:P,allowNotLoaded:R},S)},getNonLeafKeys(x={}){return i_(p,x)}};return S}function ss(e){return e.composedPath()[0]}const N_={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function R_(e,t,n){if(e==="mousemoveoutside"){const r=s=>{t.contains(ss(s))||n(s)};return{mousemove:r,touchstart:r}}else if(e==="clickoutside"){let r=!1;const s=a=>{r=!t.contains(ss(a))},o=a=>{r&&(t.contains(ss(a))||n(a))};return{mousedown:s,mouseup:o,touchstart:s,touchend:o}}return console.error(`[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`),{}}function Kc(e,t,n){const r=N_[e];let s=r.get(t);s===void 0&&r.set(t,s=new WeakMap);let o=s.get(n);return o===void 0&&s.set(n,o=R_(e,t,n)),o}function P_(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=Kc(e,t,n);return Object.keys(s).forEach(o=>{Bt(o,document,s[o],r)}),!0}return!1}function F_(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=Kc(e,t,n);return Object.keys(s).forEach(o=>{it(o,document,s[o],r)}),!0}return!1}function M_(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const e=new WeakMap,t=new WeakMap;function n(){e.set(this,!0)}function r(){e.set(this,!0),t.set(this,!0)}function s(k,N,P){const R=k[N];return k[N]=function(){return P.apply(k,arguments),R.apply(k,arguments)},k}function o(k,N){k[N]=Event.prototype[N]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var k;return(k=a.get(this))!==null&&k!==void 0?k:null}function d(k,N){l!==void 0&&Object.defineProperty(k,"currentTarget",{configurable:!0,enumerable:!0,get:N??l.get})}const h={bubble:{},capture:{}},f={};function p(){const k=function(N){const{type:P,eventPhase:R,bubbles:W}=N,q=ss(N);if(R===2)return;const F=R===1?"capture":"bubble";let M=q;const V=[];for(;M===null&&(M=window),V.push(M),M!==window;)M=M.parentNode||null;const K=h.capture[P],T=h.bubble[P];if(s(N,"stopPropagation",n),s(N,"stopImmediatePropagation",r),d(N,c),F==="capture"){if(K===void 0)return;for(let $=V.length-1;$>=0&&!e.has(N);--$){const j=V[$],z=K.get(j);if(z!==void 0){a.set(N,j);for(const U of z){if(t.has(N))break;U(N)}}if($===0&&!W&&T!==void 0){const U=T.get(j);if(U!==void 0)for(const I of U){if(t.has(N))break;I(N)}}}}else if(F==="bubble"){if(T===void 0)return;for(let $=0;$<V.length&&!e.has(N);++$){const j=V[$],z=T.get(j);if(z!==void 0){a.set(N,j);for(const U of z){if(t.has(N))break;U(N)}}}}o(N,"stopPropagation"),o(N,"stopImmediatePropagation"),d(N)};return k.displayName="evtdUnifiedHandler",k}function u(){const k=function(N){const{type:P,eventPhase:R}=N;if(R!==2)return;const W=f[P];W!==void 0&&W.forEach(q=>q(N))};return k.displayName="evtdUnifiedWindowEventHandler",k}const g=p(),m=u();function y(k,N){const P=h[k];return P[N]===void 0&&(P[N]=new Map,window.addEventListener(N,g,k==="capture")),P[N]}function _(k){return f[k]===void 0&&(f[k]=new Set,window.addEventListener(k,m)),f[k]}function b(k,N){let P=k.get(N);return P===void 0&&k.set(N,P=new Set),P}function S(k,N,P,R){const W=h[N][P];if(W!==void 0){const q=W.get(k);if(q!==void 0&&q.has(R))return!0}return!1}function x(k,N){const P=f[k];return!!(P!==void 0&&P.has(N))}function v(k,N,P,R){let W;if(typeof R=="object"&&R.once===!0?W=K=>{B(k,N,W,R),P(K)}:W=P,P_(k,N,W,R))return;const F=R===!0||typeof R=="object"&&R.capture===!0?"capture":"bubble",M=y(F,k),V=b(M,N);if(V.has(W)||V.add(W),N===window){const K=_(k);K.has(W)||K.add(W)}}function B(k,N,P,R){if(F_(k,N,P,R))return;const q=R===!0||typeof R=="object"&&R.capture===!0,F=q?"capture":"bubble",M=y(F,k),V=b(M,N);if(N===window&&!S(N,q?"bubble":"capture",k,P)&&x(k,P)){const T=f[k];T.delete(P),T.size===0&&(window.removeEventListener(k,m),f[k]=void 0)}V.has(P)&&V.delete(P),V.size===0&&M.delete(N),M.size===0&&(window.removeEventListener(k,g,F==="capture"),h[F][k]=void 0)}return{on:v,off:B}}const{on:Bt,off:it}=M_(),Ii="@@mmoContext",A_={mounted(e,{value:t}){e[Ii]={handler:void 0},typeof t=="function"&&(e[Ii].handler=t,Bt("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[Ii];typeof t=="function"?n.handler?n.handler!==t&&(it("mousemoveoutside",e,n.handler),n.handler=t,Bt("mousemoveoutside",e,t)):(e[Ii].handler=t,Bt("mousemoveoutside",e,t)):n.handler&&(it("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[Ii];t&&it("mousemoveoutside",e,t),e[Ii].handler=void 0}},Vi="@@coContext",os={mounted(e,{value:t,modifiers:n}){e[Vi]={handler:void 0},typeof t=="function"&&(e[Vi].handler=t,Bt("clickoutside",e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){const r=e[Vi];typeof t=="function"?r.handler?r.handler!==t&&(it("clickoutside",e,r.handler,{capture:n.capture}),r.handler=t,Bt("clickoutside",e,t,{capture:n.capture})):(e[Vi].handler=t,Bt("clickoutside",e,t,{capture:n.capture})):r.handler&&(it("clickoutside",e,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:n}=e[Vi];n&&it("clickoutside",e,n,{capture:t.capture}),e[Vi].handler=void 0}};function I_(e,t){console.error(`[vdirs/${e}]: ${t}`)}class V_{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(t,n){const{elementZIndex:r}=this;if(n!==void 0){t.style.zIndex=`${n}`,r.delete(t);return}const{nextZIndex:s}=this;r.has(t)&&r.get(t)+1===this.nextZIndex||(t.style.zIndex=`${s}`,r.set(t,s),this.nextZIndex=s+1,this.squashState())}unregister(t,n){const{elementZIndex:r}=this;r.has(t)?r.delete(t):n===void 0&&I_("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:t}=this;t||(this.nextZIndex=2e3),this.nextZIndex-t>2500&&this.rearrange()}rearrange(){const t=Array.from(this.elementZIndex.entries());t.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,t.forEach(n=>{const r=n[0],s=this.nextZIndex++;`${s}`!==r.style.zIndex&&(r.style.zIndex=`${s}`)})}}const vo=new V_,Oi="@@ziContext",Zc={mounted(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n;e[Oi]={enabled:!!s,initialized:!1},s&&(vo.ensureZIndex(e,r),e[Oi].initialized=!0)},updated(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n,o=e[Oi].enabled;s&&!o&&(vo.ensureZIndex(e,r),e[Oi].initialized=!0),e[Oi].enabled=!!s},unmounted(e,t){if(!e[Oi].initialized)return;const{value:n={}}=t,{zIndex:r}=n;vo.unregister(e,r)}};function O_(e){const t=i.ref(!!e.value);if(t.value)return i.readonly(t);const n=i.watch(e,r=>{r&&(t.value=!0,n())});return i.readonly(t)}function jt(e){const t=i.computed(e),n=i.ref(t.value);return i.watch(t,r=>{n.value=r}),typeof e=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){e.set(r)}}}const z_=typeof window<"u";let zi,hr;(()=>{var e,t;zi=z_?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,hr=!1,zi!==void 0?zi.then(()=>{hr=!0}):hr=!0})();function L_(e){if(hr)return;let t=!1;i.onMounted(()=>{hr||zi==null||zi.then(()=>{t||e()})}),i.onBeforeUnmount(()=>{t=!0})}function ko(e,t){return i.watch(e,n=>{n!==void 0&&(t.value=n)}),i.computed(()=>e.value===void 0?t.value:e.value)}function as(){const e=i.ref(!1);return i.onMounted(()=>{e.value=!0}),i.readonly(e)}function Jc(e,t){return i.computed(()=>{for(const n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}const D_=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function H_(){return D_}function xo(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function Co(e,t=!0,n=[]){return e.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)){Co(r,t,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Co(r.children,t,n)}else r.type!==i.Comment&&n.push(r)}}),n}function Qc(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);const s=Co(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}let On=null;function ed(){if(On===null&&(On=document.getElementById("v-binder-view-measurer"),On===null)){On=document.createElement("div"),On.id="v-binder-view-measurer";const{style:e}=On;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(On)}return On.getBoundingClientRect()}function W_(e,t){const n=ed();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function So(e){const t=e.getBoundingClientRect(),n=ed();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function j_(e){return e.nodeType===9?null:e.parentNode}function td(e){if(e===null)return null;const t=j_(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(n+s+r))return t}return td(t)}const nd=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;i.provide("VBinder",(t=i.getCurrentInstance())===null||t===void 0?void 0:t.proxy);const n=i.inject("VBinder",null),r=i.ref(null),s=_=>{r.value=_,n&&e.syncTargetWithParent&&n.setTargetRef(_)};let o=[];const a=()=>{let _=r.value;for(;_=td(_),_!==null;)o.push(_);for(const b of o)Bt("scroll",b,f,!0)},l=()=>{for(const _ of o)it("scroll",_,f,!0);o=[]},c=new Set,d=_=>{c.size===0&&a(),c.has(_)||c.add(_)},h=_=>{c.has(_)&&c.delete(_),c.size===0&&l()},f=()=>{Lc(p)},p=()=>{c.forEach(_=>_())},u=new Set,g=_=>{u.size===0&&Bt("resize",window,y),u.has(_)||u.add(_)},m=_=>{u.has(_)&&u.delete(_),u.size===0&&it("resize",window,y)},y=()=>{u.forEach(_=>_())};return i.onBeforeUnmount(()=>{it("resize",window,y),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:g,removeResizeListener:m}},render(){return xo("binder",this.$slots)}}),id=i.defineComponent({name:"Target",setup(){const{setTargetRef:e,syncTarget:t}=i.inject("VBinder");return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){const{syncTarget:e,setTargetDirective:t}=this;return e?i.withDirectives(Qc("follower",this.$slots),[[t]]):Qc("follower",this.$slots)}}),X_="@css-render/vue3-ssr";function q_(e,t){return`<style cssr-id="${e}">
104
104
  ${t}
105
- </style>`}function Wy(e,t,n){const{styles:r,ids:s}=n;s.has(e)||r!==null&&(s.add(e),r.push(Hy(e,t)))}const jy=typeof document<"u";function li(){if(jy)return;const e=i.inject(Dy,null);if(e!==null)return{adapter:(t,n)=>Wy(t,n,e),context:e}}function rd(e,t){console.error(`[vueuc/${e}]: ${t}`)}function Xy(e){let t=0;for(let n=0;n<e.length;++n)e[n]==="&"&&++t;return t}const sd=/\s*,(?![^(]*\))\s*/g,qy=/\s+/g;function Yy(e,t){const n=[];return t.split(sd).forEach(r=>{let s=Xy(r);if(s){if(s===1){e.forEach(a=>{n.push(r.replace("&",a))});return}}else{e.forEach(a=>{n.push((a&&a+" ")+r)});return}let o=[r];for(;s--;){const a=[];o.forEach(l=>{e.forEach(c=>{a.push(l.replace("&",c))})}),o=a}o.forEach(a=>n.push(a))}),n}function Uy(e,t){const n=[];return t.split(sd).forEach(r=>{e.forEach(s=>{n.push((s&&s+" ")+r)})}),n}function Gy(e){let t=[""];return e.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?t=Yy(t,n):t=Uy(t,n))}),t.join(", ").replace(qy," ")}function od(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function ls(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function Ky(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function cs(e){return e?/^\s*@(s|m)/.test(e):!1}const Zy=/[A-Z]/g;function ad(e){return e.replace(Zy,t=>"-"+t.toLowerCase())}function Jy(e,t=" "){return typeof e=="object"&&e!==null?` {
105
+ </style>`}function Y_(e,t,n){const{styles:r,ids:s}=n;s.has(e)||r!==null&&(s.add(e),r.push(q_(e,t)))}const U_=typeof document<"u";function di(){if(U_)return;const e=i.inject(X_,null);if(e!==null)return{adapter:(t,n)=>Y_(t,n,e),context:e}}function rd(e,t){console.error(`[vueuc/${e}]: ${t}`)}function G_(e){let t=0;for(let n=0;n<e.length;++n)e[n]==="&"&&++t;return t}const sd=/\s*,(?![^(]*\))\s*/g,K_=/\s+/g;function Z_(e,t){const n=[];return t.split(sd).forEach(r=>{let s=G_(r);if(s){if(s===1){e.forEach(a=>{n.push(r.replace("&",a))});return}}else{e.forEach(a=>{n.push((a&&a+" ")+r)});return}let o=[r];for(;s--;){const a=[];o.forEach(l=>{e.forEach(c=>{a.push(l.replace("&",c))})}),o=a}o.forEach(a=>n.push(a))}),n}function J_(e,t){const n=[];return t.split(sd).forEach(r=>{e.forEach(s=>{n.push((s&&s+" ")+r)})}),n}function Q_(e){let t=[""];return e.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?t=Z_(t,n):t=J_(t,n))}),t.join(", ").replace(K_," ")}function od(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function ls(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function eb(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function cs(e){return e?/^\s*@(s|m)/.test(e):!1}const tb=/[A-Z]/g;function ad(e){return e.replace(tb,t=>"-"+t.toLowerCase())}function nb(e,t=" "){return typeof e=="object"&&e!==null?` {
106
106
  `+Object.entries(e).map(n=>t+` ${ad(n[0])}: ${n[1]};`).join(`
107
107
  `)+`
108
- `+t+"}":`: ${e};`}function Qy(e,t,n){return typeof e=="function"?e({context:t.context,props:n}):e}function ld(e,t,n,r){if(!t)return"";const s=Qy(t,n,r);if(!s)return"";if(typeof s=="string")return`${e} {
108
+ `+t+"}":`: ${e};`}function ib(e,t,n){return typeof e=="function"?e({context:t.context,props:n}):e}function ld(e,t,n,r){if(!t)return"";const s=ib(t,n,r);if(!s)return"";if(typeof s=="string")return`${e} {
109
109
  ${s}
110
110
  }`;const o=Object.keys(s);if(o.length===0)return n.config.keepEmptyBlock?e+` {
111
111
  }`:"";const a=e?[e+" {"]:[];return o.forEach(l=>{const c=s[l];if(l==="raw"){a.push(`
112
112
  `+c+`
113
- `);return}l=ad(l),c!=null&&a.push(` ${l}${Jy(c)}`)}),e&&a.push("}"),a.join(`
114
- `)}function Bo(e,t,n){e&&e.forEach(r=>{if(Array.isArray(r))Bo(r,t,n);else if(typeof r=="function"){const s=r(t);Array.isArray(s)?Bo(s,t,n):s&&n(s)}else r&&n(r)})}function cd(e,t,n,r,s){const o=e.$;let a="";if(!o||typeof o=="string")cs(o)?a=o:t.push(o);else if(typeof o=="function"){const d=o({context:r.context,props:s});cs(d)?a=d:t.push(d)}else if(o.before&&o.before(r.context),!o.$||typeof o.$=="string")cs(o.$)?a=o.$:t.push(o.$);else if(o.$){const d=o.$({context:r.context,props:s});cs(d)?a=d:t.push(d)}const l=Gy(t),c=ld(l,e.props,r,s);a?n.push(`${a} {`):c.length&&n.push(c),e.children&&Bo(e.children,{context:r.context,props:s},d=>{if(typeof d=="string"){const h=ld(l,{raw:d},r,s);n.push(h)}else cd(d,t,n,r,s)}),t.pop(),a&&n.push("}"),o&&o.after&&o.after(r.context)}function eb(e,t,n){const r=[];return cd(e,[],r,t,n),r.join(`
113
+ `);return}l=ad(l),c!=null&&a.push(` ${l}${nb(c)}`)}),e&&a.push("}"),a.join(`
114
+ `)}function Bo(e,t,n){e&&e.forEach(r=>{if(Array.isArray(r))Bo(r,t,n);else if(typeof r=="function"){const s=r(t);Array.isArray(s)?Bo(s,t,n):s&&n(s)}else r&&n(r)})}function cd(e,t,n,r,s){const o=e.$;let a="";if(!o||typeof o=="string")cs(o)?a=o:t.push(o);else if(typeof o=="function"){const d=o({context:r.context,props:s});cs(d)?a=d:t.push(d)}else if(o.before&&o.before(r.context),!o.$||typeof o.$=="string")cs(o.$)?a=o.$:t.push(o.$);else if(o.$){const d=o.$({context:r.context,props:s});cs(d)?a=d:t.push(d)}const l=Q_(t),c=ld(l,e.props,r,s);a?n.push(`${a} {`):c.length&&n.push(c),e.children&&Bo(e.children,{context:r.context,props:s},d=>{if(typeof d=="string"){const h=ld(l,{raw:d},r,s);n.push(h)}else cd(d,t,n,r,s)}),t.pop(),a&&n.push("}"),o&&o.after&&o.after(r.context)}function rb(e,t,n){const r=[];return cd(e,[],r,t,n),r.join(`
115
115
 
116
- `)}function To(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function tb(e,t,n,r){const{els:s}=t;if(n===void 0)s.forEach(od),t.els=[];else{const o=ls(n,r);o&&s.includes(o)&&(od(o),t.els=s.filter(a=>a!==o))}}function dd(e,t){e.push(t)}function nb(e,t,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=t.render(r),n=To(d)),c){c.adapter(n,d??t.render(r));return}l===void 0&&(l=document.head);const h=ls(n,l);if(h!==null&&!o)return h;const f=h??Ky(n);if(d===void 0&&(d=t.render(r)),f.textContent=d,h!==null)return h;if(a){const p=l.querySelector(`meta[name="${a}"]`);if(p)return l.insertBefore(f,p),dd(t.els,f),f}return s?l.insertBefore(f,l.querySelector("style, link")):l.appendChild(f),dd(t.els,f),f}function ib(e){return eb(this,this.instance,e)}function rb(e={}){const{id:t,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=e;return nb(this.instance,this,t,r,s,o,a,l,n)}function sb(e={}){const{id:t,parent:n}=e;tb(this.instance,this,t,n)}const ds=function(e,t,n,r){return{instance:e,$:t,props:n,children:r,els:[],render:ib,mount:rb,unmount:sb}},ob=function(e,t,n,r){return Array.isArray(t)?ds(e,{$:null},null,t):Array.isArray(n)?ds(e,t,null,n):Array.isArray(r)?ds(e,t,n,r):ds(e,t,n,null)};function hd(e={}){const t={c:(...n)=>ob(t,...n),use:(n,...r)=>n.install(t,...r),find:ls,context:{},config:e};return t}function ab(e,t){if(e===void 0)return!1;if(t){const{context:{ids:n}}=t;return n.has(e)}return ls(e)!==null}const{c:In}=hd(),Eo="vueuc-style";function ud(e){return e&-e}class fd{constructor(t,n){this.l=t,this.min=n;const r=new Array(t+1);for(let s=0;s<t+1;++s)r[s]=0;this.ft=r}add(t,n){if(n===0)return;const{l:r,ft:s}=this;for(t+=1;t<=r;)s[t]+=n,t+=ud(t)}get(t){return this.sum(t+1)-this.sum(t)}sum(t){if(t===void 0&&(t=this.l),t<=0)return 0;const{ft:n,min:r,l:s}=this;if(t>s)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let o=t*r;for(;t>0;)o+=n[t],t-=ud(t);return o}getBound(t){let n=0,r=this.l;for(;r>n;){const s=Math.floor((n+r)/2),o=this.sum(s);if(o>t){r=s;continue}else if(o<t){if(n===s)return this.sum(n+1)<=t?n+1:s;n=s}else return s}return n}}function pd(e){return typeof e=="string"?document.querySelector(e):e()}const lb=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(e){return{showTeleport:My(i.toRef(e,"show")),mergedTo:i.computed(()=>{const{to:t}=e;return t??"body"})}},render(){return this.showTeleport?this.disabled?xo("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},xo("lazy-teleport",this.$slots)):null}}),hs={top:"bottom",bottom:"top",left:"right",right:"left"},gd={start:"end",center:"center",end:"start"},$o={top:"height",bottom:"height",left:"width",right:"width"},cb={"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"},db={"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"},hb={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},md={top:!0,bottom:!1,left:!0,right:!1},_d={top:"end",bottom:"start",left:"end",right:"start"};function ub(e,t,n,r,s,o){if(!s||o)return{placement:e,top:0,left:0};const[a,l]=e.split("-");let c=l??"center",d={top:0,left:0};const h=(u,g,m)=>{let _=0,y=0;const b=n[u]-t[g]-t[u];return b>0&&r&&(m?y=md[g]?b:-b:_=md[g]?b:-b),{left:_,top:y}},f=a==="left"||a==="right";if(c!=="center"){const u=hb[e],g=hs[u],m=$o[u];if(n[m]>t[m]){if(t[u]+t[m]<n[m]){const _=(n[m]-t[m])/2;t[u]<_||t[g]<_?t[u]<t[g]?(c=gd[l],d=h(m,g,f)):d=h(m,u,f):c="center"}}else n[m]<t[m]&&t[g]<0&&t[u]>t[g]&&(c=gd[l])}else{const u=a==="bottom"||a==="top"?"left":"top",g=hs[u],m=$o[u],_=(n[m]-t[m])/2;(t[u]<_||t[g]<_)&&(t[u]>t[g]?(c=_d[u],d=h(m,u,f)):(c=_d[g],d=h(m,g,f)))}let p=a;return t[a]<n[$o[a]]&&t[a]<t[hs[a]]&&(p=hs[a]),{placement:c!=="center"?`${p}-${c}`:p,left:d.left,top:d.top}}function fb(e,t){return t?db[e]:cb[e]}function pb(e,t,n,r,s,o){if(o)switch(e){case"bottom-start":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(e){case"bottom-start":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+s)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+s)}px`,transform:"translateX(-50%)"}}}const gb=In([In(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),In(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[In("> *",{pointerEvents:"all"})])]),yd=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(e){const t=i.inject("VBinder"),n=Wt(()=>e.enabled!==void 0?e.enabled:e.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:p}=e;p.includes("scroll")&&t.addScrollListener(c),p.includes("resize")&&t.addResizeListener(c)},a=()=>{t.removeScrollListener(c),t.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=li();gb.mount({id:"vueuc/binder",head:!0,anchorMetaName:Eo,ssr:l}),i.onBeforeUnmount(()=>{a()}),Iy(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const p=r.value;if(p===null)return;const u=t.targetRef,{x:g,y:m,overlap:_}=e,y=g!==void 0&&m!==void 0?zy(g,m):So(u);p.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),p.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:b,minWidth:S,placement:C,internalShift:v,flip:B}=e;p.setAttribute("v-placement",C),_?p.setAttribute("v-overlap",""):p.removeAttribute("v-overlap");const{style:k}=p;b==="target"?k.width=`${y.width}px`:b!==void 0?k.width=b:k.width="",S==="target"?k.minWidth=`${y.width}px`:S!==void 0?k.minWidth=S:k.minWidth="";const E=So(p),P=So(s.value),{left:R,top:j,placement:q}=ub(C,y,E,v,B,_),M=fb(q,_),{left:A,top:$,transform:X}=pb(q,P,y,j,R,_);p.setAttribute("v-placement",q),p.style.setProperty("--v-offset-left",`${Math.round(R)}px`),p.style.setProperty("--v-offset-top",`${Math.round(j)}px`),p.style.transform=`translateX(${A}) translateY(${$}) ${X}`,p.style.setProperty("--v-transform-origin",M),p.style.transformOrigin=M};i.watch(n,p=>{p?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(p=>console.error(p))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(p=>{i.watch(i.toRef(e,p),c)}),["teleportDisabled"].forEach(p=>{i.watch(i.toRef(e,p),d)}),i.watch(i.toRef(e,"syncTrigger"),p=>{p.includes("resize")?t.addResizeListener(c):t.removeResizeListener(c),p.includes("scroll")?t.addScrollListener(c):t.removeScrollListener(c)});const h=as(),f=Wt(()=>{const{to:p}=e;if(p!==void 0)return p;h.value});return{VBinder:t,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:f,syncPosition:c}},render(){return i.h(lb,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e,t;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))]);return this.zindexable?i.withDirectives(n,[[Zc,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var ci=[],mb=function(){return ci.some(function(e){return e.activeTargets.length>0})},_b=function(){return ci.some(function(e){return e.skippedTargets.length>0})},bd="ResizeObserver loop completed with undelivered notifications.",yb=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:bd}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=bd),window.dispatchEvent(e)},ur;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(ur||(ur={}));var di=function(e){return Object.freeze(e)},bb=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,di(this)}return e}(),wd=function(){function e(t,n,r,s){return this.x=t,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,di(this)}return e.prototype.toJSON=function(){var t=this,n=t.x,r=t.y,s=t.top,o=t.right,a=t.bottom,l=t.left,c=t.width,d=t.height;return{x:n,y:r,top:s,right:o,bottom:a,left:l,width:c,height:d}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),No=function(e){return e instanceof SVGElement&&"getBBox"in e},vd=function(e){if(No(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var s=e,o=s.offsetWidth,a=s.offsetHeight;return!(o||a||e.getClientRects().length)},kd=function(e){var t;if(e instanceof Element)return!0;var n=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},wb=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},fr=typeof window<"u"?window:{},us=new WeakMap,xd=/auto|scroll/,vb=/^tb|vertical/,kb=/msie|trident/i.test(fr.navigator&&fr.navigator.userAgent),on=function(e){return parseFloat(e||"0")},Li=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new bb((n?t:e)||0,(n?e:t)||0)},Cd=di({devicePixelContentBoxSize:Li(),borderBoxSize:Li(),contentBoxSize:Li(),contentRect:new wd(0,0,0,0)}),Sd=function(e,t){if(t===void 0&&(t=!1),us.has(e)&&!t)return us.get(e);if(vd(e))return us.set(e,Cd),Cd;var n=getComputedStyle(e),r=No(e)&&e.ownerSVGElement&&e.getBBox(),s=!kb&&n.boxSizing==="border-box",o=vb.test(n.writingMode||""),a=!r&&xd.test(n.overflowY||""),l=!r&&xd.test(n.overflowX||""),c=r?0:on(n.paddingTop),d=r?0:on(n.paddingRight),h=r?0:on(n.paddingBottom),f=r?0:on(n.paddingLeft),p=r?0:on(n.borderTopWidth),u=r?0:on(n.borderRightWidth),g=r?0:on(n.borderBottomWidth),m=r?0:on(n.borderLeftWidth),_=f+d,y=c+h,b=m+u,S=p+g,C=l?e.offsetHeight-S-e.clientHeight:0,v=a?e.offsetWidth-b-e.clientWidth:0,B=s?_+b:0,k=s?y+S:0,E=r?r.width:on(n.width)-B-v,P=r?r.height:on(n.height)-k-C,R=E+_+v+b,j=P+y+C+S,q=di({devicePixelContentBoxSize:Li(Math.round(E*devicePixelRatio),Math.round(P*devicePixelRatio),o),borderBoxSize:Li(R,j,o),contentBoxSize:Li(E,P,o),contentRect:new wd(f,c,E,P)});return us.set(e,q),q},Bd=function(e,t,n){var r=Sd(e,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case ur.DEVICE_PIXEL_CONTENT_BOX:return a;case ur.BORDER_BOX:return s;default:return o}},xb=function(){function e(t){var n=Sd(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=di([n.borderBoxSize]),this.contentBoxSize=di([n.contentBoxSize]),this.devicePixelContentBoxSize=di([n.devicePixelContentBoxSize])}return e}(),Td=function(e){if(vd(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Cb=function(){var e=1/0,t=[];ci.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var h=new xb(d.target),f=Td(d.target);l.push(h),d.lastReportedSize=Bd(d.target,d.observedBox),f<e&&(e=f)}),t.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var s=r[n];s()}return e},Ed=function(e){ci.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(Td(s.target)>e?n.activeTargets.push(s):n.skippedTargets.push(s))})})},Sb=function(){var e=0;for(Ed(e);mb();)e=Cb(),Ed(e);return _b()&&yb(),e>0},Ro,$d=[],Bb=function(){return $d.splice(0).forEach(function(e){return e()})},Tb=function(e){if(!Ro){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Bb()}).observe(n,r),Ro=function(){n.textContent="".concat(t?t--:t++)}}$d.push(e),Ro()},Eb=function(e){Tb(function(){requestAnimationFrame(e)})},fs=0,$b=function(){return!!fs},Nb=250,Rb={attributes:!0,characterData:!0,childList:!0,subtree:!0},Nd=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Rd=function(e){return e===void 0&&(e=0),Date.now()+e},Po=!1,Pb=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var n=this;if(t===void 0&&(t=Nb),!Po){Po=!0;var r=Rd(t);Eb(function(){var s=!1;try{s=Sb()}finally{if(Po=!1,t=r-Rd(),!$b())return;s?n.run(1e3):t>0?n.run(t):n.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,n=function(){return t.observer&&t.observer.observe(document.body,Rb)};document.body?n():fr.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Nd.forEach(function(n){return fr.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Nd.forEach(function(n){return fr.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),Fo=new Pb,Pd=function(e){!fs&&e>0&&Fo.start(),fs+=e,!fs&&Fo.stop()},Fb=function(e){return!No(e)&&!wb(e)&&getComputedStyle(e).display==="inline"},Mb=function(){function e(t,n){this.target=t,this.observedBox=n||ur.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=Bd(this.target,this.observedBox,!0);return Fb(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Ab=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),ps=new WeakMap,Fd=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},gs=function(){function e(){}return e.connect=function(t,n){var r=new Ab(t,n);ps.set(t,r)},e.observe=function(t,n,r){var s=ps.get(t),o=s.observationTargets.length===0;Fd(s.observationTargets,n)<0&&(o&&ci.push(s),s.observationTargets.push(new Mb(n,r&&r.box)),Pd(1),Fo.schedule())},e.unobserve=function(t,n){var r=ps.get(t),s=Fd(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&ci.splice(ci.indexOf(r),1),r.observationTargets.splice(s,1),Pd(-1))},e.disconnect=function(t){var n=this,r=ps.get(t);r.observationTargets.slice().forEach(function(s){return n.unobserve(t,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Ib=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");gs.connect(this,t)}return e.prototype.observe=function(t,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!kd(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");gs.observe(this,t,n)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!kd(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");gs.unobserve(this,t)},e.prototype.disconnect=function(){gs.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();class Vb{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Ib)(this.handleResize),this.elHandlersMap=new Map}handleResize(t){for(const n of t){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(t,n){this.elHandlersMap.set(t,n),this.observer.observe(t)}unregisterHandler(t){this.elHandlersMap.has(t)&&(this.elHandlersMap.delete(t),this.observer.unobserve(t))}}const pr=new Vb,ms=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(e){let t=!1;const n=i.getCurrentInstance().proxy;function r(s){const{onResize:o}=e;o!==void 0&&o(s)}i.onMounted(()=>{const s=n.$el;if(s===void 0){rd("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){rd("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(pr.registerHandler(s.nextElementSibling,r),t=!0)}),i.onBeforeUnmount(()=>{t&&pr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let _s;function Ob(){return typeof document>"u"?!1:(_s===void 0&&("matchMedia"in window?_s=window.matchMedia("(pointer:coarse)").matches:_s=!1),_s)}let Mo;function Md(){return typeof document>"u"?1:(Mo===void 0&&(Mo="chrome"in window?window.devicePixelRatio:1),Mo)}const Ad="VVirtualListXScroll";function zb({columnsRef:e,renderColRef:t,renderItemWithColsRef:n}){const r=i.ref(0),s=i.ref(0),o=i.computed(()=>{const d=e.value;if(d.length===0)return null;const h=new fd(d.length,0);return d.forEach((f,p)=>{h.add(p,f.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,e.value.length-1):0});return i.provide(Ad,{startIndexRef:a,endIndexRef:c,columnsRef:e,renderColRef:t,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Id=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:e,endIndexRef:t,columnsRef:n,getLeft:r,renderColRef:s,renderItemWithColsRef:o}=i.inject(Ad);return{startIndex:e,endIndex:t,columns:n,renderCol:s,renderItemWithCols:o,getLeft:r}},render(){const{startIndex:e,endIndex:t,columns:n,renderCol:r,renderItemWithCols:s,getLeft:o,item:a}=this;if(s!=null)return s({itemIndex:this.index,startColIndex:e,endColIndex:t,allColumns:n,item:a,getLeft:o});if(r!=null){const l=[];for(let c=e;c<=t;++c){const d=n[c];l.push(r({column:d,left:o(c),item:a}))}return l}return null}}),Lb=In(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[In("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[In("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Db=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(e){const t=li();Lb.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Eo,ssr:t}),i.onMounted(()=>{const{defaultScrollIndex:M,defaultScrollKey:A}=e;M!=null?_({index:M}):A!=null&&_({key:A})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}_({top:u.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=Wt(()=>{if(e.renderCol==null&&e.renderItemWithCols==null||e.columns.length===0)return;let M=0;return e.columns.forEach(A=>{M+=A.width}),M}),o=i.computed(()=>{const M=new Map,{keyField:A}=e;return e.items.forEach(($,X)=>{M.set($[A],X)}),M}),{scrollLeftRef:a,listWidthRef:l}=zb({columnsRef:i.toRef(e,"columns"),renderColRef:i.toRef(e,"renderCol"),renderItemWithColsRef:i.toRef(e,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),h=new Map,f=i.computed(()=>{const{items:M,itemSize:A,keyField:$}=e,X=new fd(M.length,A);return M.forEach((F,N)=>{const W=F[$],z=h.get(W);z!==void 0&&X.add(N,z)}),X}),p=i.ref(0),u=i.ref(0),g=Wt(()=>Math.max(f.value.getBound(u.value-cr(e.paddingTop))-1,0)),m=i.computed(()=>{const{value:M}=d;if(M===void 0)return[];const{items:A,itemSize:$}=e,X=g.value,F=Math.min(X+Math.ceil(M/$+1),A.length-1),N=[];for(let W=X;W<=F;++W)N.push(A[W]);return N}),_=(M,A)=>{if(typeof M=="number"){C(M,A,"auto");return}const{left:$,top:X,index:F,key:N,position:W,behavior:z,debounce:G=!0}=M;if($!==void 0||X!==void 0)C($,X,z);else if(F!==void 0)S(F,z,G);else if(N!==void 0){const V=o.value.get(N);V!==void 0&&S(V,z,G)}else W==="bottom"?C(0,Number.MAX_SAFE_INTEGER,z):W==="top"&&C(0,0,z)};let y,b=null;function S(M,A,$){const{value:X}=f,F=X.sum(M)+cr(e.paddingTop);if(!$)c.value.scrollTo({left:0,top:F,behavior:A});else{y=M,b!==null&&window.clearTimeout(b),b=window.setTimeout(()=>{y=void 0,b=null},16);const{scrollTop:N,offsetHeight:W}=c.value;if(F>N){const z=X.get(M);F+z<=N+W||c.value.scrollTo({left:0,top:F+z-W,behavior:A})}else c.value.scrollTo({left:0,top:F,behavior:A})}}function C(M,A,$){c.value.scrollTo({left:M,top:A,behavior:$})}function v(M,A){var $,X,F;if(n||e.ignoreItemResize||q(A.target))return;const{value:N}=f,W=o.value.get(M),z=N.get(W),G=(F=(X=($=A.borderBoxSize)===null||$===void 0?void 0:$[0])===null||X===void 0?void 0:X.blockSize)!==null&&F!==void 0?F:A.contentRect.height;if(G===z)return;G-e.itemSize===0?h.delete(M):h.set(M,G-e.itemSize);const O=G-z;if(O===0)return;N.add(W,O);const J=c.value;if(J!=null){if(y===void 0){const he=N.sum(W);J.scrollTop>he&&J.scrollBy(0,O)}else if(W<y)J.scrollBy(0,O);else if(W===y){const he=N.sum(W);G+he>J.scrollTop+J.offsetHeight&&J.scrollBy(0,O)}j()}p.value++}const B=!Ob();let k=!1;function E(M){var A;(A=e.onScroll)===null||A===void 0||A.call(e,M),(!B||!k)&&j()}function P(M){var A;if((A=e.onWheel)===null||A===void 0||A.call(e,M),B){const $=c.value;if($!=null){if(M.deltaX===0&&($.scrollTop===0&&M.deltaY<=0||$.scrollTop+$.offsetHeight>=$.scrollHeight&&M.deltaY>=0))return;M.preventDefault(),$.scrollTop+=M.deltaY/Md(),$.scrollLeft+=M.deltaX/Md(),j(),k=!0,Lc(()=>{k=!1})}}}function R(M){if(n||q(M.target))return;if(e.renderCol==null&&e.renderItemWithCols==null){if(M.contentRect.height===d.value)return}else if(M.contentRect.height===d.value&&M.contentRect.width===l.value)return;d.value=M.contentRect.height,l.value=M.contentRect.width;const{onResize:A}=e;A!==void 0&&A(M)}function j(){const{value:M}=c;M!=null&&(u.value=M.scrollTop,a.value=M.scrollLeft)}function q(M){let A=M;for(;A!==null;){if(A.style.display==="none")return!0;A=A.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:M}=e,A=dr(f.value.sum());return p.value,[e.itemsStyle,{boxSizing:"content-box",width:dr(s.value),height:M?"":A,minHeight:M?A:"",paddingTop:dr(e.paddingTop),paddingBottom:dr(e.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(p.value,{transform:`translateY(${dr(f.value.sum(g.value))})`})),viewportItems:m,listElRef:c,itemsElRef:i.ref(null),scrollTo:_,handleListResize:R,handleListScroll:E,handleListWheel:P,handleItemResize:v}},render(){const{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:r}=this;return i.h(ms,{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[t],h=n.get(d),f=a!=null?i.h(Id,{index:h,item:c}):void 0,p=l!=null?i.h(Id,{index:h,item:c}):void 0,u=this.$slots.default({item:c,renderedCols:f,renderedItemWithCols:p,index:h})[0];return e?i.h(ms,{key:d,onResize:g=>this.handleItemResize(d,g)},{default:()=>u}):(u.key=d,u)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),mn="v-hidden",Hb=In("[v-hidden]",{display:"none!important"}),Vd=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){const n=i.ref(null),r=i.ref(null);function s(a){const{value:l}=n,{getCounter:c,getTail:d}=e;let h;if(c!==void 0?h=c():h=r.value,!l||!h)return;h.hasAttribute(mn)&&h.removeAttribute(mn);const{children:f}=l;if(a.showAllItemsBeforeCalculate)for(const S of f)S.hasAttribute(mn)&&S.removeAttribute(mn);const p=l.offsetWidth,u=[],g=t.tail?d==null?void 0:d():null;let m=g?g.offsetWidth:0,_=!1;const y=l.children.length-(t.tail?1:0);for(let S=0;S<y-1;++S){if(S<0)continue;const C=f[S];if(_){C.hasAttribute(mn)||C.setAttribute(mn,"");continue}else C.hasAttribute(mn)&&C.removeAttribute(mn);const v=C.offsetWidth;if(m+=v,u[S]=v,m>p){const{updateCounter:B}=e;for(let k=S;k>=0;--k){const E=y-1-k;B!==void 0?B(E):h.textContent=`${E}`;const P=h.offsetWidth;if(m-=u[k],m+P<=p||k===0){_=!0,S=k-1,g&&(S===-1?(g.style.maxWidth=`${p-P}px`,g.style.boxSizing="border-box"):g.style.maxWidth="");const{onUpdateCount:R}=e;R&&R(E);break}}}}const{onUpdateOverflow:b}=e;_?b!==void 0&&b(!0):(b!==void 0&&b(!1),h.setAttribute(mn,""))}const o=li();return Hb.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Eo,ssr:o}),i.onMounted(()=>s({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:s}},render(){const{$slots:e}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(e,"default"),e.counter?e.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function Od(e){return e instanceof HTMLElement}function zd(e){for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes[t];if(Od(n)&&(Dd(n)||zd(n)))return!0}return!1}function Ld(e){for(let t=e.childNodes.length-1;t>=0;t--){const n=e.childNodes[t];if(Od(n)&&(Dd(n)||Ld(n)))return!0}return!1}function Dd(e){if(!Wb(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function Wb(e){if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.getAttribute("disabled"))return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return e.type!=="hidden"&&e.type!=="file";case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}let gr=[];const jb=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:String,finalFocusTo:String,returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(e){const t=J_(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return gr[gr.length-1]===t}function c(_){var y;_.code==="Escape"&&l()&&((y=e.onEsc)===null||y===void 0||y.call(e,_))}i.onMounted(()=>{i.watch(()=>e.active,_=>{_?(f(),St("keydown",document,c)):(tt("keydown",document,c),s&&p())},{immediate:!0})}),i.onBeforeUnmount(()=>{tt("keydown",document,c),s&&p()});function d(_){if(!o&&l()){const y=h();if(y===null||y.contains(lr(_)))return;u("first")}}function h(){const _=n.value;if(_===null)return null;let y=_;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function f(){var _;if(!e.disabled){if(gr.push(t),e.autoFocus){const{initialFocusTo:y}=e;y===void 0?u("first"):(_=pd(y))===null||_===void 0||_.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function p(){var _;if(e.disabled||(document.removeEventListener("focus",d,!0),gr=gr.filter(b=>b!==t),l()))return;const{finalFocusTo:y}=e;y!==void 0?(_=pd(y))===null||_===void 0||_.focus({preventScroll:!0}):e.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function u(_){if(l()&&e.active){const y=n.value,b=r.value;if(y!==null&&b!==null){const S=h();if(S==null||S===b){o=!0,y.focus({preventScroll:!0}),o=!1;return}o=!0;const C=_==="first"?zd(S):Ld(S);o=!1,C||(o=!0,y.focus({preventScroll:!0}),o=!1)}}}function g(_){if(o)return;const y=h();y!==null&&(_.relatedTarget!==null&&y.contains(_.relatedTarget)?u("last"):u("first"))}function m(_){o||(_.relatedTarget!==null&&_.relatedTarget===n.value?u("last"):u("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:g,handleEndFocus:m}},render(){const{default:e}=this.$slots;if(e===void 0)return null;if(this.disabled)return e();const{active:t,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:t?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),e(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:t?"0":"-1",onFocus:this.handleEndFocus})])}});function Lk(e){return e}const Ao="n-internal-select-menu",Hd="n-internal-select-menu-body",Wd="n-drawer-body",jd="n-modal-body",Xd="n-popover-body",qd="__disabled__";function _n(e){const t=i.inject(jd,null),n=i.inject(Wd,null),r=i.inject(Xd,null),s=i.inject(Hd,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{St("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{tt("fullscreenchange",document,a)})}return Wt(()=>{var a;const{to:l}=e;return l!==void 0?l===!1?qd:l===!0?o.value||"body":l:t!=null&&t.value?(a=t.value.$el)!==null&&a!==void 0?a:t.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:s!=null&&s.value?s.value:l??(o.value||"body")})}_n.tdkey=qd,_n.propTo={type:[String,Object,Boolean],default:void 0};function Xb(e){const t={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(t.isDeactivated=!1,!n){n=!0;return}e()}),i.onDeactivated(()=>{t.isDeactivated=!0,n||(n=!0)}),t}function Yd(e,t){t&&(i.onMounted(()=>{const{value:n}=e;n&&pr.registerHandler(n,t)}),i.watch(e,(n,r)=>{r&&pr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=e;n&&pr.unregisterHandler(n)}))}function Ud(e){return e.replace(/#|\(|\)|,|\s|\./g,"_")}const qb=/^(\d|\.)+$/,Gd=/(\d|\.)+/;function Io(e,{c:t=1,offset:n=0,attachPx:r=!0}={}){if(typeof e=="number"){const s=(e+n)*t;return s===0?"0":`${s}px`}else if(typeof e=="string")if(qb.test(e)){const s=(Number(e)+n)*t;return r?s===0?"0":`${s}px`:`${s}`}else{const s=Gd.exec(e);return s?e.replace(Gd,String((Number(s[0])+n)*t)):e}return e}function Kd(e){const{left:t,right:n,top:r,bottom:s}=Yt(e);return`${r} ${t} ${s} ${n}`}var Zd={};function Yb(e){let t=".",n="__",r="--",s;if(e){let g=e.blockPrefix;g&&(t=g),g=e.elementPrefix,g&&(n=g),g=e.modifierPrefix,g&&(r=g)}const o={install(g){s=g.c;const m=g.context;m.bem={},m.bem.b=null,m.bem.els=null}};function a(g){let m,_;return{before(y){m=y.bem.b,_=y.bem.els,y.bem.els=null},after(y){y.bem.b=m,y.bem.els=_},$({context:y,props:b}){return g=typeof g=="string"?g:g({context:y,props:b}),y.bem.b=g,`${(b==null?void 0:b.bPrefix)||t}${y.bem.b}`}}}function l(g){let m;return{before(_){m=_.bem.els},after(_){_.bem.els=m},$({context:_,props:y}){return g=typeof g=="string"?g:g({context:_,props:y}),_.bem.els=g.split(",").map(b=>b.trim()),_.bem.els.map(b=>`${(y==null?void 0:y.bPrefix)||t}${_.bem.b}${n}${b}`).join(", ")}}}function c(g){return{$({context:m,props:_}){g=typeof g=="string"?g:g({context:m,props:_});const y=g.split(",").map(C=>C.trim());function b(C){return y.map(v=>`&${(_==null?void 0:_.bPrefix)||t}${m.bem.b}${C!==void 0?`${n}${C}`:""}${r}${v}`).join(", ")}const S=m.bem.els;if(S!==null){if(Zd.NODE_ENV!=="production"&&S.length>=2)throw Error(`[css-render/plugin-bem]: m(${g}) is invalid, using modifier inside multiple elements is not allowed`);return b(S[0])}else return b()}}}function d(g){return{$({context:m,props:_}){g=typeof g=="string"?g:g({context:m,props:_});const y=m.bem.els;if(Zd.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${g}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(_==null?void 0:_.bPrefix)||t}${m.bem.b}${y!==null&&y.length>0?`${n}${y[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 Ub=".n-",Gb="__",Kb="--",Jd=hd(),Qd=Yb({blockPrefix:Ub,elementPrefix:Gb,modifierPrefix:Kb});Jd.use(Qd);const{c:oe,find:Hk}=Jd,{cB:fe,cE:_e,cM:Ce,cNotM:Ut}=Qd,Zb=(...e)=>oe(">",[fe(...e)]);function Ye(e,t){return e+(t==="default"?"":t.replace(/^[a-z]/,n=>n.toUpperCase()))}let Vo;function Jb(){return Vo===void 0&&(Vo=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Vo}const Qb=new WeakSet;function e1(e){Qb.add(e)}function eh(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}const th=new Set;function Vn(e,t){const n=`[naive/${e}]: ${t}`;th.has(n)||(th.add(n),console.error(n))}function nh(e,t){console.error(`[naive/${e}]: ${t}`)}function ih(e,t){throw new Error(`[naive/${e}]: ${t}`)}function gt(e,...t){if(Array.isArray(e))e.forEach(n=>gt(n,...t));else return e(...t)}function Oo(e,t=!0,n=[]){return e.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)){Oo(r,t,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Oo(r.children,t,n)}else{if(r.type===i.Comment&&t)return;n.push(r)}}}),n}function t1(e,t="default",n=void 0){const r=e[t];if(!r)return nh("getFirstSlotVNode",`slot[${t}] is empty`),null;const s=Oo(r(n));return s.length===1?s[0]:(nh("getFirstSlotVNode",`slot[${t}] should have exactly one child`),null)}function n1(e,t=[],n){const r={};return t.forEach(s=>{r[s]=e[s]}),Object.assign(r,n)}function zo(e){const t=e.filter(n=>n!==void 0);if(t.length!==0)return t.length===1?t[0]:n=>{e.forEach(r=>{r&&r(n)})}}function Di(e,...t){return typeof e=="function"?e(...t):typeof e=="string"?i.createTextVNode(e):typeof e=="number"?i.createTextVNode(String(e)):null}function ys(e){return e.some(t=>i.isVNode(t)?!(t.type===i.Comment||t.type===i.Fragment&&!ys(t.children)):!0)?e:null}function Lo(e,t){return e&&ys(e())||t()}function hi(e,t){const n=e&&ys(e());return t(n||null)}function rh(e){return!(e&&ys(e()))}const Do=i.defineComponent({render(){var e,t;return(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)}}),ui="n-config-provider",i1="n";function fi(e={},t={defaultBordered:!0}){const n=i.inject(ui,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}=e;return o!==void 0?o:(s=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:t.defaultBordered)!==null&&s!==void 0?s:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(i1),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function pi(e,t,n,r){n||ih("useThemeClass","cssVarsRef is not passed");const s=i.inject(ui,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=li();let d;const h=`__${e}`,f=()=>{let p=h;const u=t?t.value:void 0,g=o==null?void 0:o.value;g&&(p+=`-${g}`),u&&(p+=`-${u}`);const{themeOverrides:m,builtinThemeOverrides:_}=r;m&&(p+=`-${To(JSON.stringify(m))}`),_&&(p+=`-${To(JSON.stringify(_))}`),l.value=p,d=()=>{const y=n.value;let b="";for(const S in y)b+=`${S}: ${y[S]};`;oe(`.${p}`,b).mount({id:p,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{f()}),{themeClass:l,onRender:()=>{d==null||d()}}}const sh="n-form-item";function r1(e,{defaultSize:t="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(sh,null);i.provide(sh,null);const o=i.computed(n?()=>n(s):()=>{const{size:c}=e;if(c)return c;if(s){const{mergedSize:d}=s;if(d.value!==void 0)return d.value}return t}),a=i.computed(r?()=>r(s):()=>{const{disabled:c}=e;return c!==void 0?c:s?s.disabled.value:!1}),l=i.computed(()=>{const{status:c}=e;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 s1={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:e=>`Please load all ${e}'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:e=>`Total ${e} items`,selected:e=>`${e} 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"}};function Ho(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function mr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[l]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}function _r(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?a1(l,f=>f.test(a)):o1(l,f=>f.test(a));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function o1(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function a1(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function l1(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=t.slice(s.length);return{value:a,rest:l}}}const c1={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"}},d1=(e,t,n)=>{let r;const s=c1[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},h1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},u1=(e,t,n,r)=>h1[e],f1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},p1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},g1={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"]},m1={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"]},_1={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"}},y1={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"}},b1={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:mr({values:f1,defaultWidth:"wide"}),quarter:mr({values:p1,defaultWidth:"wide",argumentCallback:e=>e-1}),month:mr({values:g1,defaultWidth:"wide"}),day:mr({values:m1,defaultWidth:"wide"}),dayPeriod:mr({values:_1,defaultWidth:"wide",formattingValues:y1,defaultFormattingWidth:"wide"})},w1=/^(\d+)(th|st|nd|rd)?/i,v1=/\d+/i,k1={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},x1={any:[/^b/i,/^(a|c)/i]},C1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},S1={any:[/1/i,/2/i,/3/i,/4/i]},B1={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},T1={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]},E1={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},$1={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]},N1={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},R1={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}},P1={ordinalNumber:l1({matchPattern:w1,parsePattern:v1,valueCallback:e=>parseInt(e,10)}),era:_r({matchPatterns:k1,defaultMatchWidth:"wide",parsePatterns:x1,defaultParseWidth:"any"}),quarter:_r({matchPatterns:C1,defaultMatchWidth:"wide",parsePatterns:S1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:_r({matchPatterns:B1,defaultMatchWidth:"wide",parsePatterns:T1,defaultParseWidth:"any"}),day:_r({matchPatterns:E1,defaultMatchWidth:"wide",parsePatterns:$1,defaultParseWidth:"any"}),dayPeriod:_r({matchPatterns:N1,defaultMatchWidth:"any",parsePatterns:R1,defaultParseWidth:"any"})},F1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},M1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},A1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},I1={date:Ho({formats:F1,defaultWidth:"full"}),time:Ho({formats:M1,defaultWidth:"full"}),dateTime:Ho({formats:A1,defaultWidth:"full"})},V1={name:"en-US",locale:{code:"en-US",formatDistance:d1,formatLong:I1,formatRelative:u1,localize:b1,match:P1,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function oh(e){const{mergedLocaleRef:t,mergedDateLocaleRef:n}=i.inject(ui,null)||{},r=i.computed(()=>{var o,a;return(a=(o=t==null?void 0:t.value)===null||o===void 0?void 0:o[e])!==null&&a!==void 0?a:s1[e]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:V1}),localeRef:r}}const yr="naive-ui-style";function bs(e,t,n){if(!t)return;const r=li(),s=i.computed(()=>{const{value:l}=t;if(!l)return;const c=l[e];if(c)return c}),o=i.inject(ui,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${e}Rtl`;if(ab(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:yr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const br={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:O1,fontFamily:z1,lineHeight:L1}=br,ah=oe("body",`
116
+ `)}function To(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function sb(e,t,n,r){const{els:s}=t;if(n===void 0)s.forEach(od),t.els=[];else{const o=ls(n,r);o&&s.includes(o)&&(od(o),t.els=s.filter(a=>a!==o))}}function dd(e,t){e.push(t)}function ob(e,t,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=t.render(r),n=To(d)),c){c.adapter(n,d??t.render(r));return}l===void 0&&(l=document.head);const h=ls(n,l);if(h!==null&&!o)return h;const f=h??eb(n);if(d===void 0&&(d=t.render(r)),f.textContent=d,h!==null)return h;if(a){const p=l.querySelector(`meta[name="${a}"]`);if(p)return l.insertBefore(f,p),dd(t.els,f),f}return s?l.insertBefore(f,l.querySelector("style, link")):l.appendChild(f),dd(t.els,f),f}function ab(e){return rb(this,this.instance,e)}function lb(e={}){const{id:t,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=e;return ob(this.instance,this,t,r,s,o,a,l,n)}function cb(e={}){const{id:t,parent:n}=e;sb(this.instance,this,t,n)}const ds=function(e,t,n,r){return{instance:e,$:t,props:n,children:r,els:[],render:ab,mount:lb,unmount:cb}},db=function(e,t,n,r){return Array.isArray(t)?ds(e,{$:null},null,t):Array.isArray(n)?ds(e,t,null,n):Array.isArray(r)?ds(e,t,n,r):ds(e,t,n,null)};function hd(e={}){const t={c:(...n)=>db(t,...n),use:(n,...r)=>n.install(t,...r),find:ls,context:{},config:e};return t}function hb(e,t){if(e===void 0)return!1;if(t){const{context:{ids:n}}=t;return n.has(e)}return ls(e)!==null}const{c:zn}=hd(),Eo="vueuc-style";function ud(e){return e&-e}class fd{constructor(t,n){this.l=t,this.min=n;const r=new Array(t+1);for(let s=0;s<t+1;++s)r[s]=0;this.ft=r}add(t,n){if(n===0)return;const{l:r,ft:s}=this;for(t+=1;t<=r;)s[t]+=n,t+=ud(t)}get(t){return this.sum(t+1)-this.sum(t)}sum(t){if(t===void 0&&(t=this.l),t<=0)return 0;const{ft:n,min:r,l:s}=this;if(t>s)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let o=t*r;for(;t>0;)o+=n[t],t-=ud(t);return o}getBound(t){let n=0,r=this.l;for(;r>n;){const s=Math.floor((n+r)/2),o=this.sum(s);if(o>t){r=s;continue}else if(o<t){if(n===s)return this.sum(n+1)<=t?n+1:s;n=s}else return s}return n}}function pd(e){return typeof e=="string"?document.querySelector(e):e()}const ub=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(e){return{showTeleport:O_(i.toRef(e,"show")),mergedTo:i.computed(()=>{const{to:t}=e;return t??"body"})}},render(){return this.showTeleport?this.disabled?xo("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},xo("lazy-teleport",this.$slots)):null}}),hs={top:"bottom",bottom:"top",left:"right",right:"left"},gd={start:"end",center:"center",end:"start"},$o={top:"height",bottom:"height",left:"width",right:"width"},fb={"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"},pb={"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"},gb={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},md={top:!0,bottom:!1,left:!0,right:!1},yd={top:"end",bottom:"start",left:"end",right:"start"};function mb(e,t,n,r,s,o){if(!s||o)return{placement:e,top:0,left:0};const[a,l]=e.split("-");let c=l??"center",d={top:0,left:0};const h=(u,g,m)=>{let y=0,_=0;const b=n[u]-t[g]-t[u];return b>0&&r&&(m?_=md[g]?b:-b:y=md[g]?b:-b),{left:y,top:_}},f=a==="left"||a==="right";if(c!=="center"){const u=gb[e],g=hs[u],m=$o[u];if(n[m]>t[m]){if(t[u]+t[m]<n[m]){const y=(n[m]-t[m])/2;t[u]<y||t[g]<y?t[u]<t[g]?(c=gd[l],d=h(m,g,f)):d=h(m,u,f):c="center"}}else n[m]<t[m]&&t[g]<0&&t[u]>t[g]&&(c=gd[l])}else{const u=a==="bottom"||a==="top"?"left":"top",g=hs[u],m=$o[u],y=(n[m]-t[m])/2;(t[u]<y||t[g]<y)&&(t[u]>t[g]?(c=yd[u],d=h(m,u,f)):(c=yd[g],d=h(m,g,f)))}let p=a;return t[a]<n[$o[a]]&&t[a]<t[hs[a]]&&(p=hs[a]),{placement:c!=="center"?`${p}-${c}`:p,left:d.left,top:d.top}}function yb(e,t){return t?pb[e]:fb[e]}function _b(e,t,n,r,s,o){if(o)switch(e){case"bottom-start":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(e){case"bottom-start":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+s)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+s)}px`,transform:"translateX(-50%)"}}}const bb=zn([zn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),zn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[zn("> *",{pointerEvents:"all"})])]),_d=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(e){const t=i.inject("VBinder"),n=jt(()=>e.enabled!==void 0?e.enabled:e.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:p}=e;p.includes("scroll")&&t.addScrollListener(c),p.includes("resize")&&t.addResizeListener(c)},a=()=>{t.removeScrollListener(c),t.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=di();bb.mount({id:"vueuc/binder",head:!0,anchorMetaName:Eo,ssr:l}),i.onBeforeUnmount(()=>{a()}),L_(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const p=r.value;if(p===null)return;const u=t.targetRef,{x:g,y:m,overlap:y}=e,_=g!==void 0&&m!==void 0?W_(g,m):So(u);p.style.setProperty("--v-target-width",`${Math.round(_.width)}px`),p.style.setProperty("--v-target-height",`${Math.round(_.height)}px`);const{width:b,minWidth:S,placement:x,internalShift:v,flip:B}=e;p.setAttribute("v-placement",x),y?p.setAttribute("v-overlap",""):p.removeAttribute("v-overlap");const{style:k}=p;b==="target"?k.width=`${_.width}px`:b!==void 0?k.width=b:k.width="",S==="target"?k.minWidth=`${_.width}px`:S!==void 0?k.minWidth=S:k.minWidth="";const N=So(p),P=So(s.value),{left:R,top:W,placement:q}=mb(x,_,N,v,B,y),F=yb(q,y),{left:M,top:V,transform:K}=_b(q,P,_,W,R,y);p.setAttribute("v-placement",q),p.style.setProperty("--v-offset-left",`${Math.round(R)}px`),p.style.setProperty("--v-offset-top",`${Math.round(W)}px`),p.style.transform=`translateX(${M}) translateY(${V}) ${K}`,p.style.setProperty("--v-transform-origin",F),p.style.transformOrigin=F};i.watch(n,p=>{p?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(p=>console.error(p))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(p=>{i.watch(i.toRef(e,p),c)}),["teleportDisabled"].forEach(p=>{i.watch(i.toRef(e,p),d)}),i.watch(i.toRef(e,"syncTrigger"),p=>{p.includes("resize")?t.addResizeListener(c):t.removeResizeListener(c),p.includes("scroll")?t.addScrollListener(c):t.removeScrollListener(c)});const h=as(),f=jt(()=>{const{to:p}=e;if(p!==void 0)return p;h.value});return{VBinder:t,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:f,syncPosition:c}},render(){return i.h(ub,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e,t;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))]);return this.zindexable?i.withDirectives(n,[[Zc,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var hi=[],wb=function(){return hi.some(function(e){return e.activeTargets.length>0})},vb=function(){return hi.some(function(e){return e.skippedTargets.length>0})},bd="ResizeObserver loop completed with undelivered notifications.",kb=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:bd}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=bd),window.dispatchEvent(e)},ur;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(ur||(ur={}));var ui=function(e){return Object.freeze(e)},xb=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,ui(this)}return e}(),wd=function(){function e(t,n,r,s){return this.x=t,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,ui(this)}return e.prototype.toJSON=function(){var t=this,n=t.x,r=t.y,s=t.top,o=t.right,a=t.bottom,l=t.left,c=t.width,d=t.height;return{x:n,y:r,top:s,right:o,bottom:a,left:l,width:c,height:d}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),No=function(e){return e instanceof SVGElement&&"getBBox"in e},vd=function(e){if(No(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var s=e,o=s.offsetWidth,a=s.offsetHeight;return!(o||a||e.getClientRects().length)},kd=function(e){var t;if(e instanceof Element)return!0;var n=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},Cb=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},fr=typeof window<"u"?window:{},us=new WeakMap,xd=/auto|scroll/,Sb=/^tb|vertical/,Bb=/msie|trident/i.test(fr.navigator&&fr.navigator.userAgent),ln=function(e){return parseFloat(e||"0")},Li=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new xb((n?t:e)||0,(n?e:t)||0)},Cd=ui({devicePixelContentBoxSize:Li(),borderBoxSize:Li(),contentBoxSize:Li(),contentRect:new wd(0,0,0,0)}),Sd=function(e,t){if(t===void 0&&(t=!1),us.has(e)&&!t)return us.get(e);if(vd(e))return us.set(e,Cd),Cd;var n=getComputedStyle(e),r=No(e)&&e.ownerSVGElement&&e.getBBox(),s=!Bb&&n.boxSizing==="border-box",o=Sb.test(n.writingMode||""),a=!r&&xd.test(n.overflowY||""),l=!r&&xd.test(n.overflowX||""),c=r?0:ln(n.paddingTop),d=r?0:ln(n.paddingRight),h=r?0:ln(n.paddingBottom),f=r?0:ln(n.paddingLeft),p=r?0:ln(n.borderTopWidth),u=r?0:ln(n.borderRightWidth),g=r?0:ln(n.borderBottomWidth),m=r?0:ln(n.borderLeftWidth),y=f+d,_=c+h,b=m+u,S=p+g,x=l?e.offsetHeight-S-e.clientHeight:0,v=a?e.offsetWidth-b-e.clientWidth:0,B=s?y+b:0,k=s?_+S:0,N=r?r.width:ln(n.width)-B-v,P=r?r.height:ln(n.height)-k-x,R=N+y+v+b,W=P+_+x+S,q=ui({devicePixelContentBoxSize:Li(Math.round(N*devicePixelRatio),Math.round(P*devicePixelRatio),o),borderBoxSize:Li(R,W,o),contentBoxSize:Li(N,P,o),contentRect:new wd(f,c,N,P)});return us.set(e,q),q},Bd=function(e,t,n){var r=Sd(e,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case ur.DEVICE_PIXEL_CONTENT_BOX:return a;case ur.BORDER_BOX:return s;default:return o}},Tb=function(){function e(t){var n=Sd(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=ui([n.borderBoxSize]),this.contentBoxSize=ui([n.contentBoxSize]),this.devicePixelContentBoxSize=ui([n.devicePixelContentBoxSize])}return e}(),Td=function(e){if(vd(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Eb=function(){var e=1/0,t=[];hi.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var h=new Tb(d.target),f=Td(d.target);l.push(h),d.lastReportedSize=Bd(d.target,d.observedBox),f<e&&(e=f)}),t.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var s=r[n];s()}return e},Ed=function(e){hi.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(Td(s.target)>e?n.activeTargets.push(s):n.skippedTargets.push(s))})})},$b=function(){var e=0;for(Ed(e);wb();)e=Eb(),Ed(e);return vb()&&kb(),e>0},Ro,$d=[],Nb=function(){return $d.splice(0).forEach(function(e){return e()})},Rb=function(e){if(!Ro){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Nb()}).observe(n,r),Ro=function(){n.textContent="".concat(t?t--:t++)}}$d.push(e),Ro()},Pb=function(e){Rb(function(){requestAnimationFrame(e)})},fs=0,Fb=function(){return!!fs},Mb=250,Ab={attributes:!0,characterData:!0,childList:!0,subtree:!0},Nd=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Rd=function(e){return e===void 0&&(e=0),Date.now()+e},Po=!1,Ib=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var n=this;if(t===void 0&&(t=Mb),!Po){Po=!0;var r=Rd(t);Pb(function(){var s=!1;try{s=$b()}finally{if(Po=!1,t=r-Rd(),!Fb())return;s?n.run(1e3):t>0?n.run(t):n.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,n=function(){return t.observer&&t.observer.observe(document.body,Ab)};document.body?n():fr.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Nd.forEach(function(n){return fr.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Nd.forEach(function(n){return fr.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),Fo=new Ib,Pd=function(e){!fs&&e>0&&Fo.start(),fs+=e,!fs&&Fo.stop()},Vb=function(e){return!No(e)&&!Cb(e)&&getComputedStyle(e).display==="inline"},Ob=function(){function e(t,n){this.target=t,this.observedBox=n||ur.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=Bd(this.target,this.observedBox,!0);return Vb(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),zb=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),ps=new WeakMap,Fd=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},gs=function(){function e(){}return e.connect=function(t,n){var r=new zb(t,n);ps.set(t,r)},e.observe=function(t,n,r){var s=ps.get(t),o=s.observationTargets.length===0;Fd(s.observationTargets,n)<0&&(o&&hi.push(s),s.observationTargets.push(new Ob(n,r&&r.box)),Pd(1),Fo.schedule())},e.unobserve=function(t,n){var r=ps.get(t),s=Fd(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&hi.splice(hi.indexOf(r),1),r.observationTargets.splice(s,1),Pd(-1))},e.disconnect=function(t){var n=this,r=ps.get(t);r.observationTargets.slice().forEach(function(s){return n.unobserve(t,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Lb=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");gs.connect(this,t)}return e.prototype.observe=function(t,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!kd(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");gs.observe(this,t,n)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!kd(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");gs.unobserve(this,t)},e.prototype.disconnect=function(){gs.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();class Db{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Lb)(this.handleResize),this.elHandlersMap=new Map}handleResize(t){for(const n of t){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(t,n){this.elHandlersMap.set(t,n),this.observer.observe(t)}unregisterHandler(t){this.elHandlersMap.has(t)&&(this.elHandlersMap.delete(t),this.observer.unobserve(t))}}const pr=new Db,ms=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(e){let t=!1;const n=i.getCurrentInstance().proxy;function r(s){const{onResize:o}=e;o!==void 0&&o(s)}i.onMounted(()=>{const s=n.$el;if(s===void 0){rd("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){rd("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(pr.registerHandler(s.nextElementSibling,r),t=!0)}),i.onBeforeUnmount(()=>{t&&pr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let ys;function Hb(){return typeof document>"u"?!1:(ys===void 0&&("matchMedia"in window?ys=window.matchMedia("(pointer:coarse)").matches:ys=!1),ys)}let Mo;function Md(){return typeof document>"u"?1:(Mo===void 0&&(Mo="chrome"in window?window.devicePixelRatio:1),Mo)}const Ad="VVirtualListXScroll";function Wb({columnsRef:e,renderColRef:t,renderItemWithColsRef:n}){const r=i.ref(0),s=i.ref(0),o=i.computed(()=>{const d=e.value;if(d.length===0)return null;const h=new fd(d.length,0);return d.forEach((f,p)=>{h.add(p,f.width)}),h}),a=jt(()=>{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=jt(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,e.value.length-1):0});return i.provide(Ad,{startIndexRef:a,endIndexRef:c,columnsRef:e,renderColRef:t,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Id=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:e,endIndexRef:t,columnsRef:n,getLeft:r,renderColRef:s,renderItemWithColsRef:o}=i.inject(Ad);return{startIndex:e,endIndex:t,columns:n,renderCol:s,renderItemWithCols:o,getLeft:r}},render(){const{startIndex:e,endIndex:t,columns:n,renderCol:r,renderItemWithCols:s,getLeft:o,item:a}=this;if(s!=null)return s({itemIndex:this.index,startColIndex:e,endColIndex:t,allColumns:n,item:a,getLeft:o});if(r!=null){const l=[];for(let c=e;c<=t;++c){const d=n[c];l.push(r({column:d,left:o(c),item:a}))}return l}return null}}),jb=zn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[zn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[zn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Xb=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(e){const t=di();jb.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Eo,ssr:t}),i.onMounted(()=>{const{defaultScrollIndex:F,defaultScrollKey:M}=e;F!=null?y({index:F}):M!=null&&y({key:M})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}y({top:u.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=jt(()=>{if(e.renderCol==null&&e.renderItemWithCols==null||e.columns.length===0)return;let F=0;return e.columns.forEach(M=>{F+=M.width}),F}),o=i.computed(()=>{const F=new Map,{keyField:M}=e;return e.items.forEach((V,K)=>{F.set(V[M],K)}),F}),{scrollLeftRef:a,listWidthRef:l}=Wb({columnsRef:i.toRef(e,"columns"),renderColRef:i.toRef(e,"renderCol"),renderItemWithColsRef:i.toRef(e,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),h=new Map,f=i.computed(()=>{const{items:F,itemSize:M,keyField:V}=e,K=new fd(F.length,M);return F.forEach((T,$)=>{const j=T[V],z=h.get(j);z!==void 0&&K.add($,z)}),K}),p=i.ref(0),u=i.ref(0),g=jt(()=>Math.max(f.value.getBound(u.value-cr(e.paddingTop))-1,0)),m=i.computed(()=>{const{value:F}=d;if(F===void 0)return[];const{items:M,itemSize:V}=e,K=g.value,T=Math.min(K+Math.ceil(F/V+1),M.length-1),$=[];for(let j=K;j<=T;++j)$.push(M[j]);return $}),y=(F,M)=>{if(typeof F=="number"){x(F,M,"auto");return}const{left:V,top:K,index:T,key:$,position:j,behavior:z,debounce:U=!0}=F;if(V!==void 0||K!==void 0)x(V,K,z);else if(T!==void 0)S(T,z,U);else if($!==void 0){const I=o.value.get($);I!==void 0&&S(I,z,U)}else j==="bottom"?x(0,Number.MAX_SAFE_INTEGER,z):j==="top"&&x(0,0,z)};let _,b=null;function S(F,M,V){const{value:K}=f,T=K.sum(F)+cr(e.paddingTop);if(!V)c.value.scrollTo({left:0,top:T,behavior:M});else{_=F,b!==null&&window.clearTimeout(b),b=window.setTimeout(()=>{_=void 0,b=null},16);const{scrollTop:$,offsetHeight:j}=c.value;if(T>$){const z=K.get(F);T+z<=$+j||c.value.scrollTo({left:0,top:T+z-j,behavior:M})}else c.value.scrollTo({left:0,top:T,behavior:M})}}function x(F,M,V){c.value.scrollTo({left:F,top:M,behavior:V})}function v(F,M){var V,K,T;if(n||e.ignoreItemResize||q(M.target))return;const{value:$}=f,j=o.value.get(F),z=$.get(j),U=(T=(K=(V=M.borderBoxSize)===null||V===void 0?void 0:V[0])===null||K===void 0?void 0:K.blockSize)!==null&&T!==void 0?T:M.contentRect.height;if(U===z)return;U-e.itemSize===0?h.delete(F):h.set(F,U-e.itemSize);const O=U-z;if(O===0)return;$.add(j,O);const Z=c.value;if(Z!=null){if(_===void 0){const ge=$.sum(j);Z.scrollTop>ge&&Z.scrollBy(0,O)}else if(j<_)Z.scrollBy(0,O);else if(j===_){const ge=$.sum(j);U+ge>Z.scrollTop+Z.offsetHeight&&Z.scrollBy(0,O)}W()}p.value++}const B=!Hb();let k=!1;function N(F){var M;(M=e.onScroll)===null||M===void 0||M.call(e,F),(!B||!k)&&W()}function P(F){var M;if((M=e.onWheel)===null||M===void 0||M.call(e,F),B){const V=c.value;if(V!=null){if(F.deltaX===0&&(V.scrollTop===0&&F.deltaY<=0||V.scrollTop+V.offsetHeight>=V.scrollHeight&&F.deltaY>=0))return;F.preventDefault(),V.scrollTop+=F.deltaY/Md(),V.scrollLeft+=F.deltaX/Md(),W(),k=!0,Lc(()=>{k=!1})}}}function R(F){if(n||q(F.target))return;if(e.renderCol==null&&e.renderItemWithCols==null){if(F.contentRect.height===d.value)return}else if(F.contentRect.height===d.value&&F.contentRect.width===l.value)return;d.value=F.contentRect.height,l.value=F.contentRect.width;const{onResize:M}=e;M!==void 0&&M(F)}function W(){const{value:F}=c;F!=null&&(u.value=F.scrollTop,a.value=F.scrollLeft)}function q(F){let M=F;for(;M!==null;){if(M.style.display==="none")return!0;M=M.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:F}=e,M=dr(f.value.sum());return p.value,[e.itemsStyle,{boxSizing:"content-box",width:dr(s.value),height:F?"":M,minHeight:F?M:"",paddingTop:dr(e.paddingTop),paddingBottom:dr(e.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(p.value,{transform:`translateY(${dr(f.value.sum(g.value))})`})),viewportItems:m,listElRef:c,itemsElRef:i.ref(null),scrollTo:y,handleListResize:R,handleListScroll:N,handleListWheel:P,handleItemResize:v}},render(){const{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:r}=this;return i.h(ms,{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[t],h=n.get(d),f=a!=null?i.h(Id,{index:h,item:c}):void 0,p=l!=null?i.h(Id,{index:h,item:c}):void 0,u=this.$slots.default({item:c,renderedCols:f,renderedItemWithCols:p,index:h})[0];return e?i.h(ms,{key:d,onResize:g=>this.handleItemResize(d,g)},{default:()=>u}):(u.key=d,u)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),bn="v-hidden",qb=zn("[v-hidden]",{display:"none!important"}),Vd=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){const n=i.ref(null),r=i.ref(null);function s(a){const{value:l}=n,{getCounter:c,getTail:d}=e;let h;if(c!==void 0?h=c():h=r.value,!l||!h)return;h.hasAttribute(bn)&&h.removeAttribute(bn);const{children:f}=l;if(a.showAllItemsBeforeCalculate)for(const S of f)S.hasAttribute(bn)&&S.removeAttribute(bn);const p=l.offsetWidth,u=[],g=t.tail?d==null?void 0:d():null;let m=g?g.offsetWidth:0,y=!1;const _=l.children.length-(t.tail?1:0);for(let S=0;S<_-1;++S){if(S<0)continue;const x=f[S];if(y){x.hasAttribute(bn)||x.setAttribute(bn,"");continue}else x.hasAttribute(bn)&&x.removeAttribute(bn);const v=x.offsetWidth;if(m+=v,u[S]=v,m>p){const{updateCounter:B}=e;for(let k=S;k>=0;--k){const N=_-1-k;B!==void 0?B(N):h.textContent=`${N}`;const P=h.offsetWidth;if(m-=u[k],m+P<=p||k===0){y=!0,S=k-1,g&&(S===-1?(g.style.maxWidth=`${p-P}px`,g.style.boxSizing="border-box"):g.style.maxWidth="");const{onUpdateCount:R}=e;R&&R(N);break}}}}const{onUpdateOverflow:b}=e;y?b!==void 0&&b(!0):(b!==void 0&&b(!1),h.setAttribute(bn,""))}const o=di();return qb.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Eo,ssr:o}),i.onMounted(()=>s({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:s}},render(){const{$slots:e}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(e,"default"),e.counter?e.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function Od(e){return e instanceof HTMLElement}function zd(e){for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes[t];if(Od(n)&&(Dd(n)||zd(n)))return!0}return!1}function Ld(e){for(let t=e.childNodes.length-1;t>=0;t--){const n=e.childNodes[t];if(Od(n)&&(Dd(n)||Ld(n)))return!0}return!1}function Dd(e){if(!Yb(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function Yb(e){if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.getAttribute("disabled"))return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return e.type!=="hidden"&&e.type!=="file";case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}let gr=[];const Ub=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:String,finalFocusTo:String,returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(e){const t=n_(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return gr[gr.length-1]===t}function c(y){var _;y.code==="Escape"&&l()&&((_=e.onEsc)===null||_===void 0||_.call(e,y))}i.onMounted(()=>{i.watch(()=>e.active,y=>{y?(f(),Bt("keydown",document,c)):(it("keydown",document,c),s&&p())},{immediate:!0})}),i.onBeforeUnmount(()=>{it("keydown",document,c),s&&p()});function d(y){if(!o&&l()){const _=h();if(_===null||_.contains(lr(y)))return;u("first")}}function h(){const y=n.value;if(y===null)return null;let _=y;for(;_=_.nextSibling,!(_===null||_ instanceof Element&&_.tagName==="DIV"););return _}function f(){var y;if(!e.disabled){if(gr.push(t),e.autoFocus){const{initialFocusTo:_}=e;_===void 0?u("first"):(y=pd(_))===null||y===void 0||y.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function p(){var y;if(e.disabled||(document.removeEventListener("focus",d,!0),gr=gr.filter(b=>b!==t),l()))return;const{finalFocusTo:_}=e;_!==void 0?(y=pd(_))===null||y===void 0||y.focus({preventScroll:!0}):e.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function u(y){if(l()&&e.active){const _=n.value,b=r.value;if(_!==null&&b!==null){const S=h();if(S==null||S===b){o=!0,_.focus({preventScroll:!0}),o=!1;return}o=!0;const x=y==="first"?zd(S):Ld(S);o=!1,x||(o=!0,_.focus({preventScroll:!0}),o=!1)}}}function g(y){if(o)return;const _=h();_!==null&&(y.relatedTarget!==null&&_.contains(y.relatedTarget)?u("last"):u("first"))}function m(y){o||(y.relatedTarget!==null&&y.relatedTarget===n.value?u("last"):u("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:g,handleEndFocus:m}},render(){const{default:e}=this.$slots;if(e===void 0)return null;if(this.disabled)return e();const{active:t,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:t?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),e(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:t?"0":"-1",onFocus:this.handleEndFocus})])}});function jk(e){return e}const Ao="n-internal-select-menu",Hd="n-internal-select-menu-body",Wd="n-drawer-body",jd="n-modal-body",Xd="n-popover-body",qd="__disabled__";function wn(e){const t=i.inject(jd,null),n=i.inject(Wd,null),r=i.inject(Xd,null),s=i.inject(Hd,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{Bt("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{it("fullscreenchange",document,a)})}return jt(()=>{var a;const{to:l}=e;return l!==void 0?l===!1?qd:l===!0?o.value||"body":l:t!=null&&t.value?(a=t.value.$el)!==null&&a!==void 0?a:t.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:s!=null&&s.value?s.value:l??(o.value||"body")})}wn.tdkey=qd,wn.propTo={type:[String,Object,Boolean],default:void 0};function Gb(e){const t={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(t.isDeactivated=!1,!n){n=!0;return}e()}),i.onDeactivated(()=>{t.isDeactivated=!0,n||(n=!0)}),t}function Yd(e,t){t&&(i.onMounted(()=>{const{value:n}=e;n&&pr.registerHandler(n,t)}),i.watch(e,(n,r)=>{r&&pr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=e;n&&pr.unregisterHandler(n)}))}function Ud(e){return e.replace(/#|\(|\)|,|\s|\./g,"_")}const Kb=/^(\d|\.)+$/,Gd=/(\d|\.)+/;function Io(e,{c:t=1,offset:n=0,attachPx:r=!0}={}){if(typeof e=="number"){const s=(e+n)*t;return s===0?"0":`${s}px`}else if(typeof e=="string")if(Kb.test(e)){const s=(Number(e)+n)*t;return r?s===0?"0":`${s}px`:`${s}`}else{const s=Gd.exec(e);return s?e.replace(Gd,String((Number(s[0])+n)*t)):e}return e}function Kd(e){const{left:t,right:n,top:r,bottom:s}=Ut(e);return`${r} ${t} ${s} ${n}`}var Zd={};function Zb(e){let t=".",n="__",r="--",s;if(e){let g=e.blockPrefix;g&&(t=g),g=e.elementPrefix,g&&(n=g),g=e.modifierPrefix,g&&(r=g)}const o={install(g){s=g.c;const m=g.context;m.bem={},m.bem.b=null,m.bem.els=null}};function a(g){let m,y;return{before(_){m=_.bem.b,y=_.bem.els,_.bem.els=null},after(_){_.bem.b=m,_.bem.els=y},$({context:_,props:b}){return g=typeof g=="string"?g:g({context:_,props:b}),_.bem.b=g,`${(b==null?void 0:b.bPrefix)||t}${_.bem.b}`}}}function l(g){let m;return{before(y){m=y.bem.els},after(y){y.bem.els=m},$({context:y,props:_}){return g=typeof g=="string"?g:g({context:y,props:_}),y.bem.els=g.split(",").map(b=>b.trim()),y.bem.els.map(b=>`${(_==null?void 0:_.bPrefix)||t}${y.bem.b}${n}${b}`).join(", ")}}}function c(g){return{$({context:m,props:y}){g=typeof g=="string"?g:g({context:m,props:y});const _=g.split(",").map(x=>x.trim());function b(x){return _.map(v=>`&${(y==null?void 0:y.bPrefix)||t}${m.bem.b}${x!==void 0?`${n}${x}`:""}${r}${v}`).join(", ")}const S=m.bem.els;if(S!==null){if(Zd.NODE_ENV!=="production"&&S.length>=2)throw Error(`[css-render/plugin-bem]: m(${g}) is invalid, using modifier inside multiple elements is not allowed`);return b(S[0])}else return b()}}}function d(g){return{$({context:m,props:y}){g=typeof g=="string"?g:g({context:m,props:y});const _=m.bem.els;if(Zd.NODE_ENV!=="production"&&_!==null&&_.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)||t}${m.bem.b}${_!==null&&_.length>0?`${n}${_[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 Jb=".n-",Qb="__",e1="--",Jd=hd(),Qd=Zb({blockPrefix:Jb,elementPrefix:Qb,modifierPrefix:e1});Jd.use(Qd);const{c:oe,find:qk}=Jd,{cB:fe,cE:ye,cM:Se,cNotM:Gt}=Qd,t1=(...e)=>oe(">",[fe(...e)]);function qe(e,t){return e+(t==="default"?"":t.replace(/^[a-z]/,n=>n.toUpperCase()))}let Vo;function n1(){return Vo===void 0&&(Vo=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Vo}const i1=new WeakSet;function r1(e){i1.add(e)}function eh(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}const th=new Set;function Ln(e,t){const n=`[naive/${e}]: ${t}`;th.has(n)||(th.add(n),console.error(n))}function nh(e,t){console.error(`[naive/${e}]: ${t}`)}function ih(e,t){throw new Error(`[naive/${e}]: ${t}`)}function mt(e,...t){if(Array.isArray(e))e.forEach(n=>mt(n,...t));else return e(...t)}function Oo(e,t=!0,n=[]){return e.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)){Oo(r,t,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Oo(r.children,t,n)}else{if(r.type===i.Comment&&t)return;n.push(r)}}}),n}function s1(e,t="default",n=void 0){const r=e[t];if(!r)return nh("getFirstSlotVNode",`slot[${t}] is empty`),null;const s=Oo(r(n));return s.length===1?s[0]:(nh("getFirstSlotVNode",`slot[${t}] should have exactly one child`),null)}function o1(e,t=[],n){const r={};return t.forEach(s=>{r[s]=e[s]}),Object.assign(r,n)}function zo(e){const t=e.filter(n=>n!==void 0);if(t.length!==0)return t.length===1?t[0]:n=>{e.forEach(r=>{r&&r(n)})}}function Di(e,...t){return typeof e=="function"?e(...t):typeof e=="string"?i.createTextVNode(e):typeof e=="number"?i.createTextVNode(String(e)):null}function _s(e){return e.some(t=>i.isVNode(t)?!(t.type===i.Comment||t.type===i.Fragment&&!_s(t.children)):!0)?e:null}function Lo(e,t){return e&&_s(e())||t()}function fi(e,t){const n=e&&_s(e());return t(n||null)}function rh(e){return!(e&&_s(e()))}const Do=i.defineComponent({render(){var e,t;return(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)}}),pi="n-config-provider",a1="n";function gi(e={},t={defaultBordered:!0}){const n=i.inject(pi,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}=e;return o!==void 0?o:(s=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:t.defaultBordered)!==null&&s!==void 0?s:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(a1),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function mi(e,t,n,r){n||ih("useThemeClass","cssVarsRef is not passed");const s=i.inject(pi,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=di();let d;const h=`__${e}`,f=()=>{let p=h;const u=t?t.value:void 0,g=o==null?void 0:o.value;g&&(p+=`-${g}`),u&&(p+=`-${u}`);const{themeOverrides:m,builtinThemeOverrides:y}=r;m&&(p+=`-${To(JSON.stringify(m))}`),y&&(p+=`-${To(JSON.stringify(y))}`),l.value=p,d=()=>{const _=n.value;let b="";for(const S in _)b+=`${S}: ${_[S]};`;oe(`.${p}`,b).mount({id:p,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{f()}),{themeClass:l,onRender:()=>{d==null||d()}}}const sh="n-form-item";function l1(e,{defaultSize:t="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(sh,null);i.provide(sh,null);const o=i.computed(n?()=>n(s):()=>{const{size:c}=e;if(c)return c;if(s){const{mergedSize:d}=s;if(d.value!==void 0)return d.value}return t}),a=i.computed(r?()=>r(s):()=>{const{disabled:c}=e;return c!==void 0?c:s?s.disabled.value:!1}),l=i.computed(()=>{const{status:c}=e;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 c1={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:e=>`Please load all ${e}'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:e=>`Total ${e} items`,selected:e=>`${e} 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"}};function Ho(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function mr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[l]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}function yr(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?h1(l,f=>f.test(a)):d1(l,f=>f.test(a));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function d1(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function h1(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function u1(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=t.slice(s.length);return{value:a,rest:l}}}const f1={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"}},p1=(e,t,n)=>{let r;const s=f1[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},g1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},m1=(e,t,n,r)=>g1[e],y1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},b1={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"]},w1={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"]},v1={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"}},k1={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"}},x1={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:mr({values:y1,defaultWidth:"wide"}),quarter:mr({values:_1,defaultWidth:"wide",argumentCallback:e=>e-1}),month:mr({values:b1,defaultWidth:"wide"}),day:mr({values:w1,defaultWidth:"wide"}),dayPeriod:mr({values:v1,defaultWidth:"wide",formattingValues:k1,defaultFormattingWidth:"wide"})},C1=/^(\d+)(th|st|nd|rd)?/i,S1=/\d+/i,B1={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},T1={any:[/^b/i,/^(a|c)/i]},E1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},$1={any:[/1/i,/2/i,/3/i,/4/i]},N1={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},R1={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]},P1={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},F1={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]},M1={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},A1={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}},I1={ordinalNumber:u1({matchPattern:C1,parsePattern:S1,valueCallback:e=>parseInt(e,10)}),era:yr({matchPatterns:B1,defaultMatchWidth:"wide",parsePatterns:T1,defaultParseWidth:"any"}),quarter:yr({matchPatterns:E1,defaultMatchWidth:"wide",parsePatterns:$1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:yr({matchPatterns:N1,defaultMatchWidth:"wide",parsePatterns:R1,defaultParseWidth:"any"}),day:yr({matchPatterns:P1,defaultMatchWidth:"wide",parsePatterns:F1,defaultParseWidth:"any"}),dayPeriod:yr({matchPatterns:M1,defaultMatchWidth:"any",parsePatterns:A1,defaultParseWidth:"any"})},V1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},O1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},z1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},L1={date:Ho({formats:V1,defaultWidth:"full"}),time:Ho({formats:O1,defaultWidth:"full"}),dateTime:Ho({formats:z1,defaultWidth:"full"})},D1={name:"en-US",locale:{code:"en-US",formatDistance:p1,formatLong:L1,formatRelative:m1,localize:x1,match:I1,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function oh(e){const{mergedLocaleRef:t,mergedDateLocaleRef:n}=i.inject(pi,null)||{},r=i.computed(()=>{var o,a;return(a=(o=t==null?void 0:t.value)===null||o===void 0?void 0:o[e])!==null&&a!==void 0?a:c1[e]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:D1}),localeRef:r}}const _r="naive-ui-style";function bs(e,t,n){if(!t)return;const r=di(),s=i.computed(()=>{const{value:l}=t;if(!l)return;const c=l[e];if(c)return c}),o=i.inject(pi,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${e}Rtl`;if(hb(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:_r,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const br={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:H1,fontFamily:W1,lineHeight:j1}=br,ah=oe("body",`
117
117
  margin: 0;
118
- font-size: ${O1};
119
- font-family: ${z1};
120
- line-height: ${L1};
118
+ font-size: ${H1};
119
+ font-family: ${W1};
120
+ line-height: ${j1};
121
121
  -webkit-text-size-adjust: 100%;
122
122
  -webkit-tap-highlight-color: transparent;
123
123
  `,[oe("input",`
124
124
  font-family: inherit;
125
125
  font-size: inherit;
126
- `)]);var D1={};function ws(e,t,n){if(!t){D1.NODE_ENV!=="production"&&ih("use-style","No style is specified.");return}const r=li(),s=i.inject(ui,null),o=()=>{const a=n.value;t.mount({id:a===void 0?e:a+e,head:!0,anchorMetaName:yr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget}),s!=null&&s.preflightStyleDisabled||ah.mount({id:"n-global",head:!0,anchorMetaName:yr,ssr:r,parent:s==null?void 0:s.styleMountTarget})};r?o():i.onBeforeMount(o)}function Xk(e){return e}function mt(e,t,n,r,s,o){const a=li(),l=i.inject(ui,null);if(n){const d=()=>{const h=o==null?void 0:o.value;n.mount({id:h===void 0?t:h+t,head:!0,props:{bPrefix:h?`.${h}-`:void 0},anchorMetaName:yr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||ah.mount({id:"n-global",head:!0,anchorMetaName:yr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:h,self:f,peers:p={}}={},themeOverrides:u={},builtinThemeOverrides:g={}}=s,{common:m,peers:_}=u,{common:y=void 0,[e]:{common:b=void 0,self:S=void 0,peers:C={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:v=void 0,[e]:B={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:k,peers:E={}}=B,P=D.merge({},h||b||y||r.common,v,k,m),R=D.merge((d=f||S||r.self)===null||d===void 0?void 0:d(P),g,B,u);return{common:P,self:R,peers:D.merge({},r.peers,C,p),peerOverrides:D.merge({},g.peers,E,_)}})}mt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const H1=fe("base-icon",`
126
+ `)]);var X1={};function ws(e,t,n){if(!t){X1.NODE_ENV!=="production"&&ih("use-style","No style is specified.");return}const r=di(),s=i.inject(pi,null),o=()=>{const a=n.value;t.mount({id:a===void 0?e:a+e,head:!0,anchorMetaName:_r,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget}),s!=null&&s.preflightStyleDisabled||ah.mount({id:"n-global",head:!0,anchorMetaName:_r,ssr:r,parent:s==null?void 0:s.styleMountTarget})};r?o():i.onBeforeMount(o)}function Gk(e){return e}function yt(e,t,n,r,s,o){const a=di(),l=i.inject(pi,null);if(n){const d=()=>{const h=o==null?void 0:o.value;n.mount({id:h===void 0?t:h+t,head:!0,props:{bPrefix:h?`.${h}-`:void 0},anchorMetaName:_r,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||ah.mount({id:"n-global",head:!0,anchorMetaName:_r,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:h,self:f,peers:p={}}={},themeOverrides:u={},builtinThemeOverrides:g={}}=s,{common:m,peers:y}=u,{common:_=void 0,[e]:{common:b=void 0,self:S=void 0,peers:x={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:v=void 0,[e]:B={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:k,peers:N={}}=B,P=D.merge({},h||b||_||r.common,v,k,m),R=D.merge((d=f||S||r.self)===null||d===void 0?void 0:d(P),g,B,u);return{common:P,self:R,peers:D.merge({},r.peers,x,p),peerOverrides:D.merge({},g.peers,N,y)}})}yt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const q1=fe("base-icon",`
127
127
  height: 1em;
128
128
  width: 1em;
129
129
  line-height: 1em;
@@ -135,12 +135,12 @@ ${s}
135
135
  `,[oe("svg",`
136
136
  height: 1em;
137
137
  width: 1em;
138
- `)]),wr=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(e){ws("-base-icon",H1,i.toRef(e,"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)}}),lh=i.defineComponent({name:"BaseIconSwitchTransition",setup(e,{slots:t}){const n=as();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},t)}});function ch(e,t){const n=i.defineComponent({render(){return t()}});return i.defineComponent({name:D.upperFirst(e),setup(){var r;const s=(r=i.inject(ui,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[e];return a?a():i.h(n,null)}}})}const W1=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"})))}}),j1=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"}))}}),X1=ch("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"}))))),q1=ch("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"}))))),Y1=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:U1}=br;function Wo({originalTransform:e="",left:t=0,top:n=0,transition:r=`all .3s ${U1} !important`}={}){return[oe("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${e} scale(0.75)`,left:t,top:n,opacity:0}),oe("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${e}`,left:t,top:n,opacity:1}),oe("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:t,top:n,transition:r})]}const G1=fe("base-clear",`
138
+ `)]),wr=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(e){ws("-base-icon",q1,i.toRef(e,"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)}}),lh=i.defineComponent({name:"BaseIconSwitchTransition",setup(e,{slots:t}){const n=as();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},t)}});function ch(e,t){const n=i.defineComponent({render(){return t()}});return i.defineComponent({name:D.upperFirst(e),setup(){var r;const s=(r=i.inject(pi,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[e];return a?a():i.h(n,null)}}})}const Y1=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"})))}}),U1=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"}))}}),G1=ch("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"}))))),K1=ch("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"}))))),Z1=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:J1}=br;function Wo({originalTransform:e="",left:t=0,top:n=0,transition:r=`all .3s ${J1} !important`}={}){return[oe("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${e} scale(0.75)`,left:t,top:n,opacity:0}),oe("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${e}`,left:t,top:n,opacity:1}),oe("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:t,top:n,transition:r})]}const Q1=fe("base-clear",`
139
139
  flex-shrink: 0;
140
140
  height: 1em;
141
141
  width: 1em;
142
142
  position: relative;
143
- `,[oe(">",[_e("clear",`
143
+ `,[oe(">",[ye("clear",`
144
144
  font-size: var(--n-clear-size);
145
145
  height: 1em;
146
146
  width: 1em;
@@ -152,14 +152,14 @@ ${s}
152
152
  color: var(--n-clear-color-hover)!important;
153
153
  `),oe("&:active",`
154
154
  color: var(--n-clear-color-pressed)!important;
155
- `)]),_e("placeholder",`
155
+ `)]),ye("placeholder",`
156
156
  display: flex;
157
- `),_e("clear, placeholder",`
157
+ `),ye("clear, placeholder",`
158
158
  position: absolute;
159
159
  left: 50%;
160
160
  top: 50%;
161
161
  transform: translateX(-50%) translateY(-50%);
162
- `,[Wo({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),K1=i.defineComponent({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return ws("-base-clear",G1,i.toRef(e,"clsPrefix")),{handleMouseDown(t){t.preventDefault()}}},render(){const{clsPrefix:e}=this;return i.h("div",{class:`${e}-base-clear`},i.h(lh,null,{default:()=>{var t,n;return this.show?i.h("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Lo(this.$slots.icon,()=>[i.h(wr,{clsPrefix:e},{default:()=>i.h(X1,null)})])):i.h("div",{key:"icon",class:`${e}-base-clear__placeholder`},(n=(t=this.$slots).placeholder)===null||n===void 0?void 0:n.call(t))}}))}}),Z1=fe("base-close",`
162
+ `,[Wo({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),ew=i.defineComponent({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return ws("-base-clear",Q1,i.toRef(e,"clsPrefix")),{handleMouseDown(t){t.preventDefault()}}},render(){const{clsPrefix:e}=this;return i.h("div",{class:`${e}-base-clear`},i.h(lh,null,{default:()=>{var t,n;return this.show?i.h("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Lo(this.$slots.icon,()=>[i.h(wr,{clsPrefix:e},{default:()=>i.h(G1,null)})])):i.h("div",{key:"icon",class:`${e}-base-clear__placeholder`},(n=(t=this.$slots).placeholder)===null||n===void 0?void 0:n.call(t))}}))}}),tw=fe("base-close",`
163
163
  display: flex;
164
164
  align-items: center;
165
165
  justify-content: center;
@@ -174,7 +174,7 @@ ${s}
174
174
  border: none;
175
175
  position: relative;
176
176
  padding: 0;
177
- `,[Ce("absolute",`
177
+ `,[Se("absolute",`
178
178
  height: var(--n-close-icon-size);
179
179
  width: var(--n-close-icon-size);
180
180
  `),oe("&::before",`
@@ -187,7 +187,7 @@ ${s}
187
187
  transform: translateY(-50%) translateX(-50%);
188
188
  transition: inherit;
189
189
  border-radius: inherit;
190
- `),Ut("disabled",[oe("&:hover",`
190
+ `),Gt("disabled",[oe("&:hover",`
191
191
  color: var(--n-close-icon-color-hover);
192
192
  `),oe("&:hover::before",`
193
193
  background-color: var(--n-close-color-hover);
@@ -197,13 +197,13 @@ ${s}
197
197
  color: var(--n-close-icon-color-pressed);
198
198
  `),oe("&:active::before",`
199
199
  background-color: var(--n-close-color-pressed);
200
- `)]),Ce("disabled",`
200
+ `)]),Se("disabled",`
201
201
  cursor: not-allowed;
202
202
  color: var(--n-close-icon-color-disabled);
203
203
  background-color: transparent;
204
- `),Ce("round",[oe("&::before",`
204
+ `),Se("round",[oe("&::before",`
205
205
  border-radius: 50%;
206
- `)])]),J1=i.defineComponent({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(e){return ws("-base-close",Z1,i.toRef(e,"clsPrefix")),()=>{const{clsPrefix:t,disabled:n,absolute:r,round:s,isButtonTag:o}=e,a=o?"button":"div";return i.h(a,{type:o?"button":void 0,tabindex:n||!e.focusable?-1:0,"aria-disabled":n,"aria-label":"close",role:o?void 0:"button",disabled:n,class:[`${t}-base-close`,r&&`${t}-base-close--absolute`,n&&`${t}-base-close--disabled`,s&&`${t}-base-close--round`],onMousedown:l=>{e.focusable||l.preventDefault()},onClick:e.onClick},i.h(wr,{clsPrefix:t},{default:()=>i.h(q1,null)}))}}}),Q1=i.defineComponent({props:{onFocus:Function,onBlur:Function},setup(e){return()=>i.h("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}}),ew=oe([oe("@keyframes rotator",`
206
+ `)])]),nw=i.defineComponent({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(e){return ws("-base-close",tw,i.toRef(e,"clsPrefix")),()=>{const{clsPrefix:t,disabled:n,absolute:r,round:s,isButtonTag:o}=e,a=o?"button":"div";return i.h(a,{type:o?"button":void 0,tabindex:n||!e.focusable?-1:0,"aria-disabled":n,"aria-label":"close",role:o?void 0:"button",disabled:n,class:[`${t}-base-close`,r&&`${t}-base-close--absolute`,n&&`${t}-base-close--disabled`,s&&`${t}-base-close--round`],onMousedown:l=>{e.focusable||l.preventDefault()},onClick:e.onClick},i.h(wr,{clsPrefix:t},{default:()=>i.h(K1,null)}))}}}),iw=i.defineComponent({props:{onFocus:Function,onBlur:Function},setup(e){return()=>i.h("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}}),rw=oe([oe("@keyframes rotator",`
207
207
  0% {
208
208
  -webkit-transform: rotate(0deg);
209
209
  transform: rotate(0deg);
@@ -216,21 +216,21 @@ ${s}
216
216
  line-height: 0;
217
217
  width: 1em;
218
218
  height: 1em;
219
- `,[_e("transition-wrapper",`
219
+ `,[ye("transition-wrapper",`
220
220
  position: absolute;
221
221
  width: 100%;
222
222
  height: 100%;
223
- `,[Wo()]),_e("placeholder",`
223
+ `,[Wo()]),ye("placeholder",`
224
224
  position: absolute;
225
225
  left: 50%;
226
226
  top: 50%;
227
227
  transform: translateX(-50%) translateY(-50%);
228
- `,[Wo({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),_e("container",`
228
+ `,[Wo({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),ye("container",`
229
229
  animation: rotator 3s linear infinite both;
230
- `,[_e("icon",`
230
+ `,[ye("icon",`
231
231
  height: 1em;
232
232
  width: 1em;
233
- `)])])]),jo="1.6s",tw={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},dh=i.defineComponent({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},tw),setup(e){ws("-base-loading",ew,i.toRef(e,"clsPrefix"))},render(){const{clsPrefix:e,radius:t,strokeWidth:n,stroke:r,scale:s}=this,o=t/s;return i.h("div",{class:`${e}-base-loading`,role:"img","aria-label":"loading"},i.h(lh,null,{default:()=>this.show?i.h("div",{key:"icon",class:`${e}-base-loading__transition-wrapper`},i.h("div",{class:`${e}-base-loading__container`},i.h("svg",{class:`${e}-base-loading__icon`,viewBox:`0 0 ${2*o} ${2*o}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},i.h("g",null,i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};270 ${o} ${o}`,begin:"0s",dur:jo,fill:"freeze",repeatCount:"indefinite"}),i.h("circle",{class:`${e}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round",cx:o,cy:o,r:t-n/2,"stroke-dasharray":5.67*t,"stroke-dashoffset":18.48*t},i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};135 ${o} ${o};450 ${o} ${o}`,begin:"0s",dur:jo,fill:"freeze",repeatCount:"indefinite"}),i.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*t};${1.42*t};${5.67*t}`,begin:"0s",dur:jo,fill:"freeze",repeatCount:"indefinite"})))))):i.h("div",{key:"placeholder",class:`${e}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:hh}=br;function nw({name:e="fade-in",enterDuration:t="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=hh,leaveCubicBezier:s=hh}={}){return[oe(`&.${e}-transition-enter-active`,{transition:`all ${t} ${r}!important`}),oe(`&.${e}-transition-leave-active`,{transition:`all ${n} ${s}!important`}),oe(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),oe(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`,{opacity:1})]}const de={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaAvatar:"0.2",alphaProgressRail:".08",alphaInput:"0",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},iw=oi(de.neutralBase),uh=oi(de.neutralInvertBase),rw=`rgba(${uh.slice(0,3).join(", ")}, `;function fh(e){return`${rw+String(e)})`}function _t(e){const t=Array.from(uh);return t[3]=Number(e),K_(iw,t)}const gi=Object.assign(Object.assign({name:"common"},br),{baseColor:de.neutralBase,primaryColor:de.primaryDefault,primaryColorHover:de.primaryHover,primaryColorPressed:de.primaryActive,primaryColorSuppl:de.primarySuppl,infoColor:de.infoDefault,infoColorHover:de.infoHover,infoColorPressed:de.infoActive,infoColorSuppl:de.infoSuppl,successColor:de.successDefault,successColorHover:de.successHover,successColorPressed:de.successActive,successColorSuppl:de.successSuppl,warningColor:de.warningDefault,warningColorHover:de.warningHover,warningColorPressed:de.warningActive,warningColorSuppl:de.warningSuppl,errorColor:de.errorDefault,errorColorHover:de.errorHover,errorColorPressed:de.errorActive,errorColorSuppl:de.errorSuppl,textColorBase:de.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:_t(de.alpha4),placeholderColor:_t(de.alpha4),placeholderColorDisabled:_t(de.alpha5),iconColor:_t(de.alpha4),iconColorHover:ns(_t(de.alpha4),{lightness:.75}),iconColorPressed:ns(_t(de.alpha4),{lightness:.9}),iconColorDisabled:_t(de.alpha5),opacity1:de.alpha1,opacity2:de.alpha2,opacity3:de.alpha3,opacity4:de.alpha4,opacity5:de.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:_t(Number(de.alphaClose)),closeIconColorHover:_t(Number(de.alphaClose)),closeIconColorPressed:_t(Number(de.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:_t(de.alpha4),clearColorHover:ns(_t(de.alpha4),{lightness:.75}),clearColorPressed:ns(_t(de.alpha4),{lightness:.9}),scrollbarColor:fh(de.alphaScrollbar),scrollbarColorHover:fh(de.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:_t(de.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:de.neutralPopover,tableColor:de.neutralCard,cardColor:de.neutralCard,modalColor:de.neutralModal,bodyColor:de.neutralBody,tagColor:"#eee",avatarColor:_t(de.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:_t(de.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:de.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),sw={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function ow(e){const{scrollbarColor:t,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:s,scrollbarBorderRadius:o}=e;return Object.assign(Object.assign({},sw),{height:r,width:s,borderRadius:o,color:t,colorHover:n})}const ph={name:"Scrollbar",common:gi,self:ow},aw=fe("scrollbar",`
233
+ `)])])]),jo="1.6s",sw={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},dh=i.defineComponent({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},sw),setup(e){ws("-base-loading",rw,i.toRef(e,"clsPrefix"))},render(){const{clsPrefix:e,radius:t,strokeWidth:n,stroke:r,scale:s}=this,o=t/s;return i.h("div",{class:`${e}-base-loading`,role:"img","aria-label":"loading"},i.h(lh,null,{default:()=>this.show?i.h("div",{key:"icon",class:`${e}-base-loading__transition-wrapper`},i.h("div",{class:`${e}-base-loading__container`},i.h("svg",{class:`${e}-base-loading__icon`,viewBox:`0 0 ${2*o} ${2*o}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},i.h("g",null,i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};270 ${o} ${o}`,begin:"0s",dur:jo,fill:"freeze",repeatCount:"indefinite"}),i.h("circle",{class:`${e}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round",cx:o,cy:o,r:t-n/2,"stroke-dasharray":5.67*t,"stroke-dashoffset":18.48*t},i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};135 ${o} ${o};450 ${o} ${o}`,begin:"0s",dur:jo,fill:"freeze",repeatCount:"indefinite"}),i.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*t};${1.42*t};${5.67*t}`,begin:"0s",dur:jo,fill:"freeze",repeatCount:"indefinite"})))))):i.h("div",{key:"placeholder",class:`${e}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:hh}=br;function ow({name:e="fade-in",enterDuration:t="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=hh,leaveCubicBezier:s=hh}={}){return[oe(`&.${e}-transition-enter-active`,{transition:`all ${t} ${r}!important`}),oe(`&.${e}-transition-leave-active`,{transition:`all ${n} ${s}!important`}),oe(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),oe(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`,{opacity:1})]}const de={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaAvatar:"0.2",alphaProgressRail:".08",alphaInput:"0",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},aw=li(de.neutralBase),uh=li(de.neutralInvertBase),lw=`rgba(${uh.slice(0,3).join(", ")}, `;function fh(e){return`${lw+String(e)})`}function _t(e){const t=Array.from(uh);return t[3]=Number(e),e_(aw,t)}const yi=Object.assign(Object.assign({name:"common"},br),{baseColor:de.neutralBase,primaryColor:de.primaryDefault,primaryColorHover:de.primaryHover,primaryColorPressed:de.primaryActive,primaryColorSuppl:de.primarySuppl,infoColor:de.infoDefault,infoColorHover:de.infoHover,infoColorPressed:de.infoActive,infoColorSuppl:de.infoSuppl,successColor:de.successDefault,successColorHover:de.successHover,successColorPressed:de.successActive,successColorSuppl:de.successSuppl,warningColor:de.warningDefault,warningColorHover:de.warningHover,warningColorPressed:de.warningActive,warningColorSuppl:de.warningSuppl,errorColor:de.errorDefault,errorColorHover:de.errorHover,errorColorPressed:de.errorActive,errorColorSuppl:de.errorSuppl,textColorBase:de.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:_t(de.alpha4),placeholderColor:_t(de.alpha4),placeholderColorDisabled:_t(de.alpha5),iconColor:_t(de.alpha4),iconColorHover:ns(_t(de.alpha4),{lightness:.75}),iconColorPressed:ns(_t(de.alpha4),{lightness:.9}),iconColorDisabled:_t(de.alpha5),opacity1:de.alpha1,opacity2:de.alpha2,opacity3:de.alpha3,opacity4:de.alpha4,opacity5:de.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:_t(Number(de.alphaClose)),closeIconColorHover:_t(Number(de.alphaClose)),closeIconColorPressed:_t(Number(de.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:_t(de.alpha4),clearColorHover:ns(_t(de.alpha4),{lightness:.75}),clearColorPressed:ns(_t(de.alpha4),{lightness:.9}),scrollbarColor:fh(de.alphaScrollbar),scrollbarColorHover:fh(de.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:_t(de.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:de.neutralPopover,tableColor:de.neutralCard,cardColor:de.neutralCard,modalColor:de.neutralModal,bodyColor:de.neutralBody,tagColor:"#eee",avatarColor:_t(de.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:_t(de.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:de.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),cw={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function dw(e){const{scrollbarColor:t,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:s,scrollbarBorderRadius:o}=e;return Object.assign(Object.assign({},cw),{height:r,width:s,borderRadius:o,color:t,colorHover:n})}const ph={name:"Scrollbar",common:yi,self:dw},hw=fe("scrollbar",`
234
234
  overflow: hidden;
235
235
  position: relative;
236
236
  z-index: auto;
@@ -256,51 +256,51 @@ ${s}
256
256
  user-select: none;
257
257
  background: var(--n-scrollbar-rail-color);
258
258
  -webkit-user-select: none;
259
- `,[Ce("horizontal",`
259
+ `,[Se("horizontal",`
260
260
  height: var(--n-scrollbar-height);
261
- `,[oe(">",[_e("scrollbar",`
261
+ `,[oe(">",[ye("scrollbar",`
262
262
  height: var(--n-scrollbar-height);
263
263
  border-radius: var(--n-scrollbar-border-radius);
264
264
  right: 0;
265
- `)])]),Ce("horizontal--top",`
265
+ `)])]),Se("horizontal--top",`
266
266
  top: var(--n-scrollbar-rail-top-horizontal-top);
267
267
  right: var(--n-scrollbar-rail-right-horizontal-top);
268
268
  bottom: var(--n-scrollbar-rail-bottom-horizontal-top);
269
269
  left: var(--n-scrollbar-rail-left-horizontal-top);
270
- `),Ce("horizontal--bottom",`
270
+ `),Se("horizontal--bottom",`
271
271
  top: var(--n-scrollbar-rail-top-horizontal-bottom);
272
272
  right: var(--n-scrollbar-rail-right-horizontal-bottom);
273
273
  bottom: var(--n-scrollbar-rail-bottom-horizontal-bottom);
274
274
  left: var(--n-scrollbar-rail-left-horizontal-bottom);
275
- `),Ce("vertical",`
275
+ `),Se("vertical",`
276
276
  width: var(--n-scrollbar-width);
277
- `,[oe(">",[_e("scrollbar",`
277
+ `,[oe(">",[ye("scrollbar",`
278
278
  width: var(--n-scrollbar-width);
279
279
  border-radius: var(--n-scrollbar-border-radius);
280
280
  bottom: 0;
281
- `)])]),Ce("vertical--left",`
281
+ `)])]),Se("vertical--left",`
282
282
  top: var(--n-scrollbar-rail-top-vertical-left);
283
283
  right: var(--n-scrollbar-rail-right-vertical-left);
284
284
  bottom: var(--n-scrollbar-rail-bottom-vertical-left);
285
285
  left: var(--n-scrollbar-rail-left-vertical-left);
286
- `),Ce("vertical--right",`
286
+ `),Se("vertical--right",`
287
287
  top: var(--n-scrollbar-rail-top-vertical-right);
288
288
  right: var(--n-scrollbar-rail-right-vertical-right);
289
289
  bottom: var(--n-scrollbar-rail-bottom-vertical-right);
290
290
  left: var(--n-scrollbar-rail-left-vertical-right);
291
- `),Ce("disabled",[oe(">",[_e("scrollbar","pointer-events: none;")])]),oe(">",[_e("scrollbar",`
291
+ `),Se("disabled",[oe(">",[ye("scrollbar","pointer-events: none;")])]),oe(">",[ye("scrollbar",`
292
292
  z-index: 1;
293
293
  position: absolute;
294
294
  cursor: pointer;
295
295
  pointer-events: all;
296
296
  background-color: var(--n-scrollbar-color);
297
297
  transition: background-color .2s var(--n-scrollbar-bezier);
298
- `,[nw(),oe("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),lw=Object.assign(Object.assign({},mt.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"}}),gh=i.defineComponent({name:"Scrollbar",props:lw,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedRtlRef:r}=fi(e),s=bs("Scrollbar",r,t),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),f=i.ref(null),p=i.ref(null),u=i.ref(null),g=i.ref(null),m=i.ref(null),_=i.ref(0),y=i.ref(0),b=i.ref(!1),S=i.ref(!1);let C=!1,v=!1,B,k,E=0,P=0,R=0,j=0;const q=Oy(),M=mt("Scrollbar","-scrollbar",aw,ph,e,t),A=i.computed(()=>{const{value:T}=p,{value:H}=h,{value:Q}=g;return T===null||H===null||Q===null?0:Math.min(T,Q*T/H+cr(M.value.self.width)*1.5)}),$=i.computed(()=>`${A.value}px`),X=i.computed(()=>{const{value:T}=u,{value:H}=f,{value:Q}=m;return T===null||H===null||Q===null?0:Q*T/H+cr(M.value.self.height)*1.5}),F=i.computed(()=>`${X.value}px`),N=i.computed(()=>{const{value:T}=p,{value:H}=_,{value:Q}=h,{value:le}=g;if(T===null||Q===null||le===null)return 0;{const ce=Q-T;return ce?H/ce*(le-A.value):0}}),W=i.computed(()=>`${N.value}px`),z=i.computed(()=>{const{value:T}=u,{value:H}=y,{value:Q}=f,{value:le}=m;if(T===null||Q===null||le===null)return 0;{const ce=Q-T;return ce?H/ce*(le-X.value):0}}),G=i.computed(()=>`${z.value}px`),V=i.computed(()=>{const{value:T}=p,{value:H}=h;return T!==null&&H!==null&&H>T}),O=i.computed(()=>{const{value:T}=u,{value:H}=f;return T!==null&&H!==null&&H>T}),J=i.computed(()=>{const{trigger:T}=e;return T==="none"||b.value}),he=i.computed(()=>{const{trigger:T}=e;return T==="none"||S.value}),ie=i.computed(()=>{const{container:T}=e;return T?T():a.value}),ge=i.computed(()=>{const{content:T}=e;return T?T():l.value}),re=(T,H)=>{if(!e.scrollable)return;if(typeof T=="number"){Pe(T,H??0,0,!1,"auto");return}const{left:Q,top:le,index:ce,elSize:me,position:be,behavior:ke,el:Xe,debounce:hn=!0}=T;(Q!==void 0||le!==void 0)&&Pe(Q??0,le??0,0,!1,ke),Xe!==void 0?Pe(0,Xe.offsetTop,Xe.offsetHeight,hn,ke):ce!==void 0&&me!==void 0?Pe(0,ce*me,me,hn,ke):be==="bottom"?Pe(0,Number.MAX_SAFE_INTEGER,0,!1,ke):be==="top"&&Pe(0,0,0,!1,ke)},Fe=Xb(()=>{e.container||re({top:_.value,left:y.value})}),Me=()=>{Fe.isDeactivated||ne()},Ge=T=>{if(Fe.isDeactivated)return;const{onResize:H}=e;H&&H(T),ne()},Le=(T,H)=>{if(!e.scrollable)return;const{value:Q}=ie;Q&&(typeof T=="object"?Q.scrollBy(T):Q.scrollBy(T,H||0))};function Pe(T,H,Q,le,ce){const{value:me}=ie;if(me){if(le){const{scrollTop:be,offsetHeight:ke}=me;if(H>be){H+Q<=be+ke||me.scrollTo({left:T,top:H+Q-ke,behavior:ce});return}}me.scrollTo({left:T,top:H,behavior:ce})}}function $e(){yi(),bi(),ne()}function ot(){De()}function De(){ct(),Pt()}function ct(){k!==void 0&&window.clearTimeout(k),k=window.setTimeout(()=>{S.value=!1},e.duration)}function Pt(){B!==void 0&&window.clearTimeout(B),B=window.setTimeout(()=>{b.value=!1},e.duration)}function yi(){B!==void 0&&window.clearTimeout(B),b.value=!0}function bi(){k!==void 0&&window.clearTimeout(k),S.value=!0}function zn(T){const{onScroll:H}=e;H&&H(T),dn()}function dn(){const{value:T}=ie;T&&(_.value=T.scrollTop,y.value=T.scrollLeft*(s!=null&&s.value?-1:1))}function dt(){const{value:T}=ge;T&&(h.value=T.offsetHeight,f.value=T.offsetWidth);const{value:H}=ie;H&&(p.value=H.offsetHeight,u.value=H.offsetWidth);const{value:Q}=d,{value:le}=c;Q&&(m.value=Q.offsetWidth),le&&(g.value=le.offsetHeight)}function te(){const{value:T}=ie;T&&(_.value=T.scrollTop,y.value=T.scrollLeft*(s!=null&&s.value?-1:1),p.value=T.offsetHeight,u.value=T.offsetWidth,h.value=T.scrollHeight,f.value=T.scrollWidth);const{value:H}=d,{value:Q}=c;H&&(m.value=H.offsetWidth),Q&&(g.value=Q.offsetHeight)}function ne(){e.scrollable&&(e.useUnifiedContainer?te():(dt(),dn()))}function je(T){var H;return!(!((H=o.value)===null||H===void 0)&&H.contains(lr(T)))}function kr(T){T.preventDefault(),T.stopPropagation(),v=!0,St("mousemove",window,Hi,!0),St("mouseup",window,wi,!0),P=y.value,R=s!=null&&s.value?window.innerWidth-T.clientX:T.clientX}function Hi(T){if(!v)return;B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k);const{value:H}=u,{value:Q}=f,{value:le}=X;if(H===null||Q===null)return;const me=(s!=null&&s.value?window.innerWidth-T.clientX-R:T.clientX-R)*(Q-H)/(H-le),be=Q-H;let ke=P+me;ke=Math.min(be,ke),ke=Math.max(ke,0);const{value:Xe}=ie;if(Xe){Xe.scrollLeft=ke*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:hn}=e;hn&&hn(ke)}}function wi(T){T.preventDefault(),T.stopPropagation(),tt("mousemove",window,Hi,!0),tt("mouseup",window,wi,!0),v=!1,ne(),je(T)&&De()}function Wi(T){T.preventDefault(),T.stopPropagation(),C=!0,St("mousemove",window,Ln,!0),St("mouseup",window,vi,!0),E=_.value,j=T.clientY}function Ln(T){if(!C)return;B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k);const{value:H}=p,{value:Q}=h,{value:le}=A;if(H===null||Q===null)return;const me=(T.clientY-j)*(Q-H)/(H-le),be=Q-H;let ke=E+me;ke=Math.min(be,ke),ke=Math.max(ke,0);const{value:Xe}=ie;Xe&&(Xe.scrollTop=ke)}function vi(T){T.preventDefault(),T.stopPropagation(),tt("mousemove",window,Ln,!0),tt("mouseup",window,vi,!0),C=!1,ne(),je(T)&&De()}i.watchEffect(()=>{const{value:T}=O,{value:H}=V,{value:Q}=t,{value:le}=d,{value:ce}=c;le&&(T?le.classList.remove(`${Q}-scrollbar-rail--disabled`):le.classList.add(`${Q}-scrollbar-rail--disabled`)),ce&&(H?ce.classList.remove(`${Q}-scrollbar-rail--disabled`):ce.classList.add(`${Q}-scrollbar-rail--disabled`))}),i.onMounted(()=>{e.container||ne()}),i.onBeforeUnmount(()=>{B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k),tt("mousemove",window,Ln,!0),tt("mouseup",window,vi,!0)});const ji=i.computed(()=>{const{common:{cubicBezierEaseInOut:T},self:{color:H,colorHover:Q,height:le,width:ce,borderRadius:me,railInsetHorizontalTop:be,railInsetHorizontalBottom:ke,railInsetVerticalRight:Xe,railInsetVerticalLeft:hn,railColor:Zo}}=M.value,{top:Jo,right:Qo,bottom:ea,left:ta}=Yt(be),{top:na,right:ia,bottom:ra,left:sa}=Yt(ke),{top:oa,right:aa,bottom:la,left:ca}=Yt(s!=null&&s.value?Kd(Xe):Xe),{top:da,right:ha,bottom:ua,left:fa}=Yt(s!=null&&s.value?Kd(hn):hn);return{"--n-scrollbar-bezier":T,"--n-scrollbar-color":H,"--n-scrollbar-color-hover":Q,"--n-scrollbar-border-radius":me,"--n-scrollbar-width":ce,"--n-scrollbar-height":le,"--n-scrollbar-rail-top-horizontal-top":Jo,"--n-scrollbar-rail-right-horizontal-top":Qo,"--n-scrollbar-rail-bottom-horizontal-top":ea,"--n-scrollbar-rail-left-horizontal-top":ta,"--n-scrollbar-rail-top-horizontal-bottom":na,"--n-scrollbar-rail-right-horizontal-bottom":ia,"--n-scrollbar-rail-bottom-horizontal-bottom":ra,"--n-scrollbar-rail-left-horizontal-bottom":sa,"--n-scrollbar-rail-top-vertical-right":oa,"--n-scrollbar-rail-right-vertical-right":aa,"--n-scrollbar-rail-bottom-vertical-right":la,"--n-scrollbar-rail-left-vertical-right":ca,"--n-scrollbar-rail-top-vertical-left":da,"--n-scrollbar-rail-right-vertical-left":ha,"--n-scrollbar-rail-bottom-vertical-left":ua,"--n-scrollbar-rail-left-vertical-left":fa,"--n-scrollbar-rail-color":Zo}}),Kt=n?pi("scrollbar",void 0,ji,e):void 0;return Object.assign(Object.assign({},{scrollTo:re,scrollBy:Le,sync:ne,syncUnifiedContainer:te,handleMouseEnterWrapper:$e,handleMouseLeaveWrapper:ot}),{mergedClsPrefix:t,rtlEnabled:s,containerScrollTop:_,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:V,needXBar:O,yBarSizePx:$,xBarSizePx:F,yBarTopPx:W,xBarLeftPx:G,isShowXBar:J,isShowYBar:he,isIos:q,handleScroll:zn,handleContentResize:Me,handleContainerResize:Ge,handleYScrollMouseDown:Wi,handleXScrollMouseDown:kr,cssVars:n?void 0:ji,themeClass:Kt==null?void 0:Kt.themeClass,onRender:Kt==null?void 0:Kt.onRender})},render(){var e;const{$slots:t,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:s,internalHoistYRail:o,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(e=t.default)===null||e===void 0?void 0:e.call(t);const d=this.trigger==="none",h=(u,g)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,u],"data-scrollbar-rail":!0,style:[g||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?Do: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})),f=()=>{var u,g;return(u=this.onRender)===null||u===void 0||u.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=t.default)===null||g===void 0?void 0:g.call(t):i.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i.h(ms,{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]},t)})),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?Do: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}))])},p=this.container?f():i.h(ms,{onResize:this.handleContainerResize},{default:f});return o?i.h(i.Fragment,null,p,h(this.themeClass,this.cssVars)):p}}),cw=gh,dw={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function hw(e){const{textColorDisabled:t,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=e;return Object.assign(Object.assign({},dw),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:t,iconColor:n,extraTextColor:r})}const mh={name:"Empty",common:gi,self:hw},uw=fe("empty",`
298
+ `,[ow(),oe("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),uw=Object.assign(Object.assign({},yt.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"}}),gh=i.defineComponent({name:"Scrollbar",props:uw,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedRtlRef:r}=gi(e),s=bs("Scrollbar",r,t),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),f=i.ref(null),p=i.ref(null),u=i.ref(null),g=i.ref(null),m=i.ref(null),y=i.ref(0),_=i.ref(0),b=i.ref(!1),S=i.ref(!1);let x=!1,v=!1,B,k,N=0,P=0,R=0,W=0;const q=H_(),F=yt("Scrollbar","-scrollbar",hw,ph,e,t),M=i.computed(()=>{const{value:E}=p,{value:H}=h,{value:Q}=g;return E===null||H===null||Q===null?0:Math.min(E,Q*E/H+cr(F.value.self.width)*1.5)}),V=i.computed(()=>`${M.value}px`),K=i.computed(()=>{const{value:E}=u,{value:H}=f,{value:Q}=m;return E===null||H===null||Q===null?0:Q*E/H+cr(F.value.self.height)*1.5}),T=i.computed(()=>`${K.value}px`),$=i.computed(()=>{const{value:E}=p,{value:H}=y,{value:Q}=h,{value:le}=g;if(E===null||Q===null||le===null)return 0;{const ce=Q-E;return ce?H/ce*(le-M.value):0}}),j=i.computed(()=>`${$.value}px`),z=i.computed(()=>{const{value:E}=u,{value:H}=_,{value:Q}=f,{value:le}=m;if(E===null||Q===null||le===null)return 0;{const ce=Q-E;return ce?H/ce*(le-K.value):0}}),U=i.computed(()=>`${z.value}px`),I=i.computed(()=>{const{value:E}=p,{value:H}=h;return E!==null&&H!==null&&H>E}),O=i.computed(()=>{const{value:E}=u,{value:H}=f;return E!==null&&H!==null&&H>E}),Z=i.computed(()=>{const{trigger:E}=e;return E==="none"||b.value}),ge=i.computed(()=>{const{trigger:E}=e;return E==="none"||S.value}),ie=i.computed(()=>{const{container:E}=e;return E?E():a.value}),he=i.computed(()=>{const{content:E}=e;return E?E():l.value}),re=(E,H)=>{if(!e.scrollable)return;if(typeof E=="number"){dt(E,H??0,0,!1,"auto");return}const{left:Q,top:le,index:ce,elSize:me,position:be,behavior:ke,el:je,debounce:pn=!0}=E;(Q!==void 0||le!==void 0)&&dt(Q??0,le??0,0,!1,ke),je!==void 0?dt(0,je.offsetTop,je.offsetHeight,pn,ke):ce!==void 0&&me!==void 0?dt(0,ce*me,me,pn,ke):be==="bottom"?dt(0,Number.MAX_SAFE_INTEGER,0,!1,ke):be==="top"&&dt(0,0,0,!1,ke)},Pe=Gb(()=>{e.container||re({top:y.value,left:_.value})}),Fe=()=>{Pe.isDeactivated||ne()},Ze=E=>{if(Pe.isDeactivated)return;const{onResize:H}=e;H&&H(E),ne()},Le=(E,H)=>{if(!e.scrollable)return;const{value:Q}=ie;Q&&(typeof E=="object"?Q.scrollBy(E):Q.scrollBy(E,H||0))};function dt(E,H,Q,le,ce){const{value:me}=ie;if(me){if(le){const{scrollTop:be,offsetHeight:ke}=me;if(H>be){H+Q<=be+ke||me.scrollTo({left:E,top:H+Q-ke,behavior:ce});return}}me.scrollTo({left:E,top:H,behavior:ce})}}function Zt(){un(),Ue(),ne()}function Oe(){Ce()}function Ce(){Je(),Qe()}function Je(){k!==void 0&&window.clearTimeout(k),k=window.setTimeout(()=>{S.value=!1},e.duration)}function Qe(){B!==void 0&&window.clearTimeout(B),B=window.setTimeout(()=>{b.value=!1},e.duration)}function un(){B!==void 0&&window.clearTimeout(B),b.value=!0}function Ue(){k!==void 0&&window.clearTimeout(k),S.value=!0}function Ft(E){const{onScroll:H}=e;H&&H(E),fn()}function fn(){const{value:E}=ie;E&&(y.value=E.scrollTop,_.value=E.scrollLeft*(s!=null&&s.value?-1:1))}function ht(){const{value:E}=he;E&&(h.value=E.offsetHeight,f.value=E.offsetWidth);const{value:H}=ie;H&&(p.value=H.offsetHeight,u.value=H.offsetWidth);const{value:Q}=d,{value:le}=c;Q&&(m.value=Q.offsetWidth),le&&(g.value=le.offsetHeight)}function te(){const{value:E}=ie;E&&(y.value=E.scrollTop,_.value=E.scrollLeft*(s!=null&&s.value?-1:1),p.value=E.offsetHeight,u.value=E.offsetWidth,h.value=E.scrollHeight,f.value=E.scrollWidth);const{value:H}=d,{value:Q}=c;H&&(m.value=H.offsetWidth),Q&&(g.value=Q.offsetHeight)}function ne(){e.scrollable&&(e.useUnifiedContainer?te():(ht(),fn()))}function We(E){var H;return!(!((H=o.value)===null||H===void 0)&&H.contains(lr(E)))}function kr(E){E.preventDefault(),E.stopPropagation(),v=!0,Bt("mousemove",window,Hi,!0),Bt("mouseup",window,wi,!0),P=_.value,R=s!=null&&s.value?window.innerWidth-E.clientX:E.clientX}function Hi(E){if(!v)return;B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k);const{value:H}=u,{value:Q}=f,{value:le}=K;if(H===null||Q===null)return;const me=(s!=null&&s.value?window.innerWidth-E.clientX-R:E.clientX-R)*(Q-H)/(H-le),be=Q-H;let ke=P+me;ke=Math.min(be,ke),ke=Math.max(ke,0);const{value:je}=ie;if(je){je.scrollLeft=ke*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:pn}=e;pn&&pn(ke)}}function wi(E){E.preventDefault(),E.stopPropagation(),it("mousemove",window,Hi,!0),it("mouseup",window,wi,!0),v=!1,ne(),We(E)&&Ce()}function Wi(E){E.preventDefault(),E.stopPropagation(),x=!0,Bt("mousemove",window,Hn,!0),Bt("mouseup",window,vi,!0),N=y.value,W=E.clientY}function Hn(E){if(!x)return;B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k);const{value:H}=p,{value:Q}=h,{value:le}=M;if(H===null||Q===null)return;const me=(E.clientY-W)*(Q-H)/(H-le),be=Q-H;let ke=N+me;ke=Math.min(be,ke),ke=Math.max(ke,0);const{value:je}=ie;je&&(je.scrollTop=ke)}function vi(E){E.preventDefault(),E.stopPropagation(),it("mousemove",window,Hn,!0),it("mouseup",window,vi,!0),x=!1,ne(),We(E)&&Ce()}i.watchEffect(()=>{const{value:E}=O,{value:H}=I,{value:Q}=t,{value:le}=d,{value:ce}=c;le&&(E?le.classList.remove(`${Q}-scrollbar-rail--disabled`):le.classList.add(`${Q}-scrollbar-rail--disabled`)),ce&&(H?ce.classList.remove(`${Q}-scrollbar-rail--disabled`):ce.classList.add(`${Q}-scrollbar-rail--disabled`))}),i.onMounted(()=>{e.container||ne()}),i.onBeforeUnmount(()=>{B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k),it("mousemove",window,Hn,!0),it("mouseup",window,vi,!0)});const ji=i.computed(()=>{const{common:{cubicBezierEaseInOut:E},self:{color:H,colorHover:Q,height:le,width:ce,borderRadius:me,railInsetHorizontalTop:be,railInsetHorizontalBottom:ke,railInsetVerticalRight:je,railInsetVerticalLeft:pn,railColor:Zo}}=F.value,{top:Jo,right:Qo,bottom:ea,left:ta}=Ut(be),{top:na,right:ia,bottom:ra,left:sa}=Ut(ke),{top:oa,right:aa,bottom:la,left:ca}=Ut(s!=null&&s.value?Kd(je):je),{top:da,right:ha,bottom:ua,left:fa}=Ut(s!=null&&s.value?Kd(pn):pn);return{"--n-scrollbar-bezier":E,"--n-scrollbar-color":H,"--n-scrollbar-color-hover":Q,"--n-scrollbar-border-radius":me,"--n-scrollbar-width":ce,"--n-scrollbar-height":le,"--n-scrollbar-rail-top-horizontal-top":Jo,"--n-scrollbar-rail-right-horizontal-top":Qo,"--n-scrollbar-rail-bottom-horizontal-top":ea,"--n-scrollbar-rail-left-horizontal-top":ta,"--n-scrollbar-rail-top-horizontal-bottom":na,"--n-scrollbar-rail-right-horizontal-bottom":ia,"--n-scrollbar-rail-bottom-horizontal-bottom":ra,"--n-scrollbar-rail-left-horizontal-bottom":sa,"--n-scrollbar-rail-top-vertical-right":oa,"--n-scrollbar-rail-right-vertical-right":aa,"--n-scrollbar-rail-bottom-vertical-right":la,"--n-scrollbar-rail-left-vertical-right":ca,"--n-scrollbar-rail-top-vertical-left":da,"--n-scrollbar-rail-right-vertical-left":ha,"--n-scrollbar-rail-bottom-vertical-left":ua,"--n-scrollbar-rail-left-vertical-left":fa,"--n-scrollbar-rail-color":Zo}}),Jt=n?mi("scrollbar",void 0,ji,e):void 0;return Object.assign(Object.assign({},{scrollTo:re,scrollBy:Le,sync:ne,syncUnifiedContainer:te,handleMouseEnterWrapper:Zt,handleMouseLeaveWrapper:Oe}),{mergedClsPrefix:t,rtlEnabled:s,containerScrollTop:y,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:I,needXBar:O,yBarSizePx:V,xBarSizePx:T,yBarTopPx:j,xBarLeftPx:U,isShowXBar:Z,isShowYBar:ge,isIos:q,handleScroll:Ft,handleContentResize:Fe,handleContainerResize:Ze,handleYScrollMouseDown:Wi,handleXScrollMouseDown:kr,cssVars:n?void 0:ji,themeClass:Jt==null?void 0:Jt.themeClass,onRender:Jt==null?void 0:Jt.onRender})},render(){var e;const{$slots:t,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:s,internalHoistYRail:o,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(e=t.default)===null||e===void 0?void 0:e.call(t);const d=this.trigger==="none",h=(u,g)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,u],"data-scrollbar-rail":!0,style:[g||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?Do: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})),f=()=>{var u,g;return(u=this.onRender)===null||u===void 0||u.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=t.default)===null||g===void 0?void 0:g.call(t):i.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i.h(ms,{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]},t)})),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?Do: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}))])},p=this.container?f():i.h(ms,{onResize:this.handleContainerResize},{default:f});return o?i.h(i.Fragment,null,p,h(this.themeClass,this.cssVars)):p}}),fw=gh,pw={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function gw(e){const{textColorDisabled:t,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=e;return Object.assign(Object.assign({},pw),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:t,iconColor:n,extraTextColor:r})}const mh={name:"Empty",common:yi,self:gw},mw=fe("empty",`
299
299
  display: flex;
300
300
  flex-direction: column;
301
301
  align-items: center;
302
302
  font-size: var(--n-font-size);
303
- `,[_e("icon",`
303
+ `,[ye("icon",`
304
304
  width: var(--n-icon-size);
305
305
  height: var(--n-icon-size);
306
306
  font-size: var(--n-icon-size);
@@ -308,17 +308,17 @@ ${s}
308
308
  color: var(--n-icon-color);
309
309
  transition:
310
310
  color .3s var(--n-bezier);
311
- `,[oe("+",[_e("description",`
311
+ `,[oe("+",[ye("description",`
312
312
  margin-top: 8px;
313
- `)])]),_e("description",`
313
+ `)])]),ye("description",`
314
314
  transition: color .3s var(--n-bezier);
315
315
  color: var(--n-text-color);
316
- `),_e("extra",`
316
+ `),ye("extra",`
317
317
  text-align: center;
318
318
  transition: color .3s var(--n-bezier);
319
319
  margin-top: 12px;
320
320
  color: var(--n-extra-text-color);
321
- `)]),fw=Object.assign(Object.assign({},mt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),pw=i.defineComponent({name:"Empty",props:fw,slots:Object,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:r}=fi(e),s=mt("Empty","-empty",uw,mh,e,t),{localeRef:o}=oh("Empty"),a=i.computed(()=>{var h,f,p;return(h=e.description)!==null&&h!==void 0?h:(p=(f=r==null?void 0:r.value)===null||f===void 0?void 0:f.Empty)===null||p===void 0?void 0:p.description}),l=i.computed(()=>{var h,f;return((f=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||f===void 0?void 0:f.renderIcon)||(()=>i.h(Y1,null))}),c=i.computed(()=>{const{size:h}=e,{common:{cubicBezierEaseInOut:f},self:{[Ye("iconSize",h)]:p,[Ye("fontSize",h)]:u,textColor:g,iconColor:m,extraTextColor:_}}=s.value;return{"--n-icon-size":p,"--n-font-size":u,"--n-bezier":f,"--n-text-color":g,"--n-icon-color":m,"--n-extra-text-color":_}}),d=n?pi("empty",i.computed(()=>{let h="";const{size:f}=e;return h+=f[0],h}),c,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:l,localizedDescription:i.computed(()=>a.value||o.value.description),cssVars:n?void 0:c,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{$slots:e,mergedClsPrefix:t,onRender:n}=this;return n==null||n(),i.h("div",{class:[`${t}-empty`,this.themeClass],style:this.cssVars},this.showIcon?i.h("div",{class:`${t}-empty__icon`},e.icon?e.icon():i.h(wr,{clsPrefix:t},{default:this.mergedRenderIcon})):null,this.showDescription?i.h("div",{class:`${t}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?i.h("div",{class:`${t}-empty__extra`},e.extra()):null)}}),gw={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function mw(e){const{borderRadius:t,popoverColor:n,textColor3:r,dividerColor:s,textColor2:o,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:h,fontSizeTiny:f,fontSizeSmall:p,fontSizeMedium:u,fontSizeLarge:g,fontSizeHuge:m,heightTiny:_,heightSmall:y,heightMedium:b,heightLarge:S,heightHuge:C}=e;return Object.assign(Object.assign({},gw),{optionFontSizeTiny:f,optionFontSizeSmall:p,optionFontSizeMedium:u,optionFontSizeLarge:g,optionFontSizeHuge:m,optionHeightTiny:_,optionHeightSmall:y,optionHeightMedium:b,optionHeightLarge:S,optionHeightHuge:C,borderRadius:t,color:n,groupHeaderTextColor:r,actionDividerColor:s,optionTextColor:o,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:c,optionOpacityDisabled:d,optionCheckColor:c,optionColorPending:h,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:h,actionTextColor:o,loadingColor:c})}const _h={name:"InternalSelectMenu",common:gi,peers:{Scrollbar:ph,Empty:mh},self:mw},yh=i.defineComponent({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:t,labelFieldRef:n,nodePropsRef:r}=i.inject(Ao);return{labelField:n,nodeProps:r,renderLabel:e,renderOption:t}},render(){const{clsPrefix:e,renderLabel:t,renderOption:n,nodeProps:r,tmNode:{rawNode:s}}=this,o=r==null?void 0:r(s),a=t?t(s,!1):Di(s[this.labelField],s,!1),l=i.h("div",Object.assign({},o,{class:[`${e}-base-select-group-header`,o==null?void 0:o.class]}),a);return s.render?s.render({node:l,option:s}):n?n({node:l,option:s,selected:!1}):l}});function _w(e,t){return i.h(i.Transition,{name:"fade-in-scale-up-transition"},{default:()=>e?i.h(wr,{clsPrefix:t,class:`${t}-base-select-option__check`},{default:()=>i.h(W1)}):null})}const bh=i.defineComponent({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){const{valueRef:t,pendingTmNodeRef:n,multipleRef:r,valueSetRef:s,renderLabelRef:o,renderOptionRef:a,labelFieldRef:l,valueFieldRef:c,showCheckmarkRef:d,nodePropsRef:h,handleOptionClick:f,handleOptionMouseEnter:p}=i.inject(Ao),u=Wt(()=>{const{value:y}=n;return y?e.tmNode.key===y.key:!1});function g(y){const{tmNode:b}=e;b.disabled||f(y,b)}function m(y){const{tmNode:b}=e;b.disabled||p(y,b)}function _(y){const{tmNode:b}=e,{value:S}=u;b.disabled||S||p(y,b)}return{multiple:r,isGrouped:Wt(()=>{const{tmNode:y}=e,{parent:b}=y;return b&&b.rawNode.type==="group"}),showCheckmark:d,nodeProps:h,isPending:u,isSelected:Wt(()=>{const{value:y}=t,{value:b}=r;if(y===null)return!1;const S=e.tmNode.rawNode[c.value];if(b){const{value:C}=s;return C.has(S)}else return y===S}),labelField:l,renderLabel:o,renderOption:a,handleMouseMove:_,handleMouseEnter:m,handleClick:g}},render(){const{clsPrefix:e,tmNode:{rawNode:t},isSelected:n,isPending:r,isGrouped:s,showCheckmark:o,nodeProps:a,renderOption:l,renderLabel:c,handleClick:d,handleMouseEnter:h,handleMouseMove:f}=this,p=_w(n,e),u=c?[c(t,n),o&&p]:[Di(t[this.labelField],t,n),o&&p],g=a==null?void 0:a(t),m=i.h("div",Object.assign({},g,{class:[`${e}-base-select-option`,t.class,g==null?void 0:g.class,{[`${e}-base-select-option--disabled`]:t.disabled,[`${e}-base-select-option--selected`]:n,[`${e}-base-select-option--grouped`]:s,[`${e}-base-select-option--pending`]:r,[`${e}-base-select-option--show-checkmark`]:o}],style:[(g==null?void 0:g.style)||"",t.style||""],onClick:zo([d,g==null?void 0:g.onClick]),onMouseenter:zo([h,g==null?void 0:g.onMouseenter]),onMousemove:zo([f,g==null?void 0:g.onMousemove])}),i.h("div",{class:`${e}-base-select-option__content`},u));return t.render?t.render({node:m,option:t,selected:n}):l?l({node:m,option:t,selected:n}):m}}),{cubicBezierEaseIn:wh,cubicBezierEaseOut:vh}=br;function kh({transformOrigin:e="inherit",duration:t=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:s=""}={}){return[oe("&.fade-in-scale-up-transition-leave-active",{transformOrigin:e,transition:`opacity ${t} ${wh}, transform ${t} ${wh} ${s&&`,${s}`}`}),oe("&.fade-in-scale-up-transition-enter-active",{transformOrigin:e,transition:`opacity ${t} ${vh}, transform ${t} ${vh} ${s&&`,${s}`}`}),oe("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),oe("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const yw=fe("base-select-menu",`
321
+ `)]),yw=Object.assign(Object.assign({},yt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),_w=i.defineComponent({name:"Empty",props:yw,slots:Object,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:r}=gi(e),s=yt("Empty","-empty",mw,mh,e,t),{localeRef:o}=oh("Empty"),a=i.computed(()=>{var h,f,p;return(h=e.description)!==null&&h!==void 0?h:(p=(f=r==null?void 0:r.value)===null||f===void 0?void 0:f.Empty)===null||p===void 0?void 0:p.description}),l=i.computed(()=>{var h,f;return((f=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||f===void 0?void 0:f.renderIcon)||(()=>i.h(Z1,null))}),c=i.computed(()=>{const{size:h}=e,{common:{cubicBezierEaseInOut:f},self:{[qe("iconSize",h)]:p,[qe("fontSize",h)]:u,textColor:g,iconColor:m,extraTextColor:y}}=s.value;return{"--n-icon-size":p,"--n-font-size":u,"--n-bezier":f,"--n-text-color":g,"--n-icon-color":m,"--n-extra-text-color":y}}),d=n?mi("empty",i.computed(()=>{let h="";const{size:f}=e;return h+=f[0],h}),c,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:l,localizedDescription:i.computed(()=>a.value||o.value.description),cssVars:n?void 0:c,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{$slots:e,mergedClsPrefix:t,onRender:n}=this;return n==null||n(),i.h("div",{class:[`${t}-empty`,this.themeClass],style:this.cssVars},this.showIcon?i.h("div",{class:`${t}-empty__icon`},e.icon?e.icon():i.h(wr,{clsPrefix:t},{default:this.mergedRenderIcon})):null,this.showDescription?i.h("div",{class:`${t}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?i.h("div",{class:`${t}-empty__extra`},e.extra()):null)}}),bw={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function ww(e){const{borderRadius:t,popoverColor:n,textColor3:r,dividerColor:s,textColor2:o,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:h,fontSizeTiny:f,fontSizeSmall:p,fontSizeMedium:u,fontSizeLarge:g,fontSizeHuge:m,heightTiny:y,heightSmall:_,heightMedium:b,heightLarge:S,heightHuge:x}=e;return Object.assign(Object.assign({},bw),{optionFontSizeTiny:f,optionFontSizeSmall:p,optionFontSizeMedium:u,optionFontSizeLarge:g,optionFontSizeHuge:m,optionHeightTiny:y,optionHeightSmall:_,optionHeightMedium:b,optionHeightLarge:S,optionHeightHuge:x,borderRadius:t,color:n,groupHeaderTextColor:r,actionDividerColor:s,optionTextColor:o,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:c,optionOpacityDisabled:d,optionCheckColor:c,optionColorPending:h,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:h,actionTextColor:o,loadingColor:c})}const yh={name:"InternalSelectMenu",common:yi,peers:{Scrollbar:ph,Empty:mh},self:ww},_h=i.defineComponent({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:t,labelFieldRef:n,nodePropsRef:r}=i.inject(Ao);return{labelField:n,nodeProps:r,renderLabel:e,renderOption:t}},render(){const{clsPrefix:e,renderLabel:t,renderOption:n,nodeProps:r,tmNode:{rawNode:s}}=this,o=r==null?void 0:r(s),a=t?t(s,!1):Di(s[this.labelField],s,!1),l=i.h("div",Object.assign({},o,{class:[`${e}-base-select-group-header`,o==null?void 0:o.class]}),a);return s.render?s.render({node:l,option:s}):n?n({node:l,option:s,selected:!1}):l}});function vw(e,t){return i.h(i.Transition,{name:"fade-in-scale-up-transition"},{default:()=>e?i.h(wr,{clsPrefix:t,class:`${t}-base-select-option__check`},{default:()=>i.h(Y1)}):null})}const bh=i.defineComponent({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){const{valueRef:t,pendingTmNodeRef:n,multipleRef:r,valueSetRef:s,renderLabelRef:o,renderOptionRef:a,labelFieldRef:l,valueFieldRef:c,showCheckmarkRef:d,nodePropsRef:h,handleOptionClick:f,handleOptionMouseEnter:p}=i.inject(Ao),u=jt(()=>{const{value:_}=n;return _?e.tmNode.key===_.key:!1});function g(_){const{tmNode:b}=e;b.disabled||f(_,b)}function m(_){const{tmNode:b}=e;b.disabled||p(_,b)}function y(_){const{tmNode:b}=e,{value:S}=u;b.disabled||S||p(_,b)}return{multiple:r,isGrouped:jt(()=>{const{tmNode:_}=e,{parent:b}=_;return b&&b.rawNode.type==="group"}),showCheckmark:d,nodeProps:h,isPending:u,isSelected:jt(()=>{const{value:_}=t,{value:b}=r;if(_===null)return!1;const S=e.tmNode.rawNode[c.value];if(b){const{value:x}=s;return x.has(S)}else return _===S}),labelField:l,renderLabel:o,renderOption:a,handleMouseMove:y,handleMouseEnter:m,handleClick:g}},render(){const{clsPrefix:e,tmNode:{rawNode:t},isSelected:n,isPending:r,isGrouped:s,showCheckmark:o,nodeProps:a,renderOption:l,renderLabel:c,handleClick:d,handleMouseEnter:h,handleMouseMove:f}=this,p=vw(n,e),u=c?[c(t,n),o&&p]:[Di(t[this.labelField],t,n),o&&p],g=a==null?void 0:a(t),m=i.h("div",Object.assign({},g,{class:[`${e}-base-select-option`,t.class,g==null?void 0:g.class,{[`${e}-base-select-option--disabled`]:t.disabled,[`${e}-base-select-option--selected`]:n,[`${e}-base-select-option--grouped`]:s,[`${e}-base-select-option--pending`]:r,[`${e}-base-select-option--show-checkmark`]:o}],style:[(g==null?void 0:g.style)||"",t.style||""],onClick:zo([d,g==null?void 0:g.onClick]),onMouseenter:zo([h,g==null?void 0:g.onMouseenter]),onMousemove:zo([f,g==null?void 0:g.onMousemove])}),i.h("div",{class:`${e}-base-select-option__content`},u));return t.render?t.render({node:m,option:t,selected:n}):l?l({node:m,option:t,selected:n}):m}}),{cubicBezierEaseIn:wh,cubicBezierEaseOut:vh}=br;function kh({transformOrigin:e="inherit",duration:t=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:s=""}={}){return[oe("&.fade-in-scale-up-transition-leave-active",{transformOrigin:e,transition:`opacity ${t} ${wh}, transform ${t} ${wh} ${s&&`,${s}`}`}),oe("&.fade-in-scale-up-transition-enter-active",{transformOrigin:e,transition:`opacity ${t} ${vh}, transform ${t} ${vh} ${s&&`,${s}`}`}),oe("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),oe("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const kw=fe("base-select-menu",`
322
322
  line-height: 1.5;
323
323
  outline: none;
324
324
  z-index: 0;
@@ -337,7 +337,7 @@ ${s}
337
337
  font-size: var(--n-option-font-size);
338
338
  display: flex;
339
339
  align-items: center;
340
- `,[_e("content",`
340
+ `,[ye("content",`
341
341
  z-index: 1;
342
342
  white-space: nowrap;
343
343
  text-overflow: ellipsis;
@@ -350,15 +350,15 @@ ${s}
350
350
  `),fe("base-select-menu-option-wrapper",`
351
351
  position: relative;
352
352
  width: 100%;
353
- `),_e("loading, empty",`
353
+ `),ye("loading, empty",`
354
354
  display: flex;
355
355
  padding: 12px 32px;
356
356
  flex: 1;
357
357
  justify-content: center;
358
- `),_e("loading",`
358
+ `),ye("loading",`
359
359
  color: var(--n-loading-color);
360
360
  font-size: var(--n-loading-size);
361
- `),_e("header",`
361
+ `),ye("header",`
362
362
  padding: 8px var(--n-option-padding-left);
363
363
  font-size: var(--n-option-font-size);
364
364
  transition:
@@ -366,7 +366,7 @@ ${s}
366
366
  border-color .3s var(--n-bezier);
367
367
  border-bottom: 1px solid var(--n-action-divider-color);
368
368
  color: var(--n-action-text-color);
369
- `),_e("action",`
369
+ `),ye("action",`
370
370
  padding: 8px var(--n-option-padding-left);
371
371
  font-size: var(--n-option-font-size);
372
372
  transition:
@@ -389,7 +389,7 @@ ${s}
389
389
  box-sizing: border-box;
390
390
  color: var(--n-option-text-color);
391
391
  opacity: 1;
392
- `,[Ce("show-checkmark",`
392
+ `,[Se("show-checkmark",`
393
393
  padding-right: calc(var(--n-option-padding-right) + 20px);
394
394
  `),oe("&::before",`
395
395
  content: "";
@@ -402,30 +402,30 @@ ${s}
402
402
  transition: background-color .3s var(--n-bezier);
403
403
  `),oe("&:active",`
404
404
  color: var(--n-option-text-color-pressed);
405
- `),Ce("grouped",`
405
+ `),Se("grouped",`
406
406
  padding-left: calc(var(--n-option-padding-left) * 1.5);
407
- `),Ce("pending",[oe("&::before",`
407
+ `),Se("pending",[oe("&::before",`
408
408
  background-color: var(--n-option-color-pending);
409
- `)]),Ce("selected",`
409
+ `)]),Se("selected",`
410
410
  color: var(--n-option-text-color-active);
411
411
  `,[oe("&::before",`
412
412
  background-color: var(--n-option-color-active);
413
- `),Ce("pending",[oe("&::before",`
413
+ `),Se("pending",[oe("&::before",`
414
414
  background-color: var(--n-option-color-active-pending);
415
- `)])]),Ce("disabled",`
415
+ `)])]),Se("disabled",`
416
416
  cursor: not-allowed;
417
- `,[Ut("selected",`
417
+ `,[Gt("selected",`
418
418
  color: var(--n-option-text-color-disabled);
419
- `),Ce("selected",`
419
+ `),Se("selected",`
420
420
  opacity: var(--n-option-opacity-disabled);
421
- `)]),_e("check",`
421
+ `)]),ye("check",`
422
422
  font-size: 16px;
423
423
  position: absolute;
424
424
  right: calc(var(--n-option-padding-right) - 4px);
425
425
  top: calc(50% - 7px);
426
426
  color: var(--n-option-check-color);
427
427
  transition: color .3s var(--n-bezier);
428
- `,[kh({enterScale:"0.5"})])])]),bw=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},mt.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(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=fi(e),r=bs("InternalSelectMenu",n,t),s=mt("InternalSelectMenu","-internal-select-menu",yw,_h,e,i.toRef(e,"clsPrefix")),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.computed(()=>e.treeMate.getFlattenedNodes()),d=i.computed(()=>hy(c.value)),h=i.ref(null);function f(){const{treeMate:V}=e;let O=null;const{value:J}=e;J===null?O=V.getFirstAvailableNode():(e.multiple?O=V.getNode((J||[])[(J||[]).length-1]):O=V.getNode(J),(!O||O.disabled)&&(O=V.getFirstAvailableNode())),A(O||null)}function p(){const{value:V}=h;V&&!e.treeMate.getNode(V.key)&&(h.value=null)}let u;i.watch(()=>e.show,V=>{V?u=i.watch(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?f():p(),i.nextTick($)):p()},{immediate:!0}):u==null||u()},{immediate:!0}),i.onBeforeUnmount(()=>{u==null||u()});const g=i.computed(()=>cr(s.value.self[Ye("optionHeight",e.size)])),m=i.computed(()=>Yt(s.value.self[Ye("padding",e.size)])),_=i.computed(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),y=i.computed(()=>{const V=c.value;return V&&V.length===0});function b(V){const{onToggle:O}=e;O&&O(V)}function S(V){const{onScroll:O}=e;O&&O(V)}function C(V){var O;(O=l.value)===null||O===void 0||O.sync(),S(V)}function v(){var V;(V=l.value)===null||V===void 0||V.sync()}function B(){const{value:V}=h;return V||null}function k(V,O){O.disabled||A(O,!1)}function E(V,O){O.disabled||b(O)}function P(V){var O;ar(V,"action")||(O=e.onKeyup)===null||O===void 0||O.call(e,V)}function R(V){var O;ar(V,"action")||(O=e.onKeydown)===null||O===void 0||O.call(e,V)}function j(V){var O;(O=e.onMousedown)===null||O===void 0||O.call(e,V),!e.focusable&&V.preventDefault()}function q(){const{value:V}=h;V&&A(V.getNext({loop:!0}),!0)}function M(){const{value:V}=h;V&&A(V.getPrev({loop:!0}),!0)}function A(V,O=!1){h.value=V,O&&$()}function $(){var V,O;const J=h.value;if(!J)return;const he=d.value(J.key);he!==null&&(e.virtualScroll?(V=a.value)===null||V===void 0||V.scrollTo({index:he}):(O=l.value)===null||O===void 0||O.scrollTo({index:he,elSize:g.value}))}function X(V){var O,J;!((O=o.value)===null||O===void 0)&&O.contains(V.target)&&((J=e.onFocus)===null||J===void 0||J.call(e,V))}function F(V){var O,J;!((O=o.value)===null||O===void 0)&&O.contains(V.relatedTarget)||(J=e.onBlur)===null||J===void 0||J.call(e,V)}i.provide(Ao,{handleOptionMouseEnter:k,handleOptionClick:E,valueSetRef:_,pendingTmNodeRef:h,nodePropsRef:i.toRef(e,"nodeProps"),showCheckmarkRef:i.toRef(e,"showCheckmark"),multipleRef:i.toRef(e,"multiple"),valueRef:i.toRef(e,"value"),renderLabelRef:i.toRef(e,"renderLabel"),renderOptionRef:i.toRef(e,"renderOption"),labelFieldRef:i.toRef(e,"labelField"),valueFieldRef:i.toRef(e,"valueField")}),i.provide(Hd,o),i.onMounted(()=>{const{value:V}=l;V&&V.sync()});const N=i.computed(()=>{const{size:V}=e,{common:{cubicBezierEaseInOut:O},self:{height:J,borderRadius:he,color:ie,groupHeaderTextColor:ge,actionDividerColor:re,optionTextColorPressed:Fe,optionTextColor:Me,optionTextColorDisabled:Ge,optionTextColorActive:Le,optionOpacityDisabled:Pe,optionCheckColor:$e,actionTextColor:ot,optionColorPending:De,optionColorActive:ct,loadingColor:Pt,loadingSize:yi,optionColorActivePending:bi,[Ye("optionFontSize",V)]:zn,[Ye("optionHeight",V)]:dn,[Ye("optionPadding",V)]:dt}}=s.value;return{"--n-height":J,"--n-action-divider-color":re,"--n-action-text-color":ot,"--n-bezier":O,"--n-border-radius":he,"--n-color":ie,"--n-option-font-size":zn,"--n-group-header-text-color":ge,"--n-option-check-color":$e,"--n-option-color-pending":De,"--n-option-color-active":ct,"--n-option-color-active-pending":bi,"--n-option-height":dn,"--n-option-opacity-disabled":Pe,"--n-option-text-color":Me,"--n-option-text-color-active":Le,"--n-option-text-color-disabled":Ge,"--n-option-text-color-pressed":Fe,"--n-option-padding":dt,"--n-option-padding-left":Yt(dt,"left"),"--n-option-padding-right":Yt(dt,"right"),"--n-loading-color":Pt,"--n-loading-size":yi}}),{inlineThemeDisabled:W}=e,z=W?pi("internal-select-menu",i.computed(()=>e.size[0]),N,e):void 0,G={selfRef:o,next:q,prev:M,getPendingTmNode:B};return Yd(o,e.onResize),Object.assign({mergedTheme:s,mergedClsPrefix:t,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:g,padding:m,flattenedNodes:c,empty:y,virtualListContainer(){const{value:V}=a;return V==null?void 0:V.listElRef},virtualListContent(){const{value:V}=a;return V==null?void 0:V.itemsElRef},doScroll:S,handleFocusin:X,handleFocusout:F,handleKeyUp:P,handleKeyDown:R,handleMouseDown:j,handleVirtualListResize:v,handleVirtualListScroll:C,cssVars:W?void 0:N,themeClass:z==null?void 0:z.themeClass,onRender:z==null?void 0:z.onRender},G)},render(){const{$slots:e,virtualScroll:t,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},hi(e.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(dh,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},Lo(e.empty,()=>[i.h(pw,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(gh,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:t?this.virtualListContainer:void 0,content:t?this.virtualListContent:void 0,onScroll:t?void 0:this.doScroll},{default:()=>t?i.h(Db,{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(yh,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h(bh,{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(yh,{key:a.key,clsPrefix:n,tmNode:a}):i.h(bh,{clsPrefix:n,key:a.key,tmNode:a})))}),hi(e.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(Q1,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),ww={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function vw(e){const{boxShadow2:t,popoverColor:n,textColor2:r,borderRadius:s,fontSize:o,dividerColor:a}=e;return Object.assign(Object.assign({},ww),{fontSize:o,borderRadius:s,color:n,dividerColor:a,textColor:r,boxShadow:t})}const xh={name:"Popover",common:gi,self:vw},Xo={top:"bottom",bottom:"top",left:"right",right:"left"},nt="var(--n-arrow-height) * 1.414",kw=oe([fe("popover",`
428
+ `,[kh({enterScale:"0.5"})])])]),xw=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},yt.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(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=gi(e),r=bs("InternalSelectMenu",n,t),s=yt("InternalSelectMenu","-internal-select-menu",kw,yh,e,i.toRef(e,"clsPrefix")),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.computed(()=>e.treeMate.getFlattenedNodes()),d=i.computed(()=>g_(c.value)),h=i.ref(null);function f(){const{treeMate:I}=e;let O=null;const{value:Z}=e;Z===null?O=I.getFirstAvailableNode():(e.multiple?O=I.getNode((Z||[])[(Z||[]).length-1]):O=I.getNode(Z),(!O||O.disabled)&&(O=I.getFirstAvailableNode())),M(O||null)}function p(){const{value:I}=h;I&&!e.treeMate.getNode(I.key)&&(h.value=null)}let u;i.watch(()=>e.show,I=>{I?u=i.watch(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?f():p(),i.nextTick(V)):p()},{immediate:!0}):u==null||u()},{immediate:!0}),i.onBeforeUnmount(()=>{u==null||u()});const g=i.computed(()=>cr(s.value.self[qe("optionHeight",e.size)])),m=i.computed(()=>Ut(s.value.self[qe("padding",e.size)])),y=i.computed(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),_=i.computed(()=>{const I=c.value;return I&&I.length===0});function b(I){const{onToggle:O}=e;O&&O(I)}function S(I){const{onScroll:O}=e;O&&O(I)}function x(I){var O;(O=l.value)===null||O===void 0||O.sync(),S(I)}function v(){var I;(I=l.value)===null||I===void 0||I.sync()}function B(){const{value:I}=h;return I||null}function k(I,O){O.disabled||M(O,!1)}function N(I,O){O.disabled||b(O)}function P(I){var O;ar(I,"action")||(O=e.onKeyup)===null||O===void 0||O.call(e,I)}function R(I){var O;ar(I,"action")||(O=e.onKeydown)===null||O===void 0||O.call(e,I)}function W(I){var O;(O=e.onMousedown)===null||O===void 0||O.call(e,I),!e.focusable&&I.preventDefault()}function q(){const{value:I}=h;I&&M(I.getNext({loop:!0}),!0)}function F(){const{value:I}=h;I&&M(I.getPrev({loop:!0}),!0)}function M(I,O=!1){h.value=I,O&&V()}function V(){var I,O;const Z=h.value;if(!Z)return;const ge=d.value(Z.key);ge!==null&&(e.virtualScroll?(I=a.value)===null||I===void 0||I.scrollTo({index:ge}):(O=l.value)===null||O===void 0||O.scrollTo({index:ge,elSize:g.value}))}function K(I){var O,Z;!((O=o.value)===null||O===void 0)&&O.contains(I.target)&&((Z=e.onFocus)===null||Z===void 0||Z.call(e,I))}function T(I){var O,Z;!((O=o.value)===null||O===void 0)&&O.contains(I.relatedTarget)||(Z=e.onBlur)===null||Z===void 0||Z.call(e,I)}i.provide(Ao,{handleOptionMouseEnter:k,handleOptionClick:N,valueSetRef:y,pendingTmNodeRef:h,nodePropsRef:i.toRef(e,"nodeProps"),showCheckmarkRef:i.toRef(e,"showCheckmark"),multipleRef:i.toRef(e,"multiple"),valueRef:i.toRef(e,"value"),renderLabelRef:i.toRef(e,"renderLabel"),renderOptionRef:i.toRef(e,"renderOption"),labelFieldRef:i.toRef(e,"labelField"),valueFieldRef:i.toRef(e,"valueField")}),i.provide(Hd,o),i.onMounted(()=>{const{value:I}=l;I&&I.sync()});const $=i.computed(()=>{const{size:I}=e,{common:{cubicBezierEaseInOut:O},self:{height:Z,borderRadius:ge,color:ie,groupHeaderTextColor:he,actionDividerColor:re,optionTextColorPressed:Pe,optionTextColor:Fe,optionTextColorDisabled:Ze,optionTextColorActive:Le,optionOpacityDisabled:dt,optionCheckColor:Zt,actionTextColor:Oe,optionColorPending:Ce,optionColorActive:Je,loadingColor:Qe,loadingSize:un,optionColorActivePending:Ue,[qe("optionFontSize",I)]:Ft,[qe("optionHeight",I)]:fn,[qe("optionPadding",I)]:ht}}=s.value;return{"--n-height":Z,"--n-action-divider-color":re,"--n-action-text-color":Oe,"--n-bezier":O,"--n-border-radius":ge,"--n-color":ie,"--n-option-font-size":Ft,"--n-group-header-text-color":he,"--n-option-check-color":Zt,"--n-option-color-pending":Ce,"--n-option-color-active":Je,"--n-option-color-active-pending":Ue,"--n-option-height":fn,"--n-option-opacity-disabled":dt,"--n-option-text-color":Fe,"--n-option-text-color-active":Le,"--n-option-text-color-disabled":Ze,"--n-option-text-color-pressed":Pe,"--n-option-padding":ht,"--n-option-padding-left":Ut(ht,"left"),"--n-option-padding-right":Ut(ht,"right"),"--n-loading-color":Qe,"--n-loading-size":un}}),{inlineThemeDisabled:j}=e,z=j?mi("internal-select-menu",i.computed(()=>e.size[0]),$,e):void 0,U={selfRef:o,next:q,prev:F,getPendingTmNode:B};return Yd(o,e.onResize),Object.assign({mergedTheme:s,mergedClsPrefix:t,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:g,padding:m,flattenedNodes:c,empty:_,virtualListContainer(){const{value:I}=a;return I==null?void 0:I.listElRef},virtualListContent(){const{value:I}=a;return I==null?void 0:I.itemsElRef},doScroll:S,handleFocusin:K,handleFocusout:T,handleKeyUp:P,handleKeyDown:R,handleMouseDown:W,handleVirtualListResize:v,handleVirtualListScroll:x,cssVars:j?void 0:$,themeClass:z==null?void 0:z.themeClass,onRender:z==null?void 0:z.onRender},U)},render(){const{$slots:e,virtualScroll:t,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},fi(e.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(dh,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},Lo(e.empty,()=>[i.h(_w,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(gh,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:t?this.virtualListContainer:void 0,content:t?this.virtualListContent:void 0,onScroll:t?void 0:this.doScroll},{default:()=>t?i.h(Xb,{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(_h,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h(bh,{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(_h,{key:a.key,clsPrefix:n,tmNode:a}):i.h(bh,{clsPrefix:n,key:a.key,tmNode:a})))}),fi(e.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(iw,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),Cw={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function Sw(e){const{boxShadow2:t,popoverColor:n,textColor2:r,borderRadius:s,fontSize:o,dividerColor:a}=e;return Object.assign(Object.assign({},Cw),{fontSize:o,borderRadius:s,color:n,dividerColor:a,textColor:r,boxShadow:t})}const xh={name:"Popover",common:yi,self:Sw},Xo={top:"bottom",bottom:"top",left:"right",right:"left"},rt="var(--n-arrow-height) * 1.414",Bw=oe([fe("popover",`
429
429
  transition:
430
430
  box-shadow .3s var(--n-bezier),
431
431
  background-color .3s var(--n-bezier),
@@ -438,18 +438,18 @@ ${s}
438
438
  `,[oe(">",[fe("scrollbar",`
439
439
  height: inherit;
440
440
  max-height: inherit;
441
- `)]),Ut("raw",`
441
+ `)]),Gt("raw",`
442
442
  background-color: var(--n-color);
443
443
  border-radius: var(--n-border-radius);
444
- `,[Ut("scrollable",[Ut("show-header-or-footer","padding: var(--n-padding);")])]),_e("header",`
444
+ `,[Gt("scrollable",[Gt("show-header-or-footer","padding: var(--n-padding);")])]),ye("header",`
445
445
  padding: var(--n-padding);
446
446
  border-bottom: 1px solid var(--n-divider-color);
447
447
  transition: border-color .3s var(--n-bezier);
448
- `),_e("footer",`
448
+ `),ye("footer",`
449
449
  padding: var(--n-padding);
450
450
  border-top: 1px solid var(--n-divider-color);
451
451
  transition: border-color .3s var(--n-bezier);
452
- `),Ce("scrollable, show-header-or-footer",[_e("content",`
452
+ `),Se("scrollable, show-header-or-footer",[ye("content",`
453
453
  padding: var(--n-padding);
454
454
  `)])]),fe("popover-shared",`
455
455
  transform-origin: inherit;
@@ -461,8 +461,8 @@ ${s}
461
461
  transition: background-color .3s var(--n-bezier);
462
462
  position: absolute;
463
463
  display: block;
464
- width: calc(${nt});
465
- height: calc(${nt});
464
+ width: calc(${rt});
465
+ height: calc(${rt});
466
466
  box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12);
467
467
  transform: rotate(45deg);
468
468
  background-color: var(--n-color);
@@ -487,53 +487,53 @@ ${s}
487
487
  color .3s var(--n-bezier),
488
488
  opacity .15s var(--n-bezier-ease-in),
489
489
  transform .15s var(--n-bezier-ease-in);
490
- `)]),jt("top-start",`
491
- top: calc(${nt} / -2);
492
- left: calc(${yn("top-start")} - var(--v-offset-left));
493
- `),jt("top",`
494
- top: calc(${nt} / -2);
495
- transform: translateX(calc(${nt} / -2)) rotate(45deg);
490
+ `)]),Xt("top-start",`
491
+ top: calc(${rt} / -2);
492
+ left: calc(${vn("top-start")} - var(--v-offset-left));
493
+ `),Xt("top",`
494
+ top: calc(${rt} / -2);
495
+ transform: translateX(calc(${rt} / -2)) rotate(45deg);
496
496
  left: 50%;
497
- `),jt("top-end",`
498
- top: calc(${nt} / -2);
499
- right: calc(${yn("top-end")} + var(--v-offset-left));
500
- `),jt("bottom-start",`
501
- bottom: calc(${nt} / -2);
502
- left: calc(${yn("bottom-start")} - var(--v-offset-left));
503
- `),jt("bottom",`
504
- bottom: calc(${nt} / -2);
505
- transform: translateX(calc(${nt} / -2)) rotate(45deg);
497
+ `),Xt("top-end",`
498
+ top: calc(${rt} / -2);
499
+ right: calc(${vn("top-end")} + var(--v-offset-left));
500
+ `),Xt("bottom-start",`
501
+ bottom: calc(${rt} / -2);
502
+ left: calc(${vn("bottom-start")} - var(--v-offset-left));
503
+ `),Xt("bottom",`
504
+ bottom: calc(${rt} / -2);
505
+ transform: translateX(calc(${rt} / -2)) rotate(45deg);
506
506
  left: 50%;
507
- `),jt("bottom-end",`
508
- bottom: calc(${nt} / -2);
509
- right: calc(${yn("bottom-end")} + var(--v-offset-left));
510
- `),jt("left-start",`
511
- left: calc(${nt} / -2);
512
- top: calc(${yn("left-start")} - var(--v-offset-top));
513
- `),jt("left",`
514
- left: calc(${nt} / -2);
515
- transform: translateY(calc(${nt} / -2)) rotate(45deg);
507
+ `),Xt("bottom-end",`
508
+ bottom: calc(${rt} / -2);
509
+ right: calc(${vn("bottom-end")} + var(--v-offset-left));
510
+ `),Xt("left-start",`
511
+ left: calc(${rt} / -2);
512
+ top: calc(${vn("left-start")} - var(--v-offset-top));
513
+ `),Xt("left",`
514
+ left: calc(${rt} / -2);
515
+ transform: translateY(calc(${rt} / -2)) rotate(45deg);
516
516
  top: 50%;
517
- `),jt("left-end",`
518
- left: calc(${nt} / -2);
519
- bottom: calc(${yn("left-end")} + var(--v-offset-top));
520
- `),jt("right-start",`
521
- right: calc(${nt} / -2);
522
- top: calc(${yn("right-start")} - var(--v-offset-top));
523
- `),jt("right",`
524
- right: calc(${nt} / -2);
525
- transform: translateY(calc(${nt} / -2)) rotate(45deg);
517
+ `),Xt("left-end",`
518
+ left: calc(${rt} / -2);
519
+ bottom: calc(${vn("left-end")} + var(--v-offset-top));
520
+ `),Xt("right-start",`
521
+ right: calc(${rt} / -2);
522
+ top: calc(${vn("right-start")} - var(--v-offset-top));
523
+ `),Xt("right",`
524
+ right: calc(${rt} / -2);
525
+ transform: translateY(calc(${rt} / -2)) rotate(45deg);
526
526
  top: 50%;
527
- `),jt("right-end",`
528
- right: calc(${nt} / -2);
529
- bottom: calc(${yn("right-end")} + var(--v-offset-top));
530
- `),...D.map({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(e,t)=>{const n=["right","left"].includes(t),r=n?"width":"height";return e.map(s=>{const o=s.split("-")[1]==="end",l=`calc((${`var(--v-target-${r}, 0px)`} - ${nt}) / 2)`,c=yn(s);return oe(`[v-placement="${s}"] >`,[fe("popover-shared",[Ce("center-arrow",[fe("popover-arrow",`${t}: calc(max(${l}, ${c}) ${o?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function yn(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function jt(e,t){const n=e.split("-")[0],r=["top","bottom"].includes(n)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return oe(`[v-placement="${e}"] >`,[fe("popover-shared",`
527
+ `),Xt("right-end",`
528
+ right: calc(${rt} / -2);
529
+ bottom: calc(${vn("right-end")} + var(--v-offset-top));
530
+ `),...D.map({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(e,t)=>{const n=["right","left"].includes(t),r=n?"width":"height";return e.map(s=>{const o=s.split("-")[1]==="end",l=`calc((${`var(--v-target-${r}, 0px)`} - ${rt}) / 2)`,c=vn(s);return oe(`[v-placement="${s}"] >`,[fe("popover-shared",[Se("center-arrow",[fe("popover-arrow",`${t}: calc(max(${l}, ${c}) ${o?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function vn(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function Xt(e,t){const n=e.split("-")[0],r=["top","bottom"].includes(n)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return oe(`[v-placement="${e}"] >`,[fe("popover-shared",`
531
531
  margin-${Xo[n]}: var(--n-space);
532
- `,[Ce("show-arrow",`
532
+ `,[Se("show-arrow",`
533
533
  margin-${Xo[n]}: var(--n-space-arrow);
534
- `),Ce("overlap",`
534
+ `),Se("overlap",`
535
535
  margin: 0;
536
- `),Zb("popover-arrow-wrapper",`
536
+ `),t1("popover-arrow-wrapper",`
537
537
  right: 0;
538
538
  left: 0;
539
539
  top: 0;
@@ -541,7 +541,7 @@ ${s}
541
541
  ${n}: 100%;
542
542
  ${Xo[n]}: auto;
543
543
  ${r}
544
- `,[fe("popover-arrow",t)])])])}const Ch=Object.assign(Object.assign({},mt.props),{to:_n.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 xw({arrowClass:e,arrowStyle:t,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`,e],style:t}))}const Cw=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:Ch,setup(e,{slots:t,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o}=fi(e),a=mt("Popover","-popover",kw,xh,e,s),l=i.ref(null),c=i.inject("NPopover"),d=i.ref(null),h=i.ref(e.show),f=i.ref(!1);i.watchEffect(()=>{const{show:k}=e;k&&!Jb()&&!e.internalDeactivateImmediately&&(f.value=!0)});const p=i.computed(()=>{const{trigger:k,onClickoutside:E}=e,P=[],{positionManuallyRef:{value:R}}=c;return R||(k==="click"&&!E&&P.push([os,C,void 0,{capture:!0}]),k==="hover"&&P.push([Ry,S])),E&&P.push([os,C,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&f.value)&&P.push([i.vShow,e.show]),P}),u=i.computed(()=>{const{common:{cubicBezierEaseInOut:k,cubicBezierEaseIn:E,cubicBezierEaseOut:P},self:{space:R,spaceArrow:j,padding:q,fontSize:M,textColor:A,dividerColor:$,color:X,boxShadow:F,borderRadius:N,arrowHeight:W,arrowOffset:z,arrowOffsetVertical:G}}=a.value;return{"--n-box-shadow":F,"--n-bezier":k,"--n-bezier-ease-in":E,"--n-bezier-ease-out":P,"--n-font-size":M,"--n-text-color":A,"--n-color":X,"--n-divider-color":$,"--n-border-radius":N,"--n-arrow-height":W,"--n-arrow-offset":z,"--n-arrow-offset-vertical":G,"--n-padding":q,"--n-space":R,"--n-space-arrow":j}}),g=i.computed(()=>{const k=e.width==="trigger"?void 0:Io(e.width),E=[];k&&E.push({width:k});const{maxWidth:P,minWidth:R}=e;return P&&E.push({maxWidth:Io(P)}),R&&E.push({maxWidth:Io(R)}),o||E.push(u.value),E}),m=o?pi("popover",void 0,u,e):void 0;c.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{c.setBodyInstance(null)}),i.watch(i.toRef(e,"show"),k=>{e.animated||(k?h.value=!0:h.value=!1)});function _(){var k;(k=l.value)===null||k===void 0||k.syncPosition()}function y(k){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&c.handleMouseEnter(k)}function b(k){e.trigger==="hover"&&e.keepAliveOnHover&&c.handleMouseLeave(k)}function S(k){e.trigger==="hover"&&!v().contains(lr(k))&&c.handleMouseMoveOutside(k)}function C(k){(e.trigger==="click"&&!v().contains(lr(k))||e.onClickoutside)&&c.handleClickOutside(k)}function v(){return c.getTriggerElement()}i.provide(Xd,d),i.provide(Wd,null),i.provide(jd,null);function B(){if(m==null||m.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&f.value))return null;let E;const P=c.internalRenderBodyRef.value,{value:R}=s;if(P)E=P([`${R}-popover-shared`,m==null?void 0:m.themeClass.value,e.overlap&&`${R}-popover-shared--overlap`,e.showArrow&&`${R}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${R}-popover-shared--center-arrow`],d,g.value,y,b);else{const{value:j}=c.extraClassRef,{internalTrapFocus:q}=e,M=!rh(t.header)||!rh(t.footer),A=()=>{var $,X;const F=M?i.h(i.Fragment,null,hi(t.header,z=>z?i.h("div",{class:[`${R}-popover__header`,e.headerClass],style:e.headerStyle},z):null),hi(t.default,z=>z?i.h("div",{class:[`${R}-popover__content`,e.contentClass],style:e.contentStyle},t):null),hi(t.footer,z=>z?i.h("div",{class:[`${R}-popover__footer`,e.footerClass],style:e.footerStyle},z):null)):e.scrollable?($=t.default)===null||$===void 0?void 0:$.call(t):i.h("div",{class:[`${R}-popover__content`,e.contentClass],style:e.contentStyle},t),N=e.scrollable?i.h(cw,{contentClass:M?void 0:`${R}-popover__content ${(X=e.contentClass)!==null&&X!==void 0?X:""}`,contentStyle:M?void 0:e.contentStyle},{default:()=>F}):F,W=e.showArrow?xw({arrowClass:e.arrowClass,arrowStyle:e.arrowStyle,arrowWrapperClass:e.arrowWrapperClass,arrowWrapperStyle:e.arrowWrapperStyle,clsPrefix:R}):null;return[N,W]};E=i.h("div",i.mergeProps({class:[`${R}-popover`,`${R}-popover-shared`,m==null?void 0:m.themeClass.value,j.map($=>`${R}-${$}`),{[`${R}-popover--scrollable`]:e.scrollable,[`${R}-popover--show-header-or-footer`]:M,[`${R}-popover--raw`]:e.raw,[`${R}-popover-shared--overlap`]:e.overlap,[`${R}-popover-shared--show-arrow`]:e.showArrow,[`${R}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:d,style:g.value,onKeydown:c.handleKeydown,onMouseenter:y,onMouseleave:b},n),q?i.h(jb,{active:e.show,autoFocus:!0},{default:A}):A())}return i.withDirectives(E,p.value)}return{displayed:f,namespace:r,isMounted:c.isMountedRef,zIndex:c.zIndexRef,followerRef:l,adjustedTo:_n(e),followerEnabled:h,renderContentNode:B}},render(){return i.h(yd,{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===_n.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)===null||e===void 0||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var Sw={};const Bw=Object.keys(Ch),Tw={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function Ew(e,t,n){Tw[t].forEach(r=>{e.props?e.props=Object.assign({},e.props):e.props={};const s=e.props[r],o=n[r];s?e.props[r]=(...a)=>{s(...a),o(...a)}:e.props[r]=o})}const $w={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:_n.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},Nw=Object.assign(Object.assign(Object.assign({},mt.props),$w),{internalOnAfterLeave:Function,internalRenderBody:Function}),Rw=i.defineComponent({name:"Popover",inheritAttrs:!1,props:Nw,slots:Object,__popover__:!0,setup(e){Sw.NODE_ENV!=="production"&&i.watchEffect(()=>{e.maxWidth!==void 0&&Vn("popover","`max-width` is deprecated, please use `style` instead."),e.minWidth!==void 0&&Vn("popover","`min-width` is deprecated, please use `style` instead."),e.arrow!==void 0&&Vn("popover","`arrow` is deprecated, please use `showArrow` instead."),e.onHide!==void 0&&Vn("popover","`on-hide` is deprecated, please use `on-update:show` instead."),e.onShow!==void 0&&Vn("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const t=as(),n=i.ref(null),r=i.computed(()=>e.show),s=i.ref(e.defaultShow),o=ko(r,s),a=Wt(()=>e.disabled?!1:o.value),l=()=>{if(e.disabled)return!0;const{getDisabled:$}=e;return!!($!=null&&$())},c=()=>l()?!1:o.value,d=Jc(e,["arrow","showArrow"]),h=i.computed(()=>e.overlap?!1:d.value);let f=null;const p=i.ref(null),u=i.ref(null),g=Wt(()=>e.x!==void 0&&e.y!==void 0);function m($){const{"onUpdate:show":X,onUpdateShow:F,onShow:N,onHide:W}=e;s.value=$,X&&gt(X,$),F&&gt(F,$),$&&N&&gt(N,!0),$&&W&&gt(W,!1)}function _(){f&&f.syncPosition()}function y(){const{value:$}=p;$&&(window.clearTimeout($),p.value=null)}function b(){const{value:$}=u;$&&(window.clearTimeout($),u.value=null)}function S(){const $=l();if(e.trigger==="focus"&&!$){if(c())return;m(!0)}}function C(){const $=l();if(e.trigger==="focus"&&!$){if(!c())return;m(!1)}}function v(){const $=l();if(e.trigger==="hover"&&!$){if(b(),p.value!==null||c())return;const X=()=>{m(!0),p.value=null},{delay:F}=e;F===0?X():p.value=window.setTimeout(X,F)}}function B(){const $=l();if(e.trigger==="hover"&&!$){if(y(),u.value!==null||!c())return;const X=()=>{m(!1),u.value=null},{duration:F}=e;F===0?X():u.value=window.setTimeout(X,F)}}function k(){B()}function E($){var X;c()&&(e.trigger==="click"&&(y(),b(),m(!1)),(X=e.onClickoutside)===null||X===void 0||X.call(e,$))}function P(){if(e.trigger==="click"&&!l()){y(),b();const $=!c();m($)}}function R($){e.internalTrapFocus&&$.key==="Escape"&&(y(),b(),m(!1))}function j($){s.value=$}function q(){var $;return($=n.value)===null||$===void 0?void 0:$.targetRef}function M($){f=$}return i.provide("NPopover",{getTriggerElement:q,handleKeydown:R,handleMouseEnter:v,handleMouseLeave:B,handleClickOutside:E,handleMouseMoveOutside:k,setBodyInstance:M,positionManuallyRef:g,isMountedRef:t,zIndexRef:i.toRef(e,"zIndex"),extraClassRef:i.toRef(e,"internalExtraClass"),internalRenderBodyRef:i.toRef(e,"internalRenderBody")}),i.watchEffect(()=>{o.value&&l()&&m(!1)}),{binderInstRef:n,positionManually:g,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:h,getMergedShow:c,setShow:j,handleClick:P,handleMouseEnter:v,handleMouseLeave:B,handleFocus:S,handleBlur:C,syncPosition:_}},render(){var e;const{positionManually:t,$slots:n}=this;let r,s=!1;if(!t&&(r=t1(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(!((e=r.type)===null||e===void 0)&&e.__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)})}};Ew(r,a?"nested":t?"manual":this.trigger,c)}}return i.h(nd,{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}}),[[Zc,{enabled:o,zIndex:this.zIndex}]]):null,t?null:i.h(id,null,{default:()=>r}),i.h(Cw,n1(this.$props,Bw,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)}})]}})}}),Pw={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 Fw(e){const{textColor2:t,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:h,opacityDisabled:f,tagColor:p,closeIconColor:u,closeIconColorHover:g,closeIconColorPressed:m,borderRadiusSmall:_,fontSizeMini:y,fontSizeTiny:b,fontSizeSmall:S,fontSizeMedium:C,heightMini:v,heightTiny:B,heightSmall:k,heightMedium:E,closeColorHover:P,closeColorPressed:R,buttonColor2Hover:j,buttonColor2Pressed:q,fontWeightStrong:M}=e;return Object.assign(Object.assign({},Pw),{closeBorderRadius:_,heightTiny:v,heightSmall:B,heightMedium:k,heightLarge:E,borderRadius:_,opacityDisabled:f,fontSizeTiny:y,fontSizeSmall:b,fontSizeMedium:S,fontSizeLarge:C,fontWeightStrong:M,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:j,colorPressedCheckable:q,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${h}`,textColor:t,color:p,colorBordered:"rgb(250, 250, 252)",closeIconColor:u,closeIconColorHover:g,closeIconColorPressed:m,closeColorHover:P,closeColorPressed:R,borderPrimary:`1px solid ${Re(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:Re(s,{alpha:.12}),colorBorderedPrimary:Re(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:Re(s,{alpha:.12}),closeColorPressedPrimary:Re(s,{alpha:.18}),borderInfo:`1px solid ${Re(o,{alpha:.3})}`,textColorInfo:o,colorInfo:Re(o,{alpha:.12}),colorBorderedInfo:Re(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:Re(o,{alpha:.12}),closeColorPressedInfo:Re(o,{alpha:.18}),borderSuccess:`1px solid ${Re(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Re(a,{alpha:.12}),colorBorderedSuccess:Re(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Re(a,{alpha:.12}),closeColorPressedSuccess:Re(a,{alpha:.18}),borderWarning:`1px solid ${Re(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Re(l,{alpha:.15}),colorBorderedWarning:Re(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Re(l,{alpha:.12}),closeColorPressedWarning:Re(l,{alpha:.18}),borderError:`1px solid ${Re(c,{alpha:.23})}`,textColorError:c,colorError:Re(c,{alpha:.1}),colorBorderedError:Re(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Re(c,{alpha:.12}),closeColorPressedError:Re(c,{alpha:.18})})}const Mw={common:gi,self:Fw},Aw={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},Iw=fe("tag",`
544
+ `,[fe("popover-arrow",t)])])])}const Ch=Object.assign(Object.assign({},yt.props),{to:wn.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 Tw({arrowClass:e,arrowStyle:t,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`,e],style:t}))}const Ew=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:Ch,setup(e,{slots:t,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o}=gi(e),a=yt("Popover","-popover",Bw,xh,e,s),l=i.ref(null),c=i.inject("NPopover"),d=i.ref(null),h=i.ref(e.show),f=i.ref(!1);i.watchEffect(()=>{const{show:k}=e;k&&!n1()&&!e.internalDeactivateImmediately&&(f.value=!0)});const p=i.computed(()=>{const{trigger:k,onClickoutside:N}=e,P=[],{positionManuallyRef:{value:R}}=c;return R||(k==="click"&&!N&&P.push([os,x,void 0,{capture:!0}]),k==="hover"&&P.push([A_,S])),N&&P.push([os,x,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&f.value)&&P.push([i.vShow,e.show]),P}),u=i.computed(()=>{const{common:{cubicBezierEaseInOut:k,cubicBezierEaseIn:N,cubicBezierEaseOut:P},self:{space:R,spaceArrow:W,padding:q,fontSize:F,textColor:M,dividerColor:V,color:K,boxShadow:T,borderRadius:$,arrowHeight:j,arrowOffset:z,arrowOffsetVertical:U}}=a.value;return{"--n-box-shadow":T,"--n-bezier":k,"--n-bezier-ease-in":N,"--n-bezier-ease-out":P,"--n-font-size":F,"--n-text-color":M,"--n-color":K,"--n-divider-color":V,"--n-border-radius":$,"--n-arrow-height":j,"--n-arrow-offset":z,"--n-arrow-offset-vertical":U,"--n-padding":q,"--n-space":R,"--n-space-arrow":W}}),g=i.computed(()=>{const k=e.width==="trigger"?void 0:Io(e.width),N=[];k&&N.push({width:k});const{maxWidth:P,minWidth:R}=e;return P&&N.push({maxWidth:Io(P)}),R&&N.push({maxWidth:Io(R)}),o||N.push(u.value),N}),m=o?mi("popover",void 0,u,e):void 0;c.setBodyInstance({syncPosition:y}),i.onBeforeUnmount(()=>{c.setBodyInstance(null)}),i.watch(i.toRef(e,"show"),k=>{e.animated||(k?h.value=!0:h.value=!1)});function y(){var k;(k=l.value)===null||k===void 0||k.syncPosition()}function _(k){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&c.handleMouseEnter(k)}function b(k){e.trigger==="hover"&&e.keepAliveOnHover&&c.handleMouseLeave(k)}function S(k){e.trigger==="hover"&&!v().contains(lr(k))&&c.handleMouseMoveOutside(k)}function x(k){(e.trigger==="click"&&!v().contains(lr(k))||e.onClickoutside)&&c.handleClickOutside(k)}function v(){return c.getTriggerElement()}i.provide(Xd,d),i.provide(Wd,null),i.provide(jd,null);function B(){if(m==null||m.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&f.value))return null;let N;const P=c.internalRenderBodyRef.value,{value:R}=s;if(P)N=P([`${R}-popover-shared`,m==null?void 0:m.themeClass.value,e.overlap&&`${R}-popover-shared--overlap`,e.showArrow&&`${R}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${R}-popover-shared--center-arrow`],d,g.value,_,b);else{const{value:W}=c.extraClassRef,{internalTrapFocus:q}=e,F=!rh(t.header)||!rh(t.footer),M=()=>{var V,K;const T=F?i.h(i.Fragment,null,fi(t.header,z=>z?i.h("div",{class:[`${R}-popover__header`,e.headerClass],style:e.headerStyle},z):null),fi(t.default,z=>z?i.h("div",{class:[`${R}-popover__content`,e.contentClass],style:e.contentStyle},t):null),fi(t.footer,z=>z?i.h("div",{class:[`${R}-popover__footer`,e.footerClass],style:e.footerStyle},z):null)):e.scrollable?(V=t.default)===null||V===void 0?void 0:V.call(t):i.h("div",{class:[`${R}-popover__content`,e.contentClass],style:e.contentStyle},t),$=e.scrollable?i.h(fw,{contentClass:F?void 0:`${R}-popover__content ${(K=e.contentClass)!==null&&K!==void 0?K:""}`,contentStyle:F?void 0:e.contentStyle},{default:()=>T}):T,j=e.showArrow?Tw({arrowClass:e.arrowClass,arrowStyle:e.arrowStyle,arrowWrapperClass:e.arrowWrapperClass,arrowWrapperStyle:e.arrowWrapperStyle,clsPrefix:R}):null;return[$,j]};N=i.h("div",i.mergeProps({class:[`${R}-popover`,`${R}-popover-shared`,m==null?void 0:m.themeClass.value,W.map(V=>`${R}-${V}`),{[`${R}-popover--scrollable`]:e.scrollable,[`${R}-popover--show-header-or-footer`]:F,[`${R}-popover--raw`]:e.raw,[`${R}-popover-shared--overlap`]:e.overlap,[`${R}-popover-shared--show-arrow`]:e.showArrow,[`${R}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:d,style:g.value,onKeydown:c.handleKeydown,onMouseenter:_,onMouseleave:b},n),q?i.h(Ub,{active:e.show,autoFocus:!0},{default:M}):M())}return i.withDirectives(N,p.value)}return{displayed:f,namespace:r,isMounted:c.isMountedRef,zIndex:c.zIndexRef,followerRef:l,adjustedTo:wn(e),followerEnabled:h,renderContentNode:B}},render(){return i.h(_d,{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===wn.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)===null||e===void 0||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var $w={};const Nw=Object.keys(Ch),Rw={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function Pw(e,t,n){Rw[t].forEach(r=>{e.props?e.props=Object.assign({},e.props):e.props={};const s=e.props[r],o=n[r];s?e.props[r]=(...a)=>{s(...a),o(...a)}:e.props[r]=o})}const Fw={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:wn.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},Mw=Object.assign(Object.assign(Object.assign({},yt.props),Fw),{internalOnAfterLeave:Function,internalRenderBody:Function}),Aw=i.defineComponent({name:"Popover",inheritAttrs:!1,props:Mw,slots:Object,__popover__:!0,setup(e){$w.NODE_ENV!=="production"&&i.watchEffect(()=>{e.maxWidth!==void 0&&Ln("popover","`max-width` is deprecated, please use `style` instead."),e.minWidth!==void 0&&Ln("popover","`min-width` is deprecated, please use `style` instead."),e.arrow!==void 0&&Ln("popover","`arrow` is deprecated, please use `showArrow` instead."),e.onHide!==void 0&&Ln("popover","`on-hide` is deprecated, please use `on-update:show` instead."),e.onShow!==void 0&&Ln("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const t=as(),n=i.ref(null),r=i.computed(()=>e.show),s=i.ref(e.defaultShow),o=ko(r,s),a=jt(()=>e.disabled?!1:o.value),l=()=>{if(e.disabled)return!0;const{getDisabled:V}=e;return!!(V!=null&&V())},c=()=>l()?!1:o.value,d=Jc(e,["arrow","showArrow"]),h=i.computed(()=>e.overlap?!1:d.value);let f=null;const p=i.ref(null),u=i.ref(null),g=jt(()=>e.x!==void 0&&e.y!==void 0);function m(V){const{"onUpdate:show":K,onUpdateShow:T,onShow:$,onHide:j}=e;s.value=V,K&&mt(K,V),T&&mt(T,V),V&&$&&mt($,!0),V&&j&&mt(j,!1)}function y(){f&&f.syncPosition()}function _(){const{value:V}=p;V&&(window.clearTimeout(V),p.value=null)}function b(){const{value:V}=u;V&&(window.clearTimeout(V),u.value=null)}function S(){const V=l();if(e.trigger==="focus"&&!V){if(c())return;m(!0)}}function x(){const V=l();if(e.trigger==="focus"&&!V){if(!c())return;m(!1)}}function v(){const V=l();if(e.trigger==="hover"&&!V){if(b(),p.value!==null||c())return;const K=()=>{m(!0),p.value=null},{delay:T}=e;T===0?K():p.value=window.setTimeout(K,T)}}function B(){const V=l();if(e.trigger==="hover"&&!V){if(_(),u.value!==null||!c())return;const K=()=>{m(!1),u.value=null},{duration:T}=e;T===0?K():u.value=window.setTimeout(K,T)}}function k(){B()}function N(V){var K;c()&&(e.trigger==="click"&&(_(),b(),m(!1)),(K=e.onClickoutside)===null||K===void 0||K.call(e,V))}function P(){if(e.trigger==="click"&&!l()){_(),b();const V=!c();m(V)}}function R(V){e.internalTrapFocus&&V.key==="Escape"&&(_(),b(),m(!1))}function W(V){s.value=V}function q(){var V;return(V=n.value)===null||V===void 0?void 0:V.targetRef}function F(V){f=V}return i.provide("NPopover",{getTriggerElement:q,handleKeydown:R,handleMouseEnter:v,handleMouseLeave:B,handleClickOutside:N,handleMouseMoveOutside:k,setBodyInstance:F,positionManuallyRef:g,isMountedRef:t,zIndexRef:i.toRef(e,"zIndex"),extraClassRef:i.toRef(e,"internalExtraClass"),internalRenderBodyRef:i.toRef(e,"internalRenderBody")}),i.watchEffect(()=>{o.value&&l()&&m(!1)}),{binderInstRef:n,positionManually:g,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:h,getMergedShow:c,setShow:W,handleClick:P,handleMouseEnter:v,handleMouseLeave:B,handleFocus:S,handleBlur:x,syncPosition:y}},render(){var e;const{positionManually:t,$slots:n}=this;let r,s=!1;if(!t&&(r=s1(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(!((e=r.type)===null||e===void 0)&&e.__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)})}};Pw(r,a?"nested":t?"manual":this.trigger,c)}}return i.h(nd,{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}}),[[Zc,{enabled:o,zIndex:this.zIndex}]]):null,t?null:i.h(id,null,{default:()=>r}),i.h(Ew,o1(this.$props,Nw,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)}})]}})}}),Iw={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 Vw(e){const{textColor2:t,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:h,opacityDisabled:f,tagColor:p,closeIconColor:u,closeIconColorHover:g,closeIconColorPressed:m,borderRadiusSmall:y,fontSizeMini:_,fontSizeTiny:b,fontSizeSmall:S,fontSizeMedium:x,heightMini:v,heightTiny:B,heightSmall:k,heightMedium:N,closeColorHover:P,closeColorPressed:R,buttonColor2Hover:W,buttonColor2Pressed:q,fontWeightStrong:F}=e;return Object.assign(Object.assign({},Iw),{closeBorderRadius:y,heightTiny:v,heightSmall:B,heightMedium:k,heightLarge:N,borderRadius:y,opacityDisabled:f,fontSizeTiny:_,fontSizeSmall:b,fontSizeMedium:S,fontSizeLarge:x,fontWeightStrong:F,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:W,colorPressedCheckable:q,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${h}`,textColor:t,color:p,colorBordered:"rgb(250, 250, 252)",closeIconColor:u,closeIconColorHover:g,closeIconColorPressed:m,closeColorHover:P,closeColorPressed:R,borderPrimary:`1px solid ${Re(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:Re(s,{alpha:.12}),colorBorderedPrimary:Re(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:Re(s,{alpha:.12}),closeColorPressedPrimary:Re(s,{alpha:.18}),borderInfo:`1px solid ${Re(o,{alpha:.3})}`,textColorInfo:o,colorInfo:Re(o,{alpha:.12}),colorBorderedInfo:Re(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:Re(o,{alpha:.12}),closeColorPressedInfo:Re(o,{alpha:.18}),borderSuccess:`1px solid ${Re(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Re(a,{alpha:.12}),colorBorderedSuccess:Re(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Re(a,{alpha:.12}),closeColorPressedSuccess:Re(a,{alpha:.18}),borderWarning:`1px solid ${Re(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Re(l,{alpha:.15}),colorBorderedWarning:Re(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Re(l,{alpha:.12}),closeColorPressedWarning:Re(l,{alpha:.18}),borderError:`1px solid ${Re(c,{alpha:.23})}`,textColorError:c,colorError:Re(c,{alpha:.1}),colorBorderedError:Re(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Re(c,{alpha:.12}),closeColorPressedError:Re(c,{alpha:.18})})}const Ow={common:yi,self:Vw},zw={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},Lw=fe("tag",`
545
545
  --n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);
546
546
  white-space: nowrap;
547
547
  position: relative;
@@ -563,9 +563,9 @@ ${s}
563
563
  line-height: 1;
564
564
  height: var(--n-height);
565
565
  font-size: var(--n-font-size);
566
- `,[Ce("strong",`
566
+ `,[Se("strong",`
567
567
  font-weight: var(--n-font-weight-strong);
568
- `),_e("border",`
568
+ `),ye("border",`
569
569
  pointer-events: none;
570
570
  position: absolute;
571
571
  left: 0;
@@ -575,43 +575,43 @@ ${s}
575
575
  border-radius: inherit;
576
576
  border: var(--n-border);
577
577
  transition: border-color .3s var(--n-bezier);
578
- `),_e("icon",`
578
+ `),ye("icon",`
579
579
  display: flex;
580
580
  margin: 0 4px 0 0;
581
581
  color: var(--n-text-color);
582
582
  transition: color .3s var(--n-bezier);
583
583
  font-size: var(--n-avatar-size-override);
584
- `),_e("avatar",`
584
+ `),ye("avatar",`
585
585
  display: flex;
586
586
  margin: 0 6px 0 0;
587
- `),_e("close",`
587
+ `),ye("close",`
588
588
  margin: var(--n-close-margin);
589
589
  transition:
590
590
  background-color .3s var(--n-bezier),
591
591
  color .3s var(--n-bezier);
592
- `),Ce("round",`
592
+ `),Se("round",`
593
593
  padding: 0 calc(var(--n-height) / 3);
594
594
  border-radius: calc(var(--n-height) / 2);
595
- `,[_e("icon",`
595
+ `,[ye("icon",`
596
596
  margin: 0 4px 0 calc((var(--n-height) - 8px) / -2);
597
- `),_e("avatar",`
597
+ `),ye("avatar",`
598
598
  margin: 0 6px 0 calc((var(--n-height) - 8px) / -2);
599
- `),Ce("closable",`
599
+ `),Se("closable",`
600
600
  padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3);
601
- `)]),Ce("icon, avatar",[Ce("round",`
601
+ `)]),Se("icon, avatar",[Se("round",`
602
602
  padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2);
603
- `)]),Ce("disabled",`
603
+ `)]),Se("disabled",`
604
604
  cursor: not-allowed !important;
605
605
  opacity: var(--n-opacity-disabled);
606
- `),Ce("checkable",`
606
+ `),Se("checkable",`
607
607
  cursor: pointer;
608
608
  box-shadow: none;
609
609
  color: var(--n-text-color-checkable);
610
610
  background-color: var(--n-color-checkable);
611
- `,[Ut("disabled",[oe("&:hover","background-color: var(--n-color-hover-checkable);",[Ut("checked","color: var(--n-text-color-hover-checkable);")]),oe("&:active","background-color: var(--n-color-pressed-checkable);",[Ut("checked","color: var(--n-text-color-pressed-checkable);")])]),Ce("checked",`
611
+ `,[Gt("disabled",[oe("&:hover","background-color: var(--n-color-hover-checkable);",[Gt("checked","color: var(--n-text-color-hover-checkable);")]),oe("&:active","background-color: var(--n-color-pressed-checkable);",[Gt("checked","color: var(--n-text-color-pressed-checkable);")])]),Se("checked",`
612
612
  color: var(--n-text-color-checked);
613
613
  background-color: var(--n-color-checked);
614
- `,[Ut("disabled",[oe("&:hover","background-color: var(--n-color-checked-hover);"),oe("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var Vw={};const Ow=Object.assign(Object.assign(Object.assign({},mt.props),Aw),{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}),zw="n-tag",qo=i.defineComponent({name:"Tag",props:Ow,slots:Object,setup(e){Vw.NODE_ENV!=="production"&&i.watchEffect(()=>{e.onCheckedChange!==void 0&&Vn("tag","`on-checked-change` is deprecated, please use `on-update:checked` instead")});const t=i.ref(null),{mergedBorderedRef:n,mergedClsPrefixRef:r,inlineThemeDisabled:s,mergedRtlRef:o}=fi(e),a=mt("Tag","-tag",Iw,Mw,e,r);i.provide(zw,{roundRef:i.toRef(e,"round")});function l(){if(!e.disabled&&e.checkable){const{checked:u,onCheckedChange:g,onUpdateChecked:m,"onUpdate:checked":_}=e;m&&m(!u),_&&_(!u),g&&g(!u)}}function c(u){if(e.triggerClickOnClose||u.stopPropagation(),!e.disabled){const{onClose:g}=e;g&&gt(g,u)}}const d={setTextContent(u){const{value:g}=t;g&&(g.textContent=u)}},h=bs("Tag",o,r),f=i.computed(()=>{const{type:u,size:g,color:{color:m,textColor:_}={}}=e,{common:{cubicBezierEaseInOut:y},self:{padding:b,closeMargin:S,borderRadius:C,opacityDisabled:v,textColorCheckable:B,textColorHoverCheckable:k,textColorPressedCheckable:E,textColorChecked:P,colorCheckable:R,colorHoverCheckable:j,colorPressedCheckable:q,colorChecked:M,colorCheckedHover:A,colorCheckedPressed:$,closeBorderRadius:X,fontWeightStrong:F,[Ye("colorBordered",u)]:N,[Ye("closeSize",g)]:W,[Ye("closeIconSize",g)]:z,[Ye("fontSize",g)]:G,[Ye("height",g)]:V,[Ye("color",u)]:O,[Ye("textColor",u)]:J,[Ye("border",u)]:he,[Ye("closeIconColor",u)]:ie,[Ye("closeIconColorHover",u)]:ge,[Ye("closeIconColorPressed",u)]:re,[Ye("closeColorHover",u)]:Fe,[Ye("closeColorPressed",u)]:Me}}=a.value,Ge=Yt(S);return{"--n-font-weight-strong":F,"--n-avatar-size-override":`calc(${V} - 8px)`,"--n-bezier":y,"--n-border-radius":C,"--n-border":he,"--n-close-icon-size":z,"--n-close-color-pressed":Me,"--n-close-color-hover":Fe,"--n-close-border-radius":X,"--n-close-icon-color":ie,"--n-close-icon-color-hover":ge,"--n-close-icon-color-pressed":re,"--n-close-icon-color-disabled":ie,"--n-close-margin-top":Ge.top,"--n-close-margin-right":Ge.right,"--n-close-margin-bottom":Ge.bottom,"--n-close-margin-left":Ge.left,"--n-close-size":W,"--n-color":m||(n.value?N:O),"--n-color-checkable":R,"--n-color-checked":M,"--n-color-checked-hover":A,"--n-color-checked-pressed":$,"--n-color-hover-checkable":j,"--n-color-pressed-checkable":q,"--n-font-size":G,"--n-height":V,"--n-opacity-disabled":v,"--n-padding":b,"--n-text-color":_||J,"--n-text-color-checkable":B,"--n-text-color-checked":P,"--n-text-color-hover-checkable":k,"--n-text-color-pressed-checkable":E}}),p=s?pi("tag",i.computed(()=>{let u="";const{type:g,size:m,color:{color:_,textColor:y}={}}=e;return u+=g[0],u+=m[0],_&&(u+=`a${Ud(_)}`),y&&(u+=`b${Ud(y)}`),n.value&&(u+="c"),u}),f,e):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:h,mergedClsPrefix:r,contentRef:t,mergedBordered:n,handleClick:l,handleCloseClick:c,cssVars:s?void 0:f,themeClass:p==null?void 0:p.themeClass,onRender:p==null?void 0:p.onRender})},render(){var e,t;const{mergedClsPrefix:n,rtlEnabled:r,closable:s,color:{borderColor:o}={},round:a,onRender:l,$slots:c}=this;l==null||l();const d=hi(c.avatar,f=>f&&i.h("div",{class:`${n}-tag__avatar`},f)),h=hi(c.icon,f=>f&&i.h("div",{class:`${n}-tag__icon`},f));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"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)),!this.checkable&&s?i.h(J1,{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)}}),Lw=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(e,{slots:t}){return()=>{const{clsPrefix:n}=e;return i.h(dh,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?i.h(K1,{clsPrefix:n,show:e.showClear,onClear:e.onClear},{placeholder:()=>i.h(wr,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>Lo(t.default,()=>[i.h(j1,null)])})}):null})}}}),Dw={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function Hw(e){const{borderRadius:t,textColor2:n,textColorDisabled:r,inputColor:s,inputColorDisabled:o,primaryColor:a,primaryColorHover:l,warningColor:c,warningColorHover:d,errorColor:h,errorColorHover:f,borderColor:p,iconColor:u,iconColorDisabled:g,clearColor:m,clearColorHover:_,clearColorPressed:y,placeholderColor:b,placeholderColorDisabled:S,fontSizeTiny:C,fontSizeSmall:v,fontSizeMedium:B,fontSizeLarge:k,heightTiny:E,heightSmall:P,heightMedium:R,heightLarge:j,fontWeight:q}=e;return Object.assign(Object.assign({},Dw),{fontSizeTiny:C,fontSizeSmall:v,fontSizeMedium:B,fontSizeLarge:k,heightTiny:E,heightSmall:P,heightMedium:R,heightLarge:j,borderRadius:t,fontWeight:q,textColor:n,textColorDisabled:r,placeholderColor:b,placeholderColorDisabled:S,color:s,colorDisabled:o,colorActive:s,border:`1px solid ${p}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${Re(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${Re(a,{alpha:.2})}`,caretColor:a,arrowColor:u,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 ${Re(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${Re(c,{alpha:.2})}`,colorActiveWarning:s,caretColorWarning:c,borderError:`1px solid ${h}`,borderHoverError:`1px solid ${f}`,borderActiveError:`1px solid ${h}`,borderFocusError:`1px solid ${f}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${Re(h,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${Re(h,{alpha:.2})}`,colorActiveError:s,caretColorError:h,clearColor:m,clearColorHover:_,clearColorPressed:y})}const Sh={name:"InternalSelection",common:gi,peers:{Popover:xh},self:Hw},Ww=oe([fe("base-selection",`
614
+ `,[Gt("disabled",[oe("&:hover","background-color: var(--n-color-checked-hover);"),oe("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var Dw={};const Hw=Object.assign(Object.assign(Object.assign({},yt.props),zw),{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}),Ww="n-tag",qo=i.defineComponent({name:"Tag",props:Hw,slots:Object,setup(e){Dw.NODE_ENV!=="production"&&i.watchEffect(()=>{e.onCheckedChange!==void 0&&Ln("tag","`on-checked-change` is deprecated, please use `on-update:checked` instead")});const t=i.ref(null),{mergedBorderedRef:n,mergedClsPrefixRef:r,inlineThemeDisabled:s,mergedRtlRef:o}=gi(e),a=yt("Tag","-tag",Lw,Ow,e,r);i.provide(Ww,{roundRef:i.toRef(e,"round")});function l(){if(!e.disabled&&e.checkable){const{checked:u,onCheckedChange:g,onUpdateChecked:m,"onUpdate:checked":y}=e;m&&m(!u),y&&y(!u),g&&g(!u)}}function c(u){if(e.triggerClickOnClose||u.stopPropagation(),!e.disabled){const{onClose:g}=e;g&&mt(g,u)}}const d={setTextContent(u){const{value:g}=t;g&&(g.textContent=u)}},h=bs("Tag",o,r),f=i.computed(()=>{const{type:u,size:g,color:{color:m,textColor:y}={}}=e,{common:{cubicBezierEaseInOut:_},self:{padding:b,closeMargin:S,borderRadius:x,opacityDisabled:v,textColorCheckable:B,textColorHoverCheckable:k,textColorPressedCheckable:N,textColorChecked:P,colorCheckable:R,colorHoverCheckable:W,colorPressedCheckable:q,colorChecked:F,colorCheckedHover:M,colorCheckedPressed:V,closeBorderRadius:K,fontWeightStrong:T,[qe("colorBordered",u)]:$,[qe("closeSize",g)]:j,[qe("closeIconSize",g)]:z,[qe("fontSize",g)]:U,[qe("height",g)]:I,[qe("color",u)]:O,[qe("textColor",u)]:Z,[qe("border",u)]:ge,[qe("closeIconColor",u)]:ie,[qe("closeIconColorHover",u)]:he,[qe("closeIconColorPressed",u)]:re,[qe("closeColorHover",u)]:Pe,[qe("closeColorPressed",u)]:Fe}}=a.value,Ze=Ut(S);return{"--n-font-weight-strong":T,"--n-avatar-size-override":`calc(${I} - 8px)`,"--n-bezier":_,"--n-border-radius":x,"--n-border":ge,"--n-close-icon-size":z,"--n-close-color-pressed":Fe,"--n-close-color-hover":Pe,"--n-close-border-radius":K,"--n-close-icon-color":ie,"--n-close-icon-color-hover":he,"--n-close-icon-color-pressed":re,"--n-close-icon-color-disabled":ie,"--n-close-margin-top":Ze.top,"--n-close-margin-right":Ze.right,"--n-close-margin-bottom":Ze.bottom,"--n-close-margin-left":Ze.left,"--n-close-size":j,"--n-color":m||(n.value?$:O),"--n-color-checkable":R,"--n-color-checked":F,"--n-color-checked-hover":M,"--n-color-checked-pressed":V,"--n-color-hover-checkable":W,"--n-color-pressed-checkable":q,"--n-font-size":U,"--n-height":I,"--n-opacity-disabled":v,"--n-padding":b,"--n-text-color":y||Z,"--n-text-color-checkable":B,"--n-text-color-checked":P,"--n-text-color-hover-checkable":k,"--n-text-color-pressed-checkable":N}}),p=s?mi("tag",i.computed(()=>{let u="";const{type:g,size:m,color:{color:y,textColor:_}={}}=e;return u+=g[0],u+=m[0],y&&(u+=`a${Ud(y)}`),_&&(u+=`b${Ud(_)}`),n.value&&(u+="c"),u}),f,e):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:h,mergedClsPrefix:r,contentRef:t,mergedBordered:n,handleClick:l,handleCloseClick:c,cssVars:s?void 0:f,themeClass:p==null?void 0:p.themeClass,onRender:p==null?void 0:p.onRender})},render(){var e,t;const{mergedClsPrefix:n,rtlEnabled:r,closable:s,color:{borderColor:o}={},round:a,onRender:l,$slots:c}=this;l==null||l();const d=fi(c.avatar,f=>f&&i.h("div",{class:`${n}-tag__avatar`},f)),h=fi(c.icon,f=>f&&i.h("div",{class:`${n}-tag__icon`},f));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"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)),!this.checkable&&s?i.h(nw,{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)}}),jw=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(e,{slots:t}){return()=>{const{clsPrefix:n}=e;return i.h(dh,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?i.h(ew,{clsPrefix:n,show:e.showClear,onClear:e.onClear},{placeholder:()=>i.h(wr,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>Lo(t.default,()=>[i.h(U1,null)])})}):null})}}}),Xw={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function qw(e){const{borderRadius:t,textColor2:n,textColorDisabled:r,inputColor:s,inputColorDisabled:o,primaryColor:a,primaryColorHover:l,warningColor:c,warningColorHover:d,errorColor:h,errorColorHover:f,borderColor:p,iconColor:u,iconColorDisabled:g,clearColor:m,clearColorHover:y,clearColorPressed:_,placeholderColor:b,placeholderColorDisabled:S,fontSizeTiny:x,fontSizeSmall:v,fontSizeMedium:B,fontSizeLarge:k,heightTiny:N,heightSmall:P,heightMedium:R,heightLarge:W,fontWeight:q}=e;return Object.assign(Object.assign({},Xw),{fontSizeTiny:x,fontSizeSmall:v,fontSizeMedium:B,fontSizeLarge:k,heightTiny:N,heightSmall:P,heightMedium:R,heightLarge:W,borderRadius:t,fontWeight:q,textColor:n,textColorDisabled:r,placeholderColor:b,placeholderColorDisabled:S,color:s,colorDisabled:o,colorActive:s,border:`1px solid ${p}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${Re(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${Re(a,{alpha:.2})}`,caretColor:a,arrowColor:u,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 ${Re(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${Re(c,{alpha:.2})}`,colorActiveWarning:s,caretColorWarning:c,borderError:`1px solid ${h}`,borderHoverError:`1px solid ${f}`,borderActiveError:`1px solid ${h}`,borderFocusError:`1px solid ${f}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${Re(h,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${Re(h,{alpha:.2})}`,colorActiveError:s,caretColorError:h,clearColor:m,clearColorHover:y,clearColorPressed:_})}const Sh={name:"InternalSelection",common:yi,peers:{Popover:xh},self:qw},Yw=oe([fe("base-selection",`
615
615
  --n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);
616
616
  --n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);
617
617
  position: relative;
@@ -627,7 +627,7 @@ ${s}
627
627
  font-size: var(--n-font-size);
628
628
  `,[fe("base-loading",`
629
629
  color: var(--n-loading-color);
630
- `),fe("base-selection-tags","min-height: var(--n-height);"),_e("border, state-border",`
630
+ `),fe("base-selection-tags","min-height: var(--n-height);"),ye("border, state-border",`
631
631
  position: absolute;
632
632
  left: 0;
633
633
  right: 0;
@@ -639,7 +639,7 @@ ${s}
639
639
  transition:
640
640
  box-shadow .3s var(--n-bezier),
641
641
  border-color .3s var(--n-bezier);
642
- `),_e("state-border",`
642
+ `),ye("state-border",`
643
643
  z-index: 1;
644
644
  border-color: #0000;
645
645
  `),fe("base-suffix",`
@@ -648,7 +648,7 @@ ${s}
648
648
  top: 50%;
649
649
  transform: translateY(-50%);
650
650
  right: 10px;
651
- `,[_e("arrow",`
651
+ `,[ye("arrow",`
652
652
  font-size: var(--n-arrow-size);
653
653
  color: var(--n-arrow-color);
654
654
  transition: color .3s var(--n-bezier);
@@ -664,14 +664,14 @@ ${s}
664
664
  left: 0;
665
665
  padding: var(--n-padding-single);
666
666
  transition: color .3s var(--n-bezier);
667
- `,[_e("wrapper",`
667
+ `,[ye("wrapper",`
668
668
  flex-basis: 0;
669
669
  flex-grow: 1;
670
670
  overflow: hidden;
671
671
  text-overflow: ellipsis;
672
672
  `)]),fe("base-selection-placeholder",`
673
673
  color: var(--n-placeholder-color);
674
- `,[_e("inner",`
674
+ `,[ye("inner",`
675
675
  max-width: 100%;
676
676
  overflow: hidden;
677
677
  `)]),fe("base-selection-tags",`
@@ -722,22 +722,22 @@ ${s}
722
722
  color: var(--n-text-color);
723
723
  transition: color .3s var(--n-bezier);
724
724
  caret-color: var(--n-caret-color);
725
- `,[_e("content",`
725
+ `,[ye("content",`
726
726
  text-overflow: ellipsis;
727
727
  overflow: hidden;
728
728
  white-space: nowrap;
729
- `)]),_e("render-label",`
729
+ `)]),ye("render-label",`
730
730
  color: var(--n-text-color);
731
- `)]),Ut("disabled",[oe("&:hover",[_e("state-border",`
731
+ `)]),Gt("disabled",[oe("&:hover",[ye("state-border",`
732
732
  box-shadow: var(--n-box-shadow-hover);
733
733
  border: var(--n-border-hover);
734
- `)]),Ce("focus",[_e("state-border",`
734
+ `)]),Se("focus",[ye("state-border",`
735
735
  box-shadow: var(--n-box-shadow-focus);
736
736
  border: var(--n-border-focus);
737
- `)]),Ce("active",[_e("state-border",`
737
+ `)]),Se("active",[ye("state-border",`
738
738
  box-shadow: var(--n-box-shadow-active);
739
739
  border: var(--n-border-active);
740
- `),fe("base-selection-label","background-color: var(--n-color-active);"),fe("base-selection-tags","background-color: var(--n-color-active);")])]),Ce("disabled","cursor: not-allowed;",[_e("arrow",`
740
+ `),fe("base-selection-label","background-color: var(--n-color-active);"),fe("base-selection-tags","background-color: var(--n-color-active);")])]),Se("disabled","cursor: not-allowed;",[ye("arrow",`
741
741
  color: var(--n-arrow-color-disabled);
742
742
  `),fe("base-selection-label",`
743
743
  cursor: not-allowed;
@@ -745,7 +745,7 @@ ${s}
745
745
  `,[fe("base-selection-input",`
746
746
  cursor: not-allowed;
747
747
  color: var(--n-text-color-disabled);
748
- `),_e("render-label",`
748
+ `),ye("render-label",`
749
749
  color: var(--n-text-color-disabled);
750
750
  `)]),fe("base-selection-tags",`
751
751
  cursor: not-allowed;
@@ -762,7 +762,7 @@ ${s}
762
762
  margin-bottom: 3px;
763
763
  max-width: 100%;
764
764
  vertical-align: bottom;
765
- `,[_e("input",`
765
+ `,[ye("input",`
766
766
  font-size: inherit;
767
767
  font-family: inherit;
768
768
  min-width: 1px;
@@ -777,7 +777,7 @@ ${s}
777
777
  cursor: pointer;
778
778
  color: var(--n-text-color);
779
779
  caret-color: var(--n-caret-color);
780
- `),_e("mirror",`
780
+ `),ye("mirror",`
781
781
  position: absolute;
782
782
  left: 0;
783
783
  top: 0;
@@ -786,13 +786,13 @@ ${s}
786
786
  user-select: none;
787
787
  -webkit-user-select: none;
788
788
  opacity: 0;
789
- `)]),["warning","error"].map(e=>Ce(`${e}-status`,[_e("state-border",`border: var(--n-border-${e});`),Ut("disabled",[oe("&:hover",[_e("state-border",`
789
+ `)]),["warning","error"].map(e=>Se(`${e}-status`,[ye("state-border",`border: var(--n-border-${e});`),Gt("disabled",[oe("&:hover",[ye("state-border",`
790
790
  box-shadow: var(--n-box-shadow-hover-${e});
791
791
  border: var(--n-border-hover-${e});
792
- `)]),Ce("active",[_e("state-border",`
792
+ `)]),Se("active",[ye("state-border",`
793
793
  box-shadow: var(--n-box-shadow-active-${e});
794
794
  border: var(--n-border-active-${e});
795
- `),fe("base-selection-label",`background-color: var(--n-color-active-${e});`),fe("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),Ce("focus",[_e("state-border",`
795
+ `),fe("base-selection-label",`background-color: var(--n-color-active-${e});`),fe("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),Se("focus",[ye("state-border",`
796
796
  box-shadow: var(--n-box-shadow-focus-${e});
797
797
  border: var(--n-border-focus-${e});
798
798
  `)])])]))]),fe("base-selection-popover",`
@@ -807,11 +807,11 @@ ${s}
807
807
  `,[oe("&:last-child","padding-right: 0;"),fe("tag",`
808
808
  font-size: 14px;
809
809
  max-width: 100%;
810
- `,[_e("content",`
810
+ `,[ye("content",`
811
811
  line-height: 1.25;
812
812
  text-overflow: ellipsis;
813
813
  overflow: hidden;
814
- `)])])]),jw=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},mt.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(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=fi(e),r=bs("InternalSelection",n,t),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),f=i.ref(null),p=i.ref(null),u=i.ref(null),g=i.ref(!1),m=i.ref(!1),_=i.ref(!1),y=mt("InternalSelection","-internal-selection",Ww,Sh,e,i.toRef(e,"clsPrefix")),b=i.computed(()=>e.clearable&&!e.disabled&&(_.value||e.active)),S=i.computed(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):Di(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),C=i.computed(()=>{const te=e.selectedOption;if(te)return te[e.labelField]}),v=i.computed(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function B(){var te;const{value:ne}=s;if(ne){const{value:je}=o;je&&(je.style.width=`${ne.offsetWidth}px`,e.maxTagCount!=="responsive"&&((te=p.value)===null||te===void 0||te.sync({showAllItemsBeforeCalculate:!1})))}}function k(){const{value:te}=u;te&&(te.style.display="none")}function E(){const{value:te}=u;te&&(te.style.display="inline-block")}i.watch(i.toRef(e,"active"),te=>{te||k()}),i.watch(i.toRef(e,"pattern"),()=>{e.multiple&&i.nextTick(B)});function P(te){const{onFocus:ne}=e;ne&&ne(te)}function R(te){const{onBlur:ne}=e;ne&&ne(te)}function j(te){const{onDeleteOption:ne}=e;ne&&ne(te)}function q(te){const{onClear:ne}=e;ne&&ne(te)}function M(te){const{onPatternInput:ne}=e;ne&&ne(te)}function A(te){var ne;(!te.relatedTarget||!(!((ne=a.value)===null||ne===void 0)&&ne.contains(te.relatedTarget)))&&P(te)}function $(te){var ne;!((ne=a.value)===null||ne===void 0)&&ne.contains(te.relatedTarget)||R(te)}function X(te){q(te)}function F(){_.value=!0}function N(){_.value=!1}function W(te){!e.active||!e.filterable||te.target!==o.value&&te.preventDefault()}function z(te){j(te)}const G=i.ref(!1);function V(te){if(te.key==="Backspace"&&!G.value&&!e.pattern.length){const{selectedOptions:ne}=e;ne!=null&&ne.length&&z(ne[ne.length-1])}}let O=null;function J(te){const{value:ne}=s;if(ne){const je=te.target.value;ne.textContent=je,B()}e.ignoreComposition&&G.value?O=te:M(te)}function he(){G.value=!0}function ie(){G.value=!1,e.ignoreComposition&&M(O),O=null}function ge(te){var ne;m.value=!0,(ne=e.onPatternFocus)===null||ne===void 0||ne.call(e,te)}function re(te){var ne;m.value=!1,(ne=e.onPatternBlur)===null||ne===void 0||ne.call(e,te)}function Fe(){var te,ne;if(e.filterable)m.value=!1,(te=d.value)===null||te===void 0||te.blur(),(ne=o.value)===null||ne===void 0||ne.blur();else if(e.multiple){const{value:je}=l;je==null||je.blur()}else{const{value:je}=c;je==null||je.blur()}}function Me(){var te,ne,je;e.filterable?(m.value=!1,(te=d.value)===null||te===void 0||te.focus()):e.multiple?(ne=l.value)===null||ne===void 0||ne.focus():(je=c.value)===null||je===void 0||je.focus()}function Ge(){const{value:te}=o;te&&(E(),te.focus())}function Le(){const{value:te}=o;te&&te.blur()}function Pe(te){const{value:ne}=h;ne&&ne.setTextContent(`+${te}`)}function $e(){const{value:te}=f;return te}function ot(){return o.value}let De=null;function ct(){De!==null&&window.clearTimeout(De)}function Pt(){e.active||(ct(),De=window.setTimeout(()=>{v.value&&(g.value=!0)},100))}function yi(){ct()}function bi(te){te||(ct(),g.value=!1)}i.watch(v,te=>{te||(g.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const te=d.value;te&&(e.disabled?te.removeAttribute("tabindex"):te.tabIndex=m.value?-1:0)})}),Yd(a,e.onResize);const{inlineThemeDisabled:zn}=e,dn=i.computed(()=>{const{size:te}=e,{common:{cubicBezierEaseInOut:ne},self:{fontWeight:je,borderRadius:kr,color:Hi,placeholderColor:wi,textColor:Wi,paddingSingle:Ln,paddingMultiple:vi,caretColor:ji,colorDisabled:Kt,textColorDisabled:Bn,placeholderColorDisabled:T,colorActive:H,boxShadowFocus:Q,boxShadowActive:le,boxShadowHover:ce,border:me,borderFocus:be,borderHover:ke,borderActive:Xe,arrowColor:hn,arrowColorDisabled:Zo,loadingColor:Jo,colorActiveWarning:Qo,boxShadowFocusWarning:ea,boxShadowActiveWarning:ta,boxShadowHoverWarning:na,borderWarning:ia,borderFocusWarning:ra,borderHoverWarning:sa,borderActiveWarning:oa,colorActiveError:aa,boxShadowFocusError:la,boxShadowActiveError:ca,boxShadowHoverError:da,borderError:ha,borderFocusError:ua,borderHoverError:fa,borderActiveError:$k,clearColor:Nk,clearColorHover:Rk,clearColorPressed:Pk,clearSize:Fk,arrowSize:Mk,[Ye("height",te)]:Ak,[Ye("fontSize",te)]:Ik}}=y.value,Cs=Yt(Ln),Ss=Yt(vi);return{"--n-bezier":ne,"--n-border":me,"--n-border-active":Xe,"--n-border-focus":be,"--n-border-hover":ke,"--n-border-radius":kr,"--n-box-shadow-active":le,"--n-box-shadow-focus":Q,"--n-box-shadow-hover":ce,"--n-caret-color":ji,"--n-color":Hi,"--n-color-active":H,"--n-color-disabled":Kt,"--n-font-size":Ik,"--n-height":Ak,"--n-padding-single-top":Cs.top,"--n-padding-multiple-top":Ss.top,"--n-padding-single-right":Cs.right,"--n-padding-multiple-right":Ss.right,"--n-padding-single-left":Cs.left,"--n-padding-multiple-left":Ss.left,"--n-padding-single-bottom":Cs.bottom,"--n-padding-multiple-bottom":Ss.bottom,"--n-placeholder-color":wi,"--n-placeholder-color-disabled":T,"--n-text-color":Wi,"--n-text-color-disabled":Bn,"--n-arrow-color":hn,"--n-arrow-color-disabled":Zo,"--n-loading-color":Jo,"--n-color-active-warning":Qo,"--n-box-shadow-focus-warning":ea,"--n-box-shadow-active-warning":ta,"--n-box-shadow-hover-warning":na,"--n-border-warning":ia,"--n-border-focus-warning":ra,"--n-border-hover-warning":sa,"--n-border-active-warning":oa,"--n-color-active-error":aa,"--n-box-shadow-focus-error":la,"--n-box-shadow-active-error":ca,"--n-box-shadow-hover-error":da,"--n-border-error":ha,"--n-border-focus-error":ua,"--n-border-hover-error":fa,"--n-border-active-error":$k,"--n-clear-size":Fk,"--n-clear-color":Nk,"--n-clear-color-hover":Rk,"--n-clear-color-pressed":Pk,"--n-arrow-size":Mk,"--n-font-weight":je}}),dt=zn?pi("internal-selection",i.computed(()=>e.size[0]),dn,e):void 0;return{mergedTheme:y,mergedClearable:b,mergedClsPrefix:t,rtlEnabled:r,patternInputFocused:m,filterablePlaceholder:S,label:C,selected:v,showTagsPanel:g,isComposing:G,counterRef:h,counterWrapperRef:f,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:p,inputTagElRef:u,handleMouseDown:W,handleFocusin:A,handleClear:X,handleMouseEnter:F,handleMouseLeave:N,handleDeleteOption:z,handlePatternKeyDown:V,handlePatternInputInput:J,handlePatternInputBlur:re,handlePatternInputFocus:ge,handleMouseEnterCounter:Pt,handleMouseLeaveCounter:yi,handleFocusout:$,handleCompositionEnd:ie,handleCompositionStart:he,onPopoverUpdateShow:bi,focus:Me,focusInput:Ge,blur:Fe,blurInput:Le,updateCounter:Pe,getCounter:$e,getTail:ot,renderLabel:e.renderLabel,cssVars:zn?void 0:dn,themeClass:dt==null?void 0:dt.themeClass,onRender:dt==null?void 0:dt.onRender}},render(){const{status:e,multiple:t,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:h,renderLabel:f}=this;d==null||d();const p=o==="responsive",u=typeof o=="number",g=p||u,m=i.h(Do,null,{default:()=>i.h(Lw,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var y,b;return(b=(y=this.$slots).arrow)===null||b===void 0?void 0:b.call(y)}})});let _;if(t){const{labelField:y}=this,b=M=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:M.value},h?h({option:M,handleClose:()=>{this.handleDeleteOption(M)}}):i.h(qo,{size:n,closable:!M.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(M)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(M,!0):Di(M[y],M,!0)})),S=()=>(u?this.selectedOptions.slice(0,o):this.selectedOptions).map(b),C=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,v=p?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(qo,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let B;if(u){const M=this.selectedOptions.length-o;M>0&&(B=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(qo,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${M}`})))}const k=p?s?i.h(Vd,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:v,tail:()=>C}):i.h(Vd,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:v}):u&&B?S().concat(B):S(),E=g?()=>i.h("div",{class:`${l}-base-selection-popover`},p?S():this.selectedOptions.map(b)):void 0,P=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,j=(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,q=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},k,p?null:C,m):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},k,m);_=i.h(i.Fragment,null,g?i.h(Rw,Object.assign({},P,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>q,default:E}):q,j)}else if(s){const y=this.pattern||this.isComposing,b=this.active?!y:!this.selected,S=this.active?!1:this.selected;_=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:eh(this.label)},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),S?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},h?h({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Di(this.label,this.selectedOption,!0))):null,b?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,m)}else _=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:eh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Di(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)),m);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,e&&`${l}-base-selection--${e}-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},_,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function Xw(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const qw={name:"Select",common:gi,peers:{InternalSelection:Sh,InternalSelectMenu:_h},self:Xw},Yw=oe([fe("select",`
814
+ `)])])]),Uw=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},yt.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(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=gi(e),r=bs("InternalSelection",n,t),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),f=i.ref(null),p=i.ref(null),u=i.ref(null),g=i.ref(!1),m=i.ref(!1),y=i.ref(!1),_=yt("InternalSelection","-internal-selection",Yw,Sh,e,i.toRef(e,"clsPrefix")),b=i.computed(()=>e.clearable&&!e.disabled&&(y.value||e.active)),S=i.computed(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):Di(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),x=i.computed(()=>{const te=e.selectedOption;if(te)return te[e.labelField]}),v=i.computed(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function B(){var te;const{value:ne}=s;if(ne){const{value:We}=o;We&&(We.style.width=`${ne.offsetWidth}px`,e.maxTagCount!=="responsive"&&((te=p.value)===null||te===void 0||te.sync({showAllItemsBeforeCalculate:!1})))}}function k(){const{value:te}=u;te&&(te.style.display="none")}function N(){const{value:te}=u;te&&(te.style.display="inline-block")}i.watch(i.toRef(e,"active"),te=>{te||k()}),i.watch(i.toRef(e,"pattern"),()=>{e.multiple&&i.nextTick(B)});function P(te){const{onFocus:ne}=e;ne&&ne(te)}function R(te){const{onBlur:ne}=e;ne&&ne(te)}function W(te){const{onDeleteOption:ne}=e;ne&&ne(te)}function q(te){const{onClear:ne}=e;ne&&ne(te)}function F(te){const{onPatternInput:ne}=e;ne&&ne(te)}function M(te){var ne;(!te.relatedTarget||!(!((ne=a.value)===null||ne===void 0)&&ne.contains(te.relatedTarget)))&&P(te)}function V(te){var ne;!((ne=a.value)===null||ne===void 0)&&ne.contains(te.relatedTarget)||R(te)}function K(te){q(te)}function T(){y.value=!0}function $(){y.value=!1}function j(te){!e.active||!e.filterable||te.target!==o.value&&te.preventDefault()}function z(te){W(te)}const U=i.ref(!1);function I(te){if(te.key==="Backspace"&&!U.value&&!e.pattern.length){const{selectedOptions:ne}=e;ne!=null&&ne.length&&z(ne[ne.length-1])}}let O=null;function Z(te){const{value:ne}=s;if(ne){const We=te.target.value;ne.textContent=We,B()}e.ignoreComposition&&U.value?O=te:F(te)}function ge(){U.value=!0}function ie(){U.value=!1,e.ignoreComposition&&F(O),O=null}function he(te){var ne;m.value=!0,(ne=e.onPatternFocus)===null||ne===void 0||ne.call(e,te)}function re(te){var ne;m.value=!1,(ne=e.onPatternBlur)===null||ne===void 0||ne.call(e,te)}function Pe(){var te,ne;if(e.filterable)m.value=!1,(te=d.value)===null||te===void 0||te.blur(),(ne=o.value)===null||ne===void 0||ne.blur();else if(e.multiple){const{value:We}=l;We==null||We.blur()}else{const{value:We}=c;We==null||We.blur()}}function Fe(){var te,ne,We;e.filterable?(m.value=!1,(te=d.value)===null||te===void 0||te.focus()):e.multiple?(ne=l.value)===null||ne===void 0||ne.focus():(We=c.value)===null||We===void 0||We.focus()}function Ze(){const{value:te}=o;te&&(N(),te.focus())}function Le(){const{value:te}=o;te&&te.blur()}function dt(te){const{value:ne}=h;ne&&ne.setTextContent(`+${te}`)}function Zt(){const{value:te}=f;return te}function Oe(){return o.value}let Ce=null;function Je(){Ce!==null&&window.clearTimeout(Ce)}function Qe(){e.active||(Je(),Ce=window.setTimeout(()=>{v.value&&(g.value=!0)},100))}function un(){Je()}function Ue(te){te||(Je(),g.value=!1)}i.watch(v,te=>{te||(g.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const te=d.value;te&&(e.disabled?te.removeAttribute("tabindex"):te.tabIndex=m.value?-1:0)})}),Yd(a,e.onResize);const{inlineThemeDisabled:Ft}=e,fn=i.computed(()=>{const{size:te}=e,{common:{cubicBezierEaseInOut:ne},self:{fontWeight:We,borderRadius:kr,color:Hi,placeholderColor:wi,textColor:Wi,paddingSingle:Hn,paddingMultiple:vi,caretColor:ji,colorDisabled:Jt,textColorDisabled:$n,placeholderColorDisabled:E,colorActive:H,boxShadowFocus:Q,boxShadowActive:le,boxShadowHover:ce,border:me,borderFocus:be,borderHover:ke,borderActive:je,arrowColor:pn,arrowColorDisabled:Zo,loadingColor:Jo,colorActiveWarning:Qo,boxShadowFocusWarning:ea,boxShadowActiveWarning:ta,boxShadowHoverWarning:na,borderWarning:ia,borderFocusWarning:ra,borderHoverWarning:sa,borderActiveWarning:oa,colorActiveError:aa,boxShadowFocusError:la,boxShadowActiveError:ca,boxShadowHoverError:da,borderError:ha,borderFocusError:ua,borderHoverError:fa,borderActiveError:Fk,clearColor:Mk,clearColorHover:Ak,clearColorPressed:Ik,clearSize:Vk,arrowSize:Ok,[qe("height",te)]:zk,[qe("fontSize",te)]:Lk}}=_.value,Cs=Ut(Hn),Ss=Ut(vi);return{"--n-bezier":ne,"--n-border":me,"--n-border-active":je,"--n-border-focus":be,"--n-border-hover":ke,"--n-border-radius":kr,"--n-box-shadow-active":le,"--n-box-shadow-focus":Q,"--n-box-shadow-hover":ce,"--n-caret-color":ji,"--n-color":Hi,"--n-color-active":H,"--n-color-disabled":Jt,"--n-font-size":Lk,"--n-height":zk,"--n-padding-single-top":Cs.top,"--n-padding-multiple-top":Ss.top,"--n-padding-single-right":Cs.right,"--n-padding-multiple-right":Ss.right,"--n-padding-single-left":Cs.left,"--n-padding-multiple-left":Ss.left,"--n-padding-single-bottom":Cs.bottom,"--n-padding-multiple-bottom":Ss.bottom,"--n-placeholder-color":wi,"--n-placeholder-color-disabled":E,"--n-text-color":Wi,"--n-text-color-disabled":$n,"--n-arrow-color":pn,"--n-arrow-color-disabled":Zo,"--n-loading-color":Jo,"--n-color-active-warning":Qo,"--n-box-shadow-focus-warning":ea,"--n-box-shadow-active-warning":ta,"--n-box-shadow-hover-warning":na,"--n-border-warning":ia,"--n-border-focus-warning":ra,"--n-border-hover-warning":sa,"--n-border-active-warning":oa,"--n-color-active-error":aa,"--n-box-shadow-focus-error":la,"--n-box-shadow-active-error":ca,"--n-box-shadow-hover-error":da,"--n-border-error":ha,"--n-border-focus-error":ua,"--n-border-hover-error":fa,"--n-border-active-error":Fk,"--n-clear-size":Vk,"--n-clear-color":Mk,"--n-clear-color-hover":Ak,"--n-clear-color-pressed":Ik,"--n-arrow-size":Ok,"--n-font-weight":We}}),ht=Ft?mi("internal-selection",i.computed(()=>e.size[0]),fn,e):void 0;return{mergedTheme:_,mergedClearable:b,mergedClsPrefix:t,rtlEnabled:r,patternInputFocused:m,filterablePlaceholder:S,label:x,selected:v,showTagsPanel:g,isComposing:U,counterRef:h,counterWrapperRef:f,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:p,inputTagElRef:u,handleMouseDown:j,handleFocusin:M,handleClear:K,handleMouseEnter:T,handleMouseLeave:$,handleDeleteOption:z,handlePatternKeyDown:I,handlePatternInputInput:Z,handlePatternInputBlur:re,handlePatternInputFocus:he,handleMouseEnterCounter:Qe,handleMouseLeaveCounter:un,handleFocusout:V,handleCompositionEnd:ie,handleCompositionStart:ge,onPopoverUpdateShow:Ue,focus:Fe,focusInput:Ze,blur:Pe,blurInput:Le,updateCounter:dt,getCounter:Zt,getTail:Oe,renderLabel:e.renderLabel,cssVars:Ft?void 0:fn,themeClass:ht==null?void 0:ht.themeClass,onRender:ht==null?void 0:ht.onRender}},render(){const{status:e,multiple:t,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:h,renderLabel:f}=this;d==null||d();const p=o==="responsive",u=typeof o=="number",g=p||u,m=i.h(Do,null,{default:()=>i.h(jw,{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||b===void 0?void 0:b.call(_)}})});let y;if(t){const{labelField:_}=this,b=F=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:F.value},h?h({option:F,handleClose:()=>{this.handleDeleteOption(F)}}):i.h(qo,{size:n,closable:!F.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(F)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(F,!0):Di(F[_],F,!0)})),S=()=>(u?this.selectedOptions.slice(0,o):this.selectedOptions).map(b),x=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,v=p?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(qo,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let B;if(u){const F=this.selectedOptions.length-o;F>0&&(B=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(qo,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${F}`})))}const k=p?s?i.h(Vd,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:v,tail:()=>x}):i.h(Vd,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:v}):u&&B?S().concat(B):S(),N=g?()=>i.h("div",{class:`${l}-base-selection-popover`},p?S():this.selectedOptions.map(b)):void 0,P=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,W=(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,q=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},k,p?null:x,m):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},k,m);y=i.h(i.Fragment,null,g?i.h(Aw,Object.assign({},P,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>q,default:N}):q,W)}else if(s){const _=this.pattern||this.isComposing,b=this.active?!_:!this.selected,S=this.active?!1:this.selected;y=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:eh(this.label)},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),S?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},h?h({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Di(this.label,this.selectedOption,!0))):null,b?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,m)}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:eh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Di(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)),m);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,e&&`${l}-base-selection--${e}-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 Gw(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const Kw={name:"Select",common:yi,peers:{InternalSelection:Sh,InternalSelectMenu:yh},self:Gw},Zw=oe([fe("select",`
815
815
  z-index: auto;
816
816
  outline: none;
817
817
  width: 100%;
@@ -820,5 +820,5 @@ ${s}
820
820
  `),fe("select-menu",`
821
821
  margin: 4px 0;
822
822
  box-shadow: var(--n-menu-box-shadow);
823
- `,[kh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function vs(e){return e.type==="group"}function Bh(e){return e.type==="ignored"}function Yo(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function Uw(e,t){return{getIsGroup:vs,getIgnored:Bh,getKey(r){return vs(r)?r.name||r.key||"key-required":r[e]},getChildren(r){return r[t]}}}function Gw(e,t,n,r){if(!t)return e;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(vs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Bh(l))continue;t(n,l)&&a.push(l)}return a}return s(e)}function Kw(e,t,n){const r=new Map;return e.forEach(s=>{vs(s)?s[n].forEach(o=>{r.set(o[t],o)}):r.set(s[t],s)}),r}var Zw={};const Jw=Object.assign(Object.assign({},mt.props),{to:_n.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}),Qw=i.defineComponent({name:"Select",props:Jw,slots:Object,setup(e){Zw.NODE_ENV!=="production"&&i.watchEffect(()=>{e.items!==void 0&&Vn("select","`items` is deprecated, please use `options` instead."),e.onChange!==void 0&&Vn("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=fi(e),o=mt("Select","-select",Yw,qw,e,t),a=i.ref(e.defaultValue),l=i.toRef(e,"value"),c=ko(l,a),d=i.ref(!1),h=i.ref(""),f=Jc(e,["items","options"]),p=i.ref([]),u=i.ref([]),g=i.computed(()=>u.value.concat(p.value).concat(f.value)),m=i.computed(()=>{const{filter:T}=e;if(T)return T;const{labelField:H,valueField:Q}=e;return(le,ce)=>{if(!ce)return!1;const me=ce[H];if(typeof me=="string")return Yo(le,me);const be=ce[Q];return typeof be=="string"?Yo(le,be):typeof be=="number"?Yo(le,String(be)):!1}}),_=i.computed(()=>{if(e.remote)return f.value;{const{value:T}=g,{value:H}=h;return!H.length||!e.filterable?T:Gw(T,m.value,H,e.childrenField)}}),y=i.computed(()=>{const{valueField:T,childrenField:H}=e,Q=Uw(T,H);return Sy(_.value,Q)}),b=i.computed(()=>Kw(g.value,e.valueField,e.childrenField)),S=i.ref(!1),C=ko(i.toRef(e,"show"),S),v=i.ref(null),B=i.ref(null),k=i.ref(null),{localeRef:E}=oh("Select"),P=i.computed(()=>{var T;return(T=e.placeholder)!==null&&T!==void 0?T:E.value.placeholder}),R=[],j=i.ref(new Map),q=i.computed(()=>{const{fallbackOption:T}=e;if(T===void 0){const{labelField:H,valueField:Q}=e;return le=>({[H]:String(le),[Q]:le})}return T===!1?!1:H=>Object.assign(T(H),{value:H})});function M(T){const H=e.remote,{value:Q}=j,{value:le}=b,{value:ce}=q,me=[];return T.forEach(be=>{if(le.has(be))me.push(le.get(be));else if(H&&Q.has(be))me.push(Q.get(be));else if(ce){const ke=ce(be);ke&&me.push(ke)}}),me}const A=i.computed(()=>{if(e.multiple){const{value:T}=c;return Array.isArray(T)?M(T):[]}return null}),$=i.computed(()=>{const{value:T}=c;return!e.multiple&&!Array.isArray(T)?T===null?null:M([T])[0]||null:null}),X=r1(e),{mergedSizeRef:F,mergedDisabledRef:N,mergedStatusRef:W}=X;function z(T,H){const{onChange:Q,"onUpdate:value":le,onUpdateValue:ce}=e,{nTriggerFormChange:me,nTriggerFormInput:be}=X;Q&&gt(Q,T,H),ce&&gt(ce,T,H),le&&gt(le,T,H),a.value=T,me(),be()}function G(T){const{onBlur:H}=e,{nTriggerFormBlur:Q}=X;H&&gt(H,T),Q()}function V(){const{onClear:T}=e;T&&gt(T)}function O(T){const{onFocus:H,showOnFocus:Q}=e,{nTriggerFormFocus:le}=X;H&&gt(H,T),le(),Q&&re()}function J(T){const{onSearch:H}=e;H&&gt(H,T)}function he(T){const{onScroll:H}=e;H&&gt(H,T)}function ie(){var T;const{remote:H,multiple:Q}=e;if(H){const{value:le}=j;if(Q){const{valueField:ce}=e;(T=A.value)===null||T===void 0||T.forEach(me=>{le.set(me[ce],me)})}else{const ce=$.value;ce&&le.set(ce[e.valueField],ce)}}}function ge(T){const{onUpdateShow:H,"onUpdate:show":Q}=e;H&&gt(H,T),Q&&gt(Q,T),S.value=T}function re(){N.value||(ge(!0),S.value=!0,e.filterable&&Ln())}function Fe(){ge(!1)}function Me(){h.value="",u.value=R}const Ge=i.ref(!1);function Le(){e.filterable&&(Ge.value=!0)}function Pe(){e.filterable&&(Ge.value=!1,C.value||Me())}function $e(){N.value||(C.value?e.filterable?Ln():Fe():re())}function ot(T){var H,Q;!((Q=(H=k.value)===null||H===void 0?void 0:H.selfRef)===null||Q===void 0)&&Q.contains(T.relatedTarget)||(d.value=!1,G(T),Fe())}function De(T){O(T),d.value=!0}function ct(){d.value=!0}function Pt(T){var H;!((H=v.value)===null||H===void 0)&&H.$el.contains(T.relatedTarget)||(d.value=!1,G(T),Fe())}function yi(){var T;(T=v.value)===null||T===void 0||T.focus(),Fe()}function bi(T){var H;C.value&&(!((H=v.value)===null||H===void 0)&&H.$el.contains(lr(T))||Fe())}function zn(T){if(!Array.isArray(T))return[];if(q.value)return Array.from(T);{const{remote:H}=e,{value:Q}=b;if(H){const{value:le}=j;return T.filter(ce=>Q.has(ce)||le.has(ce))}else return T.filter(le=>Q.has(le))}}function dn(T){dt(T.rawNode)}function dt(T){if(N.value)return;const{tag:H,remote:Q,clearFilterAfterSelect:le,valueField:ce}=e;if(H&&!Q){const{value:me}=u,be=me[0]||null;if(be){const ke=p.value;ke.length?ke.push(be):p.value=[be],u.value=R}}if(Q&&j.value.set(T[ce],T),e.multiple){const me=zn(c.value),be=me.findIndex(ke=>ke===T[ce]);if(~be){if(me.splice(be,1),H&&!Q){const ke=te(T[ce]);~ke&&(p.value.splice(ke,1),le&&(h.value=""))}}else me.push(T[ce]),le&&(h.value="");z(me,M(me))}else{if(H&&!Q){const me=te(T[ce]);~me?p.value=[p.value[me]]:p.value=R}Wi(),Fe(),z(T[ce],T)}}function te(T){return p.value.findIndex(Q=>Q[e.valueField]===T)}function ne(T){C.value||re();const{value:H}=T.target;h.value=H;const{tag:Q,remote:le}=e;if(J(H),Q&&!le){if(!H){u.value=R;return}const{onCreate:ce}=e,me=ce?ce(H):{[e.labelField]:H,[e.valueField]:H},{valueField:be,labelField:ke}=e;f.value.some(Xe=>Xe[be]===me[be]||Xe[ke]===me[ke])||p.value.some(Xe=>Xe[be]===me[be]||Xe[ke]===me[ke])?u.value=R:u.value=[me]}}function je(T){T.stopPropagation();const{multiple:H}=e;!H&&e.filterable&&Fe(),V(),H?z([],[]):z(null,null)}function kr(T){!ar(T,"action")&&!ar(T,"empty")&&!ar(T,"header")&&T.preventDefault()}function Hi(T){he(T)}function wi(T){var H,Q,le,ce,me;if(!e.keyboard){T.preventDefault();return}switch(T.key){case" ":if(e.filterable)break;T.preventDefault();case"Enter":if(!(!((H=v.value)===null||H===void 0)&&H.isComposing)){if(C.value){const be=(Q=k.value)===null||Q===void 0?void 0:Q.getPendingTmNode();be?dn(be):e.filterable||(Fe(),Wi())}else if(re(),e.tag&&Ge.value){const be=u.value[0];if(be){const ke=be[e.valueField],{value:Xe}=c;e.multiple&&Array.isArray(Xe)&&Xe.includes(ke)||dt(be)}}}T.preventDefault();break;case"ArrowUp":if(T.preventDefault(),e.loading)return;C.value&&((le=k.value)===null||le===void 0||le.prev());break;case"ArrowDown":if(T.preventDefault(),e.loading)return;C.value?(ce=k.value)===null||ce===void 0||ce.next():re();break;case"Escape":C.value&&(e1(T),Fe()),(me=v.value)===null||me===void 0||me.focus();break}}function Wi(){var T;(T=v.value)===null||T===void 0||T.focus()}function Ln(){var T;(T=v.value)===null||T===void 0||T.focusInput()}function vi(){var T;C.value&&((T=B.value)===null||T===void 0||T.syncPosition())}ie(),i.watch(i.toRef(e,"options"),ie);const ji={focus:()=>{var T;(T=v.value)===null||T===void 0||T.focus()},focusInput:()=>{var T;(T=v.value)===null||T===void 0||T.focusInput()},blur:()=>{var T;(T=v.value)===null||T===void 0||T.blur()},blurInput:()=>{var T;(T=v.value)===null||T===void 0||T.blurInput()}},Kt=i.computed(()=>{const{self:{menuBoxShadow:T}}=o.value;return{"--n-menu-box-shadow":T}}),Bn=s?pi("select",void 0,Kt,e):void 0;return Object.assign(Object.assign({},ji),{mergedStatus:W,mergedClsPrefix:t,mergedBordered:n,namespace:r,treeMate:y,isMounted:as(),triggerRef:v,menuRef:k,pattern:h,uncontrolledShow:S,mergedShow:C,adjustedTo:_n(e),uncontrolledValue:a,mergedValue:c,followerRef:B,localizedPlaceholder:P,selectedOption:$,selectedOptions:A,mergedSize:F,mergedDisabled:N,focused:d,activeWithoutMenuOpen:Ge,inlineThemeDisabled:s,onTriggerInputFocus:Le,onTriggerInputBlur:Pe,handleTriggerOrMenuResize:vi,handleMenuFocus:ct,handleMenuBlur:Pt,handleMenuTabOut:yi,handleTriggerClick:$e,handleToggle:dn,handleDeleteOption:dt,handlePatternInput:ne,handleClear:je,handleTriggerBlur:ot,handleTriggerFocus:De,handleKeydown:wi,handleMenuAfterLeave:Me,handleMenuClickOutside:bi,handleMenuScroll:Hi,handleMenuKeydown:wi,handleMenuMousedown:kr,mergedTheme:o,cssVars:s?void 0:Kt,themeClass:Bn==null?void 0:Bn.themeClass,onRender:Bn==null?void 0:Bn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(nd,null,{default:()=>[i.h(id,null,{default:()=>i.h(jw,{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 e,t;return[(t=(e=this.$slots).arrow)===null||t===void 0?void 0:t.call(e)]}})}),i.h(yd,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===_n.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 e,t,n;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),i.withDirectives(i.h(bw,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(t=this.menuProps)===null||t===void 0?void 0:t.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],[os,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[os,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),ev={},Th=i.defineComponent({...ev,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var e;return((e=U.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>D.isArray(r.value)),a=i.computed(()=>o.value?r.value.map(b=>b.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(b=>({...b,class:r.wrapContent?`${b.class} consistent-menu-width`:b.class}))),d=i.ref(!1),h=i.useTemplateRef("select-component"),f=b=>{b.length<r.minTermLength||(d.value=!0,r.searchDataHandler(b,d).then(S=>{if(D.isEmpty(S))return;const C=o.value?r.value:r.value?[r.value]:[],v=S.filter(B=>!C.some(k=>k.id===B.id));l.value=r.optionsListConverter([...C,...v])}).finally(()=>{d.value=!1}))};let p="";const u=D.debounce(()=>f(p),800),g=b=>{p=b,u()},m=b=>{var S;if(D.isArray(b)){const C=b.length>0?b.map(v=>{var B;return i.toRaw((B=l.value.find(k=>k.value===v))==null?void 0:B.item)}):[];s("update:value",C)}else if(b>0){const C=i.toRaw((S=l.value.find(v=>v.value===b))==null?void 0:S.item);s("update:value",C)}else s("update:value",null)};return t({focus:()=>{var b;return(b=h.value)==null?void 0:b.focusInput()},blur:()=>{var b;return(b=h.value)==null?void 0:b.blurInput()}}),(b,S)=>(i.openBlock(),i.createBlock(i.unref(Qw),{ref:"select-component","clear-filter-after-select":!0,clearable:b.clearable,"consistent-menu-width":b.consistentMenuWidth,disabled:b.disabled,filterable:!0,loading:d.value,multiple:o.value,options:c.value,placeholder:b.placeholder,remote:!0,value:a.value,"render-label":b.renderLabel,"render-tag":b.renderTag,onSearch:g,"onUpdate:value":m},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),tv={},Eh=i.defineComponent({...tv,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var e;return((e=U.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.useTemplateRef("select-component"),a=async f=>r.searchType==="categories"?U.HttpRequester.getInstance(U.ProductCategoryDataProvider).publicSimpleSearch(f):r.searchType==="products"?U.HttpRequester.getInstance(U.ProductDataProvider).publicSimpleSearch(f):new Promise(p=>{p([])}),l=f=>r.searchType==="categories"?zt.convertReferencesToSelectOptionsList(f,!0,!1,p=>p!=null&&p.isNewRec()?"-":p.name):r.searchType==="products"?zt.convertReferencesToSelectOptionsList(f,!0,!1,p=>p!=null&&p.isNewRec()?"-":`[${p.code}] ${p.name}`):[],c=(f,p)=>{if(r.renderLabel)return r.renderLabel(f,p);if(r.searchType==="products"){const u=f.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},u.code),i.h("span",{},[u.name])])}if(r.searchType==="categories"){const u=f.item;return i.h("div",{},[u.name])}};return t({focus:()=>{var f;return(f=o.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=o.value)==null?void 0:f.blur()}}),(f,p)=>(i.openBlock(),i.createBlock(Th,{ref:"select-component",value:f.value,clearable:f.clearable,disabled:f.disabled,placeholder:f.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":f.consistentMenuWidth,"wrap-content":f.wrapContent,"min-term-length":f.minTermLength,"render-label":c,"render-tag":f.renderTag,"onUpdate:value":p[0]||(p[0]=u=>s("update:value",u))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),nv={class:"col-span-2 flex flex-row gap-2.5"},iv={class:"flex-1"},rv={class:"text-sc-grey"},sv={class:"ml-2.5"},ov={key:0,class:"flex-none"},av={},lv=i.defineComponent({...av,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var e;return((e=U.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(null),o=()=>structuredClone(i.toRaw(n.value)),a=i.ref(o()),l=()=>{r("update:value",a.value.map(f=>i.toRaw(f)))},c=f=>{f&&(a.value=[...a.value.map(p=>i.toRaw(p)),...(D.isArray(f)?f:[f]).filter(p=>!a.value.some(u=>u.id===p.id))],i.nextTick(()=>{s.value=null}),l())},d=f=>{f&&(a.value=a.value.map(p=>p.id===f.id?f:i.toRaw(p)),l())},h=f=>{a.value=a.value.filter(p=>p.id!==f.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(f,p)=>{const u=I.NListItem,g=V_,m=I.NButton,_=I.NList;return i.openBlock(),i.createBlock(_,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(f.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Eh,{value:s.value,"onUpdate:value":[p[0]||(p[0]=y=>s.value=y),c],clearable:!0,disabled:f.disabled,"min-term-length":f.minTermLength,"search-type":f.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(u,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>p[1]||(p[1]=[i.createTextVNode(" --- Список пуст --- ")])),_:1,__:[1]})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,y=>(i.openBlock(),i.createBlock(u,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(m,{disabled:f.disabled,quaternary:"",type:"error",onClick:b=>h(y)},{default:i.withCtx(()=>[i.createVNode(g)]),_:2},1032,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",nv,[i.createElementVNode("span",iv,[i.createElementVNode("span",rv,i.toDisplayString(y.code),1),i.createElementVNode("span",sv,i.toDisplayString(y.name),1)]),f.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",ov,[i.renderSlot(f.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),cv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dv(e,t){return i.openBlock(),i.createElementBlock("svg",cv,t[0]||(t[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 hv=i.markRaw({name:"tabler-truck-filled",render:dv}),uv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fv(e,t){return i.openBlock(),i.createElementBlock("svg",uv,t[0]||(t[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 pv=i.markRaw({name:"tabler-truck-delivery",render:fv}),gv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mv(e,t){return i.openBlock(),i.createElementBlock("svg",gv,t[0]||(t[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 _v=i.markRaw({name:"tabler-truck-loading",render:mv}),yv={class:"flex flex-col gap-1"},bv={key:0,class:"flex flex-row gap-1 text-base"},wv={key:1,class:"text-sc-dark-grey text-sm"},vv={class:"text-sc-grey mr-1.5"},kv={key:0},xv={key:1},Cv={key:2},Sv={},ks=i.defineComponent({...Sv,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(e){const t=i.computed(()=>{var s;return(s=U.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Tn.format(r.delivery.date,"dd.MM.yyyy")),r=e;return(s,o)=>{var d,h,f,p,u,g,m,_;const a=_v,l=pv,c=hv;return i.openBlock(),i.createElementBlock("div",yv,[s.showType?(i.openBlock(),i.createElementBlock("span",bv,[((d=t.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((h=t.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((f=t.value)==null?void 0:f.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((p=t.value)==null?void 0:p.name),1)])):i.createCommentVNode("",!0),s.showDetails?(i.openBlock(),i.createElementBlock("span",wv,[i.createElementVNode("span",vv,i.toDisplayString(n.value),1),(g=(u=s.delivery)==null?void 0:u.address)!=null&&g.address?(i.openBlock(),i.createElementBlock("span",kv,i.toDisplayString(s.delivery.address.address),1)):i.createCommentVNode("",!0),(_=(m=s.delivery)==null?void 0:m.warehouse)!=null&&_.address?(i.openBlock(),i.createElementBlock("span",xv,"со склада "+i.toDisplayString(s.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",Cv,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),Bv={class:"flex flex-col gap-2.5"},Tv={class:"text-base"},Ev=["href"],$v={class:"text-sc-grey"},Nv={},$h=i.defineComponent({...Nv,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(e){const t=e,n=i.computed(()=>t.fields.includes(Ke.Id)?t.order.id:void 0),r=i.computed(()=>{var l,c;return t.fields.includes(Ke.Status)?(c=(l=U.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(t.order.status??-1)))==null?void 0:c.name:void 0}),s=i.computed(()=>t.fields.includes(Ke.CreatedAt)),o=i.computed(()=>t.fields.includes(Ke.ClientInfo)?t.order.client:void 0),a=i.computed(()=>t.fields.includes(Ke.DeliveryInfo)?t.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",Bv,[i.createElementVNode("span",Tv,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:l.orderUrl.replace(":id",l.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,Ev)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ")),i.createVNode(uo,{date:l.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(" - ")),i.createElementVNode("span",$v,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(Tr,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(ks,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),Rv={},Nh=i.defineComponent({...Rv,__name:"order-payment",props:{payment:{}},setup(e){const t=e,n=i.computed(()=>{var r;return(r=U.useReferencesStore().paymentTypeReference)==null?void 0:r.find(s=>s.id===t.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)}}}),Pv={class:"flex flex-row gap-1.5"},Fv={class:"flex-none text-nowrap"},Mv={class:"flex flex-1 flex-col"},Av={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},Iv={key:0},Vv={key:1},Ov={},Rh=i.defineComponent({...Ov,__name:"order-product-info",props:{product:{},index:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",Pv,[i.createElementVNode("span",Fv,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Mv,[i.createVNode(Yi,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",Av,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",Iv,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",Vv,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)])])]))}}),zv={},Lv=i.defineComponent({...zv,__name:"order-items-list",props:{order:{}},setup(e){const t=()=>{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(Yi,{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(wt.getDeviceTypeByResolution()){case qe.phone:case qe.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(Rh,{product:o,index:a})}];case qe.laptop:return s;default:return s}},n=i.ref(t()),r=()=>{n.value=t()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(s,o)=>{const a=I.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:s.order.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1},null,8,["columns","data","row-key"])],64)}}}),Ph=Hn(Lv,[["__scopeId","data-v-b15b9b70"]]),Dv={class:"text-base"},Hv={},Uo=i.defineComponent({...Hv,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",Dv,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))}}),Wv={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},jv={class:"col-span-2"},Xv={class:"col-span-2"},qv={class:"btn btn-primary",href:"{{ invoice }}"},Yv={},Fh=i.defineComponent({...Yv,__name:"order-details",props:{order:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",null,[n[11]||(n[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",Wv,[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(Uo,{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(Tr,{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(Ba,{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",jv,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(Nh,{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(ks,{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",Xv,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(Uo,{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",qv," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),Uv={key:0},Gv={class:"text-sc-dark-grey my-2 text-center"},Kv={key:1,class:"text-sc-dark-grey my-2 text-center"},Zv={key:2},Jv={class:"text-sc-dark-grey mt-4 text-right font-bold"},Qv={class:"text-sc-primary"},e2={},Mh=i.defineComponent({...e2,__name:"order-info",props:{order:{}},setup(e){const t=e,n=i.ref(!1),r=i.ref(new U.Order(t.order)),s=()=>{n.value=!0,U.HttpRequester.getInstance(U.OrdersDataProvider).getOrder(t.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=I.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",Uv,[i.createElementVNode("div",Gv,[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",Kv," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",Zv,[i.createVNode(Ph,{order:r.value},null,8,["order"]),i.createElementVNode("div",Jv,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ")),i.createElementVNode("span",Qv,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode(Fh,{order:r.value},null,8,["order"])]))}}}),t2={},n2=i.defineComponent({...t2,__name:"orders-list",props:{fields:{},orderUrl:{},filters:{},sort:{},pagination:{}},setup(e){const t=e,n=()=>structuredClone(i.toRaw(t.sort??{field:"id",direction:"desc"})),r=i.ref(n()),s=i.ref([]),o=i.ref(!1),a=i.computed(()=>U.useReferencesStore().orderStatusReference),l=()=>{const m=t.fields.length>0?t.fields:[Ke.CreatedAt,Ke.Id,Ke.DeliveryInfo,Ke.Status,Ke.SalesDirections,Ke.AttachedUser],_={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},y={type:"expand",expandable:D.constant(!0),renderExpand:S=>i.h(Mh,{order:S,class:"pl-10 pt-3 pb-10"}),width:"30"},b=[{title:"Дата заказа",key:Ke.CreatedAt,resizable:!0,minWidth:100,render:S=>i.h(uo,{date:S.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Ke.Id,resizable:!0,minWidth:70,render:S=>i.h("a",{href:t.orderUrl.replace(":id",S.id.toString()),target:"_blank",class:"text-base"},S.id)},{title:"Клиент",key:Ke.ClientInfo,resizable:!0,render:S=>i.h(Tr,{client:S.client})},{title:"Тип доставки",key:Ke.DeliveryInfo,resizable:!0,render:S=>i.h(ks,{delivery:S.delivery})},{title:"Статус",key:Ke.Status,resizable:!0,minWidth:90,render:S=>{var C,v;return i.h("span",{class:"text-base"},[((v=(C=a.value)==null?void 0:C.find(B=>B.id===(S.status??-1)))==null?void 0:v.name)??""])}},{title:"Напр. продаж",key:Ke.SalesDirections,resizable:!0,minWidth:70,render:S=>i.h("span",{class:"text-base"},[S.salesDirection.name])},{title:"Закреплено за",key:Ke.AttachedUser,resizable:!0,render:S=>{var C;return i.h("span",{class:"text-base"},[(C=S==null?void 0:S.attachedUser)==null?void 0:C.name])}}];switch(wt.getDeviceTypeByResolution()){case qe.phone:case qe.tablet:return[y,{key:"order",title:"Заказ",resizable:!0,render:S=>i.h($h,{order:S,fields:m,orderUrl:t.orderUrl})}];case qe.laptop:return[y,...m.map(S=>b.find(C=>C.key===S)??_)];default:return[_]}},c=i.ref(l()),d=i.ref(new U.DataTablePagination(t.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),h=()=>{t.filters&&(o.value=!0,U.HttpRequester.getInstance(U.OrdersDataProvider).getOrders(t.filters,r.value,{page:d.value.page,pageSize:d.value.pageSize}).then(m=>{d.value.itemCount!==m.meta.total&&(d.value.itemCount=m.meta.total),d.value.page!==m.meta.currentPage&&(d.value.page=m.meta.currentPage),d.value.pageCount!==m.meta.lastPage&&(d.value.pageCount=m.meta.lastPage),d.value.pageSize!==m.meta.perPage&&(d.value.pageSize=m.meta.perPage),s.value=m.data}).finally(()=>{o.value=!1}))},f=m=>{d.value.page=m,h()},p=m=>{d.value.pageSize=m,h()},u=m=>{D.isNull(m)?r.value=n():(r.value.field=m.columnKey.toString(),r.value.direction=m.order==="ascend"?"asc":"desc"),c.value.forEach(_=>{if(Object.hasOwn(_,"sortOrder")){const y=_;y.sortOrder=y.key===(m==null?void 0:m.columnKey)&&(m!=null&&m.sorter)&&m.order!==!1?m.order:!1}}),h()},g=()=>{c.value=l()};return i.watch(()=>t.filters,()=>{h()}),i.watch(()=>t.sort,()=>{r.value=n(),h()}),i.onMounted(()=>{g(),window.addEventListener("resize",g),i.nextTick(()=>{h()})}),i.onUnmounted(()=>{window.removeEventListener("resize",g)}),(m,_)=>{const y=I.NDataTable;return i.openBlock(),i.createBlock(y,{columns:c.value,data:s.value,"row-key":b=>b.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":f,"onUpdate:pageSize":p,"onUpdate:sorter":u},null,8,["columns","data","row-key","pagination","loading"])}}}),i2=Hn(n2,[["__scopeId","data-v-7c4554f4"]]),r2=["href"],s2={class:"text-sc-dark-grey"},o2={},a2=i.defineComponent({...o2,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>Tn.format(n.order.createdAt,U.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{D.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(" #")),i.createElementVNode("a",{href:a.orderLink??"#",onClick:l[0]||(l[0]=c=>o(c))},i.toDisplayString(a.order.id),9,r2),i.createTextVNode(" от "+i.toDisplayString(s.value),1),a.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ")),i.createElementVNode("span",s2,"автор: "+i.toDisplayString(a.order.creator.name)+" ["+i.toDisplayString(a.order.creator.type)+"]",1)],64))}}),l2={class:"sc-page flex flex-col"},c2={class:"my-2 flex flex-row items-end"},d2={class:"sc-title grow"},h2={key:0,class:"sc-title-buttons flex-1 grow-0"},u2={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},f2={key:0,class:"sc-title-extra mt-2 sm:mt-4"},p2={},Ah=i.defineComponent({...p2,__name:"page",props:{title:{}},setup(e){return(t,n)=>{const r=I.NH1;return i.openBlock(),i.createElementBlock("div",l2,[i.createElementVNode("div",c2,[i.createElementVNode("div",d2,[i.renderSlot(t.$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})])]),t.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",h2,[i.createElementVNode("div",u2,[i.renderSlot(t.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),t.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",f2,[i.renderSlot(t.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"default")])}}}),g2={class:"overflow-hidden transition-all duration-300"},m2={class:"text-lg font-medium leading-none"},_2={},Ih=i.defineComponent({..._2,__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(e,{emit:t}){const n=e,r=t,s=i.ref(0),o=i.ref(n.showDrawer),a=()=>{switch(wt.getDeviceTypeByResolution()){case qe.phone:return window.innerWidth*.66;case qe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?D.isUndefined(n.drawerWidth)?s.value=a():s.value=D.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=I.NDrawerContent,f=I.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",g2,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(f,{show:o.value,"onUpdate:show":d[0]||(d[0]=p=>o.value=p),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",m2,i.toDisplayString(c.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)}}}),y2={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},b2={key:0},w2={class:"sc-page-preview-panel grow"},v2={key:1,class:"sc-page-preview-panel-extra flex-none"},k2={},x2=i.defineComponent({...k2,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""}},setup(e,{expose:t}){const n=i.ref(!1),r=()=>{n.value=!0},s=i.useTemplateRef("panel-component-ref");return t({scrollToTopOfPanel:a=>{var l;(l=s.value)==null||l.scrollIntoView({behavior:"smooth"}),a&&i.nextTick(()=>{var c,d;window.scrollTo({top:(((d=(c=s.value)==null?void 0:c.getBoundingClientRect())==null?void 0:d.top)??0)+window.pageYOffset+a,behavior:"smooth"})})},showPanel:r}),(a,l)=>{const c=I.NButton;return i.openBlock(),i.createBlock(Ah,{title:a.title},i.createSlots({default:i.withCtx(()=>[a.$slots["preview-panel"]||a.$slots["preview-panel-extra"]||a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",y2,[a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",b2,[i.renderSlot(a.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(c,{class:"flex-none sm:px-10 sm:py-4",onClick:l[0]||(l[0]=d=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",w2,[i.renderSlot(a.$slots,"preview-panel")]),a.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",v2,[i.renderSlot(a.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Ih,{"show-drawer":n.value,"onUpdate:showDrawer":l[1]||(l[1]=d=>n.value=d),title:a.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(a.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:2},[a.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"panel-header")]),key:"0"}:void 0,a.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[a.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title")]),key:"0"}:void 0,a.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title-buttons")]),key:"1"}:void 0,a.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title-extra")]),key:"2"}:void 0]),1032,["title"])}}}),C2={},S2=i.defineComponent({...C2,__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}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>D.isArray(r.value)),a=i.computed(()=>{var u;return D.isArray(r.value)?r.value.map(g=>g.id):((u=r.value)==null?void 0:u.id)??null}),l=i.computed(()=>{var m;let u=r.showEmptyValue?[U.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList,g=r.disabledManagerReferenceList.map(_=>_.id);if(r.showActualOnly){const _=D.isArray(r.value)?r.value.map(y=>y.id):[(m=r.value)==null?void 0:m.id];g=D.union(g,r.managerReferenceList.filter(y=>!y.isActive).map(y=>y.id)),u=r.managerReferenceList.filter(y=>y.isActive||_.includes(y.id))}return zt.convertReferencesToSelectOptionsList(u,!0,!0,_=>_.salesDirection.isNewRec()?_.name:`${_.name} (${_.salesDirection.name}) ${r.showActualOnly&&!_.isActive?"[Не активен, только снять выбор]":""}`,_=>g.includes(_.id)&&_.isActive)}),c=i.computed(()=>l.value.map(u=>({...u,class:r.wrapContent?`${u.class} consistent-menu-width`:u.class}))),d=i.useTemplateRef("select-component"),h=u=>{var g;if(D.isArray(u)){const m=u.length>0?u.map(_=>{var y;return(y=l.value.find(b=>b.value===_))==null?void 0:y.item}):[];s("update:value",m)}else{const m=u>0?(g=l.value.find(_=>_.value===u))==null?void 0:g.item:new U.Manager;s("update:value",m)}};return i.watch(()=>r.disabledManagerReferenceList,u=>{if(u.length>0&&r.value){const g=o.value?r.value:[r.value];D.some(g,m=>D.some(u,["id",m.id]))&&s("update:value",g.filter(m=>!D.some(u,["id",m.id])))}},{immediate:!0}),t({focus:()=>{var u;return(u=d.value)==null?void 0:u.focusInput()},blur:()=>{var u;return(u=d.value)==null?void 0:u.blurInput()}}),(u,g)=>(i.openBlock(),i.createBlock(i.unref(I.NSelect),{ref:"select-component",value:a.value,clearable:u.clearable,disabled:l.value.length===0,"consistent-menu-width":u.consistentMenuWidth,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),B2={class:"m-0.5 flex flex-col p-0.5"},T2={class:"flex flex-row gap-1"},E2={key:0},$2={key:1},N2={key:2},R2={key:3},P2={class:"flex flex-row gap-1"},F2={key:0},M2={key:1},A2={key:2},I2={key:3},V2={},Vh=i.defineComponent({...V2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",B2,[i.createElementVNode("span",T2,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",E2,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",$2,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",N2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",R2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",P2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",F2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",M2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",A2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",I2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Go={clearable:!1,value:"",field:void 0,disabled:!1},O2={},z2=i.defineComponent({...O2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Go,minTermLength:()=>{var e;return((e=U.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(m=>({label:m[r.field??"addressString"]??"-",value:m.id})));i.watch(()=>r.value,m=>{o.value=m}),i.watch(o,()=>{s("update:value",o.value)});const d=D.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}))},f=(m,_)=>{const y=l.value.find(b=>b.id===m.value)||{};return i.h(Vh,{addr:y,selected:_},{default:D.constant("-")})},p=m=>{d.cancel();const _=l.value.find(y=>y.id===m)||{};s("select",_)},u=i.ref(null);function g(){u.value.focus()}return t({focus:g}),(m,_)=>{const y=I.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:u,value:o.value,"onUpdate:value":[_[0]||(_[0]=b=>o.value=b),i.unref(d)],clearable:m.clearable,disabled:m.disabled,loading:a.value,options:c.value,"render-label":f,placeholder:"",onSelect:p},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),L2={class:"m-0.5 flex flex-col p-0.5"},D2={class:"font-medium"},H2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},W2={key:0},j2={key:1},X2={},Oh=i.defineComponent({...X2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",L2,[i.createElementVNode("span",D2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",H2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",W2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",j2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),q2={},Y2=i.defineComponent({...q2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Go,minTermLength:()=>{var e;return((e=U.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(m=>({label:m[r.field??"_"]??"-",value:m.id})));i.watch(()=>r.value,m=>{o.value=m}),i.watch(o,()=>{s("update:value",o.value)});const d=D.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}}},f=(m,_)=>{const y=l.value.find(b=>b.id===m.value)||{};return i.h(Oh,{bank:y,selected:_},{default:D.constant("-")})},p=m=>{d.cancel();const _=l.value.find(y=>y.id===m)||{};s("select",_)},u=i.ref(null);function g(){u.value.focus()}return t({focus:g}),(m,_)=>{const y=I.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:u,value:o.value,"onUpdate:value":[_[0]||(_[0]=b=>o.value=b),i.unref(d)],clearable:m.clearable,disabled:m.disabled,loading:a.value,options:c.value,"render-label":f,placeholder:"",onSelect:p},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),U2={class:"font-medium"},G2={key:0,class:"flex flex-row gap-2"},K2={key:0,class:"text-xs font-light text-blue-800"},Z2={key:1,class:"text-sc-dark-grey text-xs font-light"},J2={},zh=i.defineComponent({...J2,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>{var s,o;return((o=(s=t.org.rawData)==null?void 0:s.state)==null?void 0:o.liquidationDate)??!1}),r=i.computed(()=>{var s,o;return((o=(s=t.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",U2,i.toDisplayString(s.org.name),1),s.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",G2,[s.org.inn?(i.openBlock(),i.createElementBlock("span",K2,i.toDisplayString(s.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",Z2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),Q2={},ek=i.defineComponent({...Q2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Go,minTermLength:()=>{var e;return((e=U.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=_=>{var y,b;return!!(((b=(y=_.rawData)==null?void 0:y.state)==null?void 0:b.liquidationDate)??!1)},d=i.computed(()=>zt.convertReferencesToSelectOptionsList(l.value,!1,!1,_=>_[r.field??"_"]??"-",_=>!r.allowSelectTerminated&&c(_)));i.watch(()=>r.value,_=>{o.value=_}),i.watch(o,()=>{s("update:value",o.value)});const h=D.debounce(()=>f(),800),f=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}}},p=(_,y)=>{const b=l.value.find(S=>S.id===_.value)||{};return i.h(zh,{org:b,selected:y},{default:D.constant("-")})},u=_=>{h.cancel();const y=l.value.find(b=>b.id===_)||{};(r.allowSelectTerminated||!c(y))&&s("select",y)},g=i.ref(null);function m(){g.value.focus()}return t({focus:m}),(_,y)=>{const b=I.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[y[0]||(y[0]=S=>o.value=S),i.unref(h)],clearable:_.clearable,disabled:_.disabled,loading:a.value,options:d.value,"render-label":p,placeholder:"",onSelect:u},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),tk={},nk=i.defineComponent({...tk,__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(e,{emit:t}){const n=e,r=t,s=i.ref(!1),o=()=>{r("accept",()=>{s.value=!1})},a=()=>{n.disableConfirm?o():s.value=!0};return(l,c)=>{const d=I.NButton,h=I.NPopover,f=I.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(h,{disabled:l.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:l.disabled,ghost:l.ghost,loading:l.loading,size:l.size,type:l.type,quaternary:l.quaternary,circle:l.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(l.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(f,{show:s.value,"onUpdate:show":c[1]||(c[1]=p=>s.value=p),content:l.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:l.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,__:[2]}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=p=>s.value=!1)},{default:i.withCtx(()=>c[3]||(c[3]=[i.createTextVNode(" Отмена ")])),_:1,__:[3]})]),_:1},8,["show","content","title"])])}}}),ik={key:0,class:"whitespace-pre-line"},rk={key:1,class:"text-sc-dark-grey"},sk={},ok=i.defineComponent({...sk,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(e,{emit:t}){const n=e,r=t,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=I.NInput;return i.openBlock(),i.createBlock(Oc,{disabled:l.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[l.comment?(i.openBlock(),i.createElementBlock("span",ik,i.toDisplayString(l.comment),1)):(i.openBlock(),i.createElementBlock("span",rk," - Комментарий отсутствует - "))])]),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"])}}}),ak={key:0,class:"text-sm"},lk={key:1},ck={},dk=i.defineComponent({...ck,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{let r="";return(t.showLabel??!1)&&(t.debt>0?r="Переплата: ":t.debt<0&&(r="Задолженность: ")),r});return(r,s)=>(i.openBlock(),i.createElementBlock("span",null,[r.wrapAsSmall&&r.debt!==0?(i.openBlock(),i.createElementBlock("span",ak,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":r.debt>0,"text-red-700":r.debt<0})},i.toDisplayString(r.debt)+" ₽ ",3)])):i.createCommentVNode("",!0),!r.wrapAsSmall&&r.debt!==0?(i.openBlock(),i.createElementBlock("span",lk,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":r.debt>0,"text-red-700":r.debt<0})},i.toDisplayString(r.debt)+" ₽ ",3)])):i.createCommentVNode("",!0)]))}}),hk={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function uk(e,t){return i.openBlock(),i.createElementBlock("svg",hk,t[0]||(t[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 fk=i.markRaw({name:"ion-warning",render:uk}),pk={},gk=i.defineComponent({...pk,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(e){return(t,n)=>{const r=fk,s=I.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"])}}}),bt=class bt{static init(t,n){bt.messagesService&&bt.notificationsService||(bt.messagesService=t,bt.notificationsService=n)}static getMessagesService(){if(!bt.messagesService)throw new Error("UI provider is not initialized.");return bt.messagesService}static getNotificationsService(){if(!bt.notificationsService)throw new Error("UI provider is not initialized.");return bt.notificationsService}static showNotificationsForErrorResponseData(t,n={}){var r,s;if(D.isEmpty(t.errors)){const o=(s=(r=t.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";bt.notificationsService?bt.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:t.message,meta:`#${t.status}${a}: ${t.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",t)}else for(const o in t.errors)Object.prototype.hasOwnProperty.call(n,o)?n[o]=new U.FieldValidationResultData(t.errors[o].toString(),"error"):bt.messagesService?bt.messagesService.error(t.errors[o].toString()):console.log("Show notification error response data: UI provider is not initialized.",t.errors[o])}};x(bt,"messagesService"),x(bt,"notificationsService");let Ko=bt;const mk=i.computed(()=>U.useReferencesStore().deliveryTypeReference??[]),_k=i.computed(()=>U.useReferencesStore().managersList??[]),yk=i.computed(()=>U.useReferencesStore().opfReference??[]),bk=i.computed(()=>U.useReferencesStore().partnerGroupsReference??[]),wk=i.computed(()=>U.useReferencesStore().priceCoefficientsReference??[]),vk=i.computed(()=>U.useReferencesStore().productFilesTypesReference??[]),kk=i.computed(()=>U.useReferencesStore().resourceTypesReference),xk=i.computed(()=>U.useReferencesStore().salesDirectionsReference??[]),Ck=i.computed(()=>U.useReferencesStore().warehousesReference??[]),Sk=i.computed(()=>zt.convertReferencesToSelectOptionsList(U.useReferencesStore().channelPrimaryInterestsReference??[],!0,!0)),Bk=i.computed(()=>zt.convertReferencesToSelectOptionsList(U.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!0)),Tk=e=>U.HttpRequester.getInstance(U.ReferenceDataProvider).searchCity(e),Ek=e=>zt.convertReferencesToSelectOptionsList(e,!0,!1,t=>{var n,r,s;return t!=null&&t.isNewRec()?"-":`${t.name}, ${(n=t==null?void 0:t.region)==null?void 0:n.name}, ${(s=(r=t==null?void 0:t.region)==null?void 0:r.country)==null?void 0:s.name}`},t=>t==null?void 0:t.isNewRec());L.ConfiguratorSettingsKozyrek=t0,L.ContentHelper=Dn,L.KozyrekLine=ii,L.KozyrekTailTemplate=co,L.KozyrekTemplate=Mi,L.OrdersTableFields=Ke,L.Point=lo,L.ScAddProductToCartForm=Af,L.ScAddressSuggestion=z2,L.ScAddressSuggestionLabel=Vh,L.ScBankSuggestion=Y2,L.ScBankSuggestionLabel=Oh,L.ScBaseDialog=s_,L.ScButtonWithConfirmAction=nk,L.ScCategoryCollapse=Ca,L.ScClientNameWithShortInfo=Tr,L.ScCollapse=xa,L.ScCollapseItem=ya,L.ScCommentEditor=ok,L.ScConfiguratorsProductInfo=Ui,L.ScContragentWithShortInfo=Ba,L.ScDateRange=Y0,L.ScDateTimeLabel=uo,L.ScDebouncedInput=C_,L.ScDebouncedInputNumber=Ai,L.ScDebt=dk,L.ScDialogHeader=t_,L.ScEmail=ep,L.ScExternalLink=M_,L.ScImageGallery=ka,L.ScInlineEditableItem=Oc,L.ScInlineView=fo,L.ScKozyrekConfigurator=e0,L.ScKozyrekConfiguratorParamsForm=Ma,L.ScKozyrekConfiguratorPreview=Rc,L.ScKozyrekConfiguratorTemplates=Ra,L.ScLightGallery=va,L.ScManagerSelect=S2,L.ScMetalForDoorsConfigurator=a0,L.ScMetalForDoorsConfiguratorForm=Pc,L.ScMosquitoConfigurator=R0,L.ScMosquitoConfiguratorForm=Fc,L.ScMosquitoConfiguratorMeasurementInstructions=Mc,L.ScMosquitoConfiguratorPreview=ho,L.ScOrderCommonInfo=$h,L.ScOrderDeliveryLabel=ks,L.ScOrderDetails=Fh,L.ScOrderInfo=Mh,L.ScOrderItemsList=Ph,L.ScOrderPayment=Nh,L.ScOrderProductInfo=Rh,L.ScOrdersList=i2,L.ScOrgSuggestion=ek,L.ScOrgSuggestionLabel=zh,L.ScPage=Ah,L.ScPageWithSlidingPanel=x2,L.ScPersonContactsBlock=jp,L.ScPhone=Cp,L.ScPhoneInput=T_,L.ScProductName=Yi,L.ScProductsList=lv,L.ScReferenceSelect=Sa,L.ScSearchableProductSelect=Eh,L.ScSearchableReferenceSelect=Th,L.ScSetClientPriceFormItem=Of,L.ScShortTextOrderInfo=a2,L.ScSingleFileUploadSelector=d_,L.ScSlidingContentWithDrawer=Ih,L.ScStripConfigurator=H0,L.ScStripConfiguratorForm=Ic,L.ScStripConfiguratorLineItem=Ac,L.ScStripConfiguratorPreview=Vc,L.ScUserShortInfo=Uo,L.ScWarningIcon=gk,L.SelectOptionHelper=zt,L.UiNotificationProvider=Ko,L.WindowResolutionEnum=qe,L.WindowResolutionProvider=wt,L.channelPrimaryInterestOptionsList=Sk,L.componentSizeInjectionKey=xr,L.deliveryTypeReferenceList=mk,L.managersReferenceList=_k,L.naiveUiTheme=Su,L.opfReferenceList=yk,L.partnerGroupReferenceList=bk,L.priceCoefficientsReferenceList=wk,L.productFilesTypesReferenceList=vk,L.renderConfig=Oe,L.resourceReferencesList=kk,L.salesDirectionsReferenceList=xk,L.searchCityReferenceDataHandler=Tk,L.searchCityReferenceLabelRenderer=Ek,L.sourcePrimaryInterestOptionsList=Bk,L.warehousesReferenceList=Ck,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
823
+ `,[kh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function vs(e){return e.type==="group"}function Bh(e){return e.type==="ignored"}function Yo(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function Jw(e,t){return{getIsGroup:vs,getIgnored:Bh,getKey(r){return vs(r)?r.name||r.key||"key-required":r[e]},getChildren(r){return r[t]}}}function Qw(e,t,n,r){if(!t)return e;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(vs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Bh(l))continue;t(n,l)&&a.push(l)}return a}return s(e)}function ev(e,t,n){const r=new Map;return e.forEach(s=>{vs(s)?s[n].forEach(o=>{r.set(o[t],o)}):r.set(s[t],s)}),r}var tv={};const nv=Object.assign(Object.assign({},yt.props),{to:wn.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}),iv=i.defineComponent({name:"Select",props:nv,slots:Object,setup(e){tv.NODE_ENV!=="production"&&i.watchEffect(()=>{e.items!==void 0&&Ln("select","`items` is deprecated, please use `options` instead."),e.onChange!==void 0&&Ln("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=gi(e),o=yt("Select","-select",Zw,Kw,e,t),a=i.ref(e.defaultValue),l=i.toRef(e,"value"),c=ko(l,a),d=i.ref(!1),h=i.ref(""),f=Jc(e,["items","options"]),p=i.ref([]),u=i.ref([]),g=i.computed(()=>u.value.concat(p.value).concat(f.value)),m=i.computed(()=>{const{filter:E}=e;if(E)return E;const{labelField:H,valueField:Q}=e;return(le,ce)=>{if(!ce)return!1;const me=ce[H];if(typeof me=="string")return Yo(le,me);const be=ce[Q];return typeof be=="string"?Yo(le,be):typeof be=="number"?Yo(le,String(be)):!1}}),y=i.computed(()=>{if(e.remote)return f.value;{const{value:E}=g,{value:H}=h;return!H.length||!e.filterable?E:Qw(E,m.value,H,e.childrenField)}}),_=i.computed(()=>{const{valueField:E,childrenField:H}=e,Q=Jw(E,H);return $_(y.value,Q)}),b=i.computed(()=>ev(g.value,e.valueField,e.childrenField)),S=i.ref(!1),x=ko(i.toRef(e,"show"),S),v=i.ref(null),B=i.ref(null),k=i.ref(null),{localeRef:N}=oh("Select"),P=i.computed(()=>{var E;return(E=e.placeholder)!==null&&E!==void 0?E:N.value.placeholder}),R=[],W=i.ref(new Map),q=i.computed(()=>{const{fallbackOption:E}=e;if(E===void 0){const{labelField:H,valueField:Q}=e;return le=>({[H]:String(le),[Q]:le})}return E===!1?!1:H=>Object.assign(E(H),{value:H})});function F(E){const H=e.remote,{value:Q}=W,{value:le}=b,{value:ce}=q,me=[];return E.forEach(be=>{if(le.has(be))me.push(le.get(be));else if(H&&Q.has(be))me.push(Q.get(be));else if(ce){const ke=ce(be);ke&&me.push(ke)}}),me}const M=i.computed(()=>{if(e.multiple){const{value:E}=c;return Array.isArray(E)?F(E):[]}return null}),V=i.computed(()=>{const{value:E}=c;return!e.multiple&&!Array.isArray(E)?E===null?null:F([E])[0]||null:null}),K=l1(e),{mergedSizeRef:T,mergedDisabledRef:$,mergedStatusRef:j}=K;function z(E,H){const{onChange:Q,"onUpdate:value":le,onUpdateValue:ce}=e,{nTriggerFormChange:me,nTriggerFormInput:be}=K;Q&&mt(Q,E,H),ce&&mt(ce,E,H),le&&mt(le,E,H),a.value=E,me(),be()}function U(E){const{onBlur:H}=e,{nTriggerFormBlur:Q}=K;H&&mt(H,E),Q()}function I(){const{onClear:E}=e;E&&mt(E)}function O(E){const{onFocus:H,showOnFocus:Q}=e,{nTriggerFormFocus:le}=K;H&&mt(H,E),le(),Q&&re()}function Z(E){const{onSearch:H}=e;H&&mt(H,E)}function ge(E){const{onScroll:H}=e;H&&mt(H,E)}function ie(){var E;const{remote:H,multiple:Q}=e;if(H){const{value:le}=W;if(Q){const{valueField:ce}=e;(E=M.value)===null||E===void 0||E.forEach(me=>{le.set(me[ce],me)})}else{const ce=V.value;ce&&le.set(ce[e.valueField],ce)}}}function he(E){const{onUpdateShow:H,"onUpdate:show":Q}=e;H&&mt(H,E),Q&&mt(Q,E),S.value=E}function re(){$.value||(he(!0),S.value=!0,e.filterable&&Hn())}function Pe(){he(!1)}function Fe(){h.value="",u.value=R}const Ze=i.ref(!1);function Le(){e.filterable&&(Ze.value=!0)}function dt(){e.filterable&&(Ze.value=!1,x.value||Fe())}function Zt(){$.value||(x.value?e.filterable?Hn():Pe():re())}function Oe(E){var H,Q;!((Q=(H=k.value)===null||H===void 0?void 0:H.selfRef)===null||Q===void 0)&&Q.contains(E.relatedTarget)||(d.value=!1,U(E),Pe())}function Ce(E){O(E),d.value=!0}function Je(){d.value=!0}function Qe(E){var H;!((H=v.value)===null||H===void 0)&&H.$el.contains(E.relatedTarget)||(d.value=!1,U(E),Pe())}function un(){var E;(E=v.value)===null||E===void 0||E.focus(),Pe()}function Ue(E){var H;x.value&&(!((H=v.value)===null||H===void 0)&&H.$el.contains(lr(E))||Pe())}function Ft(E){if(!Array.isArray(E))return[];if(q.value)return Array.from(E);{const{remote:H}=e,{value:Q}=b;if(H){const{value:le}=W;return E.filter(ce=>Q.has(ce)||le.has(ce))}else return E.filter(le=>Q.has(le))}}function fn(E){ht(E.rawNode)}function ht(E){if($.value)return;const{tag:H,remote:Q,clearFilterAfterSelect:le,valueField:ce}=e;if(H&&!Q){const{value:me}=u,be=me[0]||null;if(be){const ke=p.value;ke.length?ke.push(be):p.value=[be],u.value=R}}if(Q&&W.value.set(E[ce],E),e.multiple){const me=Ft(c.value),be=me.findIndex(ke=>ke===E[ce]);if(~be){if(me.splice(be,1),H&&!Q){const ke=te(E[ce]);~ke&&(p.value.splice(ke,1),le&&(h.value=""))}}else me.push(E[ce]),le&&(h.value="");z(me,F(me))}else{if(H&&!Q){const me=te(E[ce]);~me?p.value=[p.value[me]]:p.value=R}Wi(),Pe(),z(E[ce],E)}}function te(E){return p.value.findIndex(Q=>Q[e.valueField]===E)}function ne(E){x.value||re();const{value:H}=E.target;h.value=H;const{tag:Q,remote:le}=e;if(Z(H),Q&&!le){if(!H){u.value=R;return}const{onCreate:ce}=e,me=ce?ce(H):{[e.labelField]:H,[e.valueField]:H},{valueField:be,labelField:ke}=e;f.value.some(je=>je[be]===me[be]||je[ke]===me[ke])||p.value.some(je=>je[be]===me[be]||je[ke]===me[ke])?u.value=R:u.value=[me]}}function We(E){E.stopPropagation();const{multiple:H}=e;!H&&e.filterable&&Pe(),I(),H?z([],[]):z(null,null)}function kr(E){!ar(E,"action")&&!ar(E,"empty")&&!ar(E,"header")&&E.preventDefault()}function Hi(E){ge(E)}function wi(E){var H,Q,le,ce,me;if(!e.keyboard){E.preventDefault();return}switch(E.key){case" ":if(e.filterable)break;E.preventDefault();case"Enter":if(!(!((H=v.value)===null||H===void 0)&&H.isComposing)){if(x.value){const be=(Q=k.value)===null||Q===void 0?void 0:Q.getPendingTmNode();be?fn(be):e.filterable||(Pe(),Wi())}else if(re(),e.tag&&Ze.value){const be=u.value[0];if(be){const ke=be[e.valueField],{value:je}=c;e.multiple&&Array.isArray(je)&&je.includes(ke)||ht(be)}}}E.preventDefault();break;case"ArrowUp":if(E.preventDefault(),e.loading)return;x.value&&((le=k.value)===null||le===void 0||le.prev());break;case"ArrowDown":if(E.preventDefault(),e.loading)return;x.value?(ce=k.value)===null||ce===void 0||ce.next():re();break;case"Escape":x.value&&(r1(E),Pe()),(me=v.value)===null||me===void 0||me.focus();break}}function Wi(){var E;(E=v.value)===null||E===void 0||E.focus()}function Hn(){var E;(E=v.value)===null||E===void 0||E.focusInput()}function vi(){var E;x.value&&((E=B.value)===null||E===void 0||E.syncPosition())}ie(),i.watch(i.toRef(e,"options"),ie);const ji={focus:()=>{var E;(E=v.value)===null||E===void 0||E.focus()},focusInput:()=>{var E;(E=v.value)===null||E===void 0||E.focusInput()},blur:()=>{var E;(E=v.value)===null||E===void 0||E.blur()},blurInput:()=>{var E;(E=v.value)===null||E===void 0||E.blurInput()}},Jt=i.computed(()=>{const{self:{menuBoxShadow:E}}=o.value;return{"--n-menu-box-shadow":E}}),$n=s?mi("select",void 0,Jt,e):void 0;return Object.assign(Object.assign({},ji),{mergedStatus:j,mergedClsPrefix:t,mergedBordered:n,namespace:r,treeMate:_,isMounted:as(),triggerRef:v,menuRef:k,pattern:h,uncontrolledShow:S,mergedShow:x,adjustedTo:wn(e),uncontrolledValue:a,mergedValue:c,followerRef:B,localizedPlaceholder:P,selectedOption:V,selectedOptions:M,mergedSize:T,mergedDisabled:$,focused:d,activeWithoutMenuOpen:Ze,inlineThemeDisabled:s,onTriggerInputFocus:Le,onTriggerInputBlur:dt,handleTriggerOrMenuResize:vi,handleMenuFocus:Je,handleMenuBlur:Qe,handleMenuTabOut:un,handleTriggerClick:Zt,handleToggle:fn,handleDeleteOption:ht,handlePatternInput:ne,handleClear:We,handleTriggerBlur:Oe,handleTriggerFocus:Ce,handleKeydown:wi,handleMenuAfterLeave:Fe,handleMenuClickOutside:Ue,handleMenuScroll:Hi,handleMenuKeydown:wi,handleMenuMousedown:kr,mergedTheme:o,cssVars:s?void 0:Jt,themeClass:$n==null?void 0:$n.themeClass,onRender:$n==null?void 0:$n.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(nd,null,{default:()=>[i.h(id,null,{default:()=>i.h(Uw,{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 e,t;return[(t=(e=this.$slots).arrow)===null||t===void 0?void 0:t.call(e)]}})}),i.h(_d,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===wn.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 e,t,n;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),i.withDirectives(i.h(xw,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(t=this.menuProps)===null||t===void 0?void 0:t.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],[os,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[os,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),rv={},Th=i.defineComponent({...rv,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var e;return((e=Y.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>D.isArray(r.value)),a=i.computed(()=>o.value?r.value.map(b=>b.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(b=>({...b,class:r.wrapContent?`${b.class} consistent-menu-width`:b.class}))),d=i.ref(!1),h=i.useTemplateRef("select-component"),f=b=>{b.length<r.minTermLength||(d.value=!0,r.searchDataHandler(b,d).then(S=>{if(D.isEmpty(S))return;const x=o.value?r.value:r.value?[r.value]:[],v=S.filter(B=>!x.some(k=>k.id===B.id));l.value=r.optionsListConverter([...x,...v])}).finally(()=>{d.value=!1}))};let p="";const u=D.debounce(()=>f(p),800),g=b=>{p=b,u()},m=b=>{var S;if(D.isArray(b)){const x=b.length>0?b.map(v=>{var B;return i.toRaw((B=l.value.find(k=>k.value===v))==null?void 0:B.item)}):[];s("update:value",x)}else if(b>0){const x=i.toRaw((S=l.value.find(v=>v.value===b))==null?void 0:S.item);s("update:value",x)}else s("update:value",null)};return t({focus:()=>{var b;return(b=h.value)==null?void 0:b.focusInput()},blur:()=>{var b;return(b=h.value)==null?void 0:b.blurInput()}}),(b,S)=>(i.openBlock(),i.createBlock(i.unref(iv),{ref:"select-component","clear-filter-after-select":!0,clearable:b.clearable,"consistent-menu-width":b.consistentMenuWidth,disabled:b.disabled,filterable:!0,loading:d.value,multiple:o.value,options:c.value,placeholder:b.placeholder,remote:!0,value:a.value,"render-label":b.renderLabel,"render-tag":b.renderTag,onSearch:g,"onUpdate:value":m},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),sv={},Eh=i.defineComponent({...sv,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var e;return((e=Y.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.useTemplateRef("select-component"),a=async f=>r.searchType==="categories"?Y.HttpRequester.getInstance(Y.ProductCategoryDataProvider).publicSimpleSearch(f):r.searchType==="products"?Y.HttpRequester.getInstance(Y.ProductDataProvider).publicSimpleSearch(f):new Promise(p=>{p([])}),l=f=>r.searchType==="categories"?Lt.convertReferencesToSelectOptionsList(f,!0,!1,p=>p!=null&&p.isNewRec()?"-":p.name):r.searchType==="products"?Lt.convertReferencesToSelectOptionsList(f,!0,!1,p=>p!=null&&p.isNewRec()?"-":`[${p.code}] ${p.name}`):[],c=(f,p)=>{if(r.renderLabel)return r.renderLabel(f,p);if(r.searchType==="products"){const u=f.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},u.code),i.h("span",{},[u.name])])}if(r.searchType==="categories"){const u=f.item;return i.h("div",{},[u.name])}};return t({focus:()=>{var f;return(f=o.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=o.value)==null?void 0:f.blur()}}),(f,p)=>(i.openBlock(),i.createBlock(Th,{ref:"select-component",value:f.value,clearable:f.clearable,disabled:f.disabled,placeholder:f.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":f.consistentMenuWidth,"wrap-content":f.wrapContent,"min-term-length":f.minTermLength,"render-label":c,"render-tag":f.renderTag,"onUpdate:value":p[0]||(p[0]=u=>s("update:value",u))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),ov={class:"col-span-2 flex flex-row gap-2.5"},av={class:"flex-1"},lv={class:"text-sc-grey"},cv={class:"ml-2.5"},dv={key:0,class:"flex-none"},hv={},uv=i.defineComponent({...hv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var e;return((e=Y.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(null),o=()=>structuredClone(i.toRaw(n.value)),a=i.ref(o()),l=()=>{r("update:value",a.value.map(f=>i.toRaw(f)))},c=f=>{f&&(a.value=[...a.value.map(p=>i.toRaw(p)),...(D.isArray(f)?f:[f]).filter(p=>!a.value.some(u=>u.id===p.id))],i.nextTick(()=>{s.value=null}),l())},d=f=>{f&&(a.value=a.value.map(p=>p.id===f.id?f:i.toRaw(p)),l())},h=f=>{a.value=a.value.filter(p=>p.id!==f.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(f,p)=>{const u=A.NListItem,g=Dy,m=A.NButton,y=A.NList;return i.openBlock(),i.createBlock(y,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(f.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Eh,{value:s.value,"onUpdate:value":[p[0]||(p[0]=_=>s.value=_),c],clearable:!0,disabled:f.disabled,"min-term-length":f.minTermLength,"search-type":f.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(u,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>p[1]||(p[1]=[i.createTextVNode(" --- Список пуст --- ")])),_:1,__:[1]})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,_=>(i.openBlock(),i.createBlock(u,{key:_.id},{suffix:i.withCtx(()=>[i.createVNode(m,{disabled:f.disabled,quaternary:"",type:"error",onClick:b=>h(_)},{default:i.withCtx(()=>[i.createVNode(g)]),_:2},1032,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",ov,[i.createElementVNode("span",av,[i.createElementVNode("span",lv,i.toDisplayString(_.code),1),i.createElementVNode("span",cv,i.toDisplayString(_.name),1)]),f.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",dv,[i.renderSlot(f.$slots,"item-extra",{item:_,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),fv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function pv(e,t){return i.openBlock(),i.createElementBlock("svg",fv,t[0]||(t[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 gv=i.markRaw({name:"tabler-truck-filled",render:pv}),mv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yv(e,t){return i.openBlock(),i.createElementBlock("svg",mv,t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M5 17a2 2 0 1 0 4 0a2 2 0 1 0-4 0m10 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"}),i.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)]))}const _v=i.markRaw({name:"tabler-truck-delivery",render:yv}),bv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wv(e,t){return i.openBlock(),i.createElementBlock("svg",bv,t[0]||(t[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 vv=i.markRaw({name:"tabler-truck-loading",render:wv}),kv={class:"flex flex-col gap-1"},xv={key:0,class:"flex flex-row gap-1 text-base"},Cv={key:1,class:"text-sc-dark-grey text-sm"},Sv={class:"text-sc-grey mr-1.5"},Bv={key:0},Tv={key:1},Ev={key:2},$v={},ks=i.defineComponent({...$v,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(e){const t=i.computed(()=>{var s;return(s=Y.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Nn.format(r.delivery.date,"dd.MM.yyyy")),r=e;return(s,o)=>{var d,h,f,p,u,g,m,y;const a=vv,l=_v,c=gv;return i.openBlock(),i.createElementBlock("div",kv,[s.showType?(i.openBlock(),i.createElementBlock("span",xv,[((d=t.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((h=t.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((f=t.value)==null?void 0:f.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((p=t.value)==null?void 0:p.name),1)])):i.createCommentVNode("",!0),s.showDetails?(i.openBlock(),i.createElementBlock("span",Cv,[i.createElementVNode("span",Sv,i.toDisplayString(n.value),1),(g=(u=s.delivery)==null?void 0:u.address)!=null&&g.address?(i.openBlock(),i.createElementBlock("span",Bv,i.toDisplayString(s.delivery.address.address),1)):i.createCommentVNode("",!0),(y=(m=s.delivery)==null?void 0:m.warehouse)!=null&&y.address?(i.openBlock(),i.createElementBlock("span",Tv,"со склада "+i.toDisplayString(s.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",Ev,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),Nv={class:"flex flex-col gap-2.5"},Rv={class:"text-base"},Pv=["href"],Fv={class:"text-sc-grey"},Mv={},$h=i.defineComponent({...Mv,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(e){const t=e,n=i.computed(()=>t.fields.includes(Ge.Id)?t.order.id:void 0),r=i.computed(()=>{var l,c;return t.fields.includes(Ge.Status)?(c=(l=Y.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(t.order.status??-1)))==null?void 0:c.name:void 0}),s=i.computed(()=>t.fields.includes(Ge.CreatedAt)),o=i.computed(()=>t.fields.includes(Ge.ClientInfo)?t.order.client:void 0),a=i.computed(()=>t.fields.includes(Ge.DeliveryInfo)?t.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",Nv,[i.createElementVNode("span",Rv,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:l.orderUrl.replace(":id",l.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,Pv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ")),i.createVNode(uo,{date:l.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(" - ")),i.createElementVNode("span",Fv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(Tr,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(ks,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),Av={},Nh=i.defineComponent({...Av,__name:"order-payment",props:{payment:{}},setup(e){const t=e,n=i.computed(()=>{var r;return(r=Y.useReferencesStore().paymentTypeReference)==null?void 0:r.find(s=>s.id===t.payment.type)});return(r,s)=>{var o;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((o=n.value)==null?void 0:o.name)??"-"),1)}}}),Iv={class:"flex flex-row gap-1.5"},Vv={class:"flex-none text-nowrap"},Ov={class:"flex flex-1 flex-col"},zv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},Lv={key:0},Dv={key:1},Hv={},Rh=i.defineComponent({...Hv,__name:"order-product-info",props:{product:{},index:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",Iv,[i.createElementVNode("span",Vv,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Ov,[i.createVNode(Yi,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",zv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",Lv,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",Dv,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)])])]))}}),Wv={},jv=i.defineComponent({...Wv,__name:"order-items-list",props:{order:{}},setup(e){const t=()=>{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(Yi,{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(vt.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(Rh,{product:o,index:a})}];case Xe.laptop:return s;default:return s}},n=i.ref(t()),r=()=>{n.value=t()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(s,o)=>{const a=A.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:s.order.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1},null,8,["columns","data","row-key"])],64)}}}),Ph=jn(jv,[["__scopeId","data-v-b15b9b70"]]),Xv={class:"text-base"},qv={},Uo=i.defineComponent({...qv,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",Xv,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))}}),Yv={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},Uv={class:"col-span-2"},Gv={class:"col-span-2"},Kv={class:"btn btn-primary",href:"{{ invoice }}"},Zv={},Fh=i.defineComponent({...Zv,__name:"order-details",props:{order:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",null,[n[11]||(n[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",Yv,[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(Uo,{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(Tr,{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(Ba,{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",Uv,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(Nh,{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(ks,{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",Gv,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(Uo,{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",Kv," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),Jv={key:0},Qv={class:"text-sc-dark-grey my-2 text-center"},e2={key:1,class:"text-sc-dark-grey my-2 text-center"},t2={key:2},n2={class:"text-sc-dark-grey mt-4 text-right font-bold"},i2={class:"text-sc-primary"},r2={},Mh=i.defineComponent({...r2,__name:"order-info",props:{order:{}},setup(e){const t=e,n=i.ref(!1),r=i.ref(new Y.Order(t.order)),s=()=>{n.value=!0,Y.HttpRequester.getInstance(Y.OrdersDataProvider).getOrder(t.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=A.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",Jv,[i.createElementVNode("div",Qv,[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",e2," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",t2,[i.createVNode(Ph,{order:r.value},null,8,["order"]),i.createElementVNode("div",n2,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ")),i.createElementVNode("span",i2,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode(Fh,{order:r.value},null,8,["order"])]))}}}),s2={},o2=i.defineComponent({...s2,__name:"orders-list",props:{fields:{},orderUrl:{},filters:{},sort:{},pagination:{}},setup(e){const t=e,n=()=>structuredClone(i.toRaw(t.sort??{field:"id",direction:"desc"})),r=i.ref(n()),s=i.ref([]),o=i.ref(!1),a=i.computed(()=>Y.useReferencesStore().orderStatusReference),l=()=>{const m=t.fields.length>0?t.fields:[Ge.CreatedAt,Ge.Id,Ge.DeliveryInfo,Ge.Status,Ge.SalesDirections,Ge.AttachedUser],y={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},_={type:"expand",expandable:D.constant(!0),renderExpand:S=>i.h(Mh,{order:S,class:"pl-10 pt-3 pb-10"}),width:"30"},b=[{title:"Дата заказа",key:Ge.CreatedAt,resizable:!0,minWidth:100,render:S=>i.h(uo,{date:S.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Ge.Id,resizable:!0,minWidth:70,render:S=>i.h("a",{href:t.orderUrl.replace(":id",S.id.toString()),target:"_blank",class:"text-base"},S.id)},{title:"Клиент",key:Ge.ClientInfo,resizable:!0,render:S=>i.h(Tr,{client:S.client})},{title:"Тип доставки",key:Ge.DeliveryInfo,resizable:!0,render:S=>i.h(ks,{delivery:S.delivery})},{title:"Статус",key:Ge.Status,resizable:!0,minWidth:90,render:S=>{var x,v;return i.h("span",{class:"text-base"},[((v=(x=a.value)==null?void 0:x.find(B=>B.id===(S.status??-1)))==null?void 0:v.name)??""])}},{title:"Напр. продаж",key:Ge.SalesDirections,resizable:!0,minWidth:70,render:S=>i.h("span",{class:"text-base"},[S.salesDirection.name])},{title:"Закреплено за",key:Ge.AttachedUser,resizable:!0,render:S=>{var x;return i.h("span",{class:"text-base"},[(x=S==null?void 0:S.attachedUser)==null?void 0:x.name])}}];switch(vt.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:return[_,{key:"order",title:"Заказ",resizable:!0,render:S=>i.h($h,{order:S,fields:m,orderUrl:t.orderUrl})}];case Xe.laptop:return[_,...m.map(S=>b.find(x=>x.key===S)??y)];default:return[y]}},c=i.ref(l()),d=i.ref(new Y.DataTablePagination(t.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),h=()=>{t.filters&&(o.value=!0,Y.HttpRequester.getInstance(Y.OrdersDataProvider).getOrders(t.filters,r.value,{page:d.value.page,pageSize:d.value.pageSize}).then(m=>{d.value.itemCount!==m.meta.total&&(d.value.itemCount=m.meta.total),d.value.page!==m.meta.currentPage&&(d.value.page=m.meta.currentPage),d.value.pageCount!==m.meta.lastPage&&(d.value.pageCount=m.meta.lastPage),d.value.pageSize!==m.meta.perPage&&(d.value.pageSize=m.meta.perPage),s.value=m.data}).finally(()=>{o.value=!1}))},f=m=>{d.value.page=m,h()},p=m=>{d.value.pageSize=m,h()},u=m=>{D.isNull(m)?r.value=n():(r.value.field=m.columnKey.toString(),r.value.direction=m.order==="ascend"?"asc":"desc"),c.value.forEach(y=>{if(Object.hasOwn(y,"sortOrder")){const _=y;_.sortOrder=_.key===(m==null?void 0:m.columnKey)&&(m!=null&&m.sorter)&&m.order!==!1?m.order:!1}}),h()},g=()=>{c.value=l()};return i.watch(()=>t.filters,()=>{h()}),i.watch(()=>t.sort,()=>{r.value=n(),h()}),i.onMounted(()=>{g(),window.addEventListener("resize",g),i.nextTick(()=>{h()})}),i.onUnmounted(()=>{window.removeEventListener("resize",g)}),(m,y)=>{const _=A.NDataTable;return i.openBlock(),i.createBlock(_,{columns:c.value,data:s.value,"row-key":b=>b.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":f,"onUpdate:pageSize":p,"onUpdate:sorter":u},null,8,["columns","data","row-key","pagination","loading"])}}}),a2=jn(o2,[["__scopeId","data-v-7c4554f4"]]),l2=["href"],c2={class:"text-sc-dark-grey"},d2={},h2=i.defineComponent({...d2,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>Nn.format(n.order.createdAt,Y.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{D.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(" #")),i.createElementVNode("a",{href:a.orderLink??"#",onClick:l[0]||(l[0]=c=>o(c))},i.toDisplayString(a.order.id),9,l2),i.createTextVNode(" от "+i.toDisplayString(s.value),1),a.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ")),i.createElementVNode("span",c2,"автор: "+i.toDisplayString(a.order.creator.name)+" ["+i.toDisplayString(a.order.creator.type)+"]",1)],64))}}),u2={class:"sc-page flex flex-col"},f2={class:"my-2 flex flex-row items-end"},p2={class:"sc-title grow"},g2={key:0,class:"sc-title-buttons flex-1 grow-0"},m2={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},y2={key:0,class:"sc-title-extra mt-2 sm:mt-4"},_2={},Ah=i.defineComponent({..._2,__name:"page",props:{title:{}},setup(e){return(t,n)=>{const r=A.NH1;return i.openBlock(),i.createElementBlock("div",u2,[i.createElementVNode("div",f2,[i.createElementVNode("div",p2,[i.renderSlot(t.$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})])]),t.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",g2,[i.createElementVNode("div",m2,[i.renderSlot(t.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),t.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",y2,[i.renderSlot(t.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"default")])}}}),b2={class:"overflow-hidden transition-all duration-300"},w2={class:"text-lg font-medium leading-none"},v2={},Ih=i.defineComponent({...v2,__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(e,{emit:t}){const n=e,r=t,s=i.ref(0),o=i.ref(n.showDrawer),a=()=>{switch(vt.getDeviceTypeByResolution()){case Xe.phone:return window.innerWidth*.66;case Xe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?D.isUndefined(n.drawerWidth)?s.value=a():s.value=D.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=A.NDrawerContent,f=A.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",b2,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(f,{show:o.value,"onUpdate:show":d[0]||(d[0]=p=>o.value=p),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",w2,i.toDisplayString(c.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)}}}),k2={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},x2={key:0},C2={class:"sc-page-preview-panel grow"},S2={key:1,class:"sc-page-preview-panel-extra flex-none"},B2={},T2=i.defineComponent({...B2,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""}},setup(e,{expose:t}){const n=i.ref(!1),r=()=>{n.value=!0},s=i.useTemplateRef("panel-component-ref");return t({scrollToTopOfPanel:a=>{var l;(l=s.value)==null||l.scrollIntoView({behavior:"smooth"}),a&&i.nextTick(()=>{var c,d;window.scrollTo({top:(((d=(c=s.value)==null?void 0:c.getBoundingClientRect())==null?void 0:d.top)??0)+window.pageYOffset+a,behavior:"smooth"})})},showPanel:r}),(a,l)=>{const c=A.NButton;return i.openBlock(),i.createBlock(Ah,{title:a.title},i.createSlots({default:i.withCtx(()=>[a.$slots["preview-panel"]||a.$slots["preview-panel-extra"]||a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",k2,[a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",x2,[i.renderSlot(a.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(c,{class:"flex-none sm:px-10 sm:py-4",onClick:l[0]||(l[0]=d=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",C2,[i.renderSlot(a.$slots,"preview-panel")]),a.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",S2,[i.renderSlot(a.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Ih,{"show-drawer":n.value,"onUpdate:showDrawer":l[1]||(l[1]=d=>n.value=d),title:a.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(a.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:2},[a.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"panel-header")]),key:"0"}:void 0,a.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[a.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title")]),key:"0"}:void 0,a.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title-buttons")]),key:"1"}:void 0,a.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title-extra")]),key:"2"}:void 0]),1032,["title"])}}}),E2={},$2=i.defineComponent({...E2,__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}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>D.isArray(r.value)),a=i.computed(()=>{var u;return D.isArray(r.value)?r.value.map(g=>g.id):((u=r.value)==null?void 0:u.id)??null}),l=i.computed(()=>{var m;let u=r.showEmptyValue?[Y.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList,g=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=D.isArray(r.value)?r.value.map(_=>_.id):[(m=r.value)==null?void 0:m.id];g=D.union(g,r.managerReferenceList.filter(_=>!_.isActive).map(_=>_.id)),u=r.managerReferenceList.filter(_=>_.isActive||y.includes(_.id))}return Lt.convertReferencesToSelectOptionsList(u,!0,!0,y=>y.salesDirection.isNewRec()?y.name:`${y.name} (${y.salesDirection.name}) ${r.showActualOnly&&!y.isActive?"[Не активен, только снять выбор]":""}`,y=>g.includes(y.id)&&y.isActive)}),c=i.computed(()=>l.value.map(u=>({...u,class:r.wrapContent?`${u.class} consistent-menu-width`:u.class}))),d=i.useTemplateRef("select-component"),h=u=>{var g;if(D.isArray(u)){const m=u.length>0?u.map(y=>{var _;return(_=l.value.find(b=>b.value===y))==null?void 0:_.item}):[];s("update:value",m)}else{const m=u>0?(g=l.value.find(y=>y.value===u))==null?void 0:g.item:new Y.Manager;s("update:value",m)}};return i.watch(()=>r.disabledManagerReferenceList,u=>{if(u.length>0&&r.value){const g=o.value?r.value:[r.value];D.some(g,m=>D.some(u,["id",m.id]))&&s("update:value",g.filter(m=>!D.some(u,["id",m.id])))}},{immediate:!0}),t({focus:()=>{var u;return(u=d.value)==null?void 0:u.focusInput()},blur:()=>{var u;return(u=d.value)==null?void 0:u.blurInput()}}),(u,g)=>(i.openBlock(),i.createBlock(i.unref(A.NSelect),{ref:"select-component",value:a.value,clearable:u.clearable,disabled:l.value.length===0,"consistent-menu-width":u.consistentMenuWidth,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),N2={class:"m-0.5 flex flex-col p-0.5"},R2={class:"flex flex-row gap-1"},P2={key:0},F2={key:1},M2={key:2},A2={key:3},I2={class:"flex flex-row gap-1"},V2={key:0},O2={key:1},z2={key:2},L2={key:3},D2={},Vh=i.defineComponent({...D2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",N2,[i.createElementVNode("span",R2,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",P2,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",F2,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",M2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",A2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",I2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",V2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",O2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",z2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",L2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Go={clearable:!1,value:"",field:void 0,disabled:!1},H2={},W2=i.defineComponent({...H2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Go,minTermLength:()=>{var e;return((e=Y.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(m=>({label:m[r.field??"addressString"]??"-",value:m.id})));i.watch(()=>r.value,m=>{o.value=m}),i.watch(o,()=>{s("update:value",o.value)});const d=D.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}))},f=(m,y)=>{const _=l.value.find(b=>b.id===m.value)||{};return i.h(Vh,{addr:_,selected:y},{default:D.constant("-")})},p=m=>{d.cancel();const y=l.value.find(_=>_.id===m)||{};s("select",y)},u=i.ref(null);function g(){u.value.focus()}return t({focus:g}),(m,y)=>{const _=A.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:u,value:o.value,"onUpdate:value":[y[0]||(y[0]=b=>o.value=b),i.unref(d)],clearable:m.clearable,disabled:m.disabled,loading:a.value,options:c.value,"render-label":f,placeholder:"",onSelect:p},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),j2={class:"m-0.5 flex flex-col p-0.5"},X2={class:"font-medium"},q2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},Y2={key:0},U2={key:1},G2={},Oh=i.defineComponent({...G2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",j2,[i.createElementVNode("span",X2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",q2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",Y2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",U2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),K2={},Z2=i.defineComponent({...K2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Go,minTermLength:()=>{var e;return((e=Y.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(m=>({label:m[r.field??"_"]??"-",value:m.id})));i.watch(()=>r.value,m=>{o.value=m}),i.watch(o,()=>{s("update:value",o.value)});const d=D.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}}},f=(m,y)=>{const _=l.value.find(b=>b.id===m.value)||{};return i.h(Oh,{bank:_,selected:y},{default:D.constant("-")})},p=m=>{d.cancel();const y=l.value.find(_=>_.id===m)||{};s("select",y)},u=i.ref(null);function g(){u.value.focus()}return t({focus:g}),(m,y)=>{const _=A.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:u,value:o.value,"onUpdate:value":[y[0]||(y[0]=b=>o.value=b),i.unref(d)],clearable:m.clearable,disabled:m.disabled,loading:a.value,options:c.value,"render-label":f,placeholder:"",onSelect:p},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),J2={class:"font-medium"},Q2={key:0,class:"flex flex-row gap-2"},ek={key:0,class:"text-xs font-light text-blue-800"},tk={key:1,class:"text-sc-dark-grey text-xs font-light"},nk={},zh=i.defineComponent({...nk,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>{var s,o;return((o=(s=t.org.rawData)==null?void 0:s.state)==null?void 0:o.liquidationDate)??!1}),r=i.computed(()=>{var s,o;return((o=(s=t.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",J2,i.toDisplayString(s.org.name),1),s.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",Q2,[s.org.inn?(i.openBlock(),i.createElementBlock("span",ek,i.toDisplayString(s.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",tk,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),ik={},rk=i.defineComponent({...ik,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Go,minTermLength:()=>{var e;return((e=Y.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,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:_.state)==null?void 0:b.liquidationDate)??!1)},d=i.computed(()=>Lt.convertReferencesToSelectOptionsList(l.value,!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=D.debounce(()=>f(),800),f=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}}},p=(y,_)=>{const b=l.value.find(S=>S.id===y.value)||{};return i.h(zh,{org:b,selected:_},{default:D.constant("-")})},u=y=>{h.cancel();const _=l.value.find(b=>b.id===y)||{};(r.allowSelectTerminated||!c(_))&&s("select",_)},g=i.ref(null);function m(){g.value.focus()}return t({focus:m}),(y,_)=>{const b=A.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[_[0]||(_[0]=S=>o.value=S),i.unref(h)],clearable:y.clearable,disabled:y.disabled,loading:a.value,options:d.value,"render-label":p,placeholder:"",onSelect:u},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),sk={},ok=i.defineComponent({...sk,__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(e,{emit:t}){const n=e,r=t,s=i.ref(!1),o=()=>{r("accept",()=>{s.value=!1})},a=()=>{n.disableConfirm?o():s.value=!0};return(l,c)=>{const d=A.NButton,h=A.NPopover,f=A.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(h,{disabled:l.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:l.disabled,ghost:l.ghost,loading:l.loading,size:l.size,type:l.type,quaternary:l.quaternary,circle:l.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(l.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(f,{show:s.value,"onUpdate:show":c[1]||(c[1]=p=>s.value=p),content:l.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:l.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,__:[2]}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=p=>s.value=!1)},{default:i.withCtx(()=>c[3]||(c[3]=[i.createTextVNode(" Отмена ")])),_:1,__:[3]})]),_:1},8,["show","content","title"])])}}}),ak={key:0,class:"whitespace-pre-line"},lk={key:1,class:"text-sc-dark-grey"},ck={},dk=i.defineComponent({...ck,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(e,{emit:t}){const n=e,r=t,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=A.NInput;return i.openBlock(),i.createBlock(Oc,{disabled:l.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[l.comment?(i.openBlock(),i.createElementBlock("span",ak,i.toDisplayString(l.comment),1)):(i.openBlock(),i.createElementBlock("span",lk," - Комментарий отсутствует - "))])]),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"])}}}),hk={key:0,class:"text-sm"},uk={key:1},fk={},pk=i.defineComponent({...fk,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{let r="";return(t.showLabel??!1)&&(t.debt>0?r="Переплата: ":t.debt<0&&(r="Задолженность: ")),r});return(r,s)=>(i.openBlock(),i.createElementBlock("span",null,[r.wrapAsSmall&&r.debt!==0?(i.openBlock(),i.createElementBlock("span",hk,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":r.debt>0,"text-red-700":r.debt<0})},i.toDisplayString(r.debt)+" ₽ ",3)])):i.createCommentVNode("",!0),!r.wrapAsSmall&&r.debt!==0?(i.openBlock(),i.createElementBlock("span",uk,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":r.debt>0,"text-red-700":r.debt<0})},i.toDisplayString(r.debt)+" ₽ ",3)])):i.createCommentVNode("",!0)]))}}),gk={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function mk(e,t){return i.openBlock(),i.createElementBlock("svg",gk,t[0]||(t[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 yk=i.markRaw({name:"ion-warning",render:mk}),_k={},bk=i.defineComponent({..._k,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(e){return(t,n)=>{const r=yk,s=A.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"])}}}),wt=class wt{static init(t,n){wt.messagesService&&wt.notificationsService||(wt.messagesService=t,wt.notificationsService=n)}static getMessagesService(){if(!wt.messagesService)throw new Error("UI provider is not initialized.");return wt.messagesService}static getNotificationsService(){if(!wt.notificationsService)throw new Error("UI provider is not initialized.");return wt.notificationsService}static showNotificationsForErrorResponseData(t,n={}){var r,s;if(D.isEmpty(t.errors)){const o=(s=(r=t.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";wt.notificationsService?wt.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:t.message,meta:`#${t.status}${a}: ${t.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",t)}else for(const o in t.errors)Object.prototype.hasOwnProperty.call(n,o)?n[o]=new Y.FieldValidationResultData(t.errors[o].toString(),"error"):wt.messagesService?wt.messagesService.error(t.errors[o].toString()):console.log("Show notification error response data: UI provider is not initialized.",t.errors[o])}};C(wt,"messagesService"),C(wt,"notificationsService");let Ko=wt;const wk=i.computed(()=>Y.useReferencesStore().deliveryTypeReference??[]),vk=i.computed(()=>Y.useReferencesStore().managersList??[]),kk=i.computed(()=>Y.useReferencesStore().opfReference??[]),xk=i.computed(()=>Y.useReferencesStore().partnerGroupsReference??[]),Ck=i.computed(()=>Y.useReferencesStore().priceCoefficientsReference??[]),Sk=i.computed(()=>Y.useReferencesStore().productFilesTypesReference??[]),Bk=i.computed(()=>Y.useReferencesStore().resourceTypesReference),Tk=i.computed(()=>Y.useReferencesStore().salesDirectionsReference??[]),Ek=i.computed(()=>Y.useReferencesStore().warehousesReference??[]),$k=i.computed(()=>Lt.convertReferencesToSelectOptionsList(Y.useReferencesStore().channelPrimaryInterestsReference??[],!0,!0)),Nk=i.computed(()=>Lt.convertReferencesToSelectOptionsList(Y.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!0)),Rk=e=>Y.HttpRequester.getInstance(Y.ReferenceDataProvider).searchCity(e),Pk=e=>Lt.convertReferencesToSelectOptionsList(e,!0,!1,t=>{var n,r,s;return t!=null&&t.isNewRec()?"-":`${t.name}, ${(n=t==null?void 0:t.region)==null?void 0:n.name}, ${(s=(r=t==null?void 0:t.region)==null?void 0:r.country)==null?void 0:s.name}`},t=>t==null?void 0:t.isNewRec());L.ConfiguratorSettingsKozyrek=s0,L.ContentHelper=Wn,L.KozyrekLine=si,L.KozyrekTailTemplate=co,L.KozyrekTemplate=Mi,L.OrdersTableFields=Ge,L.Point=lo,L.ScAddProductToCartForm=zf,L.ScAddressSuggestion=W2,L.ScAddressSuggestionLabel=Vh,L.ScBankSuggestion=Z2,L.ScBankSuggestionLabel=Oh,L.ScBaseDialog=cy,L.ScButtonWithConfirmAction=ok,L.ScCategoryCollapse=Ca,L.ScClientNameWithShortInfo=Tr,L.ScCollapse=xa,L.ScCollapseItem=_a,L.ScCommentEditor=dk,L.ScConfiguratorsProductInfo=Ui,L.ScContragentWithShortInfo=Ba,L.ScDateRange=Z0,L.ScDateTimeLabel=uo,L.ScDebouncedInput=Ey,L.ScDebouncedInputNumber=Ai,L.ScDebt=pk,L.ScDialogHeader=sy,L.ScEmail=rp,L.ScExternalLink=Oy,L.ScImageGallery=ka,L.ScInlineEditableItem=Oc,L.ScInlineView=fo,L.ScKozyrekConfigurator=r0,L.ScKozyrekConfiguratorParamsForm=Ma,L.ScKozyrekConfiguratorPreview=Rc,L.ScKozyrekConfiguratorTemplates=Ra,L.ScLightGallery=va,L.ScManagerSelect=$2,L.ScMetalForDoorsConfigurator=h0,L.ScMetalForDoorsConfiguratorForm=Pc,L.ScMosquitoConfigurator=A0,L.ScMosquitoConfiguratorForm=Fc,L.ScMosquitoConfiguratorMeasurementInstructions=Mc,L.ScMosquitoConfiguratorPreview=ho,L.ScOrderCommonInfo=$h,L.ScOrderDeliveryLabel=ks,L.ScOrderDetails=Fh,L.ScOrderInfo=Mh,L.ScOrderItemsList=Ph,L.ScOrderPayment=Nh,L.ScOrderProductInfo=Rh,L.ScOrdersList=a2,L.ScOrgSuggestion=rk,L.ScOrgSuggestionLabel=zh,L.ScPage=Ah,L.ScPageWithSlidingPanel=T2,L.ScPersonContactsBlock=Up,L.ScPhone=Ep,L.ScPhoneInput=Ry,L.ScProductName=Yi,L.ScProductsList=uv,L.ScReferenceSelect=Sa,L.ScSearchableProductSelect=Eh,L.ScSearchableReferenceSelect=Th,L.ScSetClientPriceFormItem=Hf,L.ScShortTextOrderInfo=h2,L.ScSingleFileUploadSelector=py,L.ScSlidingContentWithDrawer=Ih,L.ScStripConfigurator=q0,L.ScStripConfiguratorForm=Ic,L.ScStripConfiguratorLineItem=Ac,L.ScStripConfiguratorPreview=Vc,L.ScUserShortInfo=Uo,L.ScWarningIcon=bk,L.SelectOptionHelper=Lt,L.UiNotificationProvider=Ko,L.WindowResolutionEnum=Xe,L.WindowResolutionProvider=vt,L.channelPrimaryInterestOptionsList=$k,L.componentSizeInjectionKey=xr,L.deliveryTypeReferenceList=wk,L.managersReferenceList=vk,L.naiveUiTheme=Su,L.opfReferenceList=kk,L.partnerGroupReferenceList=xk,L.priceCoefficientsReferenceList=Ck,L.productFilesTypesReferenceList=Sk,L.renderConfig=Ve,L.resourceReferencesList=Bk,L.salesDirectionsReferenceList=Tk,L.searchCityReferenceDataHandler=Rk,L.searchCityReferenceLabelRenderer=Pk,L.sourcePrimaryInterestOptionsList=Nk,L.warehousesReferenceList=Ek,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
824
824
  //# sourceMappingURL=sc-vue-ui-lib.umd.cjs.map