@snabcentr/vue-ui-lib 2.15.2 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manifest.json +2 -2
- package/dist/release_notes.tmp +2 -6
- package/dist/sc-vue-ui-lib.css +1 -1
- package/dist/sc-vue-ui-lib.js +1732 -1741
- package/dist/sc-vue-ui-lib.js.map +1 -1
- package/dist/sc-vue-ui-lib.umd.cjs +74 -74
- package/dist/sc-vue-ui-lib.umd.cjs.map +1 -1
- package/dist/src/components/contacts/email.vue.d.ts +1 -1
- package/dist/src/components/debt.vue.d.ts +2 -2
- package/dist/src/providers/ui-provider/ui-provider.d.ts +1 -2
- package/dist/src/window/index.d.ts +0 -1
- package/dist/tailwind.config.js +20 -0
- package/package.json +3 -2
- package/dist/src/window/enums/index.d.ts +0 -1
- package/dist/src/window/enums/window-resolution-enum.d.ts +0 -17
@@ -1,4 +1,4 @@
|
|
1
|
-
(function(j,W){typeof exports=="object"&&typeof module<"u"?W(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"],W):(j=typeof globalThis<"u"?globalThis:j||self,W(j.SC_VueUiLib={},j["lodash-es"],j.Vue,j["naive-ui"],j["@snabcentr/common-lib"],j["date-fns"],j["libphonenumber-js"],j["vue-tel-input"]))})(this,function(j,W,i,V,te,Bn,ji,Lh){"use strict";var gk=Object.defineProperty;var Vh=j=>{throw TypeError(j)};var mk=(j,W,i)=>W in j?gk(j,W,{enumerable:!0,configurable:!0,writable:!0,value:i}):j[W]=i;var k=(j,W,i)=>mk(j,typeof W!="symbol"?W+"":W,i),zh=(j,W,i)=>W.has(j)||Vh("Cannot "+i);var xt=(j,W,i)=>(zh(j,W,"read from private field"),i?i.call(j):W.get(j)),ua=(j,W,i)=>W.has(j)?Vh("Cannot add the same private member more than once"):W instanceof WeakSet?W.add(j):W.set(j,i),Ih=(j,W,i,V)=>(zh(j,W,"write to private field"),V?V.call(j,i):W.set(j,i),i);var gi,st,ks;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||{});class Ln{static isVnodeEmpty(t){return t.every(n=>n.type===i.Comment||n.type===i.Text&&W.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&Ln.isVnodeEmpty(n.children))}static hasSlotContent(t){return t?!Ln.isVnodeEmpty(t()):!1}}class cn{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 cn.convertReferencesToOptionsList(t,n,r,s,o)}static convertReferencesToAutocompleteOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return cn.convertReferencesToOptionsList(t,n,r,s,o)}}const Dh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Hh(e,t){return i.openBlock(),i.createElementBlock("svg",Dh,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 fa=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Hh}),Wh={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jh(e,t){return i.openBlock(),i.createElementBlock("svg",Wh,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 pa=i.markRaw({name:"tabler-edit",render:jh}),Xh={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function qh(e,t){return i.openBlock(),i.createElementBlock("svg",Xh,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 Yh=i.markRaw({name:"fluent-pin32-regular",render:qh}),Uh={viewBox:"0 0 512 512",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:"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 Kh=i.markRaw({name:"ion-eye-outline",render:Gh}),Zh={viewBox:"0 0 32 32",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:"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 Qh=i.markRaw({name:"fluent-pin32-filled",render:Jh}),eu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tu(e,t){return i.openBlock(),i.createElementBlock("svg",eu,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 ga=i.markRaw({name:"ion-cart-outline",render:tu}),nu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function iu(e,t){return i.openBlock(),i.createElementBlock("svg",nu,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 ru=i.markRaw({name:"ion-bookmark-outline",render:iu}),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:"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 au=i.markRaw({name:"ion-eye-off-sharp",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:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)]))}const du=i.markRaw({name:"ion-chevron-forward-outline",render:cu}),hu=["data-name"],uu={class:"sc-collapse-item-header flex flex-row gap-2.5"},fu={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},pu={key:0},gu={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},mu={class:"flex flex-1 flex-col"},_u={key:0,class:"sc-collapse-item-sub-title flex-1"},yu={key:1,class:"sc-collapse-item-title-extra flex-none"},bu={key:0,class:"sc-collapse-item-content"},wu={},vu=i.defineComponent({...wu,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(e,{emit:t}){const n=e,r=t,s=i.inject("itemHeaderClickHandler",W.noop),o=i.inject("defaultExpandedNames",[]),a=i.inject("expandedNames",[]),l=W.some(o,u=>u===n.name),c=i.computed(()=>W.some(a,u=>u===n.name)),d=i.ref(l),h=()=>{n.disabled||(d.value=c.value||!d.value,r("header:click",n.name,d.value),s(n.name,d.value))};return(u,f)=>{const p=du;return i.openBlock(),i.createElementBlock("div",{"data-name":u.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":u.disabled})},[i.createElementVNode("div",uu,[i.createElementVNode("div",fu,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":d.value}),onClick:h},[i.renderSlot(u.$slots,"arrow",{},()=>[i.createVNode(p)],!0)],2)]),i.unref(Ln).hasSlotContent(u.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",pu,[i.createElementVNode("div",gu,[i.renderSlot(u.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",mu,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(u.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(u.title),1)],!0)]),i.unref(Ln).hasSlotContent(u.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",_u,[i.renderSlot(u.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(Ln).hasSlotContent(u.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",yu,[i.renderSlot(u.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[c.value||d.value?(i.openBlock(),i.createElementBlock("div",bu,[i.renderSlot(u.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,hu)}}}),Dn=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},ma=Dn(vu,[["__scopeId","data-v-a72ddc14"]]),kr=Symbol(),ku={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"}},xu={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Cu={},_a=i.defineComponent({...Cu,__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(kr,"medium"),r=i.computed(()=>W.isNil(t.productContextButtonsConfig)?[]:W.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=ga,h=V.NButton,u=V.NTooltip,f=pa,p=fa,g=V.NDropdown;return i.openBlock(),i.createElementBlock("div",xu,[(i.unref(W.isFunction)(l.showProductAddToCartButton)?l.showProductAddToCartButton(l.product):l.showProductAddToCartButton)?(i.openBlock(),i.createBlock(u,{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(W.isFunction)(l.showProductEditButton)?l.showProductEditButton(l.product):l.showProductEditButton)?(i.openBlock(),i.createBlock(u,{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(f)]),_: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(p)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Su={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Bu(e,t){return i.openBlock(),i.createElementBlock("svg",Su,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 Tu=i.markRaw({name:"tabler-history",render:Bu}),Eu={class:"flex flex-row gap-1"},$u={key:0,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600 xl:text-base"},Nu={},xr=i.defineComponent({...Nu,__name:"product-cost",props:{product:{},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}},setup(e){const t=e,n=i.computed(()=>W.find(t.product.priceCoefficients,["coefficient.slug",t.costFieldName])),r=i.computed(()=>n.value?n.value.cost:W.get(t.product,t.costFieldName)),s=i.computed(()=>t.product.costDate?Bn.format(t.product.costDate,te.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),o=i.computed(()=>(W.isFunction(t.allowPriceClick)?t.allowPriceClick(t.product):t.allowPriceClick)&&!W.isNil(r.value)),a=i.computed(()=>W.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)));return(l,c)=>{var f;const d=V.NTag,h=V.NTooltip,u=Tu;return i.openBlock(),i.createElementBlock("div",Eu,[l.showTag?(i.openBlock(),i.createBlock(h,{key:0},{trigger:i.withCtx(()=>[i.createVNode(d,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!n.value}])},{default:i.withCtx(()=>{var p;return[i.createTextVNode(i.toDisplayString(((p=n.value)==null?void 0:p.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var p;return[i.createTextVNode(" "+i.toDisplayString(((p=n.value)==null?void 0:p.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base xl:text-lg",{"text-gray-600":(f=n.value)==null?void 0:f.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":o.value&&l.eventEmitter}),onClick:c[0]||(c[0]=()=>{var p;o.value&&((p=l.eventEmitter)==null||p.emit("cost:click",{product:l.product,cost:r.value}))})},i.toDisplayString(a.value),3),i.createTextVNode(" "+i.toDisplayString(l.showQuantityUnit?` ${l.product.currency}/${l.product.quantityUnit}`:""),1)],2),l.showCostDate&&!i.unref(W.isNil)(s.value)?(i.openBlock(),i.createElementBlock("span",$u,[i.createTextVNode(i.toDisplayString(s.value)+" ",1),l.showPriceHistory&&l.eventEmitter?(i.openBlock(),i.createBlock(h,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(u,{class:"cursor-pointer",onClick:c[1]||(c[1]=p=>{var g;return(g=l.eventEmitter)==null?void 0:g.emit("cost:show-price-history",{product:l.product})})})]),default:i.withCtx(()=>[c[2]||(c[2]=i.createTextVNode(" История цен "))]),_:1,__:[2]})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Pu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ru(e,t){return i.openBlock(),i.createElementBlock("svg",Pu,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 Ss=i.markRaw({name:"ion-information-circle-outline",render:Ru}),Fu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Mu(e,t){return i.openBlock(),i.createElementBlock("svg",Fu,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 ya=i.markRaw({name:"ion-images",render:Mu});/*!
|
1
|
+
(function(q,W){typeof exports=="object"&&typeof module<"u"?W(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"],W):(q=typeof globalThis<"u"?globalThis:q||self,W(q.SC_VueUiLib={},q["lodash-es"],q.Vue,q["naive-ui"],q["@snabcentr/common-lib"],q["date-fns"],q["libphonenumber-js"],q["vue-tel-input"]))})(this,function(q,W,i,V,G,Sn,Wi,Ih){"use strict";var _k=Object.defineProperty;var Oh=q=>{throw TypeError(q)};var yk=(q,W,i)=>W in q?_k(q,W,{enumerable:!0,configurable:!0,writable:!0,value:i}):q[W]=i;var k=(q,W,i)=>yk(q,typeof W!="symbol"?W+"":W,i),Vh=(q,W,i)=>W.has(q)||Oh("Cannot "+i);var kt=(q,W,i)=>(Vh(q,W,"read from private field"),i?i.call(q):W.get(q)),ha=(q,W,i)=>W.has(q)?Oh("Cannot add the same private member more than once"):W instanceof WeakSet?W.add(q):W.set(q,i),zh=(q,W,i,V)=>(Vh(q,W,"write to private field"),V?V.call(q,i):W.set(q,i),i);var pi,rt,vs;var Ue=(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))(Ue||{});class In{static isVnodeEmpty(t){return t.every(n=>n.type===i.Comment||n.type===i.Text&&W.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&In.isVnodeEmpty(n.children))}static hasSlotContent(t){return t?!In.isVnodeEmpty(t()):!1}}class ln{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 ln.convertReferencesToOptionsList(t,n,r,s,o)}static convertReferencesToAutocompleteOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return ln.convertReferencesToOptionsList(t,n,r,s,o)}}const Lh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Dh(e,t){return i.openBlock(),i.createElementBlock("svg",Lh,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 ua=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Dh}),Hh={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Wh(e,t){return i.openBlock(),i.createElementBlock("svg",Hh,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 fa=i.markRaw({name:"tabler-edit",render:Wh}),jh={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Xh(e,t){return i.openBlock(),i.createElementBlock("svg",jh,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 qh=i.markRaw({name:"fluent-pin32-regular",render:Xh}),Yh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Uh(e,t){return i.openBlock(),i.createElementBlock("svg",Yh,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 Gh=i.markRaw({name:"ion-eye-outline",render:Uh}),Kh={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Zh(e,t){return i.openBlock(),i.createElementBlock("svg",Kh,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 Jh=i.markRaw({name:"fluent-pin32-filled",render:Zh}),Qh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function eu(e,t){return i.openBlock(),i.createElementBlock("svg",Qh,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 pa=i.markRaw({name:"ion-cart-outline",render:eu}),tu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function nu(e,t){return i.openBlock(),i.createElementBlock("svg",tu,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 iu=i.markRaw({name:"ion-bookmark-outline",render:nu}),ru={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function su(e,t){return i.openBlock(),i.createElementBlock("svg",ru,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 ou=i.markRaw({name:"ion-eye-off-sharp",render:su}),au={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lu(e,t){return i.openBlock(),i.createElementBlock("svg",au,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 cu=i.markRaw({name:"ion-chevron-forward-outline",render:lu}),du=["data-name"],hu={class:"sc-collapse-item-header flex flex-row gap-2.5"},uu={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},fu={key:0},pu={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},gu={class:"flex flex-1 flex-col"},mu={key:0,class:"sc-collapse-item-sub-title flex-1"},_u={key:1,class:"sc-collapse-item-title-extra flex-none"},yu={key:0,class:"sc-collapse-item-content"},bu={},wu=i.defineComponent({...bu,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(e,{emit:t}){const n=e,r=t,s=i.inject("itemHeaderClickHandler",W.noop),o=i.inject("defaultExpandedNames",[]),a=i.inject("expandedNames",[]),l=W.some(o,u=>u===n.name),c=i.computed(()=>W.some(a,u=>u===n.name)),d=i.ref(l),h=()=>{n.disabled||(d.value=c.value||!d.value,r("header:click",n.name,d.value),s(n.name,d.value))};return(u,f)=>{const p=cu;return i.openBlock(),i.createElementBlock("div",{"data-name":u.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":u.disabled})},[i.createElementVNode("div",hu,[i.createElementVNode("div",uu,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":d.value}),onClick:h},[i.renderSlot(u.$slots,"arrow",{},()=>[i.createVNode(p)],!0)],2)]),i.unref(In).hasSlotContent(u.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",fu,[i.createElementVNode("div",pu,[i.renderSlot(u.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",gu,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(u.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(u.title),1)],!0)]),i.unref(In).hasSlotContent(u.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",mu,[i.renderSlot(u.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(In).hasSlotContent(u.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",_u,[i.renderSlot(u.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[c.value||d.value?(i.openBlock(),i.createElementBlock("div",yu,[i.renderSlot(u.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,du)}}}),Ln=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},ga=Ln(wu,[["__scopeId","data-v-a72ddc14"]]),vr=Symbol(),vu={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"}},ku={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},xu={},ma=i.defineComponent({...xu,__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(vr,"medium"),r=i.computed(()=>W.isNil(t.productContextButtonsConfig)?[]:W.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=pa,h=V.NButton,u=V.NTooltip,f=fa,p=ua,g=V.NDropdown;return i.openBlock(),i.createElementBlock("div",ku,[(i.unref(W.isFunction)(l.showProductAddToCartButton)?l.showProductAddToCartButton(l.product):l.showProductAddToCartButton)?(i.openBlock(),i.createBlock(u,{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(W.isFunction)(l.showProductEditButton)?l.showProductEditButton(l.product):l.showProductEditButton)?(i.openBlock(),i.createBlock(u,{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(f)]),_: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(p)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Cu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Su(e,t){return i.openBlock(),i.createElementBlock("svg",Cu,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 Bu=i.markRaw({name:"tabler-history",render:Su}),Tu={class:"flex flex-row gap-1"},Eu={key:0,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},$u={},kr=i.defineComponent({...$u,__name:"product-cost",props:{product:{},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}},setup(e){const t=e,n=i.computed(()=>W.find(t.product.priceCoefficients,["coefficient.slug",t.costFieldName])),r=i.computed(()=>n.value?n.value.cost:W.get(t.product,t.costFieldName)),s=i.computed(()=>t.product.costDate?Sn.format(t.product.costDate,G.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),o=i.computed(()=>(W.isFunction(t.allowPriceClick)?t.allowPriceClick(t.product):t.allowPriceClick)&&!W.isNil(r.value)),a=i.computed(()=>W.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)));return(l,c)=>{var f;const d=V.NTag,h=V.NTooltip,u=Bu;return i.openBlock(),i.createElementBlock("div",Tu,[l.showTag?(i.openBlock(),i.createBlock(h,{key:0},{trigger:i.withCtx(()=>[i.createVNode(d,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!n.value}])},{default:i.withCtx(()=>{var p;return[i.createTextVNode(i.toDisplayString(((p=n.value)==null?void 0:p.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var p;return[i.createTextVNode(" "+i.toDisplayString(((p=n.value)==null?void 0:p.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(f=n.value)==null?void 0:f.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":o.value&&l.eventEmitter}),onClick:c[0]||(c[0]=()=>{var p;o.value&&((p=l.eventEmitter)==null||p.emit("cost:click",{product:l.product,cost:r.value}))})},i.toDisplayString(a.value),3),i.createTextVNode(" "+i.toDisplayString(l.showQuantityUnit?` ${l.product.currency}/${l.product.quantityUnit}`:""),1)],2),l.showCostDate&&!i.unref(W.isNil)(s.value)?(i.openBlock(),i.createElementBlock("span",Eu,[i.createTextVNode(i.toDisplayString(s.value)+" ",1),l.showPriceHistory&&l.eventEmitter?(i.openBlock(),i.createBlock(h,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(u,{class:"cursor-pointer",onClick:c[1]||(c[1]=p=>{var g;return(g=l.eventEmitter)==null?void 0:g.emit("cost:show-price-history",{product:l.product})})})]),default:i.withCtx(()=>[c[2]||(c[2]=i.createTextVNode(" История цен "))]),_:1,__:[2]})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Nu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Pu(e,t){return i.openBlock(),i.createElementBlock("svg",Nu,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 Cs=i.markRaw({name:"ion-information-circle-outline",render:Pu}),Ru={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Fu(e,t){return i.openBlock(),i.createElementBlock("svg",Ru,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 _a=i.markRaw({name:"ion-images",render:Fu});/*!
|
2
2
|
* lightgallery | 2.8.3 | March 1st 2025
|
3
3
|
* http://www.lightgalleryjs.com/
|
4
4
|
* Copyright (c) 2020 Sachin Neravath;
|
@@ -16,10 +16,10 @@
|
|
16
16
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
17
17
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
18
18
|
PERFORMANCE OF THIS SOFTWARE.
|
19
|
-
***************************************************************************** */var
|
19
|
+
***************************************************************************** */var xr=function(){return xr=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},xr.apply(this,arguments)},Mu={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",alignThumbnails:"middle",thumbWidth:100,thumbHeight:"80px",thumbMargin:5,appendThumbnailsTo:".lg-components",toggleThumb:!1,enableThumbDrag:!0,enableThumbSwipe:!0,thumbnailSwipeThreshold:10,loadYouTubeThumbnail:!0,youTubeThumbSize:1,thumbnailPluginStrings:{toggleThumbnails:"Toggle thumbnails"}},ji={containerResize:"lgContainerResize",updateSlides:"lgUpdateSlides",beforeOpen:"lgBeforeOpen",beforeSlide:"lgBeforeSlide"},Au=function(){function e(t,n){return this.thumbOuterWidth=0,this.thumbTotalWidth=0,this.translateX=0,this.thumbClickable=!1,this.core=t,this.$LG=n,this}return e.prototype.init=function(){this.settings=xr(xr({},Mu),this.core.settings),this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.galleryItems.length*(this.settings.thumbWidth+this.settings.thumbMargin),this.translateX=0,this.setAnimateThumbStyles(),this.core.settings.allowMediaOverlap||(this.settings.toggleThumb=!1),this.settings.thumbnail&&(this.build(),this.settings.animateThumb?(this.settings.enableThumbDrag&&this.enableThumbDrag(),this.settings.enableThumbSwipe&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toggleThumbBar(),this.thumbKeyPress())},e.prototype.build=function(){var t=this;this.setThumbMarkup(),this.manageActiveClassOnSlideChange(),this.$lgThumb.first().on("click.lg touchend.lg",function(n){var r=t.$LG(n.target);r.hasAttribute("data-lg-item-id")&&setTimeout(function(){if(t.thumbClickable&&!t.core.lgBusy){var s=parseInt(r.attr("data-lg-item-id"));t.core.slide(s,!1,!0,!1)}},50)}),this.core.LGel.on(ji.beforeSlide+".thumb",function(n){var r=n.detail.index;t.animateThumb(r)}),this.core.LGel.on(ji.beforeOpen+".thumb",function(){t.thumbOuterWidth=t.core.outer.get().offsetWidth}),this.core.LGel.on(ji.updateSlides+".thumb",function(){t.rebuildThumbnails()}),this.core.LGel.on(ji.containerResize+".thumb",function(){t.core.lgOpened&&setTimeout(function(){t.thumbOuterWidth=t.core.outer.get().offsetWidth,t.animateThumb(t.core.index),t.thumbOuterWidth=t.core.outer.get().offsetWidth},50)})},e.prototype.setThumbMarkup=function(){var t="lg-thumb-outer ";this.settings.alignThumbnails&&(t+="lg-thumb-align-"+this.settings.alignThumbnails);var n='<div class="'+t+`">
|
20
20
|
<div class="lg-thumb lg-group">
|
21
21
|
</div>
|
22
|
-
</div>`;this.core.outer.addClass("lg-has-thumb"),this.settings.appendThumbnailsTo===".lg-components"?this.core.$lgComponents.append(n):this.core.outer.append(n),this.$thumbOuter=this.core.outer.find(".lg-thumb-outer").first(),this.$lgThumb=this.core.outer.find(".lg-thumb").first(),this.settings.animateThumb&&this.core.outer.find(".lg-thumb").css("transition-duration",this.core.settings.speed+"ms").css("width",this.thumbTotalWidth+"px").css("position","relative"),this.setThumbItemHtml(this.core.galleryItems)},e.prototype.enableThumbDrag=function(){var t=this,n={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0},r=!1;this.$thumbOuter.addClass("lg-grab"),this.core.outer.find(".lg-thumb").first().on("mousedown.lg.thumb",function(s){t.thumbTotalWidth>t.thumbOuterWidth&&(s.preventDefault(),n.cords.startX=s.pageX,n.startTime=new Date,t.thumbClickable=!1,r=!0,t.core.outer.get().scrollLeft+=1,t.core.outer.get().scrollLeft-=1,t.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))}),this.$LG(window).on("mousemove.lg.thumb.global"+this.core.lgId,function(s){t.core.lgOpened&&r&&(n.cords.endX=s.pageX,n=t.onThumbTouchMove(n))}),this.$LG(window).on("mouseup.lg.thumb.global"+this.core.lgId,function(){t.core.lgOpened&&(n.isMoved?n=t.onThumbTouchEnd(n):t.thumbClickable=!0,r&&(r=!1,t.$thumbOuter.removeClass("lg-grabbing").addClass("lg-grab")))})},e.prototype.enableThumbSwipe=function(){var t=this,n={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0};this.$lgThumb.on("touchstart.lg",function(r){t.thumbTotalWidth>t.thumbOuterWidth&&(r.preventDefault(),n.cords.startX=r.targetTouches[0].pageX,t.thumbClickable=!1,n.startTime=new Date)}),this.$lgThumb.on("touchmove.lg",function(r){t.thumbTotalWidth>t.thumbOuterWidth&&(r.preventDefault(),n.cords.endX=r.targetTouches[0].pageX,n=t.onThumbTouchMove(n))}),this.$lgThumb.on("touchend.lg",function(){n.isMoved?n=t.onThumbTouchEnd(n):t.thumbClickable=!0})},e.prototype.rebuildThumbnails=function(){var t=this;this.$thumbOuter.addClass("lg-rebuilding-thumbnails"),setTimeout(function(){t.thumbTotalWidth=t.core.galleryItems.length*(t.settings.thumbWidth+t.settings.thumbMargin),t.$lgThumb.css("width",t.thumbTotalWidth+"px"),t.$lgThumb.empty(),t.setThumbItemHtml(t.core.galleryItems),t.animateThumb(t.core.index)},50),setTimeout(function(){t.$thumbOuter.removeClass("lg-rebuilding-thumbnails")},200)},e.prototype.setTranslate=function(t){this.$lgThumb.css("transform","translate3d(-"+t+"px, 0px, 0px)")},e.prototype.getPossibleTransformX=function(t){return t>this.thumbTotalWidth-this.thumbOuterWidth&&(t=this.thumbTotalWidth-this.thumbOuterWidth),t<0&&(t=0),t},e.prototype.animateThumb=function(t){if(this.$lgThumb.css("transition-duration",this.core.settings.speed+"ms"),this.settings.animateThumb){var n=0;switch(this.settings.currentPagerPosition){case"left":n=0;break;case"middle":n=this.thumbOuterWidth/2-this.settings.thumbWidth/2;break;case"right":n=this.thumbOuterWidth-this.settings.thumbWidth}this.translateX=(this.settings.thumbWidth+this.settings.thumbMargin)*t-1-n,this.translateX>this.thumbTotalWidth-this.thumbOuterWidth&&(this.translateX=this.thumbTotalWidth-this.thumbOuterWidth),this.translateX<0&&(this.translateX=0),this.setTranslate(this.translateX)}},e.prototype.onThumbTouchMove=function(t){return t.newTranslateX=this.translateX,t.isMoved=!0,t.touchMoveTime=new Date().valueOf(),t.newTranslateX-=t.cords.endX-t.cords.startX,t.newTranslateX=this.getPossibleTransformX(t.newTranslateX),this.setTranslate(t.newTranslateX),this.$thumbOuter.addClass("lg-dragging"),t},e.prototype.onThumbTouchEnd=function(t){t.isMoved=!1,t.endTime=new Date,this.$thumbOuter.removeClass("lg-dragging");var n=t.endTime.valueOf()-t.startTime.valueOf(),r=t.cords.endX-t.cords.startX,s=Math.abs(r)/n;return s>.15&&t.endTime.valueOf()-t.touchMoveTime<30?(s+=1,s>2&&(s+=1),s=s+s*(Math.abs(r)/this.thumbOuterWidth),this.$lgThumb.css("transition-duration",Math.min(s-1,2)+"settings"),r=r*s,this.translateX=this.getPossibleTransformX(this.translateX-r),this.setTranslate(this.translateX)):this.translateX=t.newTranslateX,Math.abs(t.cords.endX-t.cords.startX)<this.settings.thumbnailSwipeThreshold&&(this.thumbClickable=!0),t},e.prototype.getThumbHtml=function(t,n,r){var s=this.core.galleryItems[n].__slideVideoInfo||{},o;s.youtube&&this.settings.loadYouTubeThumbnail?o="//img.youtube.com/vi/"+s.youtube[1]+"/"+this.settings.youTubeThumbSize+".jpg":o=t;var a=document.createElement("div");a.setAttribute("data-lg-item-id",n+""),a.className="lg-thumb-item "+(n===this.core.index?"active":""),a.style.cssText="width: "+this.settings.thumbWidth+"px; height: "+this.settings.thumbHeight+"; margin-right: "+this.settings.thumbMargin+"px;";var l=document.createElement("img");return l.alt=r||"",l.setAttribute("data-lg-item-id",n+""),l.src=o,a.appendChild(l),a},e.prototype.setThumbItemHtml=function(t){for(var n=0;n<t.length;n++){var r=this.getThumbHtml(t[n].thumb,n,t[n].alt);this.$lgThumb.append(r)}},e.prototype.setAnimateThumbStyles=function(){this.settings.animateThumb&&this.core.outer.addClass("lg-animate-thumb")},e.prototype.manageActiveClassOnSlideChange=function(){var t=this;this.core.LGel.on(
|
22
|
+
</div>`;this.core.outer.addClass("lg-has-thumb"),this.settings.appendThumbnailsTo===".lg-components"?this.core.$lgComponents.append(n):this.core.outer.append(n),this.$thumbOuter=this.core.outer.find(".lg-thumb-outer").first(),this.$lgThumb=this.core.outer.find(".lg-thumb").first(),this.settings.animateThumb&&this.core.outer.find(".lg-thumb").css("transition-duration",this.core.settings.speed+"ms").css("width",this.thumbTotalWidth+"px").css("position","relative"),this.setThumbItemHtml(this.core.galleryItems)},e.prototype.enableThumbDrag=function(){var t=this,n={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0},r=!1;this.$thumbOuter.addClass("lg-grab"),this.core.outer.find(".lg-thumb").first().on("mousedown.lg.thumb",function(s){t.thumbTotalWidth>t.thumbOuterWidth&&(s.preventDefault(),n.cords.startX=s.pageX,n.startTime=new Date,t.thumbClickable=!1,r=!0,t.core.outer.get().scrollLeft+=1,t.core.outer.get().scrollLeft-=1,t.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))}),this.$LG(window).on("mousemove.lg.thumb.global"+this.core.lgId,function(s){t.core.lgOpened&&r&&(n.cords.endX=s.pageX,n=t.onThumbTouchMove(n))}),this.$LG(window).on("mouseup.lg.thumb.global"+this.core.lgId,function(){t.core.lgOpened&&(n.isMoved?n=t.onThumbTouchEnd(n):t.thumbClickable=!0,r&&(r=!1,t.$thumbOuter.removeClass("lg-grabbing").addClass("lg-grab")))})},e.prototype.enableThumbSwipe=function(){var t=this,n={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0};this.$lgThumb.on("touchstart.lg",function(r){t.thumbTotalWidth>t.thumbOuterWidth&&(r.preventDefault(),n.cords.startX=r.targetTouches[0].pageX,t.thumbClickable=!1,n.startTime=new Date)}),this.$lgThumb.on("touchmove.lg",function(r){t.thumbTotalWidth>t.thumbOuterWidth&&(r.preventDefault(),n.cords.endX=r.targetTouches[0].pageX,n=t.onThumbTouchMove(n))}),this.$lgThumb.on("touchend.lg",function(){n.isMoved?n=t.onThumbTouchEnd(n):t.thumbClickable=!0})},e.prototype.rebuildThumbnails=function(){var t=this;this.$thumbOuter.addClass("lg-rebuilding-thumbnails"),setTimeout(function(){t.thumbTotalWidth=t.core.galleryItems.length*(t.settings.thumbWidth+t.settings.thumbMargin),t.$lgThumb.css("width",t.thumbTotalWidth+"px"),t.$lgThumb.empty(),t.setThumbItemHtml(t.core.galleryItems),t.animateThumb(t.core.index)},50),setTimeout(function(){t.$thumbOuter.removeClass("lg-rebuilding-thumbnails")},200)},e.prototype.setTranslate=function(t){this.$lgThumb.css("transform","translate3d(-"+t+"px, 0px, 0px)")},e.prototype.getPossibleTransformX=function(t){return t>this.thumbTotalWidth-this.thumbOuterWidth&&(t=this.thumbTotalWidth-this.thumbOuterWidth),t<0&&(t=0),t},e.prototype.animateThumb=function(t){if(this.$lgThumb.css("transition-duration",this.core.settings.speed+"ms"),this.settings.animateThumb){var n=0;switch(this.settings.currentPagerPosition){case"left":n=0;break;case"middle":n=this.thumbOuterWidth/2-this.settings.thumbWidth/2;break;case"right":n=this.thumbOuterWidth-this.settings.thumbWidth}this.translateX=(this.settings.thumbWidth+this.settings.thumbMargin)*t-1-n,this.translateX>this.thumbTotalWidth-this.thumbOuterWidth&&(this.translateX=this.thumbTotalWidth-this.thumbOuterWidth),this.translateX<0&&(this.translateX=0),this.setTranslate(this.translateX)}},e.prototype.onThumbTouchMove=function(t){return t.newTranslateX=this.translateX,t.isMoved=!0,t.touchMoveTime=new Date().valueOf(),t.newTranslateX-=t.cords.endX-t.cords.startX,t.newTranslateX=this.getPossibleTransformX(t.newTranslateX),this.setTranslate(t.newTranslateX),this.$thumbOuter.addClass("lg-dragging"),t},e.prototype.onThumbTouchEnd=function(t){t.isMoved=!1,t.endTime=new Date,this.$thumbOuter.removeClass("lg-dragging");var n=t.endTime.valueOf()-t.startTime.valueOf(),r=t.cords.endX-t.cords.startX,s=Math.abs(r)/n;return s>.15&&t.endTime.valueOf()-t.touchMoveTime<30?(s+=1,s>2&&(s+=1),s=s+s*(Math.abs(r)/this.thumbOuterWidth),this.$lgThumb.css("transition-duration",Math.min(s-1,2)+"settings"),r=r*s,this.translateX=this.getPossibleTransformX(this.translateX-r),this.setTranslate(this.translateX)):this.translateX=t.newTranslateX,Math.abs(t.cords.endX-t.cords.startX)<this.settings.thumbnailSwipeThreshold&&(this.thumbClickable=!0),t},e.prototype.getThumbHtml=function(t,n,r){var s=this.core.galleryItems[n].__slideVideoInfo||{},o;s.youtube&&this.settings.loadYouTubeThumbnail?o="//img.youtube.com/vi/"+s.youtube[1]+"/"+this.settings.youTubeThumbSize+".jpg":o=t;var a=document.createElement("div");a.setAttribute("data-lg-item-id",n+""),a.className="lg-thumb-item "+(n===this.core.index?"active":""),a.style.cssText="width: "+this.settings.thumbWidth+"px; height: "+this.settings.thumbHeight+"; margin-right: "+this.settings.thumbMargin+"px;";var l=document.createElement("img");return l.alt=r||"",l.setAttribute("data-lg-item-id",n+""),l.src=o,a.appendChild(l),a},e.prototype.setThumbItemHtml=function(t){for(var n=0;n<t.length;n++){var r=this.getThumbHtml(t[n].thumb,n,t[n].alt);this.$lgThumb.append(r)}},e.prototype.setAnimateThumbStyles=function(){this.settings.animateThumb&&this.core.outer.addClass("lg-animate-thumb")},e.prototype.manageActiveClassOnSlideChange=function(){var t=this;this.core.LGel.on(ji.beforeSlide+".thumb",function(n){var r=t.core.outer.find(".lg-thumb-item"),s=n.detail.index;r.removeClass("active"),r.eq(s).addClass("active")})},e.prototype.toggleThumbBar=function(){var t=this;this.settings.toggleThumb&&(this.core.outer.addClass("lg-can-toggle"),this.core.$toolbar.append('<button type="button" aria-label="'+this.settings.thumbnailPluginStrings.toggleThumbnails+'" class="lg-toggle-thumb lg-icon"></button>'),this.core.outer.find(".lg-toggle-thumb").first().on("click.lg",function(){t.core.outer.toggleClass("lg-components-open")}))},e.prototype.thumbKeyPress=function(){var t=this;this.$LG(window).on("keydown.lg.thumb.global"+this.core.lgId,function(n){!t.core.lgOpened||!t.settings.toggleThumb||(n.keyCode===38?(n.preventDefault(),t.core.outer.addClass("lg-components-open")):n.keyCode===40&&(n.preventDefault(),t.core.outer.removeClass("lg-components-open")))})},e.prototype.destroy=function(){this.settings.thumbnail&&(this.$LG(window).off(".lg.thumb.global"+this.core.lgId),this.core.LGel.off(".lg.thumb"),this.core.LGel.off(".thumb"),this.$thumbOuter.remove(),this.core.outer.removeClass("lg-has-thumb"))},e}();/*!
|
23
23
|
* lightgallery | 2.8.3 | March 1st 2025
|
24
24
|
* http://www.lightgalleryjs.com/
|
25
25
|
* 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 Sr=function(){return Sr=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},Sr.apply(this,arguments)},Vu={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"}},dn={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Bs=500,zu=function(){function e(t,n){return this.core=t,this.$LG=n,this.settings=Sr(Sr({},Vu),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(dn.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,u=d.allowX;this.positionChanged&&(l=this.left/(this.scale-n),c=this.top/(this.scale-n),this.pageX=o-l,this.pageY=a-c,this.positionChanged=!1);var f=this.getPossibleSwipeDragCords(n),p,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)),p=m/y,g=_/y}else{var y=(t-n)*n;p=m*y,g=_*y}r&&(u?this.isBeyondPossibleLeft(p,f.minX)?p=f.minX:this.isBeyondPossibleRight(p,f.maxX)&&(p=f.maxX):t>1&&(p<f.minX?p=f.minX:p>f.maxX&&(p=f.maxX)),h?this.isBeyondPossibleTop(g,f.minY)?g=f.minY:this.isBeyondPossibleBottom(g,f.maxY)&&(g=f.maxY):t>1&&(g<f.minY?g=f.minY:g>f.maxY&&(g=f.maxY))),this.setZoomStyles({x:p,y:g,scale:t}),this.left=p,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)},Bs),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")}},Bs+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},Bs+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(dn.containerResize+".zoom "+dn.rotateRight+".zoom "+dn.rotateLeft+".zoom "+dn.flipHorizontal+".zoom "+dn.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(dn.beforeOpen+".zoom",function(){t.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(dn.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(dn.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 u=t.scale-o;t.zoomImage(t.scale,Math.round((u+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(),u={};u.x=this.left+a,u.y=this.top+l;var f=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(u.y,f.minY)?u.y=f.minY:this.isBeyondPossibleBottom(u.y,f.maxY)&&(u.y=f.maxY)),r&&(this.isBeyondPossibleLeft(u.x,f.minX)?u.x=f.minX:this.isBeyondPossibleRight(u.x,f.maxX)&&(u.x=f.maxX)),s?this.top=u.y:u.y=this.top,r?this.left=u.x:u.x=this.left,this.setZoomSwipeStyles(h,u),this.positionChanged=!0)},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,u={minY:l,maxY:c,minX:d,maxX:h};return u},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,u=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(f){if(t.isImageSlide(t.core.index)&&(u=t.core.getSlideItem(t.core.index),(t.$LG(f.target).hasClass("lg-item")||u.get().contains(f.target))&&f.touches.length===1&&t.core.outer.hasClass("lg-zoomed"))){f.preventDefault(),l=new Date,t.core.touchAction="zoomSwipe",h=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var p=t.getDragAllowedAxises(0);a=p.allowY,o=p.allowX,(o||a)&&(n=t.getSwipeCords(f)),d=t.getPossibleSwipeDragCords(),t.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(f){if(f.touches.length===1&&t.core.touchAction==="zoomSwipe"&&(t.$LG(f.target).hasClass("lg-item")||u.get().contains(f.target))){f.preventDefault(),t.core.touchAction="zoomSwipe",r=t.getSwipeCords(f);var p=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,p))}}),this.core.$inner.on("touchend.lg",function(f){if(t.core.touchAction==="zoomSwipe"&&(t.$LG(f.target).hasClass("lg-item")||u.get().contains(f.target))){if(f.preventDefault(),t.core.touchAction=void 0,t.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var p=c.valueOf()-l.valueOf();t.touchendZoom(n,r,o,a,p)}})},e.prototype.zoomDrag=function(){var t=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,u;this.core.outer.on("mousedown.lg.zoom",function(f){if(t.isImageSlide(t.core.index)){var p=t.core.getSlideItem(t.core.index);if(t.$LG(f.target).hasClass("lg-item")||p.get().contains(f.target)){c=new Date,u=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(f.target).hasClass("lg-object")&&(a||l)&&(f.preventDefault(),n=t.getDragCords(f),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(f){if(s){o=!0,r=t.getDragCords(f);var p=t.getZoomSwipeCords(n,r,a,l,h);t.setZoomSwipeStyles(u,p)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(f){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(f);var p=d.valueOf()-c.valueOf();t.touchendZoom(n,r,a,l,p)}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}(),qe=(e=>(e.phone="phone",e.tablet="tablet",e.laptop="laptop",e))(qe||{});const De=class De{static init(t){if(De.uiConfig)throw new Error("UI provider already initialized.");De.uiConfig=t,De.windowResizeHandler(),window.addEventListener("resize",De.windowResizeHandler)}static destroy(){window.removeEventListener("resize",De.windowResizeHandler)}static getMessagesService(){return De.getUiConfig().messagesService}static getNotificationsService(){return De.getUiConfig().notificationsService}static getDeviceTypeByResolution(){const{deviceTypeResolutionsConfig:t}=De.getUiConfig();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 De.setRefValueDependingOnDeviceResolution(s,t,n,r),De.refsDependingOnDeviceResolution.push({r:s,phoneValue:t,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return De.getDeviceTypeByResolution()===qe.phone}static isTabletDevice(){return De.getDeviceTypeByResolution()===qe.tablet}static isLaptopDevice(){return De.getDeviceTypeByResolution()===qe.laptop}static showNotificationsForErrorResponseData(t,n={}){var r,s;if(W.isEmpty(t.errors)){const o=(s=(r=t.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";De.getNotificationsService().error({title:"Ошибка выполнения/обработки запроса",content:t.message,meta:`#${t.status}${a}: ${t.statusText}`,duration:3e3})}else for(const o in t.errors)Object.prototype.hasOwnProperty.call(n,o)?n[o]=new te.FieldValidationResultData(t.errors[o].toString(),"error"):De.getMessagesService().error(t.errors[o].toString())}static getUiConfig(){if(!De.uiConfig)throw new Error("UI provider is not initialized.");return De.uiConfig}static setRefValueDependingOnDeviceResolution(t,n,r,s){switch(De.getDeviceTypeByResolution()){case qe.phone:t.value=n;break;case qe.tablet:t.value=r;break;default:t.value=s;break}}static windowResizeHandler(){W.forEach(De.refsDependingOnDeviceResolution,t=>{De.setRefValueDependingOnDeviceResolution(t.r,t.phoneValue,t.tabletValue,t.defaultValue)})}};k(De,"uiConfig"),k(De,"refsDependingOnDeviceResolution",[]);let gt=De;const Iu={ref:"gallery-container",class:"lightgallery-wrapper"},Lu={},ba=i.defineComponent({...Lu,__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}),W.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",Iu,[i.renderSlot(o.$slots,"default")],512))}}),Du=["href"],Hu=["src","alt"],Wu={},wa=i.defineComponent({...Wu,__name:"image-gallery",props:{images:{}},setup(e,{expose:t}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[Ou,zu],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(gt.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 u=ya,f=V.NPopover;return i.openBlock(),i.createBlock(f,{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]=p=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(u)])])]),default:i.withCtx(()=>[i.createVNode(ba,{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,(p,g)=>(i.openBlock(),i.createElementBlock("a",{key:g,href:p.image},[i.createElementVNode("img",{src:p.preview,alt:`Изображение #${g+1}`},null,8,Hu)],8,Du))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),ju={class:"flex flex-col"},Xu={},qu=i.defineComponent({...Xu,__name:"product-stock-count",props:{product:{}},setup(e){return(t,n)=>{const r=Ss,s=V.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",ju,[(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})}}}),Yu={class:"flex flex-row justify-between"},Uu={key:0},Gu={class:"ml-2 align-sub"},Ku={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},Zu={class:"text-sc-dark-grey grid grid-cols-1 gap-1 text-sm xl:grid-cols-2 xl:text-base 2xl:grid-cols-3"},Ju={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},Qu={class:"text-sc-dark-grey"},ef={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},tf={class:"text-gray-600"},nf={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},rf={key:3,class:"underline decoration-dashed"},sf={key:4,class:"sc-product-pack whitespace-nowrap"},of={class:"text-gray-600"},af={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},lf={class:"text-gray-600"},cf={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},df={key:0},hf={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},uf={},qi=i.defineComponent({...uf,__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},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},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(()=>W.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>W.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,u;return(u=(h=n.product)==null?void 0:h.properties)==null?void 0:u.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>W.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,u)=>{var y,b,S,x,C;const f=ya,p=V.NText,g=_a,m=Ss,_=V.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",Yu,[i.createVNode(p,{type:"info",class:"sc-product-name text-balance text-base font-medium xl:text-lg"},{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",Uu," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",Gu,[h.product.images&&h.product.images.length>0?(i.openBlock(),i.createBlock(wa,{key:0,ref:"image-gallery",images:h.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",Ku,[i.createVNode(f)])]),_: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",Zu,[h.product.supplierSku?(i.openBlock(),i.createElementBlock("div",Ju,[u[0]||(u[0]=i.createTextVNode(" Артикул производителя/поставщика: ")),i.createElementVNode("span",Qu,i.toDisplayString(h.product.supplierSku),1)])):i.createCommentVNode("",!0),h.showCode?(i.openBlock(),i.createElementBlock("span",ef,[u[1]||(u[1]=i.createTextVNode(" Артикул: ")),i.createElementVNode("span",tf,i.toDisplayString(h.product.code),1)])):i.createCommentVNode("",!0),h.product.stockCount&&h.product.stockCount.length>0?(i.openBlock(),i.createBlock(qu,{key:2,product:h.product},{default:i.withCtx(()=>[i.createElementVNode("span",nf,[u[2]||(u[2]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(m,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",rf," Нет в наличии ")),(S=(b=h.product)==null?void 0:b.properties)!=null&&S.pack?(i.openBlock(),i.createElementBlock("span",sf,[u[3]||(u[3]=i.createTextVNode(" Норма упаковки: ")),i.createElementVNode("span",of,i.toDisplayString((C=(x=h.product)==null?void 0:x.properties)==null?void 0:C.pack),1)])):i.createCommentVNode("",!0),h.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",af,[u[4]||(u[4]=i.createTextVNode(" Планируемая дата поступления на основной склад: ")),i.createElementVNode("span",lf,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)]),i.createVNode(_,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",cf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,B=>(i.openBlock(),i.createBlock(xr,{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},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history"]))),128)),i.createVNode(xr,{product:h.product,"event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":!0,"show-price-history":h.showPriceHistory,"cost-field-name":"cost",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-price-history"])])):i.createCommentVNode("",!0)]),_:1}),h.showSlugs||h.showProperties?(i.openBlock(),i.createElementBlock("div",df,[i.createElementVNode("ul",hf,[h.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:h.product.id,slug:h.product.slug},(B,v)=>(i.openBlock(),i.createElementBlock("li",{key:v}," ("+i.toDisplayString(v)+"): "+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,v)=>(i.openBlock(),i.createElementBlock("li",{key:v}," ("+i.toDisplayString(v)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),ff=(e,t,n)=>({key:e,title:t,className:"align-top",resizable:!0,render:r=>i.h(xr,{product:r,costFieldName:e,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick})}),pf=(e,t)=>{if(e.length===0)return[];const n=[],r={};switch(gt.getDeviceTypeByResolution()){case qe.phone:case qe.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(qi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,productContextButtonsConfig:t.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(qi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory})}),t.showProductCosts&&(W.forEach(e,s=>{W.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),W.forEach(W.sortBy(r,["slug"]),s=>{n.push(ff(s.slug??"",s.name,t))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(xr,{product:s,costFieldName:"cost",eventEmitter:t.eventEmitter,allowPriceClick:t.allowPriceClick,showQuantityUnit:!0,showCostDate:!0,showPriceHistory:t.showPriceHistory})})),(t.showProductEditButton||!W.isNil(t.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(_a,{product:s,eventEmitter:t.eventEmitter,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,productContextButtonsConfig:t.productContextButtonsConfig})});break}return n},gf={key:0,class:"pt-0.5"},mf={class:"flex flex-row gap-1"},_f={key:0},yf={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},bf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},wf={},vf=i.defineComponent({...wf,__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},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(kr,"medium"),r=i.computed(()=>{var M;return(M=t==null?void 0:t.filteredItems)==null?void 0:M[t.categoryItem.id]}),s=i.computed(()=>{var M,N;return W.isArray((M=t.categoryItem)==null?void 0:M.categories)&&((N=t.categoryItem.categories)==null?void 0:N.length)>0}),o=i.computed(()=>{var M;return W.isArray((M=t.categoryItem)==null?void 0:M.products)?t.categoryItem.products:[]}),a=i.computed(()=>W.isUndefined(t.filteredItems)||r.value==="*"?o.value:o.value.filter(M=>{var N,A;return(A=(N=r.value)==null?void 0:N.products)==null?void 0:A.includes(M.id)})),l=i.computed(()=>a.value.length>0),c=i.computed(()=>W.isFunction(t.showHideForClientButton)?t.showHideForClientButton(t.categoryItem):t.showHideForClientButton),d=i.computed(()=>W.isFunction(t.showPinButton)?t.showPinButton(t.categoryItem):t.showPinButton),h=i.computed(()=>W.isFunction(t.showCategoryEditButton)?t.showCategoryEditButton(t.categoryItem):t.showCategoryEditButton),u=i.computed(()=>W.isNil(t.categoryContextButtonsConfig)?[]:W.isFunction(t.categoryContextButtonsConfig)?t.categoryContextButtonsConfig(t.categoryItem):t.categoryContextButtonsConfig),f=i.computed(()=>new te.ClientCategory(t.categoryItem)),p=i.ref(!1),g=i.ref(!1),m=i.computed(()=>!W.isUndefined(t.selectedCategoriesItems)),_=i.computed(()=>(t.selectedCategoriesItems??[]).some(M=>M.id===t.categoryItem.id)),y=i.computed(()=>F.value&>.getDeviceTypeByResolution()===qe.laptop?"auto":"fixed"),b=M=>{t.eventEmitter.emit("category:checked",{category:t.categoryItem,checked:M})},S=(M,N)=>{t.eventEmitter.emit("category:header-click",{categoryItem:t.categoryItem,expanded:N,isLoadingState:p})},x=()=>{t.eventEmitter.emit("category:hide",{category:t.categoryItem})},C=()=>{t.eventEmitter.emit("category:attach",{category:t.categoryItem})},B=()=>{t.eventEmitter.emit("category:detach",{category:t.categoryItem})},v=()=>{t.eventEmitter.emit("category:edit",{category:t.categoryItem})},$=M=>{t.eventEmitter.emit("category:context-select",{category:t.categoryItem,key:M})},F=i.ref(0),R=i.computed(()=>F.value&&o.value.length>0?pf(o.value,{eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,productContextButtonsConfig:t.productContextButtonsConfig}):[]),q=W.debounce(()=>{F.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",q)}),window.addEventListener("resize",q),q(),(M,N)=>{const A=V.NCheckbox,L=au,Y=V.NTooltip,P=ru,E=ga,H=V.NTag,I=Qh,U=Kh,O=V.NButton,z=Yh,Z=pa,pe=fa,re=V.NDropdown,ge=V.NDataTable,ie=V.NAlert,Me=V.NSpin;return i.openBlock(),i.createBlock(ma,{name:M.categoryItem.id,"data-id":M.categoryItem.id,"onHeader:click":S},{"pre-arrow":i.withCtx(()=>{var xe,Ce,Fe;return[m.value?(i.openBlock(),i.createElementBlock("div",gf,[i.createVNode(A,{checked:_.value,"onUpdate:checked":b},null,8,["checked"])])):i.createCommentVNode("",!0),!c.value&&((xe=f.value)!=null&&xe.isDisabled)?(i.openBlock(),i.createBlock(Y,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(L,{class:"pt-1.5"})]),default:i.withCtx(()=>[N[1]||(N[1]=i.createTextVNode(" Категория скрыта для клиента "))]),_:1,__:[1]})):i.createCommentVNode("",!0),((Ce=f.value)==null?void 0:Ce.isFavorite)??!1?(i.openBlock(),i.createBlock(Y,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(P,{class:"pt-1.5"})]),default:i.withCtx(()=>[N[2]||(N[2]=i.createTextVNode(" Избранная категория "))]),_:1,__:[2]})):i.createCommentVNode("",!0),((Fe=f.value)==null?void 0:Fe.isRequired)??!1?(i.openBlock(),i.createBlock(Y,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(E,{class:"pt-1.5"})]),default:i.withCtx(()=>[N[3]||(N[3]=i.createTextVNode(" Доп. продажа "))]),_:1,__:[3]})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var xe,Ce,Fe;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase xl:text-lg":!0,"text-gray-400 line-through":M.categoryItem.isHidden,"text-gray-400":(xe=f.value)==null?void 0:xe.isDisabled})},[i.createVNode(Y,{disabled:!M.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(M.categoryItem.name),1)]),default:i.withCtx(()=>[N[4]||(N[4]=i.createTextVNode(" Категория скрыта "))]),_:1,__:[4]},8,["disabled"])],2),i.createElementVNode("div",{onClick:N[0]||(N[0]=i.withModifiers((...Ie)=>i.unref(W.noop)&&i.unref(W.noop)(...Ie),["prevent","stop"]))},[(Ce=M.categoryItem.properties)!=null&&Ce.m2Price?(i.openBlock(),i.createBlock(H,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Средняя стоимость: "+i.toDisplayString(M.categoryItem.properties.m2Price)+" руб./м2 ",1)]),_:1},8,["size"])):i.createCommentVNode("",!0),d.value&&((Fe=f.value)!=null&&Fe.manager)?(i.openBlock(),i.createBlock(H,{key:1,size:i.unref(n),closable:!0,round:"",onClose:B},{default:i.withCtx(()=>[i.createVNode(Y,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Ie,kt;return[i.createElementVNode("span",mf,[i.createVNode(I),i.createTextVNode(" "+i.toDisplayString((kt=(Ie=f.value)==null?void 0:Ie.manager)==null?void 0:kt.name),1)])]}),default:i.withCtx(()=>{var Ie,kt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((kt=(Ie=f.value)==null?void 0:Ie.manager)==null?void 0:kt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[M.showSlugs||M.showProperties?(i.openBlock(),i.createElementBlock("div",_f,[i.createElementVNode("ul",yf,[M.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:M.categoryItem.id,slug:M.categoryItem.slug},(xe,Ce)=>(i.openBlock(),i.createElementBlock("li",{key:Ce}," ("+i.toDisplayString(Ce)+"): "+i.toDisplayString(xe),1))),128)):i.createCommentVNode("",!0),M.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(M.categoryItem.properties,(xe,Ce)=>(i.openBlock(),i.createElementBlock("li",{key:Ce}," ("+i.toDisplayString(Ce)+"): "+i.toDisplayString(xe),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var xe;return[i.createElementVNode("div",bf,[c.value?(i.openBlock(),i.createBlock(Y,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(O,{size:i.unref(n),onClick:x},{default:i.withCtx(()=>{var Ce;return[(Ce=f.value)!=null&&Ce.isDisabled?(i.openBlock(),i.createBlock(L,{key:1})):(i.openBlock(),i.createBlock(U,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var Ce;return[(Ce=f.value)!=null&&Ce.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(f.value.hidingComment?`. Причина: '${f.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),d.value&&!((xe=f.value)!=null&&xe.manager)?(i.openBlock(),i.createBlock(Y,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(O,{size:i.unref(n),onClick:C},{default:i.withCtx(()=>[i.createVNode(z)]),_:1},8,["size"])]),default:i.withCtx(()=>{var Ce,Fe,Ie;return[(Ce=f.value)!=null&&Ce.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((Ie=(Fe=f.value)==null?void 0:Fe.manager)==null?void 0:Ie.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),h.value?(i.openBlock(),i.createBlock(Y,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(O,{ghost:!0,size:i.unref(n),type:"primary",onClick:v},{default:i.withCtx(()=>[i.createVNode(Z)]),_:1},8,["size"])]),default:i.withCtx(()=>[N[5]||(N[5]=i.createTextVNode(" Редактировать "))]),_:1,__:[5]})):i.createCommentVNode("",!0),u.value.length>0?(i.openBlock(),i.createBlock(re,{key:3,options:u.value,size:i.unref(n),trigger:"click",onSelect:$},{default:i.withCtx(()=>[i.createVNode(O,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(pe)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(M.$slots,"default",{},()=>{var xe;return[s.value?(i.openBlock(),i.createBlock(ka,{key:0,"categories-items":M.categoryItem.categories??[],"event-emitter":M.eventEmitter,"filtered-items":(xe=r.value)==null?void 0:xe.categories,"selected-categories-items":M.selectedCategoriesItems,"selected-products-items":M.selectedProductsItems,"show-slugs":M.showSlugs,"show-properties":M.showProperties,"show-product-costs":M.showProductCosts,"allow-name-click":M.allowNameClick,"allow-price-click":M.allowPriceClick,"show-price-history":M.showPriceHistory,"show-product-add-to-cart-button":M.showProductAddToCartButton,"show-product-edit-button":M.showProductEditButton,"product-context-buttons-config":M.productContextButtonsConfig,"show-hide-for-client-button":M.showHideForClientButton,"show-pin-button":M.showPinButton,"show-category-edit-button":M.showCategoryEditButton,"category-context-buttons-config":M.categoryContextButtonsConfig},null,8,["categories-items","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-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),l.value?(i.openBlock(),i.createBlock(ge,{key:1,columns:R.value,data:a.value,bordered:!0,loading:p.value,remote:!0,"row-key":Ce=>Ce.id,"table-layout":y.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])):i.createCommentVNode("",!0),!p.value&&!g.value&&!s.value&&!l.value?(i.openBlock(),i.createBlock(ie,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),g.value?(i.openBlock(),i.createBlock(ie,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createBlock(Me,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>N[6]||(N[6]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),kf=Dn(vf,[["__scopeId","data-v-f40a0da8"]]),xf={class:"sc-collapse flex w-full flex-col"},Cf={},va=i.defineComponent({...Cf,__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",xf,[i.renderSlot(o.$slots,"default")]))}}),Sf={},ka=i.defineComponent({...Sf,__name:"category-collapse",props:{categoriesItems:{},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},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(kr,"medium"),r=i.computed(()=>W.isUndefined(t.filteredItems)?t.categoriesItems:t.categoriesItems.filter(o=>{var a;return!!((a=t.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(W.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=V.NSpin,c=V.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(va,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(kf,{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-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-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.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)}}}),Bf={},Tf=i.defineComponent({...Bf,__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,u,f,p,g;const n=e,r=i.ref(new te.CartItemBase(n.cartItem??new te.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)||((f=(u=n.product)==null?void 0:u.properties)!=null&&f.ignoreMinCountCheck?0:(g=(p=n.product)==null?void 0:p.properties)==null?void 0:g.minCount)||0}))),s=t,o=i.computed(()=>{var y,b,S,x,C,B,v,$,F;const m=((b=(y=n.product)==null?void 0:y.properties)==null?void 0:b.minLength)??((x=(S=n.product)==null?void 0:S.properties)!=null&&x.ignoreMinCountCheck?0:(B=(C=n.product)==null?void 0:C.properties)==null?void 0:B.minCount),_=($=(v=n.product)==null?void 0:v.properties)==null?void 0:$.maxLength;return m||_?`(${m?`от ${m}`:""}${m&&_?" ":""}${_?`до ${_}`:""} ${(F=n.product)==null?void 0:F.unit})`:""}),a=()=>{te.UnitsHelper.productIsMeasurable(n.product)||delete r.value.length,s("submit",r.value)};return(m,_)=>(i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.unref(te.UnitsHelper).productIsMeasurable(m.product)?(i.openBlock(),i.createBlock(i.unref(V.NFormItem),{key:0,required:!0,feedback:m.validation.length.feedback||"","show-feedback":m.validation.length.showFeedback||i.unref(te.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(V.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(te.UnitsHelper).getProductLengthMultiplicity(m.product),step:i.unref(te.UnitsHelper).getProductMultiplicity(m.product),validator:S=>S%i.unref(te.UnitsHelper).getProductLengthMultiplicity(m.product)===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]}),_:2},[!m.validation.length.feedback&&i.unref(te.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01?{name:"feedback",fn:i.withCtx(()=>[i.createTextVNode(" Метраж должен быть кратен "+i.toDisplayString(i.unref(te.UnitsHelper).getProductLengthMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status","label"])):i.createCommentVNode("",!0),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:m.validation.quantity.feedback||"","show-feedback":m.validation.quantity.showFeedback||i.unref(te.UnitsHelper).getProductMultiplicity(m.product)!==1||!1,"validation-status":m.validation.quantity.validationStatus||void 0,label:"Количество"},i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:r.value.quantity,"onUpdate:value":_[1]||(_[1]=y=>r.value.quantity=y),min:i.unref(te.UnitsHelper).getProductMultiplicity(m.product),step:i.unref(te.UnitsHelper).getProductMultiplicity(m.product),validator:y=>y%i.unref(te.UnitsHelper).getProductMultiplicity(m.product)===0,placeholder:"Введите количество",class:"w-full"},null,8,["value","min","step","validator"])]),_:2},[!m.validation.quantity.feedback&&i.unref(te.UnitsHelper).getProductMultiplicity(m.product)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createTextVNode(" Количество должно быть кратно "+i.toDisplayString(i.unref(te.UnitsHelper).getProductMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.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(V.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(V.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}))}}),Ef={class:"flex flex-row gap-1"},$f={class:"flex flex-col gap-1"},Nf=["href"],Pf={key:1,class:"text-sc-grey"},Rf={key:0,class:"text-sc-dark-grey truncate"},Ff={key:0},Mf={key:1},Af={},Br=i.defineComponent({...Af,__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?Bn.format(n.client.lastLoginAt,te.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{W.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Ss,d=V.NButton,h=V.NPopover;return i.openBlock(),i.createElementBlock("div",Ef,[a.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=u=>a.$emit("click:client-info",a.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(W.isNil)(a.popoverPosition),placement:a.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",$f,[i.createElementVNode("a",{href:a.nameLink??"#",class:"no-underline",onClick:l[1]||(l[1]=u=>o(u))},[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",Pf," [ Деактивирован ] "))],8,Nf),a.showCityAndRegion&&a.client.city?(i.openBlock(),i.createElementBlock("small",Rf," г. "+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",Ff,i.toDisplayString(a.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("small",Mf," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),Of={},xa=i.defineComponent({...Of,__name:"contragent-with-short-info",props:{contragent:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(t.contragent.name),1))}}),Vf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zf(e,t){return i.openBlock(),i.createElementBlock("svg",Vf,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 If=i.markRaw({name:"tabler-mail",render:zf}),Lf={key:0,class:"flex flex-row items-center gap-1"},Df=["href"],Hf={key:1},Wf=["href"],jf={},Xf=i.defineComponent({...jf,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(e){return(t,n)=>{const r=If;return i.openBlock(),i.createElementBlock("div",null,[t.showEmailIcon?(i.openBlock(),i.createElementBlock("span",Lf,[i.createVNode(r),i.createElementVNode("a",{href:`mailto:${t.email}`,class:"no-underline"},i.toDisplayString(t.email),9,Df)])):(i.openBlock(),i.createElementBlock("span",Hf,[i.createElementVNode("a",{href:`mailto:${t.email}`,class:"no-underline"},i.toDisplayString(t.email),9,Wf)]))])}}}),qf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Yf(e,t){return i.openBlock(),i.createElementBlock("svg",qf,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 Ca=i.markRaw({name:"fa6-brands-viber",render:Yf}),Uf={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},Gf=["id"],Kf=["id"],Zf=["fill"],Jf=["fill"];function Qf(e,t){return i.openBlock(),i.createElementBlock("svg",Uf,[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,Gf),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,Kf)]),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,Zf),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,Jf),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 Sa=i.markRaw({name:"logos-whatsapp-icon",render:Qf,setup(){const e=()=>Math.random().toString(36).substr(2,10);return{idMap:{logosWhatsappIcon0:"uicons-"+e(),logosWhatsappIcon1:"uicons-"+e()}}}}),ep={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},tp=["id"],np=["fill"];function ip(e,t){return i.openBlock(),i.createElementBlock("svg",ep,[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,tp)]),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,np),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 Ba=i.markRaw({name:"logos-telegram",render:ip,setup(){return{idMap:{logosTelegram0:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),rp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sp(e,t){return i.openBlock(),i.createElementBlock("svg",rp,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 Ta=i.markRaw({name:"ion-call",render:sp}),op={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ap(e,t){return i.openBlock(),i.createElementBlock("svg",op,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 lp=i.markRaw({name:"tabler-phone-call",render:ap}),cp={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center text-base backdrop-blur-sm"},dp=["href"],hp=["href"],up=["href"],fp=["href"],pp={},gp=i.defineComponent({...pp,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{try{return t.phone?ji.parsePhoneNumberWithError(t.phone,t.defaultCountry):void 0}catch{}return t.phone}),r=i.computed(()=>{var l;return W.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return W.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return W.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=lp,h=Ta,u=Ba,f=Sa,p=Ca;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",cp,[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,dp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(u)],8,hp)):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(f)],8,up)):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(p)],8,fp)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),mp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _p(e,t){return i.openBlock(),i.createElementBlock("svg",mp,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 yp=i.markRaw({name:"mdi-envelope",render:_p}),bp={class:"flex flex-col gap-1"},wp={key:0,class:"mb-2 flex flex-col"},vp={key:0,class:"text-sc-dark-grey"},kp={key:1,class:"whitespace-nowrap"},xp={key:2,class:"whitespace-nowrap"},Cp={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Sp=["href"],Bp=["href"],Tp=["href"],Ep=["href"],$p=["href"],Np={key:0,class:"flex flex-col"},Pp={key:0,class:"text-sc-dark-grey"},Rp={key:1,class:"mt-2"},Fp={key:0,class:"-mt-1"},Mp={},Ap=i.defineComponent({...Mp,__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?ji.parsePhoneNumberWithError(t.contact.phone,t.defaultCountry):void 0}catch{}return t.contact.phone}),r=i.computed(()=>{var c;return W.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return W.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return W.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=Ta,u=Ba,f=Sa,p=Ca,g=yp,m=V.NPopover;return i.openBlock(),i.createElementBlock("div",bp,[i.createVNode(m,{disabled:c.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var b,S,x,C;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",wp,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(x=c.contact)!=null&&x.position?(i.openBlock(),i.createElementBlock("small",vp,i.toDisplayString((C=c.contact)==null?void 0:C.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),c.contact.phone?(i.openBlock(),i.createElementBlock("div",kp,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("div",xp,i.toDisplayString(c.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",Cp,[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,Sp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(u)],8,Bp)):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(f)],8,Tp)):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(p)],8,Ep)):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,$p)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var b,S,x,C;return[c.contact.name?(i.openBlock(),i.createElementBlock("div",Np,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(b=c.contact)!=null&&b.position?(i.openBlock(),i.createElementBlock("small",Pp,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",Rp,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((C=c.contact)==null?void 0:C.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),c.fullView&&((_=c.contact)!=null&&_.comment)?(i.openBlock(),i.createElementBlock("div",Fp,[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)])}}}),Op={key:0,class:"flex w-fit items-center gap-2"},Vp={key:1,class:"flex flex-wrap gap-1"},zp={key:0},Ip={},Yi=i.defineComponent({...Ip,__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=V.NSpin;return r.isProductSearching?(i.openBlock(),i.createElementBlock("div",Op,[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",Vp,[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)]))}}}),Lp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Dp(e,t){return i.openBlock(),i.createElementBlock("svg",Lp,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 Tr=i.markRaw({name:"ion-close",render:Dp}),Hp={class:"mr-3 flex flex-col gap-2"},Wp=["onClick"],jp={class:"h-full p-2"},Xp={},qp=i.defineComponent({...Xp,__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=Tr;return i.openBlock(),i.createBlock(i.unref(V.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",Hp,[(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(V.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",jp,[i.createElementVNode("div",{ref_for:!0,ref:"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Wp)]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(c.label),1)]),_:2},1024),c.isCustom&&!c.isNewRec()?(i.openBlock(),i.createBlock(i.unref(V.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})}}}),Ea=Dn(qp,[["__scopeId","data-v-828c3059"]]),Yp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Up(e,t){return i.openBlock(),i.createElementBlock("svg",Yp,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 $a=i.markRaw({name:"ion-trash",render:Up}),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",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)]))}const Na=i.markRaw({name:"ion-plus",render:Kp}),Zp={class:"flex flex-col gap-4"},Jp={class:"flex flex-col gap-2"},Qp={class:"mt-8 font-bold"},eg={class:"grid grow grid-cols-2 items-start gap-2"},tg={class:"flex flex-col gap-4"},ng={class:"flex gap-3"},ig={},Pa=i.defineComponent({...ig,__name:"kozyrek-configurator-params-form",props:{value:{},settings:{},previewParams:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},selectTemplateIndex:{}},emits:["update:value","update:params","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 te.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.watch(()=>n.value.configuratorParams,c=>{s.value=W.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=Na,u=$a,f=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"grid gap-2 md:grid-cols-2 md:gap-6"},{default:i.withCtx(()=>{var p,g,m,_,y,b,S,x,C;return[i.createElementVNode("div",Zp,[d[10]||(d[10]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),c.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(V.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:s.value.startTailType,"onUpdate:value":[d[0]||(d[0]=B=>s.value.startTailType=B),a],options:c.settings.startTailConfigs.map(({label:B},v)=>({label:B,value:v})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Jp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value.linesAngles,(B,v)=>{var $,F,R,q,M,N;return i.openBlock(),i.createElementBlock("div",{key:v,class:"flex items-start gap-2"},[i.createElementVNode("div",Qp,i.toDisplayString(v+1),1),i.createElementVNode("div",eg,[i.createVNode(i.unref(V.NFormItem),{label:"Ширина, мм",required:!0,feedback:(($=c.validation[`lines_widths[${v+1}]`])==null?void 0:$.feedback)||"","show-feedback":((F=c.validation[`lines_widths[${v+1}]`])==null?void 0:F.showFeedback)||!1,"validation-status":(R=c.validation[`lines_widths[${v+1}]`])==null?void 0:R.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:s.value.linesWidths[v],"onUpdate:value":[A=>s.value.linesWidths[v]=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(V.NFormItem),{label:"Угол сгиба, °",required:!0,feedback:((q=c.validation[`lines_angles[${v+1}]`])==null?void 0:q.feedback)||"","show-feedback":((M=c.validation[`lines_angles[${v+1}]`])==null?void 0:M.showFeedback)||!1,"validation-status":(N=c.validation[`lines_angles[${v+1}]`])==null?void 0:N.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:s.value.linesAngles[v],"onUpdate:value":[A=>s.value.linesAngles[v]=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(V.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(V.NButton),{key:0,size:"medium",onClick:A=>r("click:add-line",v)},{default:i.withCtx(()=>[i.createVNode(h)]),_:2},1032,["onClick"])),c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:1,disabled:s.value.linesWidths.length===1,size:"medium",class:"ml-2",onClick:A=>r("click:remove-line",v)},{default:i.withCtx(()=>[i.createVNode(u)]),_:2},1032,["disabled","onClick"]))]),_:2},1024)])}),128))]),c.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(V.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:s.value.endTailType,"onUpdate:value":[d[1]||(d[1]=B=>s.value.endTailType=B),a],options:c.settings.endTailConfigs.map(({label:B},v)=>({label:B,value:v})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Yi,{"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(V.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",tg,[i.createVNode(i.unref(V.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(V.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(V.NFormItem),{required:!0,"show-feedback":((p=c.validation.length)==null?void 0:p.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(V.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(V.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(V.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(V.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":(C=c.validation.marker)==null?void 0:C.validationStatus,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(f,{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",ng,[i.createVNode(i.unref(V.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(V.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 Ra=Object.defineProperty,rg=Object.defineProperties,sg=Object.getOwnPropertyDescriptors,Fa=Object.getOwnPropertySymbols,og=Object.prototype.hasOwnProperty,ag=Object.prototype.propertyIsEnumerable,Ts=(e,t,n)=>t in e?Ra(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Es=(e,t)=>{for(var n in t||(t={}))og.call(t,n)&&Ts(e,n,t[n]);if(Fa)for(var n of Fa(t))ag.call(t,n)&&Ts(e,n,t[n]);return e},$s=(e,t)=>rg(e,sg(t)),Ma=(e,t)=>{for(var n in t)Ra(e,n,{get:t[n],enumerable:!0})},w=(e,t,n)=>(Ts(e,typeof t!="symbol"?t+"":t,n),n),Aa=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Ct=(e,t,n)=>(Aa(e,t,"read from private field"),n?n.call(e):t.get(e)),Oa=(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)},lg=(e,t,n,r)=>(Aa(e,t,"write to private field"),t.set(e,n),n),mt={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 mt.shim(e),typeof t<"u"&&(mt.Image=t),mt.isHeadless=!0,e}},Va={};Ma(Va,{Curve:()=>ki,getAnchorsFromArcData:()=>hg,getComponentOnCubicBezier:()=>Ui,getControlPoints:()=>Ga,getCurveBoundingBox:()=>qa,getCurveFromPoints:()=>Ua,getCurveLength:()=>Xa,getReflection:()=>Rs,integrate:()=>Ya,subdivide:()=>Ps});var za={};Ma(za,{HALF_PI:()=>Ze,NumArray:()=>Ut,TWO_PI:()=>at,decomposeMatrix:()=>vi,getComputedMatrix:()=>Da,getPoT:()=>Ha,lerp:()=>$t,mod:()=>Nt,setMatrix:()=>La,toFixed:()=>Pe});var He;typeof window<"u"?He=window:typeof global<"u"?He=global:typeof self<"u"&&(He=self);var Ia,at=Math.PI*2,Ze=Math.PI*.5;function vi(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 La(e){Ia=e}function Da(e,t){t=t&&t.identity()||new Ia;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 $t(e,t,n){return n*(t-e)+e}var Ns=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function Ha(e){let t=0;for(;Ns[t]&&Ns[t]<e;)t++;return Ns[t]}function Nt(e,t){for(;e<0;)e+=t;return e%t}var Ut=He.Float32Array||Array,cg=Math.floor;function Pe(e){return cg(e*1e6)/1e6}var Q={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 Wa={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))}}},Dt=class extends X{constructor(e=0,t=0){super(),w(this,"_x",0),w(this,"_y",0);for(let n in Wa)Object.defineProperty(this,n,Wa[n]);this.x=e,this.y=t}static add(e,t){return new Dt(e.x+t.x,e.y+t.y)}static sub(e,t){return new Dt(e.x-t.x,e.y-t.y)}static subtract(e,t){return Dt.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(Dt.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 Dt(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:Pe(this.x),y:Pe(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}},K=Dt;w(K,"zero",new Dt),w(K,"left",new Dt(-1,0)),w(K,"right",new Dt(1,0)),w(K,"up",new Dt(0,-1)),w(K,"down",new Dt(0,1));var ve=class extends K{constructor(t=0,n=0,r=0,s=0,o=0,a=0,l=Q.move){super(t,n),w(this,"controls",{left:new K,right:new K}),w(this,"_command",Q.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 ja)Object.defineProperty(this,d,ja[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:Pe(this.x),y:Pe(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Pe(this.rx),ry:Pe(this.ry),xAxisRotation:Pe(this.xAxisRotation),largeArcFlag:Pe(this.largeArcFlag),sweepFlag:Pe(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},ja={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))}}},dg=0,_t={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 dg++}},ki={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 Ui(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||ki.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 u=0;u<d;u++){const f=u/d,p=Ui(f,e,n,s,a),g=Ui(f,t,r,o,l);h.push(new ve(p,g))}return h}function Xa(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,u=3*(n-e),f=9*(r-o)+3*(l-t),p=6*(t+o)-12*r,g=3*(r-t);function m(_){const y=(d*_+h)*_+u,b=(f*_+p)*_+g;return Math.sqrt(y*y+b*b)}return Ya(m,0,1,c||ki.RecursionLimit)}function qa(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,f,p,g,m,_,y;for(let C=0;C<2;++C){if(C==0?(u=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,f=3*n-3*e):(u=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,f=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;p=-f/u,0<p&&p<1&&c.push(p);continue}_=u*u-4*f*h,y=Math.sqrt(_),!(_<0)&&(g=(-u+y)/(2*h),0<g&&g<1&&c.push(g),m=(-u-y)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,x;for(;b--;)p=c[b],x=1-p,d[0][b]=x*x*x*e+3*x*x*p*n+3*x*p*p*s+p*p*p*a,d[1][b]=x*x*x*t+3*x*x*p*r+3*x*p*p*o+p*p*p*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 Ya(e,t,n,r){let s=ki.abscissas[r-2],o=ki.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 u=a*s[c];h+=o[c++]*(e(l+u)+e(l-u))}return a*h}function Ua(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?Nt(s-1,n):Math.max(s-1,0),l=t?Nt(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];Ga(c,d,h),d.command=s===0?Q.move:Q.curve}}function Ga(e,t,n){const r=K.angleBetween(e,t),s=K.angleBetween(n,t);let o=K.distanceBetween(e,t),a=K.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+=Ze:l-=Ze,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 Rs(e,t,n){return new K(2*e.x-(t.x+e.x)-(n?e.x:0),2*e.y-(t.y+e.y)-(n?e.y:0))}function hg(e,t,n,r,s,o,a){const l=_t.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,u=n*Math.cos(h),f=r*Math.sin(h),p=new ve(u,f);p.command=Q.line}}var Ka=Array.prototype.slice;function ug(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=Ka.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=Ka.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=!ug(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},Pt={hasEventListeners:typeof He.addEventListener=="function",bind:function(e,t,n,r){return this.hasEventListeners?e.addEventListener(t,n,!!r):e.attachEvent("on"+t,n),Pt},unbind:function(e,t,n,r){return Pt.hasEventListeners?e.removeEventListeners(t,n,!!r):e.detachEvent("on"+t,n),Pt},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}},xi=He.document?He.document.createElement("div"):{};xi.id="help-two-load",Object.defineProperty(Pt,"temp",{enumerable:!0,get:function(){return ae.isElement(xi)&&!He.document.head.contains(xi)&&(xi.style.display="none",He.document.head.appendChild(xi)),xi}});var St=class extends Error{constructor(t){super(),w(this,"name","Two.js"),w(this,"message"),this.message=t}},fg=He.devicePixelRatio||1;function pg(e){return e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1}function Fs(e){return fg/pg(e)}var Er=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}},lt,Tn=class extends Array{constructor(){super(),Oa(this,lt,new X),arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return Ct(this,lt)}set _events(t){lg(this,lt,t)}get _bound(){return Ct(this,lt)._bound}set _bound(t){Ct(this,lt)._bound=t}addEventListener(){return Ct(this,lt).addEventListener.apply(this,arguments)}on(){return Ct(this,lt).on.apply(this,arguments)}bind(){return Ct(this,lt).bind.apply(this,arguments)}removeEventListener(){return Ct(this,lt).removeEventListener.apply(this,arguments)}off(){return Ct(this,lt).off.apply(this,arguments)}unbind(){return Ct(this,lt).unbind.apply(this,arguments)}dispatchEvent(){return Ct(this,lt).dispatchEvent.apply(this,arguments)}trigger(){return Ct(this,lt).trigger.apply(this,arguments)}listen(){return Ct(this,lt).listen.apply(this,arguments)}ignore(){return Ct(this,lt).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}};lt=new WeakMap;var Za=class extends X{constructor(){super(),w(this,"_flagId",!1),w(this,"_flagClassName",!1),w(this,"_renderer",{}),w(this,"_id",_t.Identifier+_t.uniqueId()),w(this,"_className",""),w(this,"classList",[]);for(let e in Ja)Object.defineProperty(this,e,Ja[e])}static fromObject(e){const t=new Za().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}}},Hn=Za;w(Hn,"Properties",["renderer","id","className"]);var Ja={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)}}},$r,Qa={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};He.document&&($r=document.createElement("a"));var Je=class extends Hn{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 el)Object.defineProperty(this,n,el[n]);if(this._renderer.type="texture",this._renderer.flagOffset=gg.bind(this),this._renderer.flagScale=mg.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new K,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 Je().copy(e);return"id"in e&&(t.id=e.id),t}static getAbsoluteURL(e){return $r?($r.href=e,$r.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=Je.getAbsoluteURL(e);if(Je.ImageRegistry.contains(t))return Je.ImageRegistry.get(t);let n;return mt.Image?(n=new mt.Image,mt.shim(n,"img")):He.document?Qa.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=Je.getTag(n);e._flagImage&&(/canvas/i.test(r)?Je.Register.canvas(e,t):(e._src=!mt.isHeadless&&n.getAttribute("two-src")||n.src,Je.Register[r](e,t))),e._flagSrc&&(n||(n=Je.getImage(e.src),e.image=n),r=Je.getTag(n),Je.Register[r](e,t))}clone(){const e=new Je(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 K?e.offset:new K().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof K?e.scale:new K().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,Je.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}},Ee=Je;w(Ee,"Properties",["src","loaded","repeat","scale","offset","image"]),w(Ee,"RegularExpressions",Qa),w(Ee,"ImageRegistry",new Er),w(Ee,"Register",{canvas:function(e,t){e._src="#"+e.id,Je.ImageRegistry.add(e.src,e.image),typeof t=="function"&&t()},img:function(e,t){const n=e.image,r=function(o){!mt.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!mt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new St("unable to load "+e.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!mt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),e._src=Je.getAbsoluteURL(e._src),!(!mt.isHeadless&&n&&n.getAttribute("two-src"))&&(mt.isHeadless||n.setAttribute("two-src",e.src),Je.ImageRegistry.add(e.src,n),mt.isHeadless?Je.loadHeadlessBuffer(e,r):e.image.src=e.src)},video:function(e,t){if(mt.isHeadless)throw new St("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 St("unable to load "+e.src)};e._src=Je.getAbsoluteURL(e._src),e.image.getAttribute("two-src")||(e.image.setAttribute("two-src",e.src),Je.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 el={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=Ee.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}Ee.ImageRegistry.contains(n)?this._image=Ee.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 K&&this._scale.unbind(X.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof K&&this._scale.bind(X.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function gg(){this._flagOffset=!0}function mg(){this._flagScale=!0}var Ht=class extends Hn{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 tl)Object.defineProperty(this,r,tl[r]);this._renderer.type="stop",this.offset=typeof e=="number"?e:Ht.Index<=0?0:1,this.opacity=typeof n=="number"?n:1,this.color=typeof t=="string"?t:Ht.Index<=0?"#fff":"#000",Ht.Index=(Ht.Index+1)%2}static fromObject(e){const t=new Ht().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ht.Properties.length;t++){const n=Ht.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Ht;return ae.each(Ht.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(Ht.Properties,t=>{e[t]=this[t]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}},Gt=Ht;w(Gt,"Index",0),w(Gt,"Properties",["offset","opacity","color"]);var tl={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)}}},Wn=class extends Hn{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 nl)Object.defineProperty(this,t,nl[t]);this._renderer.type="gradient",this._renderer.flagStops=_g.bind(this),this._renderer.bindStops=yg.bind(this),this._renderer.unbindStops=bg.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 Gt?r:new Gt().copy(r)));const n=new Wn().copy(e);return"id"in e&&(n.id=e.id),n}clone(e){const t=this.stops.map(r=>r.clone()),n=new Wn(t);return ae.each(Wn.Properties,r=>{n[r]=this[r]},this),e&&e.add(n),n}copy(e){super.copy.call(this,e);for(let t=0;t<Wn.Properties.length;t++){const n=Wn.Properties[t];n in e&&(this[n]=e[n])}return this}toObject(){const e={stops:this.stops.map(t=>t.toObject())};return ae.each(Wn.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}},Ue=Wn;w(Ue,"Stop",Gt),w(Ue,"Properties",["spread","stops","units"]);var nl={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 Tn((e||[]).slice(0)),this._stops.bind(X.Types.insert,t).bind(X.Types.remove,n),t(this._stops)}}};function _g(){this._flagStops=!0}function yg(e){let t=e.length;for(;t--;)e[t].bind(X.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function bg(e){let t=e.length;for(;t--;)e[t].unbind(X.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}var Gi=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 il)Object.defineProperty(this,o,il[o]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=wg.bind(this),this.left=new K,this.right=new K,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 Gi().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Gi.Properties.length;t++){const n=Gi.Properties[t];n in e&&(this[n]=e[n]instanceof K?e[n]:new K().copy(e[n]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Gi(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(X.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}},Oe=Gi;w(Oe,"Stop",Gt),w(Oe,"Properties",["left","right"]);var il={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof K&&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 K&&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 wg(){this._flagEndPoints=!0}var jn=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 rl)Object.defineProperty(this,a,rl[a]);this._renderer.type="radial-gradient",this._renderer.flagCenter=vg.bind(this),this._renderer.flagFocal=kg.bind(this),this.center=new K,this.radius=typeof n=="number"?n:1,this.focal=new K,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 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&&(/(center|focal)i/.test(n)?this[n]=e[n]instanceof K?e[n]:new K().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 jn(this.center._x,this.center._y,this._radius,t,this.focal._x,this.focal._y);return ae.each(Ue.Properties.concat(jn.Properties),function(r){n[r]=this[r]},this),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return ae.each(jn.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}},Ve=jn;w(Ve,"Stop",Gt),w(Ve,"Properties",["center","radius","focal"]);var rl={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 vg(){this._flagCenter=!0}function kg(){this._flagFocal=!0}function sl(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 Nr(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 ol(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,f=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(f||e).x,d=(f||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),f&&e._relative&&(o+=e.x,d+=e.y),Xa(r,l,s,c,o,d,a,h,n)}function al(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,f=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(f||e).x,d=(f||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),f&&e._relative&&(o+=e.x,d+=e.y),Ps(r,l,s,c,o,d,a,h,n)}function Xn(e){switch(e.renderer.type){case"texture":return Ee.fromObject(e);case"gradient":return Ue.fromObject(e);case"linear-gradient":return Oe.fromObject(e);case"radial-gradient":return Ve.fromObject(e)}return e}var xg=Math.cos,Cg=Math.sin,ll=Math.tan,Ms=[],Rt=class extends X{constructor(e,t,n,r,s,o){super(),w(this,"elements",new Ut(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 C=e;let B,v,$;const F=t[0]||0,R=t[1]||0,q=t[2]||0;return B=C[0]*F+C[1]*R+C[2]*q,v=C[3]*F+C[4]*R+C[5]*q,$=C[6]*F+C[7]*R+C[8]*q,[B,v,$]}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],u=e[8],f=t[0],p=t[1],g=t[2],m=t[3],_=t[4],y=t[5],b=t[6],S=t[7],x=t[8];return n=n||new Ut(9),n[0]=r*f+s*m+o*b,n[1]=r*p+s*_+o*S,n[2]=r*g+s*y+o*x,n[3]=a*f+l*m+c*b,n[4]=a*p+l*_+c*S,n[5]=a*g+l*y+c*x,n[6]=d*f+h*m+u*b,n[7]=d*p+h*_+u*S,n[8]=d*g+h*y+u*x,n}static fromObject(e){return new Rt().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]=Rt.Identity[0],this.elements[1]=Rt.Identity[1],this.elements[2]=Rt.Identity[2],this.elements[3]=Rt.Identity[3],this.elements[4]=Rt.Identity[4],this.elements[5]=Rt.Identity[5],this.elements[6]=Rt.Identity[6],this.elements[7]=Rt.Identity[7],this.elements[8]=Rt.Identity[8],this.trigger(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 N=s[0]*e+s[1]*t+s[2]*n,A=s[3]*e+s[4]*t+s[5]*n,L=s[6]*e+s[7]*t+s[8]*n;return[N,A,L]}const d=this.elements,h=[e,t,n,r,s,o,a,l,c],u=d[0],f=d[1],p=d[2],g=d[3],m=d[4],_=d[5],y=d[6],b=d[7],S=d[8],x=h[0],C=h[1],B=h[2],v=h[3],$=h[4],F=h[5],R=h[6],q=h[7],M=h[8];return this.elements[0]=u*x+f*v+p*R,this.elements[1]=u*C+f*$+p*q,this.elements[2]=u*B+f*F+p*M,this.elements[3]=g*x+m*v+_*R,this.elements[4]=g*C+m*$+_*q,this.elements[5]=g*B+m*F+_*M,this.elements[6]=y*x+b*v+S*R,this.elements[7]=y*C+b*$+S*q,this.elements[8]=y*B+b*F+S*M,this.trigger(X.Types.change)}inverse(e){const t=this.elements;e=e||new Rt;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],u=h*a-l*d,f=-h*o+l*c,p=d*o-a*c;let g=n*u+r*f+s*p;return g?(g=1/g,e.elements[0]=u*g,e.elements[1]=(-h*r+s*d)*g,e.elements[2]=(l*r-s*a)*g,e.elements[3]=f*g,e.elements[4]=(h*n-s*c)*g,e.elements[5]=(-l*n+s*o)*g,e.elements[6]=p*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=xg(e),n=Cg(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=ll(e);return this.multiply(1,t,0,0,1,0,0,0,1)}skewY(e){const t=ll(e);return this.multiply(1,0,0,t,1,0,0,0,1)}toString(e){return Ms.length=0,this.toTransformArray(e,Ms),Ms.map(Pe).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],u=n[7],f=n[8];if(r){t[0]=s,t[1]=l,t[2]=h,t[3]=o,t[4]=c,t[5]=u,t[6]=a,t[7]=d,t[8]=f;return}return[s,l,h,o,c,u,a,d,f]}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],u=n[7],f=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]=u,t[8]=f;return}return[s,o,a,l,c,d,h,u,f]}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 Rt().copy(this)}},qn=Rt;w(qn,"Identity",[1,0,0,0,1,0,0,0,1]),La(qn);var As=class extends Hn{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=cl.bind(this),this.isShape=!0,this.matrix=new qn,this.worldMatrix=new qn,this.position=new K,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const t=new As().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 K?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 K?e.scale:new K(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 As;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 K?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 K?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}},hn=As;w(hn,"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),cl.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 K&&this._scale.unbind(X.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof K&&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 Da(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function cl(){this._flagMatrix=!0}var Ci=Math.min,Si=Math.max,Sg=Math.ceil,Bg=Math.floor,Tg=new K,En=class extends hn{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 dl)Object.defineProperty(this,s,dl[s]);this._renderer.type="path",this._renderer.flagVertices=hl.bind(this),this._renderer.bindVertices=ul.bind(this),this._renderer.unbindVertices=fl.bind(this),this._renderer.flagFill=pl.bind(this),this._renderer.flagStroke=gl.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:Xn(e.fill),n=typeof e.stroke=="string"?e.stroke:Xn(e.stroke),r=new En().copy($s(Es({},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<En.Properties.length;t++){const n=En.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new En;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<En.Properties.length;n++){const r=En.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(En.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:u,scaleY:f}=vi(t.elements[0],t.elements[3],t.elements[1],t.elements[4],t.elements[2],t.elements[5]);typeof u=="number"&&typeof f=="number"&&(n=Math.max(u,f)*(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[u,f]=t.multiply(o.x,o.y),[p,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,x=a.controls.left.y;a.relative&&(S+=a.x,x+=a.y);let[C,B]=t.multiply(S,x);const v=qa(u,f,y,b,C,B,p,g);d=Ci(v.min.y-n,d),l=Ci(v.min.x-n,l),c=Si(v.max.x+n,c),h=Si(v.max.y+n,h)}else s<=1&&(d=Ci(f-n,d),l=Ci(u-n,l),c=Si(u+n,c),h=Si(f+n,h)),d=Ci(g-n,d),l=Ci(p-n,l),c=Si(p+n,c),h=Si(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,u,f,p,g,m,_,y=this.length*Math.min(Math.max(e,0),1);const b=this.vertices.length,S=b-1;let x=null,C=null;for(let Y=0,P=this._lengths.length,E=0;Y<P;Y++){if(E+this._lengths[Y]>=y){this._closed?(n=Nt(Y,b),r=Nt(Y-1,b),Y===0&&(n=r,r=Y)):(n=Y,r=Math.min(Math.max(Y-1,0),S)),x=this.vertices[n],C=this.vertices[r],y-=E,this._lengths[Y]!==0?e=y/this._lengths[Y]:e=0;break}E+=this._lengths[Y]}if(x===null||C===null)return null;if(x){if(!C)return x}else return C;_=C.controls&&C.controls.right,m=x.controls&&x.controls.left,a=C.x,u=C.y,l=(_||C).x,f=(_||C).y,c=(m||x).x,p=(m||x).y,d=x.x,g=x.y,_&&C.relative&&(l+=C.x,f+=C.y),m&&x.relative&&(c+=x.x,p+=x.y),o=Ui(e,a,l,c,d),h=Ui(e,u,f,p,g);const B=$t(a,l,e),v=$t(u,f,e),$=$t(l,c,e),F=$t(f,p,e),R=$t(c,d,e),q=$t(p,g,e),M=$t(B,$,e),N=$t(v,F,e),A=$t($,R,e),L=$t(F,q,e);return ae.isObject(t)?(t.x=o,t.y=h,t instanceof ve&&(t.controls.left.x=M,t.controls.left.y=N,t.controls.right.x=A,t.controls.right.y=L,(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,M-o,N-h,A-o,L-h,this._curved?Q.curve:Q.line),s.t=e,s)}plot(){if(this.curved)return Ua(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?Q.move:Q.line;return this}subdivide(e){this._update();const t=this.vertices.length-1,n=this._closed||this.vertices[t]._command===Q.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===Q.move){s.push(new ve(r.x,r.y)),l>0&&(s[s.length-1].command=Q.line),r=a;return}o=al(a,r,e),s=s.concat(o),ae.each(o,function(c,d){d<=0&&r.command===Q.move?c.command=Q.move:c.command=Q.line}),l>=t&&(this._closed&&this._automatic&&(r=a,o=al(a,r,e),s=s.concat(o),ae.each(o,function(c,d){d<=0&&r.command===Q.move?c.command=Q.move:c.command=Q.line})),s.push(new ve(a.x,a.y)),s[s.length-1].command=n?Q.close:Q.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===Q.move){s=a,this._lengths[l]=0;return}this._lengths[l]=ol(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=Nr(this,n*this._length),o=Nr(this,r*this._length),a=Sg(s),l=Bg(o);let c,d,h,u,f,p;for(this._renderer.vertices.length=0,p=0;p<e;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new ve),p>l&&!d?(f=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(r,f),f.command=this._renderer.collection[p].command,this._renderer.vertices.push(f),d=f,h=this._collection[p-1],h&&h.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f),h.relative?this._renderer.collection[p-1].controls.right.copy(h.controls.right).lerp(K.zero,1-f.t):this._renderer.collection[p-1].controls.right.copy(h.controls.right).lerp(h,1-f.t))):p>=a&&p<=l&&(f=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(f),p===l&&sl(this,r)?(d=f,!t&&d.controls&&(d.relative?d.controls.right.clear():d.controls.right.copy(d))):p===a&&sl(this,n)&&(c=f,c.command=Q.move,!t&&c.controls&&(c.relative?c.controls.left.clear():c.controls.left.copy(c))));a>0&&!c&&(p=a-1,f=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(n,f),f.command=Q.move,this._renderer.vertices.unshift(f),u=this._collection[p+1],u&&u.controls&&(f.controls.left.clear(),u.relative?this._renderer.collection[p+1].controls.left.copy(u.controls.left).lerp(K.zero,f.t):(Tg.copy(u),this._renderer.collection[p+1].controls.left.copy(u.controls.left).lerp(u,f.t))))}return hn.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,hn.prototype.flagReset.call(this),this}},Se=En;w(Se,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),w(Se,"Utils",{getCurveLength:ol});var dl={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 Oe||this._fill instanceof Ve||this._fill instanceof Ee)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ue||this._fill instanceof Oe||this._fill instanceof Ve||this._fill instanceof Ee)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ue||this._stroke instanceof Oe||this._stroke instanceof Ve||this._stroke instanceof Ee)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ue||this._stroke instanceof Oe||this._stroke instanceof Ve||this._stroke instanceof Ee)&&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 Tn?this._collection=e:this._collection=new Tn(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 hl(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function ul(e){let t=e.length;for(;t--;)e[t].bind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function fl(e){let t=e.length;for(;t--;)e[t].unbind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function pl(){this._flagFill=!0}function gl(){this._flagStroke=!0}var Ki=class extends Se{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 ml)Object.defineProperty(this,o,ml[o]);this.width=typeof n=="number"?n:1,this.height=typeof r=="number"?r:1,this.origin=new K,typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t),this._update()}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&&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=Q.move,this.vertices[1].set(e,-t).sub(this._origin).command=Q.line,this.vertices[2].set(e,t).sub(this._origin).command=Q.line,this.vertices[3].set(-e,t).sub(this._origin).command=Q.line,this.vertices[4]&&(this.vertices[4].set(-e,-t).sub(this._origin).command=Q.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=new Ki(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<Se.Properties.length;n++){const r=Se.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}},$n=Ki;w($n,"Properties",["width","height"]);var ml={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()}}},Zi=class extends $n{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 _l)Object.defineProperty(this,a,_l[a]);this.noStroke(),this.noFill(),e instanceof Ee?this.texture=e:typeof e=="string"&&(this.texture=new Ee(e)),this.origin=new K,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 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&&(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 Zi(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,u;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,u=this._lastFrame+1,l=1e3*(u-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),c=$t(this._firstFrame,u,o/l),c=Math.floor(c),c!==this._index&&(this._index=c,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const f=this._index%t,p=Math.floor(this._index/t),g=-r*f+(d-r)/2,m=-s*p+(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}},Rr=Zi;w(Rr,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var _l={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}}},Os,yl=class extends Tn{constructor(t){t=Array.isArray(t)?t:Array.prototype.slice.call(arguments),super(t),Oa(this,Os,{}),this.attach(t),this.on(X.Types.insert,this.attach),this.on(X.Types.remove,this.detach)}get ids(){return Ct(this,Os)}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}};Os=new WeakMap;var Yn=class extends Se{constructor(e,t,n,r,s,o,a){const l=a||_t.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",at),w(this,"_innerRadius",0),w(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let d in bl)Object.defineProperty(this,d,bl[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 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&&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=Nt(e,at)===Nt(t,at),o=n>0,a=this.vertices;let l=o?a.length/2:a.length,c,d=0,h,u,f,p,g,m,_,y,b;for(s?l--:o||(l-=2),h=0,u=l-1;h<l;h++){switch(f=h/u,p=a[d],g=f*(t-e)+e,m=(t-e)/l,_=r*Math.cos(g),y=r*Math.sin(g),h){case 0:c=Q.move;break;default:c=Q.curve}p.command=c,p.x=_,p.y=y,p.controls.left.clear(),p.controls.right.clear(),p.command===Q.curve&&(b=r*m/Math.PI,p.controls.left.x=b*Math.cos(g-Ze),p.controls.left.y=b*Math.sin(g-Ze),p.controls.right.x=b*Math.cos(g+Ze),p.controls.right.y=b*Math.sin(g+Ze),h===1&&p.controls.left.multiplyScalar(2),h===u&&p.controls.right.multiplyScalar(2)),d++}if(o){for(s?(a[d].command=Q.close,d++):(l--,u=l-1),h=0;h<l;h++)f=h/u,p=a[d],g=(1-f)*(t-e)+e,m=(t-e)/l,_=n*Math.cos(g),y=n*Math.sin(g),c=Q.curve,h<=0&&(c=s?Q.move:Q.line),p.command=c,p.x=_,p.y=y,p.controls.left.clear(),p.controls.right.clear(),p.command===Q.curve&&(b=n*m/Math.PI,p.controls.left.x=b*Math.cos(g+Ze),p.controls.left.y=b*Math.sin(g+Ze),p.controls.right.x=b*Math.cos(g-Ze),p.controls.right.y=b*Math.sin(g-Ze),h===1&&p.controls.left.multiplyScalar(2),h===u&&p.controls.right.multiplyScalar(2)),d++;a[d].copy(a[0]),a[d].command=Q.line}else s||(a[d].command=Q.line,a[d].x=0,a[d].y=0,d++,a[d].copy(a[0]),a[d].command=Q.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 Yn(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<Se.Properties.length;l++){const c=Se.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<Yn.Properties.length;t++){const n=Yn.Properties[t];e[n]=this[n]}return e}},Fr=Yn;w(Fr,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var bl={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}}},Vs=Math.cos,zs=Math.sin,Un=class extends Se{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 wl)Object.defineProperty(this,a,wl[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 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._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*at,l=n*Vs(a),c=n*zs(a),d=r*Vs(a-Ze),h=r*zs(a-Ze),u=r*Vs(a+Ze),f=r*zs(a+Ze),p=this.vertices[s];p.command=s===0?Q.move:Q.curve,p.set(l,c),p.controls.left.set(d,h),p.controls.right.set(u,f)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const t=new Un(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<Se.Properties.length;n++){const r=Se.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<Un.Properties.length;t++){const n=Un.Properties[t];e[n]=this[n]}return e}},Ji=Un;w(Ji,"Properties",["radius"]);var wl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Is=Math.cos,Ls=Math.sin,Gn=class extends Se{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 vl)Object.defineProperty(this,l,vl[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 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._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*at,l=n*Is(a),c=r*Ls(a),d=n*t*Is(a-Ze),h=r*t*Ls(a-Ze),u=n*t*Is(a+Ze),f=r*t*Ls(a+Ze),p=this.vertices[s];p.command=s===0?Q.move:Q.curve,p.set(l,c),p.controls.left.set(d,h),p.controls.right.set(u,f)}}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 Gn(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<Se.Properties.length;o++){const a=Se.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<Gn.Properties.length;t++){const n=Gn.Properties[t];e[n]=this[n]}return e}},Qi=Gn;w(Qi,"Properties",["width","height"]);var vl={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}}},Eg=Math.ceil,$g=Math.floor,Nn=class extends hn{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",Se.prototype.noFill),w(this,"noStroke",Se.prototype.noStroke),w(this,"corner",Se.prototype.corner),w(this,"center",Se.prototype.center),w(this,"getBoundingClientRect",Se.prototype.getBoundingClientRect),w(this,"_updateLength",Se.prototype._updateLength);for(let t in kl)Object.defineProperty(this,t,kl[t]);this._renderer.type="points",this._renderer.flagVertices=hl.bind(this),this._renderer.bindVertices=ul.bind(this),this._renderer.unbindVertices=fl.bind(this),this._renderer.flagFill=pl.bind(this),this._renderer.flagStroke=gl.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:Xn(e.fill),n=typeof e.stroke=="string"?e.stroke:Xn(e.stroke),r=new Nn().copy($s(Es({},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<Nn.Properties.length;t++){const n=Nn.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Nn;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<Nn.Properties.length;n++){const r=Nn.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(Nn.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=Nr(this,e*this._length),r=Nr(this,t*this._length),s=Eg(n),o=$g(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}},Mr=Nn;w(Mr,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);var kl={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 Oe||this._fill instanceof Ve||this._fill instanceof Ee)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ue||this._fill instanceof Oe||this._fill instanceof Ve||this._fill instanceof Ee)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ue||this._stroke instanceof Oe||this._stroke instanceof Ve||this._stroke instanceof Ee)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ue||this._stroke instanceof Oe||this._stroke instanceof Ve||this._stroke instanceof Ee)&&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 Tn?this._collection=e:this._collection=new Tn(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}}},Ng=Math.cos,Pg=Math.sin,Kn=class extends Se{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 xl)Object.defineProperty(this,s,xl[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 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||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=at*s+Math.PI/2,a=this._width*Ng(o)/2,l=this._height*Pg(o)/2;r>=n?this.vertices.push(new ve(a,l)):this.vertices[r].set(a,l),this.vertices[r].command=r===0?Q.move:Q.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 Kn(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<Se.Properties.length;n++){const r=Se.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<Kn.Properties.length;t++){const n=Kn.Properties[t];e[n]=this[n]}return e}},Ar=Kn;w(Ar,"Properties",["width","height","sides"]);var xl={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}}},Zn=class extends Se{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?Q.move:Q.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 Cl)Object.defineProperty(this,a,Cl[a]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Rg.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 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];if(n in e){const r=e[n];/radius/i.test(n)?this[n]=typeof r=="number"||r instanceof K?r:new K().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 K?(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 Zn(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<Se.Properties.length;o++){const a=Se.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<Zn.Properties.length;t++){const n=Zn.Properties[t];e[n]=this[n]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}},er=Zn;w(er,"Properties",["width","height","radius"]);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}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof K&&this._radius.unbind(X.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof K&&this._radius.bind(X.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Rg(){this._flagRadius=!0}var Fg=Math.cos,Mg=Math.sin,Jn=class extends Se{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 Sl)Object.defineProperty(this,o,Sl[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 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._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=at*s,a=(r%2?this._outerRadius:this._innerRadius)/2,l=a*Fg(o),c=a*Mg(o);r>=n?this.vertices.push(new ve(l,c)):this.vertices[r].set(l,c),this.vertices[r].command=r===0?Q.move:Q.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 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<Se.Properties.length;o++){const a=Se.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<Jn.Properties.length;t++){const n=Jn.Properties[t];e[n]=this[n]}return e}},Or=Jn;w(Or,"Properties",["innerRadius","outerRadius","sides"]);var Sl={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}}},Ds,Bl=Math.min,Tl=Math.max;He.document&&(Ds=document.createElement("canvas"));var Ft=class extends hn{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 El)Object.defineProperty(this,s,El[s]);if(this._renderer.type="text",this._renderer.flagFill=Ag.bind(this),this._renderer.flagStroke=Og.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<Ft.Properties.length;s++){const o=Ft.Properties[s];o in r&&(this[o]=r[o])}}static Measure(e){if(Ds){const t=Ds.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*Ft.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:Xn(e.fill),n=typeof e.stroke=="string"?e.stroke:Xn(e.stroke),r=new Ft().copy($s(Es({},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<Ft.Properties.length;t++){const n=Ft.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Ft(this.value);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale;for(let n=0;n<Ft.Properties.length;n++){const r=Ft.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<Ft.Properties.length;t++){const n=Ft.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}=Ft.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),[u,f]=t.multiply(n,o),[p,g]=t.multiply(r,s),[m,_]=t.multiply(r,o);return s=Bl(h,f,g,_),n=Bl(d,u,p,m),r=Tl(d,u,p,m),o=Tl(h,f,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}},Ot=Ft;w(Ot,"Ratio",.6),w(Ot,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);var El={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 Oe||this._fill instanceof Ve||this._fill instanceof Ee)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ue||this._fill instanceof Oe||this._fill instanceof Ve||this._fill instanceof Ee)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ue||this._stroke instanceof Oe||this._stroke instanceof Ve||this._stroke instanceof Ee)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ue||this._stroke instanceof Oe||this._stroke instanceof Ve||this._stroke instanceof Ee)&&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 Ag(){this._flagFill=!0}function Og(){this._flagStroke=!0}var Vr=Math.min,zr=Math.max,Bi=class extends hn{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 $l)Object.defineProperty(this,t,$l[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++)Nl.call(this,e[t],this)}static RemoveChildren(e){for(let t=0;t<e.length;t++)Nl.call(this,e[t])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const t=new Bi;for(let r=0;r<Bi.Properties.length;r++){const s=Bi.Properties[r];s in e&&(/(fill|stroke)/i.test(s)?t[s]=typeof e[s]=="string"?e[s]:Xn(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 Fr.fromObject(r);case"circle":return Ji.fromObject(r);case"ellipse":return Qi.fromObject(r);case"points":return Mr.fromObject(r);case"polygon":return Ar.fromObject(r);case"rectangle":return $n.fromObject(r);case"rounded-rectangle":return er.fromObject(r);case"star":return Or.fromObject(r);case"path":return Se.fromObject(r);case"text":return Ot.fromObject(r);case"group":return Bi.fromObject(r);case"shape":return hn.fromObject(r);case"element":return Hn.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 Bi,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 u=/texture|gradient/i;n=e?this.matrix:this.worldMatrix;for(let f=0;f<this.children.length;f++){const p=this.children[f];if(!(!p.visible||u.test(p._renderer.type))&&(t=p.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,C]=n.multiply(t.right,t.bottom);d=Vr(m,y,S,C,d),l=Vr(g,_,b,x,l),c=zr(g,_,b,x,c),h=zr(m,y,S,C,h)}else d=Vr(t.top,d),l=Vr(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=Bi;w(Ke,"Children",yl),w(Ke,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var $l={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 yl(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 Nl(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 Hs=class extends Se{constructor(t,n,r,s){const o=[new ve(t,n),new ve(r,s)];super(o);for(let a in Pl)Object.defineProperty(this,a,Pl[a]);this.vertices[0].command=Q.move,this.vertices[1].command=Q.line,this.automatic=!1}},Pl={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 St("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 St("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}},Kt={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},Vg={start:"left",middle:"center",end:"right"},Rl=["id","class","transform","xmlns","viewBox"],zg=["x","y","width","height","href","xlink:href"];function Ig(e){return Vg[e]}function Lg(e){const t=e.getAttribute("dominant-baseline"),n=e.getAttribute("alignment-baseline");return t||n}function tr(e){return e.replace(/svg:/gi,"").toLowerCase()}function Fl(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 Dg(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 Hg(e){const t={},n=Wg(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 Wg(e){const t=e.getAttributeNames();for(let n=0;n<Rl.length;n++){const r=Rl[n],s=Array.prototype.indexOf.call(t,r);s>=0&&t.splice(s,1)}return t}function jg(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 u=0;u<e.children.length;u++){const f=e.children[u];"translation"in f?f.translation.add(r,s):"x"in f?f.x=r:"y"in f&&(f.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 K(1,1)),d&&(e.scale.x=e.width/o),h&&(e.scale.y=e.height/a),e.mask=new $n(0,0,o,a),e.mask.origin.set(-o/2,-a/2),e}function Vt(e,t,n){const r={},s={},o={};let a,l,c,d,h,u,f,p,g,m,_,y,b,S,x,C,B;if(e===null)return r;if(He.getComputedStyle){const v=He.getComputedStyle(e);for(a=v.length;a--;)c=v[a],d=v[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<e.attributes.length;a++)u=e.attributes[a],/style/i.test(u.nodeName)?Dg(u.value,o):s[u.nodeName]=u.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&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(f=vi(l),t._renderer.type){case"linear-gradient":Fl(f,t.left),Fl(f,t.right);break;case"radial-gradient":t.center.x+=f.translateX,t.center.y+=f.translateY,t.focal.x+=f.translateX,t.focal.y+=f.translateY,t.radius*=Math.max(f.scaleX,f.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;f=vi(l),t.translation.set(f.translateX,f.translateY),t.rotation=Math.PI*(f.rotation/180),t.scale=new K(f.scaleX,f.scaleY),p=parseFloat((r.x+"").replace("px")),g=parseFloat((r.y+"").replace("px")),p&&(t.translation.x=p),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(Kt.cssBackgroundImage.test(d)&&(m=d.replace(Kt.cssBackgroundImage,"$1"),Le.defs.current&&Le.defs.current.contains(m)&&(y=Le.defs.current.get(m),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],b=tr(y.nodeName),t.mask=Le[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 Ke?"_":"")+c,Kt.cssBackgroundImage.test(d)?(m=d.replace(Kt.cssBackgroundImage,"$1"),Le.defs.current&&Le.defs.current.contains(m)?(y=Le.defs.current.get(m),y.object||(b=tr(y.nodeName),y.object=Le[b].call(this,y,{})),y=y.object):(_=qg(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,x=t instanceof Oe,C=t instanceof Ve,S||x||C)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new St("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 Ot&&(t.family=d);break;case"font-size":t instanceof Ot&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new St("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 Ot&&(t.weight=d);break;case"font-style":t instanceof Ot&&(t.style=d);break;case"text-decoration":t instanceof Ot&&(t.decoration=d);break;case"line-height":t instanceof Ot&&(t.leading=d);break}return Object.keys(e.dataset).length&&(t.dataset=e.dataset),r}function Xg(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){const s=e.childNodes[n];!s.id||tr(e.nodeName)==="#text"||t.add(s.id,s)}}function qg(e){for(;e.parent;)e=e.parent;return e.scene}var Le={svg:function(e){const t=Le.defs.current=new Er,n=e.getElementsByTagName("defs");for(let g=0;g<n.length;g++)Xg(n[g],t);const r=Le.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,u=a!==null,f=l!==null,p=c!==null;return h&&(r.x=parseFloat(o.replace(Kt.unitSuffix,""))),u&&(r.y=parseFloat(a.replace(Kt.unitSuffix,""))),f&&(r.width=parseFloat(l.replace(Kt.unitSuffix,""))),p&&(r.height=parseFloat(c.replace(Kt.unitSuffix,""))),d&&jg(r,s),delete Le.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 St("encountered <use /> with no href."),console.warn(n.name,n.message),null;const s=r.slice(1);if(!Le.defs.current.contains(s))return n=new St("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=Le.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),u=!a.hasAttribute(d.nodeName);(h||u)&&a.setAttribute(d.nodeName,d.value)}const l=tr(a.nodeName);return Le[l].call(this,a,t)},g:function(e,t){const n=new Ke;Vt.call(this,e,n,t),this.add(n);const r=Hg.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=tr(l);if(c in Le){const d=Le[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 Se(r,!0);return s.stroke="none",s.fill="black",Vt.call(this,e,s,t),s},polyline:function(e,t){const n=Le.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 u=h.length-1;ae.each(h.slice(0),function(f,p){const g=f.slice(1).trim().match(Kt.path),m=f[0],_=m.toLowerCase();let y,b,S,x,C;const B=[];switch(p===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,C=0;b<S;b+=y){if(x=m,C>0)switch(m){case"m":x="l";break;case"M":x="L";break}B.push(x+g.slice(b,b+y).join(" ")),C++}h=Array.prototype.concat.apply(h,B)}else h.push(f)}),ae.each(h,function(f,p){let g,m,_;const y=f[0],b=y.toLowerCase();d=f.slice(1).trim().match(Kt.path),o=y===b;let S,x,C,B,v,$,F,R,q,M,N,A,L,Y,P,E,H;switch(b){case"z":if(p>=u)s=!0;else{m=l.x,_=l.y,g=new ve(m,_,void 0,void 0,void 0,void 0,Q.close);for(let I=r.length-1;I>=0;I--){const U=r[I];if(/m/i.test(U.command)){l=U;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)?Q.move:Q.line),o&&g.addSelf(l),l=g;break;case"h":case"v":M=/h/i.test(b)?"x":"y",N=/x/i.test(M)?"y":"x",g=new ve(void 0,void 0,void 0,void 0,void 0,void 0,Q.line),g[M]=parseFloat(d[0]),g[N]=l[N],o&&(g[M]+=l[M]),l=g;break;case"c":case"s":S=l.x,x=l.y,c||(c=new K),/c/i.test(b)?(C=parseFloat(d[0]),B=parseFloat(d[1]),v=parseFloat(d[2]),$=parseFloat(d[3]),F=parseFloat(d[4]),R=parseFloat(d[5])):(q=Rs(l,c,o),C=q.x,B=q.y,v=parseFloat(d[0]),$=parseFloat(d[1]),F=parseFloat(d[2]),R=parseFloat(d[3])),o&&(C+=S,B+=x,v+=S,$+=x,F+=S,R+=x),l.controls.right.set(C-l.x,B-l.y),g=new ve(F,R,v-F,$-R,void 0,void 0,Q.curve),l=g,c=g.controls.left;break;case"t":case"q":S=l.x,x=l.y,c||(c=new K),/q/i.test(b)?(C=parseFloat(d[0]),B=parseFloat(d[1]),v=parseFloat(d[0]),$=parseFloat(d[1]),F=parseFloat(d[2]),R=parseFloat(d[3])):(q=Rs(l,c,o),C=q.x,B=q.y,v=q.x,$=q.y,F=parseFloat(d[0]),R=parseFloat(d[1])),o&&(C+=S,B+=x,v+=S,$+=x,F+=S,R+=x),l.controls.right.set((C-l.x)*.33,(B-l.y)*.33),g=new ve(F,R,v-F,$-R,void 0,void 0,Q.curve),l=g,c=g.controls.left;break;case"a":S=l.x,x=l.y,L=parseFloat(d[0]),Y=parseFloat(d[1]),P=parseFloat(d[2]),E=parseFloat(d[3]),H=parseFloat(d[4]),F=parseFloat(d[5]),R=parseFloat(d[6]),o&&(F+=S,R+=x),A=new ve(F,R),A.command=Q.arc,A.rx=L,A.ry=Y,A.xAxisRotation=P,A.largeArcFlag=E,A.sweepFlag=H,g=A,l=A,c=void 0;break}g&&(Array.isArray(g)?r=r.concat(g):r.push(g))})}n=new Se(r,s,void 0,!0),n.stroke="none",n.fill="black";const a=n.getBoundingClientRect(!0);return a.centroid={x:a.left+a.width/2,y:a.top+a.height/2},ae.each(n.vertices,function(l){l.subSelf(a.centroid)}),Vt.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 Ji(0,0,s);return o.stroke="none",o.fill="black",Vt.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 Qi(0,0,s,o);return a.stroke="none",a.fill="black",Vt.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 Le["rounded-rect"](e);const s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new $n(0,0,s,o);return c.stroke="none",c.fill="black",Vt.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 K(n,r),d=new er(0,0,s,o,c);return d.stroke="none",d.fill="black",Vt.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 Hs(n,r,s,o).noFill();return Vt.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 f=0;f<e.children.length;f++){const p=e.children[f];let g=p.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let m=p.getAttribute("stop-color"),_=p.getAttribute("stop-opacity"),y=p.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 Gt(g,m,_))}const u=new Oe(s,o,a,l,h);return u.spread=r,u.units=n,Vt.call(this,e,u,t),u},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 u=[];for(let p=0;p<e.children.length;p++){const g=e.children[p];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),u.push(new Gt(m,_,y))}const f=new Ve(s,o,a,u,l,c);return f.spread=r,f.units=n,Vt.call(this,e,f,t),f},text:function(e,t){const n=Ig(e.getAttribute("text-anchor"))||"left",r=Lg(e)||"baseline";let s="";e.childNodes.length>0&&e.childNodes[0].tagName==="TSPAN"?s=e.childNodes[0].textContent:s=e.textContent;const o=new Ot(s);return Vt.call(this,e,o,t),o.alignment=n,o.baseline=r,o},clippath:function(e,t){return Le.defs.current&&!Le.defs.current.contains(e.id)&&Le.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 St("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 Rr(r,s,o);return ae.isNaN(a)||(c.width=a),ae.isNaN(l)||(c.height=l),Vt.call(this,e,c,t),c}};function Ml(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 Ti=class extends $n{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 Al)Object.defineProperty(this,s,Al[s]);this._renderer.flagTextures=Yg.bind(this),this._renderer.bindTextures=Ug.bind(this),this._renderer.unbindTextures=Gg.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(Ol.bind(this)):this.textures=[Ol(e)],this.origin=new K,this._update(),typeof r=="number"?this.frameRate=r:this.frameRate=Ti.DefaultFrameRate,this.index=0}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&&(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 Ti(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=$t(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 Ee))&&(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}},Ir=Ti;w(Ir,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),w(Ir,"DefaultFrameRate",30);var Al={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 Tn((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 Yg(){this._flagTextures=!0}function Ug(e){let t=e.length;for(;t--;)e[t].bind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Gg(e){let t=e.length;for(;t--;)e[t].unbind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Ol(e){if(e instanceof Ee)return e;if(typeof e=="string")return new Ee(e)}var Ws=[],js=Math.max,Kg=Math.min,Vl=Math.abs,Lr=Math.sin,Dr=Math.cos,Zg=Math.acos,Hr=Math.sqrt,Te={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(e){return e in Te?e:"path"},group:{renderChild:function(e){const t=Te.getRendererType(e._renderer.type);Te[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=Wr(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=Te.getRendererType(r._renderer.type);Te[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=Te.getRendererType(l._renderer.type);Te[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,u,f,p,g,m,_,y,b,S,x,C,B,v,$,F,R,q,M,N,A,L,Y,P,E,H,I;if(I=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,L=this._mask,Y=this._clip,l=this._opacity*(I||1),c=this._visible,!t&&(!c||Y||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,u=this._miter,f=this._closed,p=this._renderer.vertices,g=p.length,m=g-1,P=Wr(r),H=this.dashes,P||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),L){const ie=Te.getRendererType(L._renderer.type);Te[ie].render.call(L,e,!0)}if(a)if(typeof a=="string")e.fillStyle=a;else{const ie=Te.getRendererType(a._renderer.type);Te[ie].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const ie=Te.getRendererType(s._renderer.type);Te[ie].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o),u&&(e.miterLimit=u),h&&(e.lineJoin=h),!f&&d&&(e.lineCap=d)}typeof l=="number"&&(e.globalAlpha=l),H&&H.length>0&&(e.lineDashOffset=H.offset||0,e.setLineDash(H)),e.beginPath();let U,O,z,Z,pe,re,ge;for(let ie=0;ie<g;ie++)switch(b=p[ie],N=b.x,A=b.y,b.command){case Q.close:e.closePath();break;case Q.arc:U=b.rx,O=b.ry,z=b.xAxisRotation,Z=b.largeArcFlag,pe=b.sweepFlag,_=f?Nt(ie-1,g):js(ie-1,0),y=p[_],re=y.x,ge=y.y,Te.renderSvgArcCommand(e,re,ge,U,O,Z,pe,z,N,A);break;case Q.curve:_=f?Nt(ie-1,g):Math.max(ie-1,0),y=p[_],F=y.controls&&y.controls.right||K.zero,R=b.controls&&b.controls.left||K.zero,y._relative?(v=F.x+y.x,$=F.y+y.y):(v=F.x,$=F.y),b._relative?(C=R.x+b.x,B=R.y+b.y):(C=R.x,B=R.y),e.bezierCurveTo(v,$,C,B,N,A),ie>=m&&f&&(S=x,q=b.controls&&b.controls.right||K.zero,M=S.controls&&S.controls.left||K.zero,b._relative?(v=q.x+b.x,$=q.y+b.y):(v=q.x,$=q.y),S._relative?(C=M.x+S.x,B=M.y+S.y):(C=M.x,B=M.y),N=S.x,A=S.y,e.bezierCurveTo(v,$,C,B,N,A));break;case Q.line:e.lineTo(N,A);break;case Q.move:x=b,e.moveTo(N,A);break}return f&&e.closePath(),!Y&&!n&&(Te.isHidden.test(a)||(E=a._renderer&&a._renderer.offset,E&&(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&&e.restore()),Te.isHidden.test(s)||(E=s._renderer&&s._renderer.offset,E&&(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&&e.restore())),P||e.restore(),Y&&!n&&e.clip(),H&&H.length>0&&e.setLineDash(Ws),this.flagReset()}},points:{render:function(e,t,n){let r,s,o,a,l,c,d,h,u,f,p,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,u=h.length,m=Wr(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 C=Te.getRendererType(a._renderer.type);Te[C].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const C=Te.getRendererType(s._renderer.type);Te[C].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,x;this._sizeAttenuation||(x=this.worldMatrix.elements,x=vi(x[0],x[3],x[1],x[4],x[2],x[5]),S/=Math.max(x.scaleX,x.scaleY));for(let C=0;C<u;C++)f=h[C],p=f.x,g=f.y,e.moveTo(p+S,g),e.arc(p,g,S,0,at);return n||(Te.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()),Te.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(Ws),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,u=this._fill,f=this._decoration,p=this._direction,g=Wr(c),m=u._renderer&&u._renderer.offset&&d._renderer&&d._renderer.offset,_=this.dashes,y=Te.alignments[this._alignment]||this._alignment,b=Te.baselines[this._baseline]||this._baseline;let S,x,C,B,v,$,F,R,q,M,N;if(g||(e.save(),e.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const A=Te.getRendererType(a._renderer.type);Te[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=p,u)if(typeof u=="string")e.fillStyle=u;else{const A=Te.getRendererType(u._renderer.type);Te[A].render.call(u,e,this),e.fillStyle=u._renderer.effect}if(d){if(typeof d=="string")e.strokeStyle=d;else{const A=Te.getRendererType(d._renderer.type);Te[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&&(Te.isHidden.test(u)||(u._renderer&&u._renderer.offset?($=u._renderer.scale.x,F=u._renderer.scale.y,e.save(),e.translate(-u._renderer.offset.x,-u._renderer.offset.y),e.scale($,F),S=this._size/u._renderer.scale.y,x=this._leading/u._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",x+"px",this._family].join(" "),C=u._renderer.offset.x/u._renderer.scale.x,B=u._renderer.offset.y/u._renderer.scale.y,e.fillText(this.value,C,B),e.restore()):e.fillText(this.value,0,0)),Te.isHidden.test(d)||(d._renderer&&d._renderer.offset?($=d._renderer.scale.x,F=d._renderer.scale.y,e.save(),e.translate(-d._renderer.offset.x,-d._renderer.offset.y),e.scale($,F),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(" "),C=d._renderer.offset.x/d._renderer.scale.x,B=d._renderer.offset.y/d._renderer.scale.y,v=h/d._renderer.scale.x,e.lineWidth=v,e.strokeText(this.value,C,B),e.restore()):e.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(f)){const A=e.measureText(this.value);let L=1;switch(f){case"underline":q=A.actualBoundingBoxDescent,N=A.actualBoundingBoxDescent;break;case"strikethrough":q=0,N=0,L=.5;break}switch(b){case"top":q+=this._size*L,N+=this._size*L;break;case"baseline":case"bottom":q-=this._size*L,N-=this._size*L;break}switch(y){case"left":case"start":R=0,M=A.width;break;case"right":case"end":R=-A.width,M=0;break;default:R=-A.width/2,M=A.width/2}e.lineWidth=Math.max(Math.floor(this._size/15),1),e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(R,q),e.lineTo(M,N),e.stroke()}return g||e.restore(),l&&!n&&e.clip(),_&&_.length>0&&e.setLineDash(Ws),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 K||(this._renderer.offset=new K),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 K?(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 K||(this._renderer.scale=new K),this._scale instanceof K?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=Vl(r),s=Vl(s);const h=(t-c)/2,u=(n-d)/2,f=Dr(l)*h+Lr(l)*u,p=-Lr(l)*h+Dr(l)*u,g=f*f,m=p*p;let _=r*r,y=s*s;const b=g/_+m/y;if(b>1){const A=Hr(b);r=A*r,s=A*s,_=r*r,y=s*s}const S=_*m+y*g,x=(_*y-S)/S;let C=Hr(js(0,x));o===a&&(C=-C);const B=C*r*p/s,v=-C*s*f/r,$=Dr(l)*B-Lr(l)*v+(t+c)/2,F=Lr(l)*B+Dr(l)*v+(n+d)/2,R=zl(1,0,(f-B)/r,(p-v)/s),q=zl((f-B)/r,(p-v)/s,(-f-B)/r,(-p-v)/s)%at,M=R+q;Jg(e,$,F,r,s,R,M,a===0,l)}},ct=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"?Fs(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),Te.group.render.call(this.scene,this.ctx),e||this.ctx.restore(),this}};w(ct,"Utils",Te);function Jg(e,t,n,r,s,o,a,l,c){const d=a-o,h=ki.Tolerance.epsilon,u=Math.abs(d)<h;let f=Nt(d,at);f<h&&(u?f=0:f=at),l===!0&&!u&&(f===at?f=-at:f=f-at);for(let p=0;p<_t.Resolution;p++){const g=p/(_t.Resolution-1),m=o+g*f;let _=t+r*Math.cos(m),y=n+s*Math.sin(m);if(c!==0){const b=Math.cos(c),S=Math.sin(c),x=_-t,C=y-n;_=x*b-C*S+t,y=x*S+C*b+n}e.lineTo(_,y)}}function zl(e,t,n,r){const s=e*n+t*r,o=Hr(e*e+t*t)*Hr(n*n+r*r);let a=Zg(js(-1,Kg(1,s/o)));return e*r-t*n<0&&(a=-a),a}function Wr(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?Nt(a-1,n):Math.max(a-1,0),d=e[c];let h,u,f,p,g,m,_,y,b,S,x,C,B,v,$,F=Pe(l.x),R=Pe(l.y);switch(l.command){case Q.close:h=Q.close;break;case Q.arc:x=l.rx,C=l.ry,B=l.xAxisRotation,v=l.largeArcFlag,$=l.sweepFlag,h=Q.arc+" "+x+" "+C+" "+B+" "+v+" "+$+" "+F+" "+R;break;case Q.curve:_=d.controls&&d.controls.right||K.zero,y=l.controls&&l.controls.left||K.zero,d.relative?(f=Pe(_.x+d.x),p=Pe(_.y+d.y)):(f=Pe(_.x),p=Pe(_.y)),l.relative?(g=Pe(y.x+l.x),m=Pe(y.y+l.y)):(g=Pe(y.x),m=Pe(y.y)),h=(a===0?Q.move:Q.curve)+" "+f+" "+p+" "+g+" "+m+" "+F+" "+R;break;case Q.move:s=l,h=Q.move+" "+F+" "+R;break;default:h=l.command+" "+F+" "+R}a>=r&&t&&(l.command===Q.curve&&(u=s,b=l.controls&&l.controls.right||l,S=u.controls&&u.controls.left||u,l.relative?(f=Pe(b.x+l.x),p=Pe(b.y+l.y)):(f=Pe(b.x),p=Pe(b.y)),u.relative?(g=Pe(S.x+u.x),m=Pe(S.y+u.y)):(g=Pe(S.x),m=Pe(S.y)),F=Pe(u.x),R=Pe(u.y),h+=" C "+f+" "+p+" "+g+" "+m+" "+F+" "+R),l.command!==Q.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+=Q.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=vi(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 K?(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 K?(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()}}},Il=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(Il,"Utils",se);var zt={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 St("unable to compile shader "+r+": "+o)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
|
40
|
+
***************************************************************************** */var Cr=function(){return Cr=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},Cr.apply(this,arguments)},Ou={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"}},cn={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ss=500,Vu=function(){function e(t,n){return this.core=t,this.$LG=n,this.settings=Cr(Cr({},Ou),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(cn.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,u=d.allowX;this.positionChanged&&(l=this.left/(this.scale-n),c=this.top/(this.scale-n),this.pageX=o-l,this.pageY=a-c,this.positionChanged=!1);var f=this.getPossibleSwipeDragCords(n),p,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)),p=m/y,g=_/y}else{var y=(t-n)*n;p=m*y,g=_*y}r&&(u?this.isBeyondPossibleLeft(p,f.minX)?p=f.minX:this.isBeyondPossibleRight(p,f.maxX)&&(p=f.maxX):t>1&&(p<f.minX?p=f.minX:p>f.maxX&&(p=f.maxX)),h?this.isBeyondPossibleTop(g,f.minY)?g=f.minY:this.isBeyondPossibleBottom(g,f.maxY)&&(g=f.maxY):t>1&&(g<f.minY?g=f.minY:g>f.maxY&&(g=f.maxY))),this.setZoomStyles({x:p,y:g,scale:t}),this.left=p,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)},Ss),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")}},Ss+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},Ss+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(cn.containerResize+".zoom "+cn.rotateRight+".zoom "+cn.rotateLeft+".zoom "+cn.flipHorizontal+".zoom "+cn.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(cn.beforeOpen+".zoom",function(){t.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(cn.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(cn.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 u=t.scale-o;t.zoomImage(t.scale,Math.round((u+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(),u={};u.x=this.left+a,u.y=this.top+l;var f=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(u.y,f.minY)?u.y=f.minY:this.isBeyondPossibleBottom(u.y,f.maxY)&&(u.y=f.maxY)),r&&(this.isBeyondPossibleLeft(u.x,f.minX)?u.x=f.minX:this.isBeyondPossibleRight(u.x,f.maxX)&&(u.x=f.maxX)),s?this.top=u.y:u.y=this.top,r?this.left=u.x:u.x=this.left,this.setZoomSwipeStyles(h,u),this.positionChanged=!0)},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,u={minY:l,maxY:c,minX:d,maxX:h};return u},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,u=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(f){if(t.isImageSlide(t.core.index)&&(u=t.core.getSlideItem(t.core.index),(t.$LG(f.target).hasClass("lg-item")||u.get().contains(f.target))&&f.touches.length===1&&t.core.outer.hasClass("lg-zoomed"))){f.preventDefault(),l=new Date,t.core.touchAction="zoomSwipe",h=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var p=t.getDragAllowedAxises(0);a=p.allowY,o=p.allowX,(o||a)&&(n=t.getSwipeCords(f)),d=t.getPossibleSwipeDragCords(),t.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(f){if(f.touches.length===1&&t.core.touchAction==="zoomSwipe"&&(t.$LG(f.target).hasClass("lg-item")||u.get().contains(f.target))){f.preventDefault(),t.core.touchAction="zoomSwipe",r=t.getSwipeCords(f);var p=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,p))}}),this.core.$inner.on("touchend.lg",function(f){if(t.core.touchAction==="zoomSwipe"&&(t.$LG(f.target).hasClass("lg-item")||u.get().contains(f.target))){if(f.preventDefault(),t.core.touchAction=void 0,t.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var p=c.valueOf()-l.valueOf();t.touchendZoom(n,r,o,a,p)}})},e.prototype.zoomDrag=function(){var t=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,u;this.core.outer.on("mousedown.lg.zoom",function(f){if(t.isImageSlide(t.core.index)){var p=t.core.getSlideItem(t.core.index);if(t.$LG(f.target).hasClass("lg-item")||p.get().contains(f.target)){c=new Date,u=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(f.target).hasClass("lg-object")&&(a||l)&&(f.preventDefault(),n=t.getDragCords(f),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(f){if(s){o=!0,r=t.getDragCords(f);var p=t.getZoomSwipeCords(n,r,a,l,h);t.setZoomSwipeStyles(u,p)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(f){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(f);var p=d.valueOf()-c.valueOf();t.touchendZoom(n,r,a,l,p)}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 De=class De{static init(t){if(De.uiConfig)throw new Error("UI provider already initialized.");De.uiConfig=t,De.windowResizeHandler(),window.addEventListener("resize",De.windowResizeHandler)}static destroy(){window.removeEventListener("resize",De.windowResizeHandler)}static getMessagesService(){return De.getUiConfig().messagesService}static getNotificationsService(){return De.getUiConfig().notificationsService}static getDeviceTypeByResolution(){const{deviceTypeResolutionsConfig:t}=De.getUiConfig();return window.innerWidth<t.tablet?G.WindowResolutionEnum.phone:window.innerWidth<t.laptop?G.WindowResolutionEnum.tablet:G.WindowResolutionEnum.laptop}static initRefDependingOnDeviceResolution(t,n,r){const s=i.ref(r);return De.setRefValueDependingOnDeviceResolution(s,t,n,r),De.refsDependingOnDeviceResolution.push({r:s,phoneValue:t,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return De.getDeviceTypeByResolution()===G.WindowResolutionEnum.phone}static isTabletDevice(){return De.getDeviceTypeByResolution()===G.WindowResolutionEnum.tablet}static isLaptopDevice(){return De.getDeviceTypeByResolution()===G.WindowResolutionEnum.laptop}static showNotificationsForErrorResponseData(t,n={}){var r,s;if(W.isEmpty(t.errors)){const o=(s=(r=t.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";De.getNotificationsService().error({title:"Ошибка выполнения/обработки запроса",content:t.message,meta:`#${t.status}${a}: ${t.statusText}`,duration:3e3})}else for(const o in t.errors)Object.prototype.hasOwnProperty.call(n,o)?n[o]=new G.FieldValidationResultData(t.errors[o].toString(),"error"):De.getMessagesService().error(t.errors[o].toString())}static getUiConfig(){if(!De.uiConfig)throw new Error("UI provider is not initialized.");return De.uiConfig}static setRefValueDependingOnDeviceResolution(t,n,r,s){switch(De.getDeviceTypeByResolution()){case G.WindowResolutionEnum.phone:t.value=n;break;case G.WindowResolutionEnum.tablet:t.value=r;break;default:t.value=s;break}}static windowResizeHandler(){W.forEach(De.refsDependingOnDeviceResolution,t=>{De.setRefValueDependingOnDeviceResolution(t.r,t.phoneValue,t.tabletValue,t.defaultValue)})}};k(De,"uiConfig"),k(De,"refsDependingOnDeviceResolution",[]);let pt=De;const zu={ref:"gallery-container",class:"lightgallery-wrapper"},Iu={},ya=i.defineComponent({...Iu,__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}),W.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",zu,[i.renderSlot(o.$slots,"default")],512))}}),Lu=["href"],Du=["src","alt"],Hu={},ba=i.defineComponent({...Hu,__name:"image-gallery",props:{images:{}},setup(e,{expose:t}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[Au,Vu],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(pt.getDeviceTypeByResolution()===G.WindowResolutionEnum.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 u=_a,f=V.NPopover;return i.openBlock(),i.createBlock(f,{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]=p=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(u)])])]),default:i.withCtx(()=>[i.createVNode(ya,{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,(p,g)=>(i.openBlock(),i.createElementBlock("a",{key:g,href:p.image},[i.createElementVNode("img",{src:p.preview,alt:`Изображение #${g+1}`},null,8,Du)],8,Lu))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Wu={class:"flex flex-col text-sm"},ju={},Xu=i.defineComponent({...ju,__name:"product-stock-count",props:{product:{}},setup(e){return(t,n)=>{const r=Cs,s=V.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",Wu,[(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})}}}),qu={class:"flex flex-row justify-between"},Yu={key:0},Uu={class:"ml-2 align-sub"},Gu={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},Ku={class:"@container"},Zu={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},Ju={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},Qu={class:"text-sc-dark-grey"},ef={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},tf={class:"text-gray-600"},nf={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},rf={key:3,class:"underline decoration-dashed"},sf={key:4,class:"sc-product-pack whitespace-nowrap"},of={class:"text-gray-600"},af={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},lf={class:"text-gray-600"},cf={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},df={key:0},hf={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},uf={},Xi=i.defineComponent({...uf,__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},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},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(()=>W.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>W.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,u;return(u=(h=n.product)==null?void 0:h.properties)==null?void 0:u.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>W.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,u)=>{var y,b,S,x,C;const f=_a,p=V.NText,g=ma,m=Cs,_=V.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",qu,[i.createVNode(p,{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",Yu," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",Uu,[h.product.images&&h.product.images.length>0?(i.openBlock(),i.createBlock(ba,{key:0,ref:"image-gallery",images:h.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",Gu,[i.createVNode(f)])]),_: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",Ku,[i.createElementVNode("div",Zu,[h.product.supplierSku?(i.openBlock(),i.createElementBlock("div",Ju,[u[0]||(u[0]=i.createTextVNode(" Артикул производителя/поставщика: ")),i.createElementVNode("span",Qu,i.toDisplayString(h.product.supplierSku),1)])):i.createCommentVNode("",!0),h.showCode?(i.openBlock(),i.createElementBlock("span",ef,[u[1]||(u[1]=i.createTextVNode(" Артикул: ")),i.createElementVNode("span",tf,i.toDisplayString(h.product.code),1)])):i.createCommentVNode("",!0),h.product.stockCount&&h.product.stockCount.length>0?(i.openBlock(),i.createBlock(Xu,{key:2,product:h.product},{default:i.withCtx(()=>[i.createElementVNode("span",nf,[u[2]||(u[2]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(m,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",rf," Нет в наличии ")),(S=(b=h.product)==null?void 0:b.properties)!=null&&S.pack?(i.openBlock(),i.createElementBlock("span",sf,[u[3]||(u[3]=i.createTextVNode(" Норма упаковки: ")),i.createElementVNode("span",of,i.toDisplayString((C=(x=h.product)==null?void 0:x.properties)==null?void 0:C.pack),1)])):i.createCommentVNode("",!0),h.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",af,[u[4]||(u[4]=i.createTextVNode(" Планируемая дата поступления на основной склад: ")),i.createElementVNode("span",lf,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(_,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",cf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,B=>(i.openBlock(),i.createBlock(kr,{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},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history"]))),128)),i.createVNode(kr,{product:h.product,"event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":!0,"show-price-history":h.showPriceHistory,"cost-field-name":"cost",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-price-history"])])):i.createCommentVNode("",!0)]),_:1}),h.showSlugs||h.showProperties?(i.openBlock(),i.createElementBlock("div",df,[i.createElementVNode("ul",hf,[h.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:h.product.id,slug:h.product.slug},(B,v)=>(i.openBlock(),i.createElementBlock("li",{key:v}," ("+i.toDisplayString(v)+"): "+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,v)=>(i.openBlock(),i.createElementBlock("li",{key:v}," ("+i.toDisplayString(v)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),ff=(e,t,n)=>({key:e,title:t,className:"align-top",resizable:!0,render:r=>i.h(kr,{product:r,costFieldName:e,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick})}),pf=(e,t)=>{if(e.length===0)return[];const n=[],r={};switch(pt.getDeviceTypeByResolution()){case G.WindowResolutionEnum.phone:case G.WindowResolutionEnum.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(Xi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,productContextButtonsConfig:t.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(Xi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory})}),t.showProductCosts&&(W.forEach(e,s=>{W.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),W.forEach(W.sortBy(r,["slug"]),s=>{n.push(ff(s.slug??"",s.name,t))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(kr,{product:s,costFieldName:"cost",eventEmitter:t.eventEmitter,allowPriceClick:t.allowPriceClick,showQuantityUnit:!0,showCostDate:!0,showPriceHistory:t.showPriceHistory})})),(t.showProductEditButton||!W.isNil(t.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(ma,{product:s,eventEmitter:t.eventEmitter,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,productContextButtonsConfig:t.productContextButtonsConfig})});break}return n},gf={key:0,class:"pt-0.5"},mf={class:"flex flex-row gap-1"},_f={key:0},yf={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},bf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},wf={},vf=i.defineComponent({...wf,__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},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(vr,"medium"),r=i.computed(()=>{var M;return(M=t==null?void 0:t.filteredItems)==null?void 0:M[t.categoryItem.id]}),s=i.computed(()=>{var M,N;return W.isArray((M=t.categoryItem)==null?void 0:M.categories)&&((N=t.categoryItem.categories)==null?void 0:N.length)>0}),o=i.computed(()=>{var M;return W.isArray((M=t.categoryItem)==null?void 0:M.products)?t.categoryItem.products:[]}),a=i.computed(()=>W.isUndefined(t.filteredItems)||r.value==="*"?o.value:o.value.filter(M=>{var N,A;return(A=(N=r.value)==null?void 0:N.products)==null?void 0:A.includes(M.id)})),l=i.computed(()=>a.value.length>0),c=i.computed(()=>W.isFunction(t.showHideForClientButton)?t.showHideForClientButton(t.categoryItem):t.showHideForClientButton),d=i.computed(()=>W.isFunction(t.showPinButton)?t.showPinButton(t.categoryItem):t.showPinButton),h=i.computed(()=>W.isFunction(t.showCategoryEditButton)?t.showCategoryEditButton(t.categoryItem):t.showCategoryEditButton),u=i.computed(()=>W.isNil(t.categoryContextButtonsConfig)?[]:W.isFunction(t.categoryContextButtonsConfig)?t.categoryContextButtonsConfig(t.categoryItem):t.categoryContextButtonsConfig),f=i.computed(()=>new G.ClientCategory(t.categoryItem)),p=i.ref(!1),g=i.ref(!1),m=i.computed(()=>!W.isUndefined(t.selectedCategoriesItems)),_=i.computed(()=>(t.selectedCategoriesItems??[]).some(M=>M.id===t.categoryItem.id)),y=i.computed(()=>F.value&&pt.getDeviceTypeByResolution()===G.WindowResolutionEnum.laptop?"auto":"fixed"),b=M=>{t.eventEmitter.emit("category:checked",{category:t.categoryItem,checked:M})},S=(M,N)=>{t.eventEmitter.emit("category:header-click",{categoryItem:t.categoryItem,expanded:N,isLoadingState:p})},x=()=>{t.eventEmitter.emit("category:hide",{category:t.categoryItem})},C=()=>{t.eventEmitter.emit("category:attach",{category:t.categoryItem})},B=()=>{t.eventEmitter.emit("category:detach",{category:t.categoryItem})},v=()=>{t.eventEmitter.emit("category:edit",{category:t.categoryItem})},$=M=>{t.eventEmitter.emit("category:context-select",{category:t.categoryItem,key:M})},F=i.ref(0),R=i.computed(()=>F.value&&o.value.length>0?pf(o.value,{eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,productContextButtonsConfig:t.productContextButtonsConfig}):[]),X=W.debounce(()=>{F.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",X)}),window.addEventListener("resize",X),X(),(M,N)=>{const A=V.NCheckbox,L=ou,Y=V.NTooltip,P=iu,E=pa,H=V.NTag,I=Jh,U=Gh,O=V.NButton,z=qh,J=fa,pe=ua,re=V.NDropdown,ge=V.NDataTable,ie=V.NAlert,Me=V.NSpin;return i.openBlock(),i.createBlock(ga,{name:M.categoryItem.id,"data-id":M.categoryItem.id,"onHeader:click":S},{"pre-arrow":i.withCtx(()=>{var xe,Ce,Fe;return[m.value?(i.openBlock(),i.createElementBlock("div",gf,[i.createVNode(A,{checked:_.value,"onUpdate:checked":b},null,8,["checked"])])):i.createCommentVNode("",!0),!c.value&&((xe=f.value)!=null&&xe.isDisabled)?(i.openBlock(),i.createBlock(Y,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(L,{class:"pt-1.5"})]),default:i.withCtx(()=>[N[1]||(N[1]=i.createTextVNode(" Категория скрыта для клиента "))]),_:1,__:[1]})):i.createCommentVNode("",!0),((Ce=f.value)==null?void 0:Ce.isFavorite)??!1?(i.openBlock(),i.createBlock(Y,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(P,{class:"pt-1.5"})]),default:i.withCtx(()=>[N[2]||(N[2]=i.createTextVNode(" Избранная категория "))]),_:1,__:[2]})):i.createCommentVNode("",!0),((Fe=f.value)==null?void 0:Fe.isRequired)??!1?(i.openBlock(),i.createBlock(Y,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(E,{class:"pt-1.5"})]),default:i.withCtx(()=>[N[3]||(N[3]=i.createTextVNode(" Доп. продажа "))]),_:1,__:[3]})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var xe,Ce,Fe;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":M.categoryItem.isHidden,"text-gray-400":(xe=f.value)==null?void 0:xe.isDisabled})},[i.createVNode(Y,{disabled:!M.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(M.categoryItem.name),1)]),default:i.withCtx(()=>[N[4]||(N[4]=i.createTextVNode(" Категория скрыта "))]),_:1,__:[4]},8,["disabled"])],2),i.createElementVNode("div",{onClick:N[0]||(N[0]=i.withModifiers((...Ie)=>i.unref(W.noop)&&i.unref(W.noop)(...Ie),["prevent","stop"]))},[(Ce=M.categoryItem.properties)!=null&&Ce.m2Price?(i.openBlock(),i.createBlock(H,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Средняя стоимость: "+i.toDisplayString(M.categoryItem.properties.m2Price)+" руб./м2 ",1)]),_:1},8,["size"])):i.createCommentVNode("",!0),d.value&&((Fe=f.value)!=null&&Fe.manager)?(i.openBlock(),i.createBlock(H,{key:1,size:i.unref(n),closable:!0,round:"",onClose:B},{default:i.withCtx(()=>[i.createVNode(Y,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Ie,vt;return[i.createElementVNode("span",mf,[i.createVNode(I),i.createTextVNode(" "+i.toDisplayString((vt=(Ie=f.value)==null?void 0:Ie.manager)==null?void 0:vt.name),1)])]}),default:i.withCtx(()=>{var Ie,vt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((vt=(Ie=f.value)==null?void 0:Ie.manager)==null?void 0:vt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[M.showSlugs||M.showProperties?(i.openBlock(),i.createElementBlock("div",_f,[i.createElementVNode("ul",yf,[M.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:M.categoryItem.id,slug:M.categoryItem.slug},(xe,Ce)=>(i.openBlock(),i.createElementBlock("li",{key:Ce}," ("+i.toDisplayString(Ce)+"): "+i.toDisplayString(xe),1))),128)):i.createCommentVNode("",!0),M.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(M.categoryItem.properties,(xe,Ce)=>(i.openBlock(),i.createElementBlock("li",{key:Ce}," ("+i.toDisplayString(Ce)+"): "+i.toDisplayString(xe),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var xe;return[i.createElementVNode("div",bf,[c.value?(i.openBlock(),i.createBlock(Y,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(O,{size:i.unref(n),onClick:x},{default:i.withCtx(()=>{var Ce;return[(Ce=f.value)!=null&&Ce.isDisabled?(i.openBlock(),i.createBlock(L,{key:1})):(i.openBlock(),i.createBlock(U,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var Ce;return[(Ce=f.value)!=null&&Ce.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(f.value.hidingComment?`. Причина: '${f.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),d.value&&!((xe=f.value)!=null&&xe.manager)?(i.openBlock(),i.createBlock(Y,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(O,{size:i.unref(n),onClick:C},{default:i.withCtx(()=>[i.createVNode(z)]),_:1},8,["size"])]),default:i.withCtx(()=>{var Ce,Fe,Ie;return[(Ce=f.value)!=null&&Ce.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((Ie=(Fe=f.value)==null?void 0:Fe.manager)==null?void 0:Ie.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),h.value?(i.openBlock(),i.createBlock(Y,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(O,{ghost:!0,size:i.unref(n),type:"primary",onClick:v},{default:i.withCtx(()=>[i.createVNode(J)]),_:1},8,["size"])]),default:i.withCtx(()=>[N[5]||(N[5]=i.createTextVNode(" Редактировать "))]),_:1,__:[5]})):i.createCommentVNode("",!0),u.value.length>0?(i.openBlock(),i.createBlock(re,{key:3,options:u.value,size:i.unref(n),trigger:"click",onSelect:$},{default:i.withCtx(()=>[i.createVNode(O,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(pe)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(M.$slots,"default",{},()=>{var xe;return[s.value?(i.openBlock(),i.createBlock(va,{key:0,"categories-items":M.categoryItem.categories??[],"event-emitter":M.eventEmitter,"filtered-items":(xe=r.value)==null?void 0:xe.categories,"selected-categories-items":M.selectedCategoriesItems,"selected-products-items":M.selectedProductsItems,"show-slugs":M.showSlugs,"show-properties":M.showProperties,"show-product-costs":M.showProductCosts,"allow-name-click":M.allowNameClick,"allow-price-click":M.allowPriceClick,"show-price-history":M.showPriceHistory,"show-product-add-to-cart-button":M.showProductAddToCartButton,"show-product-edit-button":M.showProductEditButton,"product-context-buttons-config":M.productContextButtonsConfig,"show-hide-for-client-button":M.showHideForClientButton,"show-pin-button":M.showPinButton,"show-category-edit-button":M.showCategoryEditButton,"category-context-buttons-config":M.categoryContextButtonsConfig},null,8,["categories-items","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-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),l.value?(i.openBlock(),i.createBlock(ge,{key:1,columns:R.value,data:a.value,bordered:!0,loading:p.value,remote:!0,"row-key":Ce=>Ce.id,"table-layout":y.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])):i.createCommentVNode("",!0),!p.value&&!g.value&&!s.value&&!l.value?(i.openBlock(),i.createBlock(ie,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),g.value?(i.openBlock(),i.createBlock(ie,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createBlock(Me,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>N[6]||(N[6]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),kf=Ln(vf,[["__scopeId","data-v-0c971738"]]),xf={class:"sc-collapse flex w-full flex-col"},Cf={},wa=i.defineComponent({...Cf,__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",xf,[i.renderSlot(o.$slots,"default")]))}}),Sf={},va=i.defineComponent({...Sf,__name:"category-collapse",props:{categoriesItems:{},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},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(vr,"medium"),r=i.computed(()=>W.isUndefined(t.filteredItems)?t.categoriesItems:t.categoriesItems.filter(o=>{var a;return!!((a=t.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(W.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=V.NSpin,c=V.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(wa,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(kf,{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-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-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.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)}}}),Bf={class:"text-sm"},Tf={class:"text-sm"},Ef={},$f=i.defineComponent({...Ef,__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,u,f,p,g;const n=e,r=i.ref(new G.CartItemBase(n.cartItem??new G.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)||((f=(u=n.product)==null?void 0:u.properties)!=null&&f.ignoreMinCountCheck?0:(g=(p=n.product)==null?void 0:p.properties)==null?void 0:g.minCount)||0}))),s=t,o=i.computed(()=>{var y,b,S,x,C,B,v,$,F;const m=((b=(y=n.product)==null?void 0:y.properties)==null?void 0:b.minLength)??((x=(S=n.product)==null?void 0:S.properties)!=null&&x.ignoreMinCountCheck?0:(B=(C=n.product)==null?void 0:C.properties)==null?void 0:B.minCount),_=($=(v=n.product)==null?void 0:v.properties)==null?void 0:$.maxLength;return m||_?`(${m?`от ${m}`:""}${m&&_?" ":""}${_?`до ${_}`:""} ${(F=n.product)==null?void 0:F.unit})`:""}),a=()=>{G.UnitsHelper.productIsMeasurable(n.product)||delete r.value.length,s("submit",r.value)};return(m,_)=>(i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.unref(G.UnitsHelper).productIsMeasurable(m.product)?(i.openBlock(),i.createBlock(i.unref(V.NFormItem),{key:0,required:!0,feedback:m.validation.length.feedback||"","show-feedback":m.validation.length.showFeedback||i.unref(G.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(V.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(G.UnitsHelper).getProductLengthMultiplicity(m.product),step:i.unref(G.UnitsHelper).getProductMultiplicity(m.product),validator:S=>S%i.unref(G.UnitsHelper).getProductLengthMultiplicity(m.product)===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]}),_:2},[!m.validation.length.feedback&&i.unref(G.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Bf,"Метраж должен быть кратен "+i.toDisplayString(i.unref(G.UnitsHelper).getProductLengthMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status","label"])):i.createCommentVNode("",!0),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:m.validation.quantity.feedback||"","show-feedback":m.validation.quantity.showFeedback||i.unref(G.UnitsHelper).getProductMultiplicity(m.product)!==1||!1,"validation-status":m.validation.quantity.validationStatus||void 0,label:"Количество"},i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:r.value.quantity,"onUpdate:value":_[1]||(_[1]=y=>r.value.quantity=y),min:i.unref(G.UnitsHelper).getProductMultiplicity(m.product),step:i.unref(G.UnitsHelper).getProductMultiplicity(m.product),validator:y=>y%i.unref(G.UnitsHelper).getProductMultiplicity(m.product)===0,placeholder:"Введите количество",class:"w-full"},null,8,["value","min","step","validator"])]),_:2},[!m.validation.quantity.feedback&&i.unref(G.UnitsHelper).getProductMultiplicity(m.product)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Tf,"Количество должно быть кратно "+i.toDisplayString(i.unref(G.UnitsHelper).getProductMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.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(V.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(V.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}))}}),Nf={class:"flex flex-row gap-1"},Pf={class:"flex flex-col gap-1 text-base"},Rf=["href"],Ff={key:1,class:"text-sc-grey"},Mf={key:0,class:"text-sc-dark-grey truncate text-sm"},Af={key:0},Of={key:1,class:"text-sm"},Vf={},Sr=i.defineComponent({...Vf,__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?Sn.format(n.client.lastLoginAt,G.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{W.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Cs,d=V.NButton,h=V.NPopover;return i.openBlock(),i.createElementBlock("div",Nf,[a.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=u=>a.$emit("click:client-info",a.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(W.isNil)(a.popoverPosition),placement:a.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",Pf,[i.createElementVNode("a",{href:a.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=u=>o(u))},[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",Ff," [ Деактивирован ] "))],8,Rf),a.showCityAndRegion&&a.client.city?(i.openBlock(),i.createElementBlock("span",Mf," г. "+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",Af,i.toDisplayString(a.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",Of," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),zf={class:"text-base"},If={},ka=i.defineComponent({...If,__name:"contragent-with-short-info",props:{contragent:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("span",zf,i.toDisplayString(t.contragent.name),1))}}),Lf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Df(e,t){return i.openBlock(),i.createElementBlock("svg",Lf,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 Hf=i.markRaw({name:"tabler-mail",render:Df}),Wf=["href"],jf={},Xf=i.defineComponent({...jf,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(e){return(t,n)=>{const r=Hf;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,Wf)],2)}}}),qf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Yf(e,t){return i.openBlock(),i.createElementBlock("svg",qf,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 xa=i.markRaw({name:"fa6-brands-viber",render:Yf}),Uf={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},Gf=["id"],Kf=["id"],Zf=["fill"],Jf=["fill"];function Qf(e,t){return i.openBlock(),i.createElementBlock("svg",Uf,[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,Gf),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,Kf)]),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,Zf),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,Jf),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 Ca=i.markRaw({name:"logos-whatsapp-icon",render:Qf,setup(){const e=()=>Math.random().toString(36).substr(2,10);return{idMap:{logosWhatsappIcon0:"uicons-"+e(),logosWhatsappIcon1:"uicons-"+e()}}}}),ep={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},tp=["id"],np=["fill"];function ip(e,t){return i.openBlock(),i.createElementBlock("svg",ep,[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,tp)]),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,np),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 Sa=i.markRaw({name:"logos-telegram",render:ip,setup(){return{idMap:{logosTelegram0:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),rp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sp(e,t){return i.openBlock(),i.createElementBlock("svg",rp,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 Ba=i.markRaw({name:"ion-call",render:sp}),op={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ap(e,t){return i.openBlock(),i.createElementBlock("svg",op,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 lp=i.markRaw({name:"tabler-phone-call",render:ap}),cp={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},dp=["href"],hp=["href"],up=["href"],fp=["href"],pp={},gp=i.defineComponent({...pp,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{try{return t.phone?Wi.parsePhoneNumberWithError(t.phone,t.defaultCountry):void 0}catch{}return t.phone}),r=i.computed(()=>{var l;return W.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return W.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return W.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=lp,h=Ba,u=Sa,f=Ca,p=xa;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",cp,[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,dp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(u)],8,hp)):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(f)],8,up)):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(p)],8,fp)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),mp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _p(e,t){return i.openBlock(),i.createElementBlock("svg",mp,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 yp=i.markRaw({name:"mdi-envelope",render:_p}),bp={class:"flex flex-col gap-1"},wp={key:0,class:"mb-2 flex flex-col text-base"},vp={key:0,class:"text-sc-dark-grey text-sm"},kp={key:1,class:"whitespace-nowrap text-sm"},xp={key:2,class:"whitespace-nowrap text-sm"},Cp={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Sp=["href"],Bp=["href"],Tp=["href"],Ep=["href"],$p=["href"],Np={key:0,class:"flex flex-col text-base"},Pp={key:0,class:"text-sc-dark-grey text-sm"},Rp={key:1,class:"mt-2 text-sm"},Fp={key:0,class:"-mt-1"},Mp={},Ap=i.defineComponent({...Mp,__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?Wi.parsePhoneNumberWithError(t.contact.phone,t.defaultCountry):void 0}catch{}return t.contact.phone}),r=i.computed(()=>{var c;return W.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return W.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return W.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=Ba,u=Sa,f=Ca,p=xa,g=yp,m=V.NPopover;return i.openBlock(),i.createElementBlock("div",bp,[i.createVNode(m,{disabled:c.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var b,S,x,C;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",wp,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(x=c.contact)!=null&&x.position?(i.openBlock(),i.createElementBlock("span",vp,i.toDisplayString((C=c.contact)==null?void 0:C.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),c.contact.phone?(i.openBlock(),i.createElementBlock("div",kp,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("div",xp,i.toDisplayString(c.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",Cp,[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,Sp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(u)],8,Bp)):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(f)],8,Tp)):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(p)],8,Ep)):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,$p)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var b,S,x,C;return[c.contact.name?(i.openBlock(),i.createElementBlock("div",Np,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(b=c.contact)!=null&&b.position?(i.openBlock(),i.createElementBlock("span",Pp,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",Rp,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((C=c.contact)==null?void 0:C.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),c.fullView&&((_=c.contact)!=null&&_.comment)?(i.openBlock(),i.createElementBlock("div",Fp,[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)])}}}),Op={key:0,class:"flex w-fit items-center gap-2"},Vp={key:1,class:"flex flex-wrap gap-1"},zp={key:0},Ip={},qi=i.defineComponent({...Ip,__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=V.NSpin;return r.isProductSearching?(i.openBlock(),i.createElementBlock("div",Op,[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",Vp,[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)]))}}}),Lp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Dp(e,t){return i.openBlock(),i.createElementBlock("svg",Lp,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 Br=i.markRaw({name:"ion-close",render:Dp}),Hp={class:"mr-3 flex flex-col gap-2"},Wp=["onClick"],jp={class:"h-full p-2"},Xp={},qp=i.defineComponent({...Xp,__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=Br;return i.openBlock(),i.createBlock(i.unref(V.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",Hp,[(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(V.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",jp,[i.createElementVNode("div",{ref_for:!0,ref:"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Wp)]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(c.label),1)]),_:2},1024),c.isCustom&&!c.isNewRec()?(i.openBlock(),i.createBlock(i.unref(V.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})}}}),Ta=Ln(qp,[["__scopeId","data-v-828c3059"]]),Yp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Up(e,t){return i.openBlock(),i.createElementBlock("svg",Yp,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 Ea=i.markRaw({name:"ion-trash",render:Up}),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",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)]))}const $a=i.markRaw({name:"ion-plus",render:Kp}),Zp={class:"flex flex-col gap-4"},Jp={class:"flex flex-col gap-2"},Qp={class:"mt-8 font-bold"},eg={class:"grid grow grid-cols-2 items-start gap-2"},tg={class:"flex flex-col gap-4"},ng={class:"flex gap-3"},ig={},Na=i.defineComponent({...ig,__name:"kozyrek-configurator-params-form",props:{value:{},settings:{},previewParams:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},selectTemplateIndex:{}},emits:["update:value","update:params","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 G.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.watch(()=>n.value.configuratorParams,c=>{s.value=W.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=$a,u=Ea,f=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"grid gap-2 md:grid-cols-2 md:gap-6"},{default:i.withCtx(()=>{var p,g,m,_,y,b,S,x,C;return[i.createElementVNode("div",Zp,[d[10]||(d[10]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),c.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(V.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:s.value.startTailType,"onUpdate:value":[d[0]||(d[0]=B=>s.value.startTailType=B),a],options:c.settings.startTailConfigs.map(({label:B},v)=>({label:B,value:v})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Jp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value.linesAngles,(B,v)=>{var $,F,R,X,M,N;return i.openBlock(),i.createElementBlock("div",{key:v,class:"flex items-start gap-2"},[i.createElementVNode("div",Qp,i.toDisplayString(v+1),1),i.createElementVNode("div",eg,[i.createVNode(i.unref(V.NFormItem),{label:"Ширина, мм",required:!0,feedback:(($=c.validation[`lines_widths[${v+1}]`])==null?void 0:$.feedback)||"","show-feedback":((F=c.validation[`lines_widths[${v+1}]`])==null?void 0:F.showFeedback)||!1,"validation-status":(R=c.validation[`lines_widths[${v+1}]`])==null?void 0:R.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:s.value.linesWidths[v],"onUpdate:value":[A=>s.value.linesWidths[v]=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(V.NFormItem),{label:"Угол сгиба, °",required:!0,feedback:((X=c.validation[`lines_angles[${v+1}]`])==null?void 0:X.feedback)||"","show-feedback":((M=c.validation[`lines_angles[${v+1}]`])==null?void 0:M.showFeedback)||!1,"validation-status":(N=c.validation[`lines_angles[${v+1}]`])==null?void 0:N.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:s.value.linesAngles[v],"onUpdate:value":[A=>s.value.linesAngles[v]=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(V.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(V.NButton),{key:0,size:"medium",onClick:A=>r("click:add-line",v)},{default:i.withCtx(()=>[i.createVNode(h)]),_:2},1032,["onClick"])),c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:1,disabled:s.value.linesWidths.length===1,size:"medium",class:"ml-2",onClick:A=>r("click:remove-line",v)},{default:i.withCtx(()=>[i.createVNode(u)]),_:2},1032,["disabled","onClick"]))]),_:2},1024)])}),128))]),c.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(V.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:s.value.endTailType,"onUpdate:value":[d[1]||(d[1]=B=>s.value.endTailType=B),a],options:c.settings.endTailConfigs.map(({label:B},v)=>({label:B,value:v})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(qi,{"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(V.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",tg,[i.createVNode(i.unref(V.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(V.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(V.NFormItem),{required:!0,"show-feedback":((p=c.validation.length)==null?void 0:p.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(V.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(V.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(V.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(V.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":(C=c.validation.marker)==null?void 0:C.validationStatus,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(f,{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",ng,[i.createVNode(i.unref(V.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(V.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 Pa=Object.defineProperty,rg=Object.defineProperties,sg=Object.getOwnPropertyDescriptors,Ra=Object.getOwnPropertySymbols,og=Object.prototype.hasOwnProperty,ag=Object.prototype.propertyIsEnumerable,Bs=(e,t,n)=>t in e?Pa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ts=(e,t)=>{for(var n in t||(t={}))og.call(t,n)&&Bs(e,n,t[n]);if(Ra)for(var n of Ra(t))ag.call(t,n)&&Bs(e,n,t[n]);return e},Es=(e,t)=>rg(e,sg(t)),Fa=(e,t)=>{for(var n in t)Pa(e,n,{get:t[n],enumerable:!0})},w=(e,t,n)=>(Bs(e,typeof t!="symbol"?t+"":t,n),n),Ma=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},xt=(e,t,n)=>(Ma(e,t,"read from private field"),n?n.call(e):t.get(e)),Aa=(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)},lg=(e,t,n,r)=>(Ma(e,t,"write to private field"),t.set(e,n),n),gt={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 gt.shim(e),typeof t<"u"&&(gt.Image=t),gt.isHeadless=!0,e}},Oa={};Fa(Oa,{Curve:()=>vi,getAnchorsFromArcData:()=>hg,getComponentOnCubicBezier:()=>Yi,getControlPoints:()=>Ua,getCurveBoundingBox:()=>Xa,getCurveFromPoints:()=>Ya,getCurveLength:()=>ja,getReflection:()=>Ps,integrate:()=>qa,subdivide:()=>Ns});var Va={};Fa(Va,{HALF_PI:()=>Ke,NumArray:()=>Yt,TWO_PI:()=>ot,decomposeMatrix:()=>wi,getComputedMatrix:()=>La,getPoT:()=>Da,lerp:()=>Et,mod:()=>$t,setMatrix:()=>Ia,toFixed:()=>Pe});var He;typeof window<"u"?He=window:typeof global<"u"?He=global:typeof self<"u"&&(He=self);var za,ot=Math.PI*2,Ke=Math.PI*.5;function wi(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 Ia(e){za=e}function La(e,t){t=t&&t.identity()||new za;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 Et(e,t,n){return n*(t-e)+e}var $s=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function Da(e){let t=0;for(;$s[t]&&$s[t]<e;)t++;return $s[t]}function $t(e,t){for(;e<0;)e+=t;return e%t}var Yt=He.Float32Array||Array,cg=Math.floor;function Pe(e){return cg(e*1e6)/1e6}var ee={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},j=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(j,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),w(j,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var Ha={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(j.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(j.Types.change))}}},Lt=class extends j{constructor(e=0,t=0){super(),w(this,"_x",0),w(this,"_y",0);for(let n in Ha)Object.defineProperty(this,n,Ha[n]);this.x=e,this.y=t}static add(e,t){return new Lt(e.x+t.x,e.y+t.y)}static sub(e,t){return new Lt(e.x-t.x,e.y-t.y)}static subtract(e,t){return Lt.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(Lt.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 Lt(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:Pe(this.x),y:Pe(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=Lt;w(Z,"zero",new Lt),w(Z,"left",new Lt(-1,0)),w(Z,"right",new Lt(1,0)),w(Z,"up",new Lt(0,-1)),w(Z,"down",new Lt(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 Wa)Object.defineProperty(this,d,Wa[d]);this.command=l,this.relative=!0;const c=ve.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(j.Types.change,c),this.controls.right.set(o,a).addEventListener(j.Types.change,c)}static makeBroadcast(t){return n;function n(){t._bound&&t.dispatchEvent(j.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:Pe(this.x),y:Pe(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Pe(this.rx),ry:Pe(this.ry),xAxisRotation:Pe(this.xAxisRotation),largeArcFlag:Pe(this.largeArcFlag),sweepFlag:Pe(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},Wa={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(j.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(j.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(j.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(j.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(j.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(j.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(j.Types.change))}}},dg=0,mt={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 dg++}},vi={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 Yi(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 Ns(e,t,n,r,s,o,a,l,c){c=c||vi.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 u=0;u<d;u++){const f=u/d,p=Yi(f,e,n,s,a),g=Yi(f,t,r,o,l);h.push(new ve(p,g))}return h}function ja(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,u=3*(n-e),f=9*(r-o)+3*(l-t),p=6*(t+o)-12*r,g=3*(r-t);function m(_){const y=(d*_+h)*_+u,b=(f*_+p)*_+g;return Math.sqrt(y*y+b*b)}return qa(m,0,1,c||vi.RecursionLimit)}function Xa(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,f,p,g,m,_,y;for(let C=0;C<2;++C){if(C==0?(u=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,f=3*n-3*e):(u=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,f=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;p=-f/u,0<p&&p<1&&c.push(p);continue}_=u*u-4*f*h,y=Math.sqrt(_),!(_<0)&&(g=(-u+y)/(2*h),0<g&&g<1&&c.push(g),m=(-u-y)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,x;for(;b--;)p=c[b],x=1-p,d[0][b]=x*x*x*e+3*x*x*p*n+3*x*p*p*s+p*p*p*a,d[1][b]=x*x*x*t+3*x*x*p*r+3*x*p*p*o+p*p*p*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 qa(e,t,n,r){let s=vi.abscissas[r-2],o=vi.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 u=a*s[c];h+=o[c++]*(e(l+u)+e(l-u))}return a*h}function Ya(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?$t(s-1,n):Math.max(s-1,0),l=t?$t(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];Ua(c,d,h),d.command=s===0?ee.move:ee.curve}}function Ua(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+=Ke:l-=Ke,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 Ps(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 hg(e,t,n,r,s,o,a){const l=mt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,u=n*Math.cos(h),f=r*Math.sin(h),p=new ve(u,f);p.command=ee.line}}var Ga=Array.prototype.slice;function ug(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=Ga.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=Ga.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=!ug(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},Nt={hasEventListeners:typeof He.addEventListener=="function",bind:function(e,t,n,r){return this.hasEventListeners?e.addEventListener(t,n,!!r):e.attachEvent("on"+t,n),Nt},unbind:function(e,t,n,r){return Nt.hasEventListeners?e.removeEventListeners(t,n,!!r):e.detachEvent("on"+t,n),Nt},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}},ki=He.document?He.document.createElement("div"):{};ki.id="help-two-load",Object.defineProperty(Nt,"temp",{enumerable:!0,get:function(){return ae.isElement(ki)&&!He.document.head.contains(ki)&&(ki.style.display="none",He.document.head.appendChild(ki)),ki}});var Ct=class extends Error{constructor(t){super(),w(this,"name","Two.js"),w(this,"message"),this.message=t}},fg=He.devicePixelRatio||1;function pg(e){return e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1}function Rs(e){return fg/pg(e)}var Tr=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}},at,Bn=class extends Array{constructor(){super(),Aa(this,at,new j),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 xt(this,at)}set _events(t){lg(this,at,t)}get _bound(){return xt(this,at)._bound}set _bound(t){xt(this,at)._bound=t}addEventListener(){return xt(this,at).addEventListener.apply(this,arguments)}on(){return xt(this,at).on.apply(this,arguments)}bind(){return xt(this,at).bind.apply(this,arguments)}removeEventListener(){return xt(this,at).removeEventListener.apply(this,arguments)}off(){return xt(this,at).off.apply(this,arguments)}unbind(){return xt(this,at).unbind.apply(this,arguments)}dispatchEvent(){return xt(this,at).dispatchEvent.apply(this,arguments)}trigger(){return xt(this,at).trigger.apply(this,arguments)}listen(){return xt(this,at).listen.apply(this,arguments)}ignore(){return xt(this,at).ignore.apply(this,arguments)}pop(){const t=super.pop.apply(this,arguments);return this.trigger(j.Types.remove,[t]),t}shift(){const t=super.shift.apply(this,arguments);return this.trigger(j.Types.remove,[t]),t}push(){const t=super.push.apply(this,arguments);return this.trigger(j.Types.insert,arguments),t}unshift(){const t=super.unshift.apply(this,arguments);return this.trigger(j.Types.insert,arguments),t}splice(){const t=super.splice.apply(this,arguments);if(this.trigger(j.Types.remove,t),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(j.Types.insert,n),this.trigger(j.Types.order)}return t}sort(){return super.sort.apply(this,arguments),this.trigger(j.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(j.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}};at=new WeakMap;var Ka=class extends j{constructor(){super(),w(this,"_flagId",!1),w(this,"_flagClassName",!1),w(this,"_renderer",{}),w(this,"_id",mt.Identifier+mt.uniqueId()),w(this,"_className",""),w(this,"classList",[]);for(let e in Za)Object.defineProperty(this,e,Za[e])}static fromObject(e){const t=new Ka().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}}},Dn=Ka;w(Dn,"Properties",["renderer","id","className"]);var Za={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)}}},Er,Ja={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};He.document&&(Er=document.createElement("a"));var Ze=class extends Dn{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 Qa)Object.defineProperty(this,n,Qa[n]);if(this._renderer.type="texture",this._renderer.flagOffset=gg.bind(this),this._renderer.flagScale=mg.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new Z,typeof t=="function"){const n=(function(){this.unbind(j.Types.load,n),typeof t=="function"&&t()}).bind(this);this.bind(j.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 Ze().copy(e);return"id"in e&&(t.id=e.id),t}static getAbsoluteURL(e){return Er?(Er.href=e,Er.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=Ze.getAbsoluteURL(e);if(Ze.ImageRegistry.contains(t))return Ze.ImageRegistry.get(t);let n;return gt.Image?(n=new gt.Image,gt.shim(n,"img")):He.document?Ja.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=Ze.getTag(n);e._flagImage&&(/canvas/i.test(r)?Ze.Register.canvas(e,t):(e._src=!gt.isHeadless&&n.getAttribute("two-src")||n.src,Ze.Register[r](e,t))),e._flagSrc&&(n||(n=Ze.getImage(e.src),e.image=n),r=Ze.getTag(n),Ze.Register[r](e,t))}clone(){const e=new Ze(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(j.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Ze.load(this,(function(){this.loaded=!0,this.trigger(j.Types.change).trigger(j.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}},Ee=Ze;w(Ee,"Properties",["src","loaded","repeat","scale","offset","image"]),w(Ee,"RegularExpressions",Ja),w(Ee,"ImageRegistry",new Tr),w(Ee,"Register",{canvas:function(e,t){e._src="#"+e.id,Ze.ImageRegistry.add(e.src,e.image),typeof t=="function"&&t()},img:function(e,t){const n=e.image,r=function(o){!gt.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!gt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new Ct("unable to load "+e.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!gt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),e._src=Ze.getAbsoluteURL(e._src),!(!gt.isHeadless&&n&&n.getAttribute("two-src"))&&(gt.isHeadless||n.setAttribute("two-src",e.src),Ze.ImageRegistry.add(e.src,n),gt.isHeadless?Ze.loadHeadlessBuffer(e,r):e.image.src=e.src)},video:function(e,t){if(gt.isHeadless)throw new Ct("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 Ct("unable to load "+e.src)};e._src=Ze.getAbsoluteURL(e._src),e.image.getAttribute("two-src")||(e.image.setAttribute("two-src",e.src),Ze.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 Qa={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=Ee.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}Ee.ImageRegistry.contains(n)?this._image=Ee.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(j.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(j.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(j.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof Z&&this._scale.bind(j.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function gg(){this._flagOffset=!0}function mg(){this._flagScale=!0}var Dt=class extends Dn{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 el)Object.defineProperty(this,r,el[r]);this._renderer.type="stop",this.offset=typeof e=="number"?e:Dt.Index<=0?0:1,this.opacity=typeof n=="number"?n:1,this.color=typeof t=="string"?t:Dt.Index<=0?"#fff":"#000",Dt.Index=(Dt.Index+1)%2}static fromObject(e){const t=new Dt().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Dt.Properties.length;t++){const n=Dt.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Dt;return ae.each(Dt.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(Dt.Properties,t=>{e[t]=this[t]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}},Ut=Dt;w(Ut,"Index",0),w(Ut,"Properties",["offset","opacity","color"]);var el={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)}}},Hn=class extends Dn{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 tl)Object.defineProperty(this,t,tl[t]);this._renderer.type="gradient",this._renderer.flagStops=_g.bind(this),this._renderer.bindStops=yg.bind(this),this._renderer.unbindStops=bg.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 Ut?r:new Ut().copy(r)));const n=new Hn().copy(e);return"id"in e&&(n.id=e.id),n}clone(e){const t=this.stops.map(r=>r.clone()),n=new Hn(t);return ae.each(Hn.Properties,r=>{n[r]=this[r]},this),e&&e.add(n),n}copy(e){super.copy.call(this,e);for(let t=0;t<Hn.Properties.length;t++){const n=Hn.Properties[t];n in e&&(this[n]=e[n])}return this}toObject(){const e={stops:this.stops.map(t=>t.toObject())};return ae.each(Hn.Properties,t=>{e[t]=this[t]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(j.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=Hn;w(Ye,"Stop",Ut),w(Ye,"Properties",["spread","stops","units"]);var tl={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(j.Types.insert,t).unbind(j.Types.remove,n),this._stops=new Bn((e||[]).slice(0)),this._stops.bind(j.Types.insert,t).bind(j.Types.remove,n),t(this._stops)}}};function _g(){this._flagStops=!0}function yg(e){let t=e.length;for(;t--;)e[t].bind(j.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function bg(e){let t=e.length;for(;t--;)e[t].unbind(j.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}var Ui=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 nl)Object.defineProperty(this,o,nl[o]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=wg.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 Ui().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ui.Properties.length;t++){const n=Ui.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 Ui(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(j.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}},Oe=Ui;w(Oe,"Stop",Ut),w(Oe,"Properties",["left","right"]);var nl={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof Z&&this._left.unbind(j.Types.change,this._renderer.flagEndPoints),this._left=e,this._left.bind(j.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(j.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(j.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function wg(){this._flagEndPoints=!0}var Wn=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 il)Object.defineProperty(this,a,il[a]);this._renderer.type="radial-gradient",this._renderer.flagCenter=vg.bind(this),this._renderer.flagFocal=kg.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 Wn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Wn.Properties.length;t++){const n=Wn.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 Wn(this.center._x,this.center._y,this._radius,t,this.focal._x,this.focal._y);return ae.each(Ye.Properties.concat(Wn.Properties),function(r){n[r]=this[r]},this),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return ae.each(Wn.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(j.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}},Ve=Wn;w(Ve,"Stop",Ut),w(Ve,"Properties",["center","radius","focal"]);var il={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(j.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(j.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(j.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(j.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function vg(){this._flagCenter=!0}function kg(){this._flagFocal=!0}function rl(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 $r(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 sl(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,f=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(f||e).x,d=(f||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),f&&e._relative&&(o+=e.x,d+=e.y),ja(r,l,s,c,o,d,a,h,n)}function ol(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,f=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(f||e).x,d=(f||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),f&&e._relative&&(o+=e.x,d+=e.y),Ns(r,l,s,c,o,d,a,h,n)}function jn(e){switch(e.renderer.type){case"texture":return Ee.fromObject(e);case"gradient":return Ye.fromObject(e);case"linear-gradient":return Oe.fromObject(e);case"radial-gradient":return Ve.fromObject(e)}return e}var xg=Math.cos,Cg=Math.sin,al=Math.tan,Fs=[],Pt=class extends j{constructor(e,t,n,r,s,o){super(),w(this,"elements",new Yt(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 C=e;let B,v,$;const F=t[0]||0,R=t[1]||0,X=t[2]||0;return B=C[0]*F+C[1]*R+C[2]*X,v=C[3]*F+C[4]*R+C[5]*X,$=C[6]*F+C[7]*R+C[8]*X,[B,v,$]}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],u=e[8],f=t[0],p=t[1],g=t[2],m=t[3],_=t[4],y=t[5],b=t[6],S=t[7],x=t[8];return n=n||new Yt(9),n[0]=r*f+s*m+o*b,n[1]=r*p+s*_+o*S,n[2]=r*g+s*y+o*x,n[3]=a*f+l*m+c*b,n[4]=a*p+l*_+c*S,n[5]=a*g+l*y+c*x,n[6]=d*f+h*m+u*b,n[7]=d*p+h*_+u*S,n[8]=d*g+h*y+u*x,n}static fromObject(e){return new Pt().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(j.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(j.Types.change)}identity(){return this.elements[0]=Pt.Identity[0],this.elements[1]=Pt.Identity[1],this.elements[2]=Pt.Identity[2],this.elements[3]=Pt.Identity[3],this.elements[4]=Pt.Identity[4],this.elements[5]=Pt.Identity[5],this.elements[6]=Pt.Identity[6],this.elements[7]=Pt.Identity[7],this.elements[8]=Pt.Identity[8],this.trigger(j.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(j.Types.change);if(typeof n>"u"&&(n=1),typeof r>"u"){e=e||0,t=t||0,n=n||0,s=this.elements;const N=s[0]*e+s[1]*t+s[2]*n,A=s[3]*e+s[4]*t+s[5]*n,L=s[6]*e+s[7]*t+s[8]*n;return[N,A,L]}const d=this.elements,h=[e,t,n,r,s,o,a,l,c],u=d[0],f=d[1],p=d[2],g=d[3],m=d[4],_=d[5],y=d[6],b=d[7],S=d[8],x=h[0],C=h[1],B=h[2],v=h[3],$=h[4],F=h[5],R=h[6],X=h[7],M=h[8];return this.elements[0]=u*x+f*v+p*R,this.elements[1]=u*C+f*$+p*X,this.elements[2]=u*B+f*F+p*M,this.elements[3]=g*x+m*v+_*R,this.elements[4]=g*C+m*$+_*X,this.elements[5]=g*B+m*F+_*M,this.elements[6]=y*x+b*v+S*R,this.elements[7]=y*C+b*$+S*X,this.elements[8]=y*B+b*F+S*M,this.trigger(j.Types.change)}inverse(e){const t=this.elements;e=e||new Pt;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],u=h*a-l*d,f=-h*o+l*c,p=d*o-a*c;let g=n*u+r*f+s*p;return g?(g=1/g,e.elements[0]=u*g,e.elements[1]=(-h*r+s*d)*g,e.elements[2]=(l*r-s*a)*g,e.elements[3]=f*g,e.elements[4]=(h*n-s*c)*g,e.elements[5]=(-l*n+s*o)*g,e.elements[6]=p*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=xg(e),n=Cg(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=al(e);return this.multiply(1,t,0,0,1,0,0,0,1)}skewY(e){const t=al(e);return this.multiply(1,0,0,t,1,0,0,0,1)}toString(e){return Fs.length=0,this.toTransformArray(e,Fs),Fs.map(Pe).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],u=n[7],f=n[8];if(r){t[0]=s,t[1]=l,t[2]=h,t[3]=o,t[4]=c,t[5]=u,t[6]=a,t[7]=d,t[8]=f;return}return[s,l,h,o,c,u,a,d,f]}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],u=n[7],f=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]=u,t[8]=f;return}return[s,o,a,l,c,d,h,u,f]}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 Pt().copy(this)}},Xn=Pt;w(Xn,"Identity",[1,0,0,0,1,0,0,0,1]),Ia(Xn);var Ms=class extends Dn{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 Nr)Object.defineProperty(this,e,Nr[e]);this._renderer.flagMatrix=ll.bind(this),this.isShape=!0,this.matrix=new Xn,this.worldMatrix=new Xn,this.position=new Z,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const t=new Ms().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 Nr.position.get.apply(this,arguments)}set translation(e){Nr.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 Ms;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}},dn=Ms;w(dn,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Nr={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(j.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(j.Types.change,this._renderer.flagMatrix),ll.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(j.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof Z&&this._scale.bind(j.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 La(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function ll(){this._flagMatrix=!0}var xi=Math.min,Ci=Math.max,Sg=Math.ceil,Bg=Math.floor,Tg=new Z,Tn=class extends dn{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 cl)Object.defineProperty(this,s,cl[s]);this._renderer.type="path",this._renderer.flagVertices=dl.bind(this),this._renderer.bindVertices=hl.bind(this),this._renderer.unbindVertices=ul.bind(this),this._renderer.flagFill=fl.bind(this),this._renderer.flagStroke=pl.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:jn(e.fill),n=typeof e.stroke=="string"?e.stroke:jn(e.stroke),r=new Tn().copy(Es(Ts({},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<Tn.Properties.length;t++){const n=Tn.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Tn;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<Tn.Properties.length;n++){const r=Tn.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(Tn.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:u,scaleY:f}=wi(t.elements[0],t.elements[3],t.elements[1],t.elements[4],t.elements[2],t.elements[5]);typeof u=="number"&&typeof f=="number"&&(n=Math.max(u,f)*(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[u,f]=t.multiply(o.x,o.y),[p,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,x=a.controls.left.y;a.relative&&(S+=a.x,x+=a.y);let[C,B]=t.multiply(S,x);const v=Xa(u,f,y,b,C,B,p,g);d=xi(v.min.y-n,d),l=xi(v.min.x-n,l),c=Ci(v.max.x+n,c),h=Ci(v.max.y+n,h)}else s<=1&&(d=xi(f-n,d),l=xi(u-n,l),c=Ci(u+n,c),h=Ci(f+n,h)),d=xi(g-n,d),l=xi(p-n,l),c=Ci(p+n,c),h=Ci(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,u,f,p,g,m,_,y=this.length*Math.min(Math.max(e,0),1);const b=this.vertices.length,S=b-1;let x=null,C=null;for(let Y=0,P=this._lengths.length,E=0;Y<P;Y++){if(E+this._lengths[Y]>=y){this._closed?(n=$t(Y,b),r=$t(Y-1,b),Y===0&&(n=r,r=Y)):(n=Y,r=Math.min(Math.max(Y-1,0),S)),x=this.vertices[n],C=this.vertices[r],y-=E,this._lengths[Y]!==0?e=y/this._lengths[Y]:e=0;break}E+=this._lengths[Y]}if(x===null||C===null)return null;if(x){if(!C)return x}else return C;_=C.controls&&C.controls.right,m=x.controls&&x.controls.left,a=C.x,u=C.y,l=(_||C).x,f=(_||C).y,c=(m||x).x,p=(m||x).y,d=x.x,g=x.y,_&&C.relative&&(l+=C.x,f+=C.y),m&&x.relative&&(c+=x.x,p+=x.y),o=Yi(e,a,l,c,d),h=Yi(e,u,f,p,g);const B=Et(a,l,e),v=Et(u,f,e),$=Et(l,c,e),F=Et(f,p,e),R=Et(c,d,e),X=Et(p,g,e),M=Et(B,$,e),N=Et(v,F,e),A=Et($,R,e),L=Et(F,X,e);return ae.isObject(t)?(t.x=o,t.y=h,t instanceof ve&&(t.controls.left.x=M,t.controls.left.y=N,t.controls.right.x=A,t.controls.right.y=L,(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,M-o,N-h,A-o,L-h,this._curved?ee.curve:ee.line),s.t=e,s)}plot(){if(this.curved)return Ya(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=ol(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=ol(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]=sl(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=$r(this,n*this._length),o=$r(this,r*this._length),a=Sg(s),l=Bg(o);let c,d,h,u,f,p;for(this._renderer.vertices.length=0,p=0;p<e;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new ve),p>l&&!d?(f=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(r,f),f.command=this._renderer.collection[p].command,this._renderer.vertices.push(f),d=f,h=this._collection[p-1],h&&h.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f),h.relative?this._renderer.collection[p-1].controls.right.copy(h.controls.right).lerp(Z.zero,1-f.t):this._renderer.collection[p-1].controls.right.copy(h.controls.right).lerp(h,1-f.t))):p>=a&&p<=l&&(f=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(f),p===l&&rl(this,r)?(d=f,!t&&d.controls&&(d.relative?d.controls.right.clear():d.controls.right.copy(d))):p===a&&rl(this,n)&&(c=f,c.command=ee.move,!t&&c.controls&&(c.relative?c.controls.left.clear():c.controls.left.copy(c))));a>0&&!c&&(p=a-1,f=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(n,f),f.command=ee.move,this._renderer.vertices.unshift(f),u=this._collection[p+1],u&&u.controls&&(f.controls.left.clear(),u.relative?this._renderer.collection[p+1].controls.left.copy(u.controls.left).lerp(Z.zero,f.t):(Tg.copy(u),this._renderer.collection[p+1].controls.left.copy(u.controls.left).lerp(u,f.t))))}return dn.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,dn.prototype.flagReset.call(this),this}},Se=Tn;w(Se,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),w(Se,"Utils",{getCurveLength:sl});var cl={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 Oe||this._fill instanceof Ve||this._fill instanceof Ee)&&this._fill.unbind(j.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ye||this._fill instanceof Oe||this._fill instanceof Ve||this._fill instanceof Ee)&&this._fill.bind(j.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ye||this._stroke instanceof Oe||this._stroke instanceof Ve||this._stroke instanceof Ee)&&this._stroke.unbind(j.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ye||this._stroke instanceof Oe||this._stroke instanceof Ve||this._stroke instanceof Ee)&&this._stroke.bind(j.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(j.Types.insert,t).unbind(j.Types.remove,n),e instanceof Bn?this._collection=e:this._collection=new Bn(e||[]),this._collection.bind(j.Types.insert,t).bind(j.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 dl(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function hl(e){let t=e.length;for(;t--;)e[t].bind(j.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function ul(e){let t=e.length;for(;t--;)e[t].unbind(j.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function fl(){this._flagFill=!0}function pl(){this._flagStroke=!0}var Gi=class extends Se{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 gl)Object.defineProperty(this,o,gl[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 Gi().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Gi.Properties.length;t++){const n=Gi.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 Gi(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<Se.Properties.length;n++){const r=Se.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}},En=Gi;w(En,"Properties",["width","height"]);var gl={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(j.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(j.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Ki=class extends En{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 ml)Object.defineProperty(this,a,ml[a]);this.noStroke(),this.noFill(),e instanceof Ee?this.texture=e:typeof e=="string"&&(this.texture=new Ee(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 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])}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 Ki(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,u;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,u=this._lastFrame+1,l=1e3*(u-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),c=Et(this._firstFrame,u,o/l),c=Math.floor(c),c!==this._index&&(this._index=c,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const f=this._index%t,p=Math.floor(this._index/t),g=-r*f+(d-r)/2,m=-s*p+(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}},Pr=Ki;w(Pr,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var ml={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}}},As,_l=class extends Bn{constructor(t){t=Array.isArray(t)?t:Array.prototype.slice.call(arguments),super(t),Aa(this,As,{}),this.attach(t),this.on(j.Types.insert,this.attach),this.on(j.Types.remove,this.detach)}get ids(){return xt(this,As)}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}};As=new WeakMap;var qn=class extends Se{constructor(e,t,n,r,s,o,a){const l=a||mt.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",ot),w(this,"_innerRadius",0),w(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let d in yl)Object.defineProperty(this,d,yl[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 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._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,t=this._endAngle,n=this._innerRadius,r=this._outerRadius,s=$t(e,ot)===$t(t,ot),o=n>0,a=this.vertices;let l=o?a.length/2:a.length,c,d=0,h,u,f,p,g,m,_,y,b;for(s?l--:o||(l-=2),h=0,u=l-1;h<l;h++){switch(f=h/u,p=a[d],g=f*(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}p.command=c,p.x=_,p.y=y,p.controls.left.clear(),p.controls.right.clear(),p.command===ee.curve&&(b=r*m/Math.PI,p.controls.left.x=b*Math.cos(g-Ke),p.controls.left.y=b*Math.sin(g-Ke),p.controls.right.x=b*Math.cos(g+Ke),p.controls.right.y=b*Math.sin(g+Ke),h===1&&p.controls.left.multiplyScalar(2),h===u&&p.controls.right.multiplyScalar(2)),d++}if(o){for(s?(a[d].command=ee.close,d++):(l--,u=l-1),h=0;h<l;h++)f=h/u,p=a[d],g=(1-f)*(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),p.command=c,p.x=_,p.y=y,p.controls.left.clear(),p.controls.right.clear(),p.command===ee.curve&&(b=n*m/Math.PI,p.controls.left.x=b*Math.cos(g+Ke),p.controls.left.y=b*Math.sin(g+Ke),p.controls.right.x=b*Math.cos(g-Ke),p.controls.right.y=b*Math.sin(g-Ke),h===1&&p.controls.left.multiplyScalar(2),h===u&&p.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 qn(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<Se.Properties.length;l++){const c=Se.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<qn.Properties.length;t++){const n=qn.Properties[t];e[n]=this[n]}return e}},Rr=qn;w(Rr,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var yl={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,Vs=Math.sin,Yn=class extends Se{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 bl)Object.defineProperty(this,a,bl[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 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&&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*ot,l=n*Os(a),c=n*Vs(a),d=r*Os(a-Ke),h=r*Vs(a-Ke),u=r*Os(a+Ke),f=r*Vs(a+Ke),p=this.vertices[s];p.command=s===0?ee.move:ee.curve,p.set(l,c),p.controls.left.set(d,h),p.controls.right.set(u,f)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const t=new Yn(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<Se.Properties.length;n++){const r=Se.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<Yn.Properties.length;t++){const n=Yn.Properties[t];e[n]=this[n]}return e}},Zi=Yn;w(Zi,"Properties",["radius"]);var bl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},zs=Math.cos,Is=Math.sin,Un=class extends Se{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 wl)Object.defineProperty(this,l,wl[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 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._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*ot,l=n*zs(a),c=r*Is(a),d=n*t*zs(a-Ke),h=r*t*Is(a-Ke),u=n*t*zs(a+Ke),f=r*t*Is(a+Ke),p=this.vertices[s];p.command=s===0?ee.move:ee.curve,p.set(l,c),p.controls.left.set(d,h),p.controls.right.set(u,f)}}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 Un(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<Se.Properties.length;o++){const a=Se.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<Un.Properties.length;t++){const n=Un.Properties[t];e[n]=this[n]}return e}},Ji=Un;w(Ji,"Properties",["width","height"]);var wl={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}}},Eg=Math.ceil,$g=Math.floor,$n=class extends dn{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",Se.prototype.noFill),w(this,"noStroke",Se.prototype.noStroke),w(this,"corner",Se.prototype.corner),w(this,"center",Se.prototype.center),w(this,"getBoundingClientRect",Se.prototype.getBoundingClientRect),w(this,"_updateLength",Se.prototype._updateLength);for(let t in vl)Object.defineProperty(this,t,vl[t]);this._renderer.type="points",this._renderer.flagVertices=dl.bind(this),this._renderer.bindVertices=hl.bind(this),this._renderer.unbindVertices=ul.bind(this),this._renderer.flagFill=fl.bind(this),this._renderer.flagStroke=pl.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:jn(e.fill),n=typeof e.stroke=="string"?e.stroke:jn(e.stroke),r=new $n().copy(Es(Ts({},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<$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="points",e.vertices=this.vertices.map(t=>t.toObject()),ae.each($n.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=Ns(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=$r(this,e*this._length),r=$r(this,t*this._length),s=Eg(n),o=$g(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}},Fr=$n;w(Fr,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);var vl={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 Oe||this._fill instanceof Ve||this._fill instanceof Ee)&&this._fill.unbind(j.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ye||this._fill instanceof Oe||this._fill instanceof Ve||this._fill instanceof Ee)&&this._fill.bind(j.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ye||this._stroke instanceof Oe||this._stroke instanceof Ve||this._stroke instanceof Ee)&&this._stroke.unbind(j.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ye||this._stroke instanceof Oe||this._stroke instanceof Ve||this._stroke instanceof Ee)&&this._stroke.bind(j.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(j.Types.insert,t).unbind(j.Types.remove,n),e instanceof Bn?this._collection=e:this._collection=new Bn(e||[]),this._collection.bind(j.Types.insert,t).bind(j.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}}},Ng=Math.cos,Pg=Math.sin,Gn=class extends Se{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 kl)Object.defineProperty(this,s,kl[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 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._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=ot*s+Math.PI/2,a=this._width*Ng(o)/2,l=this._height*Pg(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 Gn(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<Se.Properties.length;n++){const r=Se.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<Gn.Properties.length;t++){const n=Gn.Properties[t];e[n]=this[n]}return e}},Mr=Gn;w(Mr,"Properties",["width","height","sides"]);var kl={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}}},Kn=class extends Se{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 xl)Object.defineProperty(this,a,xl[a]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Rg.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 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];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 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<Se.Properties.length;o++){const a=Se.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<Kn.Properties.length;t++){const n=Kn.Properties[t];e[n]=this[n]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}},Qi=Kn;w(Qi,"Properties",["width","height","radius"]);var xl={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(j.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof Z&&this._radius.bind(j.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Rg(){this._flagRadius=!0}var Fg=Math.cos,Mg=Math.sin,Zn=class extends Se{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 Cl)Object.defineProperty(this,o,Cl[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 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._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=ot*s,a=(r%2?this._outerRadius:this._innerRadius)/2,l=a*Fg(o),c=a*Mg(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 Zn(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<Se.Properties.length;o++){const a=Se.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<Zn.Properties.length;t++){const n=Zn.Properties[t];e[n]=this[n]}return e}},Ar=Zn;w(Ar,"Properties",["innerRadius","outerRadius","sides"]);var Cl={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}}},Ls,Sl=Math.min,Bl=Math.max;He.document&&(Ls=document.createElement("canvas"));var Rt=class extends dn{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 Tl)Object.defineProperty(this,s,Tl[s]);if(this._renderer.type="text",this._renderer.flagFill=Ag.bind(this),this._renderer.flagStroke=Og.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<Rt.Properties.length;s++){const o=Rt.Properties[s];o in r&&(this[o]=r[o])}}static Measure(e){if(Ls){const t=Ls.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*Rt.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:jn(e.fill),n=typeof e.stroke=="string"?e.stroke:jn(e.stroke),r=new Rt().copy(Es(Ts({},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<Rt.Properties.length;t++){const n=Rt.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Rt(this.value);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale;for(let n=0;n<Rt.Properties.length;n++){const r=Rt.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<Rt.Properties.length;t++){const n=Rt.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}=Rt.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),[u,f]=t.multiply(n,o),[p,g]=t.multiply(r,s),[m,_]=t.multiply(r,o);return s=Sl(h,f,g,_),n=Sl(d,u,p,m),r=Bl(d,u,p,m),o=Bl(h,f,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}},At=Rt;w(At,"Ratio",.6),w(At,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);var Tl={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 Oe||this._fill instanceof Ve||this._fill instanceof Ee)&&this._fill.unbind(j.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ye||this._fill instanceof Oe||this._fill instanceof Ve||this._fill instanceof Ee)&&this._fill.bind(j.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ye||this._stroke instanceof Oe||this._stroke instanceof Ve||this._stroke instanceof Ee)&&this._stroke.unbind(j.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ye||this._stroke instanceof Oe||this._stroke instanceof Ve||this._stroke instanceof Ee)&&this._stroke.bind(j.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 Ag(){this._flagFill=!0}function Og(){this._flagStroke=!0}var Or=Math.min,Vr=Math.max,Si=class extends dn{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 El)Object.defineProperty(this,t,El[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++)$l.call(this,e[t],this)}static RemoveChildren(e){for(let t=0;t<e.length;t++)$l.call(this,e[t])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const t=new Si;for(let r=0;r<Si.Properties.length;r++){const s=Si.Properties[r];s in e&&(/(fill|stroke)/i.test(s)?t[s]=typeof e[s]=="string"?e[s]:jn(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 Rr.fromObject(r);case"circle":return Zi.fromObject(r);case"ellipse":return Ji.fromObject(r);case"points":return Fr.fromObject(r);case"polygon":return Mr.fromObject(r);case"rectangle":return En.fromObject(r);case"rounded-rectangle":return Qi.fromObject(r);case"star":return Ar.fromObject(r);case"path":return Se.fromObject(r);case"text":return At.fromObject(r);case"group":return Si.fromObject(r);case"shape":return dn.fromObject(r);case"element":return Dn.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 Si,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 u=/texture|gradient/i;n=e?this.matrix:this.worldMatrix;for(let f=0;f<this.children.length;f++){const p=this.children[f];if(!(!p.visible||u.test(p._renderer.type))&&(t=p.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,C]=n.multiply(t.right,t.bottom);d=Or(m,y,S,C,d),l=Or(g,_,b,x,l),c=Vr(g,_,b,x,c),h=Vr(m,y,S,C,h)}else d=Or(t.top,d),l=Or(t.left,l),c=Vr(t.right,c),h=Vr(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}},Ge=Si;w(Ge,"Children",_l),w(Ge,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var El={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=Ge.InsertChildren.bind(this),n=Ge.RemoveChildren.bind(this),r=Ge.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new _l(e),this._children.bind(j.Types.insert,t),this._children.bind(j.Types.remove,n),this._children.bind(j.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 $l(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 Ds=class extends Se{constructor(t,n,r,s){const o=[new ve(t,n),new ve(r,s)];super(o);for(let a in Nl)Object.defineProperty(this,a,Nl[a]);this.vertices[0].command=ee.move,this.vertices[1].command=ee.line,this.automatic=!1}},Nl={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 Ct("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 Ct("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}},Gt={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},Vg={start:"left",middle:"center",end:"right"},Pl=["id","class","transform","xmlns","viewBox"],zg=["x","y","width","height","href","xlink:href"];function Ig(e){return Vg[e]}function Lg(e){const t=e.getAttribute("dominant-baseline"),n=e.getAttribute("alignment-baseline");return t||n}function er(e){return e.replace(/svg:/gi,"").toLowerCase()}function Rl(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 Dg(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 Hg(e){const t={},n=Wg(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 Wg(e){const t=e.getAttributeNames();for(let n=0;n<Pl.length;n++){const r=Pl[n],s=Array.prototype.indexOf.call(t,r);s>=0&&t.splice(s,1)}return t}function jg(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 u=0;u<e.children.length;u++){const f=e.children[u];"translation"in f?f.translation.add(r,s):"x"in f?f.x=r:"y"in f&&(f.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 En(0,0,o,a),e.mask.origin.set(-o/2,-a/2),e}function Ot(e,t,n){const r={},s={},o={};let a,l,c,d,h,u,f,p,g,m,_,y,b,S,x,C,B;if(e===null)return r;if(He.getComputedStyle){const v=He.getComputedStyle(e);for(a=v.length;a--;)c=v[a],d=v[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<e.attributes.length;a++)u=e.attributes[a],/style/i.test(u.nodeName)?Dg(u.value,o):s[u.nodeName]=u.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&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(f=wi(l),t._renderer.type){case"linear-gradient":Rl(f,t.left),Rl(f,t.right);break;case"radial-gradient":t.center.x+=f.translateX,t.center.y+=f.translateY,t.focal.x+=f.translateX,t.focal.y+=f.translateY,t.radius*=Math.max(f.scaleX,f.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;f=wi(l),t.translation.set(f.translateX,f.translateY),t.rotation=Math.PI*(f.rotation/180),t.scale=new Z(f.scaleX,f.scaleY),p=parseFloat((r.x+"").replace("px")),g=parseFloat((r.y+"").replace("px")),p&&(t.translation.x=p),g&&(t.translation.y=g);break;case"visible":if(t instanceof Ge){t._visible=d;break}t.visible=d;break;case"stroke-linecap":if(t instanceof Ge){t._cap=d;break}t.cap=d;break;case"stroke-linejoin":if(t instanceof Ge){t._join=d;break}t.join=d;break;case"stroke-miterlimit":if(t instanceof Ge){t._miter=d;break}t.miter=d;break;case"stroke-width":if(t instanceof Ge){t._linewidth=parseFloat(d);break}t.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(t instanceof Ge){t._opacity=parseFloat(d);break}t.opacity=parseFloat(d);break;case"clip-path":if(Gt.cssBackgroundImage.test(d)&&(m=d.replace(Gt.cssBackgroundImage,"$1"),Le.defs.current&&Le.defs.current.contains(m)&&(y=Le.defs.current.get(m),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],b=er(y.nodeName),t.mask=Le[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 Ge?"_":"")+c,Gt.cssBackgroundImage.test(d)?(m=d.replace(Gt.cssBackgroundImage,"$1"),Le.defs.current&&Le.defs.current.contains(m)?(y=Le.defs.current.get(m),y.object||(b=er(y.nodeName),y.object=Le[b].call(this,y,{})),y=y.object):(_=qg(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 Ye,x=t instanceof Oe,C=t instanceof Ve,S||x||C)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Ct("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 At&&(t.family=d);break;case"font-size":t instanceof At&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Ct("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 At&&(t.weight=d);break;case"font-style":t instanceof At&&(t.style=d);break;case"text-decoration":t instanceof At&&(t.decoration=d);break;case"line-height":t instanceof At&&(t.leading=d);break}return Object.keys(e.dataset).length&&(t.dataset=e.dataset),r}function Xg(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){const s=e.childNodes[n];!s.id||er(e.nodeName)==="#text"||t.add(s.id,s)}}function qg(e){for(;e.parent;)e=e.parent;return e.scene}var Le={svg:function(e){const t=Le.defs.current=new Tr,n=e.getElementsByTagName("defs");for(let g=0;g<n.length;g++)Xg(n[g],t);const r=Le.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,u=a!==null,f=l!==null,p=c!==null;return h&&(r.x=parseFloat(o.replace(Gt.unitSuffix,""))),u&&(r.y=parseFloat(a.replace(Gt.unitSuffix,""))),f&&(r.width=parseFloat(l.replace(Gt.unitSuffix,""))),p&&(r.height=parseFloat(c.replace(Gt.unitSuffix,""))),d&&jg(r,s),delete Le.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 Ct("encountered <use /> with no href."),console.warn(n.name,n.message),null;const s=r.slice(1);if(!Le.defs.current.contains(s))return n=new Ct("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=Le.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),u=!a.hasAttribute(d.nodeName);(h||u)&&a.setAttribute(d.nodeName,d.value)}const l=er(a.nodeName);return Le[l].call(this,a,t)},g:function(e,t){const n=new Ge;Ot.call(this,e,n,t),this.add(n);const r=Hg.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=er(l);if(c in Le){const d=Le[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 Se(r,!0);return s.stroke="none",s.fill="black",Ot.call(this,e,s,t),s},polyline:function(e,t){const n=Le.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 u=h.length-1;ae.each(h.slice(0),function(f,p){const g=f.slice(1).trim().match(Gt.path),m=f[0],_=m.toLowerCase();let y,b,S,x,C;const B=[];switch(p===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,C=0;b<S;b+=y){if(x=m,C>0)switch(m){case"m":x="l";break;case"M":x="L";break}B.push(x+g.slice(b,b+y).join(" ")),C++}h=Array.prototype.concat.apply(h,B)}else h.push(f)}),ae.each(h,function(f,p){let g,m,_;const y=f[0],b=y.toLowerCase();d=f.slice(1).trim().match(Gt.path),o=y===b;let S,x,C,B,v,$,F,R,X,M,N,A,L,Y,P,E,H;switch(b){case"z":if(p>=u)s=!0;else{m=l.x,_=l.y,g=new ve(m,_,void 0,void 0,void 0,void 0,ee.close);for(let I=r.length-1;I>=0;I--){const U=r[I];if(/m/i.test(U.command)){l=U;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":M=/h/i.test(b)?"x":"y",N=/x/i.test(M)?"y":"x",g=new ve(void 0,void 0,void 0,void 0,void 0,void 0,ee.line),g[M]=parseFloat(d[0]),g[N]=l[N],o&&(g[M]+=l[M]),l=g;break;case"c":case"s":S=l.x,x=l.y,c||(c=new Z),/c/i.test(b)?(C=parseFloat(d[0]),B=parseFloat(d[1]),v=parseFloat(d[2]),$=parseFloat(d[3]),F=parseFloat(d[4]),R=parseFloat(d[5])):(X=Ps(l,c,o),C=X.x,B=X.y,v=parseFloat(d[0]),$=parseFloat(d[1]),F=parseFloat(d[2]),R=parseFloat(d[3])),o&&(C+=S,B+=x,v+=S,$+=x,F+=S,R+=x),l.controls.right.set(C-l.x,B-l.y),g=new ve(F,R,v-F,$-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 Z),/q/i.test(b)?(C=parseFloat(d[0]),B=parseFloat(d[1]),v=parseFloat(d[0]),$=parseFloat(d[1]),F=parseFloat(d[2]),R=parseFloat(d[3])):(X=Ps(l,c,o),C=X.x,B=X.y,v=X.x,$=X.y,F=parseFloat(d[0]),R=parseFloat(d[1])),o&&(C+=S,B+=x,v+=S,$+=x,F+=S,R+=x),l.controls.right.set((C-l.x)*.33,(B-l.y)*.33),g=new ve(F,R,v-F,$-R,void 0,void 0,ee.curve),l=g,c=g.controls.left;break;case"a":S=l.x,x=l.y,L=parseFloat(d[0]),Y=parseFloat(d[1]),P=parseFloat(d[2]),E=parseFloat(d[3]),H=parseFloat(d[4]),F=parseFloat(d[5]),R=parseFloat(d[6]),o&&(F+=S,R+=x),A=new ve(F,R),A.command=ee.arc,A.rx=L,A.ry=Y,A.xAxisRotation=P,A.largeArcFlag=E,A.sweepFlag=H,g=A,l=A,c=void 0;break}g&&(Array.isArray(g)?r=r.concat(g):r.push(g))})}n=new Se(r,s,void 0,!0),n.stroke="none",n.fill="black";const a=n.getBoundingClientRect(!0);return a.centroid={x:a.left+a.width/2,y:a.top+a.height/2},ae.each(n.vertices,function(l){l.subSelf(a.centroid)}),Ot.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 Zi(0,0,s);return o.stroke="none",o.fill="black",Ot.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 Ji(0,0,s,o);return a.stroke="none",a.fill="black",Ot.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 Le["rounded-rect"](e);const s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new En(0,0,s,o);return c.stroke="none",c.fill="black",Ot.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 Qi(0,0,s,o,c);return d.stroke="none",d.fill="black",Ot.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 Ds(n,r,s,o).noFill();return Ot.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 f=0;f<e.children.length;f++){const p=e.children[f];let g=p.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let m=p.getAttribute("stop-color"),_=p.getAttribute("stop-opacity"),y=p.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 Ut(g,m,_))}const u=new Oe(s,o,a,l,h);return u.spread=r,u.units=n,Ot.call(this,e,u,t),u},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 u=[];for(let p=0;p<e.children.length;p++){const g=e.children[p];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),u.push(new Ut(m,_,y))}const f=new Ve(s,o,a,u,l,c);return f.spread=r,f.units=n,Ot.call(this,e,f,t),f},text:function(e,t){const n=Ig(e.getAttribute("text-anchor"))||"left",r=Lg(e)||"baseline";let s="";e.childNodes.length>0&&e.childNodes[0].tagName==="TSPAN"?s=e.childNodes[0].textContent:s=e.textContent;const o=new At(s);return Ot.call(this,e,o,t),o.alignment=n,o.baseline=r,o},clippath:function(e,t){return Le.defs.current&&!Le.defs.current.contains(e.id)&&Le.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 Ct("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 Pr(r,s,o);return ae.isNaN(a)||(c.width=a),ae.isNaN(l)||(c.height=l),Ot.call(this,e,c,t),c}};function Fl(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 Bi=class extends En{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 Ml)Object.defineProperty(this,s,Ml[s]);this._renderer.flagTextures=Yg.bind(this),this._renderer.bindTextures=Ug.bind(this),this._renderer.unbindTextures=Gg.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(Al.bind(this)):this.textures=[Al(e)],this.origin=new Z,this._update(),typeof r=="number"?this.frameRate=r:this.frameRate=Bi.DefaultFrameRate,this.index=0}static fromObject(e){const t=new Bi().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Bi.Properties.length;t++){const n=Bi.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 Bi(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=Et(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 Ee))&&(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}},zr=Bi;w(zr,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),w(zr,"DefaultFrameRate",30);var Ml={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(j.Types.insert,t).unbind(j.Types.remove,n),this._textures=new Bn((e||[]).slice(0)),this._textures.bind(j.Types.insert,t).bind(j.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 Yg(){this._flagTextures=!0}function Ug(e){let t=e.length;for(;t--;)e[t].bind(j.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Gg(e){let t=e.length;for(;t--;)e[t].unbind(j.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Al(e){if(e instanceof Ee)return e;if(typeof e=="string")return new Ee(e)}var Hs=[],Ws=Math.max,Kg=Math.min,Ol=Math.abs,Ir=Math.sin,Lr=Math.cos,Zg=Math.acos,Dr=Math.sqrt,Te={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(e){return e in Te?e:"path"},group:{renderChild:function(e){const t=Te.getRendererType(e._renderer.type);Te[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=Hr(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=Te.getRendererType(r._renderer.type);Te[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=Te.getRendererType(l._renderer.type);Te[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,u,f,p,g,m,_,y,b,S,x,C,B,v,$,F,R,X,M,N,A,L,Y,P,E,H,I;if(I=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,L=this._mask,Y=this._clip,l=this._opacity*(I||1),c=this._visible,!t&&(!c||Y||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,u=this._miter,f=this._closed,p=this._renderer.vertices,g=p.length,m=g-1,P=Hr(r),H=this.dashes,P||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),L){const ie=Te.getRendererType(L._renderer.type);Te[ie].render.call(L,e,!0)}if(a)if(typeof a=="string")e.fillStyle=a;else{const ie=Te.getRendererType(a._renderer.type);Te[ie].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const ie=Te.getRendererType(s._renderer.type);Te[ie].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o),u&&(e.miterLimit=u),h&&(e.lineJoin=h),!f&&d&&(e.lineCap=d)}typeof l=="number"&&(e.globalAlpha=l),H&&H.length>0&&(e.lineDashOffset=H.offset||0,e.setLineDash(H)),e.beginPath();let U,O,z,J,pe,re,ge;for(let ie=0;ie<g;ie++)switch(b=p[ie],N=b.x,A=b.y,b.command){case ee.close:e.closePath();break;case ee.arc:U=b.rx,O=b.ry,z=b.xAxisRotation,J=b.largeArcFlag,pe=b.sweepFlag,_=f?$t(ie-1,g):Ws(ie-1,0),y=p[_],re=y.x,ge=y.y,Te.renderSvgArcCommand(e,re,ge,U,O,J,pe,z,N,A);break;case ee.curve:_=f?$t(ie-1,g):Math.max(ie-1,0),y=p[_],F=y.controls&&y.controls.right||Z.zero,R=b.controls&&b.controls.left||Z.zero,y._relative?(v=F.x+y.x,$=F.y+y.y):(v=F.x,$=F.y),b._relative?(C=R.x+b.x,B=R.y+b.y):(C=R.x,B=R.y),e.bezierCurveTo(v,$,C,B,N,A),ie>=m&&f&&(S=x,X=b.controls&&b.controls.right||Z.zero,M=S.controls&&S.controls.left||Z.zero,b._relative?(v=X.x+b.x,$=X.y+b.y):(v=X.x,$=X.y),S._relative?(C=M.x+S.x,B=M.y+S.y):(C=M.x,B=M.y),N=S.x,A=S.y,e.bezierCurveTo(v,$,C,B,N,A));break;case ee.line:e.lineTo(N,A);break;case ee.move:x=b,e.moveTo(N,A);break}return f&&e.closePath(),!Y&&!n&&(Te.isHidden.test(a)||(E=a._renderer&&a._renderer.offset,E&&(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&&e.restore()),Te.isHidden.test(s)||(E=s._renderer&&s._renderer.offset,E&&(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&&e.restore())),P||e.restore(),Y&&!n&&e.clip(),H&&H.length>0&&e.setLineDash(Hs),this.flagReset()}},points:{render:function(e,t,n){let r,s,o,a,l,c,d,h,u,f,p,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,u=h.length,m=Hr(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 C=Te.getRendererType(a._renderer.type);Te[C].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const C=Te.getRendererType(s._renderer.type);Te[C].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,x;this._sizeAttenuation||(x=this.worldMatrix.elements,x=wi(x[0],x[3],x[1],x[4],x[2],x[5]),S/=Math.max(x.scaleX,x.scaleY));for(let C=0;C<u;C++)f=h[C],p=f.x,g=f.y,e.moveTo(p+S,g),e.arc(p,g,S,0,ot);return n||(Te.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()),Te.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(Hs),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,u=this._fill,f=this._decoration,p=this._direction,g=Hr(c),m=u._renderer&&u._renderer.offset&&d._renderer&&d._renderer.offset,_=this.dashes,y=Te.alignments[this._alignment]||this._alignment,b=Te.baselines[this._baseline]||this._baseline;let S,x,C,B,v,$,F,R,X,M,N;if(g||(e.save(),e.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const A=Te.getRendererType(a._renderer.type);Te[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=p,u)if(typeof u=="string")e.fillStyle=u;else{const A=Te.getRendererType(u._renderer.type);Te[A].render.call(u,e,this),e.fillStyle=u._renderer.effect}if(d){if(typeof d=="string")e.strokeStyle=d;else{const A=Te.getRendererType(d._renderer.type);Te[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&&(Te.isHidden.test(u)||(u._renderer&&u._renderer.offset?($=u._renderer.scale.x,F=u._renderer.scale.y,e.save(),e.translate(-u._renderer.offset.x,-u._renderer.offset.y),e.scale($,F),S=this._size/u._renderer.scale.y,x=this._leading/u._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",x+"px",this._family].join(" "),C=u._renderer.offset.x/u._renderer.scale.x,B=u._renderer.offset.y/u._renderer.scale.y,e.fillText(this.value,C,B),e.restore()):e.fillText(this.value,0,0)),Te.isHidden.test(d)||(d._renderer&&d._renderer.offset?($=d._renderer.scale.x,F=d._renderer.scale.y,e.save(),e.translate(-d._renderer.offset.x,-d._renderer.offset.y),e.scale($,F),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(" "),C=d._renderer.offset.x/d._renderer.scale.x,B=d._renderer.offset.y/d._renderer.scale.y,v=h/d._renderer.scale.x,e.lineWidth=v,e.strokeText(this.value,C,B),e.restore()):e.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(f)){const A=e.measureText(this.value);let L=1;switch(f){case"underline":X=A.actualBoundingBoxDescent,N=A.actualBoundingBoxDescent;break;case"strikethrough":X=0,N=0,L=.5;break}switch(b){case"top":X+=this._size*L,N+=this._size*L;break;case"baseline":case"bottom":X-=this._size*L,N-=this._size*L;break}switch(y){case"left":case"start":R=0,M=A.width;break;case"right":case"end":R=-A.width,M=0;break;default:R=-A.width/2,M=A.width/2}e.lineWidth=Math.max(Math.floor(this._size/15),1),e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(R,X),e.lineTo(M,N),e.stroke()}return g||e.restore(),l&&!n&&e.clip(),_&&_.length>0&&e.setLineDash(Hs),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=Ol(r),s=Ol(s);const h=(t-c)/2,u=(n-d)/2,f=Lr(l)*h+Ir(l)*u,p=-Ir(l)*h+Lr(l)*u,g=f*f,m=p*p;let _=r*r,y=s*s;const b=g/_+m/y;if(b>1){const A=Dr(b);r=A*r,s=A*s,_=r*r,y=s*s}const S=_*m+y*g,x=(_*y-S)/S;let C=Dr(Ws(0,x));o===a&&(C=-C);const B=C*r*p/s,v=-C*s*f/r,$=Lr(l)*B-Ir(l)*v+(t+c)/2,F=Ir(l)*B+Lr(l)*v+(n+d)/2,R=Vl(1,0,(f-B)/r,(p-v)/s),X=Vl((f-B)/r,(p-v)/s,(-f-B)/r,(-p-v)/s)%ot,M=R+X;Jg(e,$,F,r,s,R,M,a===0,l)}},lt=class extends j{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 Ge,this.scene.parent=this}setSize(e,t,n){return this.width=e,this.height=t,this.ratio=typeof n>"u"?Rs(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(j.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),Te.group.render.call(this.scene,this.ctx),e||this.ctx.restore(),this}};w(lt,"Utils",Te);function Jg(e,t,n,r,s,o,a,l,c){const d=a-o,h=vi.Tolerance.epsilon,u=Math.abs(d)<h;let f=$t(d,ot);f<h&&(u?f=0:f=ot),l===!0&&!u&&(f===ot?f=-ot:f=f-ot);for(let p=0;p<mt.Resolution;p++){const g=p/(mt.Resolution-1),m=o+g*f;let _=t+r*Math.cos(m),y=n+s*Math.sin(m);if(c!==0){const b=Math.cos(c),S=Math.sin(c),x=_-t,C=y-n;_=x*b-C*S+t,y=x*S+C*b+n}e.lineTo(_,y)}}function Vl(e,t,n,r){const s=e*n+t*r,o=Dr(e*e+t*t)*Dr(n*n+r*r);let a=Zg(Ws(-1,Kg(1,s/o)));return e*r-t*n<0&&(a=-a),a}function Hr(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?$t(a-1,n):Math.max(a-1,0),d=e[c];let h,u,f,p,g,m,_,y,b,S,x,C,B,v,$,F=Pe(l.x),R=Pe(l.y);switch(l.command){case ee.close:h=ee.close;break;case ee.arc:x=l.rx,C=l.ry,B=l.xAxisRotation,v=l.largeArcFlag,$=l.sweepFlag,h=ee.arc+" "+x+" "+C+" "+B+" "+v+" "+$+" "+F+" "+R;break;case ee.curve:_=d.controls&&d.controls.right||Z.zero,y=l.controls&&l.controls.left||Z.zero,d.relative?(f=Pe(_.x+d.x),p=Pe(_.y+d.y)):(f=Pe(_.x),p=Pe(_.y)),l.relative?(g=Pe(y.x+l.x),m=Pe(y.y+l.y)):(g=Pe(y.x),m=Pe(y.y)),h=(a===0?ee.move:ee.curve)+" "+f+" "+p+" "+g+" "+m+" "+F+" "+R;break;case ee.move:s=l,h=ee.move+" "+F+" "+R;break;default:h=l.command+" "+F+" "+R}a>=r&&t&&(l.command===ee.curve&&(u=s,b=l.controls&&l.controls.right||l,S=u.controls&&u.controls.left||u,l.relative?(f=Pe(b.x+l.x),p=Pe(b.y+l.y)):(f=Pe(b.x),p=Pe(b.y)),u.relative?(g=Pe(S.x+u.x),m=Pe(S.y+u.y)):(g=Pe(S.x),m=Pe(S.y)),F=Pe(u.x),R=Pe(u.y),h+=" C "+f+" "+p+" "+g+" "+m+" "+F+" "+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=wi(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()}}},zl=class extends j{constructor(e){super(),this.domElement=e.domElement||se.createElement("svg"),this.scene=new Ge,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(j.Types.resize,e,t)}render(){return se.group.render.call(this.scene,this.domElement),se.defs.update(this.domElement),this}};w(zl,"Utils",se);var Vt={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 Ct("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,20 +100,20 @@
|
|
100
100
|
}
|
101
101
|
gl_FragColor = texel;
|
102
102
|
}
|
103
|
-
`}},jr=qn.Multiply,Qg=[1,0,0,0,1,0,0,0,1],Pn=new Ut(9),em=ct.Utils,Ll=new K,Xs=new Ut([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 qn,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 Ut(9)),this._matrix.toTransformArray(!0,Pn),jr(Pn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof K||(this._renderer.scale=new K),this._scale instanceof K?(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=ct.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=ct.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,u,f,p,g,m;const _=t._renderer.vertices,y=this.canvas,b=this.ctx,S=e.renderer.ratio,x=Ll.copy(t._renderer.scale).multiply(S),C=t._stroke,B=t._linewidth,v=t._fill,$=t._renderer.opacity||t._opacity,F=t._cap,R=t._join,q=t._miter,M=t._closed,N=t.dashes,A=_.length,L=A-1;y.width=Math.max(Math.ceil(t._renderer.rect.width*x.x),1),y.height=Math.max(Math.ceil(t._renderer.rect.height*x.y),1);const Y=t._renderer.rect.centroid,P=Y.x,E=Y.y;if(b.clearRect(0,0,y.width,y.height),v)if(typeof v=="string")b.fillStyle=v;else{const ge=ct.Utils.getRendererType(v._renderer.type);ye[ge].render.call(v,b,t),b.fillStyle=v._renderer.effect}if(C){if(typeof C=="string")b.strokeStyle=C;else{const ge=ct.Utils.getRendererType(C._renderer.type);ye[ge].render.call(C,b,t),b.strokeStyle=C._renderer.effect}B&&(b.lineWidth=B),q&&(b.miterLimit=q),R&&(b.lineJoin=R),!M&&F&&(b.lineCap=F)}typeof $=="number"&&(b.globalAlpha=$),N&&N.length>0&&(b.lineDashOffset=N.offset||0,b.setLineDash(N));let H,I,U,O,z,Z,pe,re;b.save(),b.scale(x.x,x.y),b.translate(P,E),b.beginPath();for(let ge=0;ge<_.length;ge++){const ie=_[ge];switch(p=ie.x,g=ie.y,ie.command){case Q.close:b.closePath();break;case Q.arc:I=ie.rx,U=ie.ry,O=ie.xAxisRotation,z=ie.largeArcFlag,Z=ie.sweepFlag,n=M?Nt(ge-1,A):Math.max(ge-1,0),r=_[n],pe=r.x,re=r.y,em.renderSvgArcCommand(b,pe,re,I,U,z,Z,O,p,g);break;case Q.curve:n=M?Nt(ge-1,A):Math.max(ge-1,0),r=_[n],d=r.controls&&r.controls.right||K.zero,h=ie.controls&&ie.controls.left||K.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),ie._relative?(o=h.x+ie.x,a=h.y+ie.y):(o=h.x,a=h.y),b.bezierCurveTo(l,c,o,a,p,g),ge>=L&&M&&(s=H,u=ie.controls&&ie.controls.right||K.zero,f=s.controls&&s.controls.left||K.zero,ie._relative?(l=u.x+ie.x,c=u.y+ie.y):(l=u.x,c=u.y),s._relative?(o=f.x+s.x,a=f.y+s.y):(o=f.x,a=f.y),p=s.x,g=s.y,b.bezierCurveTo(l,c,o,a,p,g));break;case Q.line:b.lineTo(p,g);break;case Q.move:H=ie,b.moveTo(p,g);break}}M&&b.closePath(),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.fill(),m&&b.restore()),ye.isHidden.test(C)||(m=C._renderer&&C._renderer.offset,m&&(b.save(),b.translate(-C._renderer.offset.x,-C._renderer.offset.y),b.scale(C._renderer.scale.x,C._renderer.scale.y),b.lineWidth=B/C._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,u=d.y,f=d.controls;let p,g,m,_,y,b;o=Math.min(u,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(u,a),d.controls&&(y=f.left,b=f.right,!(!y||!b)&&(p=d._relative?y.x+h:y.x,g=d._relative?y.y+u:y.y,m=d._relative?b.x+h:b.x,_=d._relative?b.y+u:b.y,!(!p||!g||!m||!_)&&(o=Math.min(g,_,o),r=Math.min(p,m,r),s=Math.max(p,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=ct.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 Oe&&(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 Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Oe&&(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 Ee&&(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 Ut(9)),this._matrix.toTransformArray(!0,Pn),jr(Pn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof K||(this._renderer.scale=new K);let u,f;this._scale instanceof K?(u=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=f<0?-f:f,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 u=ct.Utils.getRendererType(this._mask._renderer.type);ye[u].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,Xs,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,u=t._size*o;let f=u;ye.isHidden.test(a)||(f+=l),r.width=Ha(f),r.height=r.width;const p=f/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 _=ct.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 _=ct.Utils.getRendererType(a._renderer.type);ye[_].render.call(a,s,t),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=l/p)}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,u/p*.5,0,at),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,u=this._renderer.parent!==s,f=this._renderer.vertices,p=this._renderer.collection.length,g=this._flagVertices,m=this._flagFill||this._fill instanceof Oe&&(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 Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Oe&&(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 Ee&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||s._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||h||u){this._renderer.matrix||(this._renderer.matrix=new Ut(9)),this._matrix.toTransformArray(!0,Pn),jr(Pn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof K||(this._renderer.scale=new K);let _,y;this._scale instanceof K?(_=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,u&&(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,f,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,p),this.flagReset())}},text:{updateCanvas:function(e,t){const n=this.canvas,r=this.ctx,s=e.renderer.ratio,o=Ll.copy(t._renderer.scale).multiply(s),a=t._stroke,l=t._linewidth,c=t._fill,d=t._renderer.opacity||t._opacity,h=t.dashes,u=t._decoration,f=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 p=t._renderer.rect.centroid,g=p.x,m=p.y;let _,y,b,S,x,C,B,v,$,F,R;const q=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),q||(r.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=f,c)if(typeof c=="string")r.fillStyle=c;else{const M=ct.Utils.getRendererType(c._renderer.type);ye[M].render.call(c,r,t),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const M=ct.Utils.getRendererType(a._renderer.type);ye[M].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?(C=c._renderer.scale.x,B=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(C,B),_=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?(C=a._renderer.scale.x,B=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(C,B),_=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,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(u)){const M=r.measureText(t.value);switch(u){case"underline":$=M.actualBoundingBoxDescent,R=M.actualBoundingBoxDescent;break;case"strikethrough":$=0,R=0;break}v=-M.width/2,F=M.width/2,r.lineWidth=Math.max(Math.floor(t._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(v,$),r.lineTo(F,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=ct.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 Oe&&(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 Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Oe&&(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 Ee&&(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 Ut(9)),this._matrix.toTransformArray(!0,Pn),jr(Pn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof K||(this._renderer.scale=new K);let h,u;this._scale instanceof K?(h=this._scale.x*r._renderer.scale.x,u=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,u=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=u<0?-u:u,l&&(this._renderer.parent=r)}if(this._mask){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=ct.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,Xs,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 K||(this._renderer.offset=new K),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 K?(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 K||(this._renderer.scale=new K);let r,s;this._scale instanceof K?(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=ct.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 St("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 Er};ye.ctx=ye.canvas.getContext("2d");var Dl=class extends X{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 Ke,this.scene.parent=this,this._renderer={type:"renderer",matrix:new Ut(Qg),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 St("unable to create a webgl context. Try using another renderer.");r=zt.create(t,zt.path.vertex,zt.types.vertex),s=zt.create(t,zt.path.fragment,zt.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,Xs,t.STATIC_DRAW),r=zt.create(t,zt.points.vertex,zt.types.vertex),s=zt.create(t,zt.points.fragment,zt.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"?Fs(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),ye.group.render.call(this.scene,e,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};w(Dl,"Utils",ye);var tm=ae.extend({Error:St,getRatio:Fs,read:Le,xhr:Ml},ae,mt,Va,za),nr=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:nr.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=nr.Types[n])}this.renderer=new nr[this.type](this),this.setPlaying(t.autostart),this.frameCount=0,t.fullscreen?(this.fit=nm.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"}),Pt.bind(this.fit.domElement,"resize",this.fit),this.fit()):t.fitted?(this.fit=im.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,rm.bind(this)),this.scene=this.renderer.scene,nr.Instances.push(this),t.autostart&&ir.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,ir.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&&(Pt.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 Hs(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,Q.move),new ve(n,r,void 0,void 0,void 0,void 0,Q.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,Q.line),new ve(n,r,void 0,void 0,void 0,void 0,Q.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,Q.line)],c=new Se(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 $n(e,t,n,r);return this.scene.add(s),s}makeRoundedRectangle(e,t,n,r,s){const o=new er(e,t,n,r,s);return this.scene.add(o),o}makeCircle(e,t,n,r){const s=new Ji(e,t,n,r);return this.scene.add(s),s}makeEllipse(e,t,n,r,s){const o=new Qi(e,t,n,r,s);return this.scene.add(o),o}makeStar(e,t,n,r,s){const o=new Or(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 Se(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 Ar(e,t,n,r);return this.scene.add(s),s}makeArcSegment(e,t,n,r,s,o,a){const l=new Fr(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 K(o,a))}}const r=new Mr(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 Se(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 Ot(e,t,n,r);return this.add(s),s}makeLinearGradient(e,t,n,r){const s=Array.prototype.slice.call(arguments,4),o=new Oe(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 Rr(e,t,n,r,s,o);return a&&l.play(),this.add(l),l}makeImageSequence(e,t,n,r,s){const o=new Ir(e,t,n,r);return s&&o.play(),this.add(o),o}makeTexture(e,t){return new Ee(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 Le))return null;const s=Le[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(Pt.temp.innerHTML=l,s=0;s<Pt.temp.children.length;s++)r=Pt.temp.children[s],o=this.interpret(r,!1,!1),o!==null&&n.add(o);if(typeof t=="function"){const c=Pt.temp.children.length<=1?Pt.temp.children[0]:Pt.temp.children;t(n,c)}}).bind(this);return/\.svg$/i.test(e)?(Ml(e,a),n):(a(e),n)}},he=nr;w(he,"NextFrameId",_t.NextFrameId),w(he,"Types",_t.Types),w(he,"Version",_t.Version),w(he,"PublishDate",_t.PublishDate),w(he,"Identifier",_t.Identifier),w(he,"Resolution",_t.Resolution),w(he,"AutoCalculateImportedMatrices",_t.AutoCalculateImportedMatrices),w(he,"Instances",_t.Instances),w(he,"uniqueId",_t.uniqueId),w(he,"Anchor",ve),w(he,"Collection",Tn),w(he,"Events",X),w(he,"Group",Ke),w(he,"Matrix",qn),w(he,"Path",Se),w(he,"Registry",Er),w(he,"Element",Hn),w(he,"Shape",hn),w(he,"Text",Ot),w(he,"Vector",K),w(he,"Gradient",Ue),w(he,"ImageSequence",Ir),w(he,"LinearGradient",Oe),w(he,"RadialGradient",Ve),w(he,"Sprite",Rr),w(he,"Stop",Gt),w(he,"Texture",Ee),w(he,"ArcSegment",Fr),w(he,"Circle",Ji),w(he,"Ellipse",Qi),w(he,"Line",Hs),w(he,"Points",Mr),w(he,"Polygon",Ar),w(he,"Rectangle",$n),w(he,"RoundedRectangle",er),w(he,"Star",Or),w(he,"CanvasRenderer",ct),w(he,"SVGRenderer",Il),w(he,"WebGLRenderer",Dl),w(he,"Commands",Q),w(he,"Utils",tm);function nm(){const e=document.body.getBoundingClientRect(),t=this.width=e.width,n=this.height=e.height;this.renderer.setSize(t,n,this.ratio)}function im(){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 rm(e,t){this.width=e,this.height=t,this.trigger(X.Types.resize,e,t)}var ir=Pt.getRequestAnimationFrame();function Hl(){for(let e=0;e<he.Instances.length;e++){const t=he.Instances[e];t.playing&&t.update()}he.NextFrameId=ir(Hl)}ir.init=function(){Hl(),ir.init=function(){}};let Zt;typeof window<"u"?Zt=window:typeof global<"u"?Zt=global:typeof self<"u"&&(Zt=self);let Wl;const Qn=Math.PI*2,nt=Math.PI*.5;function sm(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 om(e){Wl=e}function am(e,t){t=t&&t.identity()||new Wl;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 Jt(e,t,n){return n*(t-e)+e}function Ei(e,t){for(;e<0;)e+=t;return e%t}const jl=Zt.Float32Array||Array,lm=Math.floor;function Qt(e){return lm(e*1e6)/1e6}const fe={move:"M",line:"L",curve:"C",close:"Z"};class G{constructor(){k(this,"_events",{});k(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}}k(G,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),k(G,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Xl={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))}}},rt=class rt extends G{constructor(n=0,r=0){super();k(this,"_x",0);k(this,"_y",0);for(let s in Xl)Object.defineProperty(this,s,Xl[s]);this.x=n,this.y=r}static add(n,r){return new rt(n.x+r.x,n.y+r.y)}static sub(n,r){return new rt(n.x-r.x,n.y-r.y)}static subtract(n,r){return rt.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(rt.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 rt(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:Qt(this.x),y:Qt(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}};k(rt,"zero",new rt),k(rt,"left",new rt(-1,0)),k(rt,"right",new rt(1,0)),k(rt,"up",new rt(0,-1)),k(rt,"down",new rt(0,1));let we=rt;class $e extends we{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=fe.move){super(n,r);k(this,"controls",{left:new we,right:new we});k(this,"_command",fe.move);k(this,"_relative",!0);k(this,"_rx",0);k(this,"_ry",0);k(this,"_xAxisRotation",0);k(this,"_largeArcFlag",0);k(this,"_sweepFlag",1);for(let h in ql)Object.defineProperty(this,h,ql[h]);this.command=c,this.relative=!0;const d=$e.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 $e().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 $e().copy(this)}toObject(){return{x:Qt(this.x),y:Qt(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Qt(this.rx),ry:Qt(this.ry),xAxisRotation:Qt(this.xAxisRotation),largeArcFlag:Qt(this.largeArcFlag),sweepFlag:Qt(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const ql={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 cm=0;const qs={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return cm++}},Xr={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 qr(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 Yl(e,t,n,r,s,o,a,l,c){c=c||Xr.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new $e(a,l)];const h=[];for(let u=0;u<d;u++){const f=u/d,p=qr(f,e,n,s,a),g=qr(f,t,r,o,l);h.push(new $e(p,g))}return h}function dm(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,u=3*(n-e),f=9*(r-o)+3*(l-t),p=6*(t+o)-12*r,g=3*(r-t);function m(_){const y=(d*_+h)*_+u,b=(f*_+p)*_+g;return Math.sqrt(y*y+b*b)}return um(m,0,1,c||Xr.RecursionLimit)}function hm(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,f,p,g,m,_,y;for(let C=0;C<2;++C){if(C==0?(u=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,f=3*n-3*e):(u=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,f=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;p=-f/u,0<p&&p<1&&c.push(p);continue}_=u*u-4*f*h,y=Math.sqrt(_),!(_<0)&&(g=(-u+y)/(2*h),0<g&&g<1&&c.push(g),m=(-u-y)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,x;for(;b--;)p=c[b],x=1-p,d[0][b]=x*x*x*e+3*x*x*p*n+3*x*p*p*s+p*p*p*a,d[1][b]=x*x*x*t+3*x*x*p*r+3*x*p*p*o+p*p*p*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 um(e,t,n,r){let s=Xr.abscissas[r-2],o=Xr.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 u=a*s[c];h+=o[c++]*(e(l+u)+e(l-u))}return a*h}function fm(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?Ei(s-1,n):Math.max(s-1,0),l=t?Ei(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];pm(c,d,h),d.command=s===0?fe.move:fe.curve}}function pm(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+=nt:l-=nt,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 rr=(gi=class extends G{constructor(){super();k(this,"_flagId",!1);k(this,"_flagClassName",!1);k(this,"_renderer",{});k(this,"_id",qs.Identifier+qs.uniqueId());k(this,"_className","");k(this,"classList",[]);for(let n in Ul)Object.defineProperty(this,n,Ul[n])}static fromObject(n){const r=new gi().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}}},k(gi,"Properties",["renderer","id","className"]),gi);const Ul={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 Yr extends Error{constructor(n){super();k(this,"name","Two.js");k(this,"message");this.message=n}}class gm{constructor(){k(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 Ur;const Gl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Zt.document&&(Ur=document.createElement("a"));const We=class We extends rr{constructor(n,r){super();k(this,"_flagSrc",!1);k(this,"_flagImage",!1);k(this,"_flagVideo",!1);k(this,"_flagLoaded",!1);k(this,"_flagRepeat",!1);k(this,"_flagOffset",!1);k(this,"_flagScale",!1);k(this,"_src","");k(this,"_image",null);k(this,"_loaded",!1);k(this,"_repeat","no-repeat");k(this,"_scale",1);k(this,"_offset",null);for(let s in Kl)Object.defineProperty(this,s,Kl[s]);if(this._renderer.type="texture",this._renderer.flagOffset=mm.bind(this),this._renderer.flagScale=_m.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 We().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return Ur?(Ur.href=n,Ur.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 Zt.document?Gl.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(G.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,We.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}};k(We,"Properties",["src","loaded","repeat","scale","offset","image"]),k(We,"RegularExpressions",Gl),k(We,"ImageRegistry",new gm),k(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 Yr("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 Yr("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 it=We;const Kl={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=it.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}it.ImageRegistry.contains(n)?this._image=it.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 mm(){this._flagOffset=!0}function _m(){this._flagScale=!0}class $i extends Array{constructor(){super();ua(this,st,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 xt(this,st)}set _events(n){Ih(this,st,n)}get _bound(){return xt(this,st)._bound}set _bound(n){xt(this,st)._bound=n}addEventListener(){return xt(this,st).addEventListener.apply(this,arguments)}on(){return xt(this,st).on.apply(this,arguments)}bind(){return xt(this,st).bind.apply(this,arguments)}removeEventListener(){return xt(this,st).removeEventListener.apply(this,arguments)}off(){return xt(this,st).off.apply(this,arguments)}unbind(){return xt(this,st).unbind.apply(this,arguments)}dispatchEvent(){return xt(this,st).dispatchEvent.apply(this,arguments)}trigger(){return xt(this,st).trigger.apply(this,arguments)}listen(){return xt(this,st).listen.apply(this,arguments)}ignore(){return xt(this,st).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}}st=new WeakMap;const Zl=Array.prototype.slice;function ym(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=Zl.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=Zl.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=!ym(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:Zt.performance&&Zt.performance.now?Zt.performance:Date},Tt=class Tt extends rr{constructor(n,r,s){super();k(this,"_flagOffset",!0);k(this,"_flagOpacity",!0);k(this,"_flagColor",!0);k(this,"_offset",0);k(this,"_opacity",1);k(this,"_color","#fff");for(let o in Jl)Object.defineProperty(this,o,Jl[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Tt.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Tt.Index<=0?"#fff":"#000",Tt.Index=(Tt.Index+1)%2}static fromObject(n){const r=new Tt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Tt.Properties.length;r++){const s=Tt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Tt;return Ae.each(Tt.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(Tt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};k(Tt,"Index",0),k(Tt,"Properties",["offset","opacity","color"]);let ei=Tt;const Jl={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)}}},rn=class rn extends rr{constructor(n){super();k(this,"_flagStops",!1);k(this,"_flagSpread",!1);k(this,"_flagUnits",!1);k(this,"_spread","");k(this,"_units","");for(let r in Ql)Object.defineProperty(this,r,Ql[r]);this._renderer.type="gradient",this._renderer.flagStops=bm.bind(this),this._renderer.bindStops=wm.bind(this),this._renderer.unbindStops=vm.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 ei?o:new ei().copy(o)));const s=new rn().copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new rn(r);return Ae.each(rn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<rn.Properties.length;r++){const s=rn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Ae.each(rn.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}};k(rn,"Stop",ei),k(rn,"Properties",["spread","stops","units"]);let Qe=rn;const Ql={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 $i((e||[]).slice(0)),this._stops.bind(G.Types.insert,t).bind(G.Types.remove,n),t(this._stops)}}};function bm(){this._flagStops=!0}function wm(e){let t=e.length;for(;t--;)e[t].bind(G.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function vm(e){let t=e.length;for(;t--;)e[t].unbind(G.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}const Vn=class Vn extends Qe{constructor(n,r,s,o,a){super(a);k(this,"_flagEndPoints",!1);k(this,"_left",null);k(this,"_right",null);for(let l in ec)Object.defineProperty(this,l,ec[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=km.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 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&&(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 Vn(this.left._x,this.left._y,this.right._x,this.right._y,r);return Ae.each(Qe.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}};k(Vn,"Stop",ei),k(Vn,"Properties",["left","right"]);let yt=Vn;const ec={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 km(){this._flagEndPoints=!0}const sn=class sn extends Qe{constructor(n,r,s,o,a,l){super(o);k(this,"_flagRadius",!1);k(this,"_flagCenter",!1);k(this,"_flagFocal",!1);k(this,"_radius",0);k(this,"_center",null);k(this,"_focal",null);for(let c in tc)Object.defineProperty(this,c,tc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=xm.bind(this),this._renderer.flagFocal=Cm.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 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&&(/(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 sn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Ae.each(Qe.Properties.concat(sn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Ae.each(sn.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}};k(sn,"Stop",ei),k(sn,"Properties",["center","radius","focal"]);let bt=sn;const tc={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 xm(){this._flagCenter=!0}function Cm(){this._flagFocal=!0}function nc(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 Gr(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 ic(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,f=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(f||e).x,d=(f||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),f&&e._relative&&(o+=e.x,d+=e.y),dm(r,l,s,c,o,d,a,h,n)}function rc(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,f=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(f||e).x,d=(f||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),f&&e._relative&&(o+=e.x,d+=e.y),Yl(r,l,s,c,o,d,a,h,n)}function ti(e){switch(e.renderer.type){case"texture":return it.fromObject(e);case"gradient":return Qe.fromObject(e);case"linear-gradient":return yt.fromObject(e);case"radial-gradient":return bt.fromObject(e)}return e}const Sm=Math.cos,Bm=Math.sin,sc=Math.tan,Ys=[],vt=class vt extends G{constructor(n,r,s,o,a,l){super();k(this,"elements",new jl(9));k(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 v=n;let $,F,R;const q=r[0]||0,M=r[1]||0,N=r[2]||0;return $=v[0]*q+v[1]*M+v[2]*N,F=v[3]*q+v[4]*M+v[5]*N,R=v[6]*q+v[7]*M+v[8]*N,[$,F,R]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],u=n[6],f=n[7],p=n[8],g=r[0],m=r[1],_=r[2],y=r[3],b=r[4],S=r[5],x=r[6],C=r[7],B=r[8];return s=s||new jl(9),s[0]=o*g+a*y+l*x,s[1]=o*m+a*b+l*C,s[2]=o*_+a*S+l*B,s[3]=c*g+d*y+h*x,s[4]=c*m+d*b+h*C,s[5]=c*_+d*S+h*B,s[6]=u*g+f*y+p*x,s[7]=u*m+f*b+p*C,s[8]=u*_+f*S+p*B,s}static fromObject(n){return new vt().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const u=n;n=u[0],r=u[1],s=u[2],o=u[3],a=u[4],l=u[5],c=u[6],d=u[7],h=u[8]}return this.elements[0]=n,this.elements[1]=r,this.elements[2]=s,this.elements[3]=o,this.elements[4]=a,this.elements[5]=l,this.elements[6]=c,this.elements[7]=d,this.elements[8]=h,this.trigger(G.Types.change)}copy(n){return this.elements[0]=n.elements[0],this.elements[1]=n.elements[1],this.elements[2]=n.elements[2],this.elements[3]=n.elements[3],this.elements[4]=n.elements[4],this.elements[5]=n.elements[5],this.elements[6]=n.elements[6],this.elements[7]=n.elements[7],this.elements[8]=n.elements[8],this.manual=n.manual,this.trigger(G.Types.change)}identity(){return this.elements[0]=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(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 L=a[0]*n+a[1]*r+a[2]*s,Y=a[3]*n+a[4]*r+a[5]*s,P=a[6]*n+a[7]*r+a[8]*s;return[L,Y,P]}const u=this.elements,f=[n,r,s,o,a,l,c,d,h],p=u[0],g=u[1],m=u[2],_=u[3],y=u[4],b=u[5],S=u[6],x=u[7],C=u[8],B=f[0],v=f[1],$=f[2],F=f[3],R=f[4],q=f[5],M=f[6],N=f[7],A=f[8];return this.elements[0]=p*B+g*F+m*M,this.elements[1]=p*v+g*R+m*N,this.elements[2]=p*$+g*q+m*A,this.elements[3]=_*B+y*F+b*M,this.elements[4]=_*v+y*R+b*N,this.elements[5]=_*$+y*q+b*A,this.elements[6]=S*B+x*F+C*M,this.elements[7]=S*v+x*R+C*N,this.elements[8]=S*$+x*q+C*A,this.trigger(G.Types.change)}inverse(n){const r=this.elements;n=n||new vt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],u=r[7],f=r[8],p=f*c-d*u,g=-f*l+d*h,m=u*l-c*h;let _=s*p+o*g+a*m;return _?(_=1/_,n.elements[0]=p*_,n.elements[1]=(-f*o+a*u)*_,n.elements[2]=(d*o-a*c)*_,n.elements[3]=g*_,n.elements[4]=(f*s-a*h)*_,n.elements[5]=(-d*s+a*l)*_,n.elements[6]=m*_,n.elements[7]=(-u*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=Sm(n),s=Bm(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=sc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=sc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return Ys.length=0,this.toTransformArray(n,Ys),Ys.map(Qt).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const f=s[6],p=s[7],g=s[8];if(o){r[0]=a,r[1]=d,r[2]=f,r[3]=l,r[4]=h,r[5]=p,r[6]=c,r[7]=u,r[8]=g;return}return[a,d,f,l,h,p,c,u,g]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=u;return}return[a,d,l,h,c,u]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const f=s[6],p=s[7],g=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u,r[6]=f,r[7]=p,r[8]=g;return}return[a,l,c,d,h,u,f,p,g]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u;return}return[a,l,c,d,h,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new vt().copy(this)}};k(vt,"Identity",[1,0,0,0,1,0,0,0,1]);let sr=vt;om(sr);const wr=class wr extends rr{constructor(){super();k(this,"_flagMatrix",!0);k(this,"_flagScale",!1);k(this,"_matrix",null);k(this,"_worldMatrix",null);k(this,"_position",null);k(this,"_rotation",0);k(this,"_scale",1);k(this,"_skewX",0);k(this,"_skewY",0);for(let n in Kr)Object.defineProperty(this,n,Kr[n]);this._renderer.flagMatrix=oc.bind(this),this.isShape=!0,this.matrix=new sr,this.worldMatrix=new sr,this.position=new we,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new wr().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 Kr.position.get.apply(this,arguments)}set translation(n){Kr.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 wr;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}};k(wr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let un=wr;const Kr={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),oc.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 am(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function oc(){this._flagMatrix=!0}const Ni=Math.min,Pi=Math.max,Tm=Math.ceil,Em=Math.floor,$m=new we,Xt=class Xt extends un{constructor(n,r,s,o){super();k(this,"_flagVertices",!0);k(this,"_flagLength",!0);k(this,"_flagFill",!0);k(this,"_flagStroke",!0);k(this,"_flagLinewidth",!0);k(this,"_flagOpacity",!0);k(this,"_flagVisible",!0);k(this,"_flagCap",!0);k(this,"_flagJoin",!0);k(this,"_flagMiter",!0);k(this,"_flagMask",!1);k(this,"_flagClip",!1);k(this,"_length",0);k(this,"_fill","#fff");k(this,"_stroke","#000");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_cap","round");k(this,"_join","round");k(this,"_miter",4);k(this,"_closed",!0);k(this,"_curved",!1);k(this,"_automatic",!0);k(this,"_beginning",0);k(this,"_ending",1);k(this,"_mask",null);k(this,"_clip",!1);k(this,"_dashes",null);for(let a in ac)Object.defineProperty(this,a,ac[a]);this._renderer.type="path",this._renderer.flagVertices=lc.bind(this),this._renderer.bindVertices=cc.bind(this),this._renderer.unbindVertices=dc.bind(this),this._renderer.flagFill=hc.bind(this),this._renderer.flagStroke=uc.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:ti(n.fill),s=typeof n.stroke=="string"?n.stroke:ti(n.stroke),o=new Xt().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 $e?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new $e().copy(s))}for(let r=0;r<Xt.Properties.length;r++){const s=Xt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Xt;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<Xt.Properties.length;s++){const o=Xt.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(Xt.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,u=1/0,f=-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:p,scaleY:g}=sm(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof p=="number"&&typeof g=="number"&&(s=Math.max(p,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[p,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,x]=r.multiply(y,b),C=c.controls.left.x,B=c.controls.left.y;c.relative&&(C+=c.x,B+=c.y);let[v,$]=r.multiply(C,B);const F=hm(p,g,S,x,v,$,m,_);u=Ni(F.min.y-s,u),d=Ni(F.min.x-s,d),h=Pi(F.max.x+s,h),f=Pi(F.max.y+s,f)}else a<=1&&(u=Ni(g-s,u),d=Ni(p-s,d),h=Pi(p+s,h),f=Pi(g+s,f)),u=Ni(_-s,u),d=Ni(m-s,d),h=Pi(m+s,h),f=Pi(_+s,f)}return{top:u,left:d,right:h,bottom:f,width:h-d,height:f-u}}getPointAt(n,r){let s,o,a,l,c,d,h,u,f,p,g,m,_,y,b,S=this.length*Math.min(Math.max(n,0),1);const x=this.vertices.length,C=x-1;let B=null,v=null;for(let E=0,H=this._lengths.length,I=0;E<H;E++){if(I+this._lengths[E]>=S){this._closed?(s=Ei(E,x),o=Ei(E-1,x),E===0&&(s=o,o=E)):(s=E,o=Math.min(Math.max(E-1,0),C)),B=this.vertices[s],v=this.vertices[o],S-=I,this._lengths[E]!==0?n=S/this._lengths[E]:n=0;break}I+=this._lengths[E]}if(B===null||v===null)return null;if(B){if(!v)return B}else return v;b=v.controls&&v.controls.right,y=B.controls&&B.controls.left,c=v.x,p=v.y,d=(b||v).x,g=(b||v).y,h=(y||B).x,m=(y||B).y,u=B.x,_=B.y,b&&v.relative&&(d+=v.x,g+=v.y),y&&B.relative&&(h+=B.x,m+=B.y),l=qr(n,c,d,h,u),f=qr(n,p,g,m,_);const $=Jt(c,d,n),F=Jt(p,g,n),R=Jt(d,h,n),q=Jt(g,m,n),M=Jt(h,u,n),N=Jt(m,_,n),A=Jt($,R,n),L=Jt(F,q,n),Y=Jt(R,M,n),P=Jt(q,N,n);return Ae.isObject(r)?(r.x=l,r.y=f,r instanceof $e&&(r.controls.left.x=A,r.controls.left.y=L,r.controls.right.x=Y,r.controls.right.y=P,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=f,r.controls.right.x-=l,r.controls.right.y-=f)),r.t=n,r):(a=new $e(l,f,A-l,L-f,Y-l,P-f,this._curved?fe.curve:fe.line),a.t=n,a)}plot(){if(this.curved)return fm(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?fe.move:fe.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===fe.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===fe.move){a.push(new $e(o.x,o.y)),d>0&&(a[a.length-1].command=fe.line),o=c;return}l=rc(c,o,n),a=a.concat(l),Ae.each(l,function(h,u){u<=0&&o.command===fe.move?h.command=fe.move:h.command=fe.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=rc(c,o,n),a=a.concat(l),Ae.each(l,function(h,u){u<=0&&o.command===fe.move?h.command=fe.move:h.command=fe.line})),a.push(new $e(c.x,c.y)),a[a.length-1].command=s?fe.close:fe.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===fe.move){a=c,this._lengths[d]=0;return}this._lengths[d]=ic(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=Gr(this,s*this._length),l=Gr(this,o*this._length),c=Tm(a),d=Em(l);let h,u,f,p,g,m;for(this._renderer.vertices.length=0,m=0;m<n;m++)this._renderer.collection.length<=m&&this._renderer.collection.push(new $e),m>d&&!u?(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),u=g,f=this._collection[m-1],f&&f.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),f.relative?this._renderer.collection[m-1].controls.right.copy(f.controls.right).lerp(we.zero,1-g.t):this._renderer.collection[m-1].controls.right.copy(f.controls.right).lerp(f,1-g.t))):m>=c&&m<=d&&(g=this._renderer.collection[m].copy(this._collection[m]),this._renderer.vertices.push(g),m===d&&nc(this,o)?(u=g,!r&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):m===c&&nc(this,s)&&(h=g,h.command=fe.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=fe.move,this._renderer.vertices.unshift(g),p=this._collection[m+1],p&&p.controls&&(g.controls.left.clear(),p.relative?this._renderer.collection[m+1].controls.left.copy(p.controls.left).lerp(we.zero,g.t):($m.copy(p),this._renderer.collection[m+1].controls.left.copy(p.controls.left).lerp(p,g.t))))}return un.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,un.prototype.flagReset.call(this),this}};k(Xt,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),k(Xt,"Utils",{getCurveLength:ic});let Ne=Xt;const ac={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 Qe||this._fill instanceof yt||this._fill instanceof bt||this._fill instanceof it)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof yt||this._fill instanceof bt||this._fill instanceof it)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Qe||this._stroke instanceof yt||this._stroke instanceof bt||this._stroke instanceof it)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof yt||this._stroke instanceof bt||this._stroke instanceof it)&&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";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(G.Types.insert,t).unbind(G.Types.remove,n),e instanceof $i?this._collection=e:this._collection=new $i(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,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 lc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function cc(e){let t=e.length;for(;t--;)e[t].bind(G.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function dc(e){let t=e.length;for(;t--;)e[t].unbind(G.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function hc(){this._flagFill=!0}function uc(){this._flagStroke=!0}const Nm=Math.ceil,Pm=Math.floor,on=class on extends un{constructor(n){super();k(this,"_flagVertices",!0);k(this,"_flagLength",!0);k(this,"_flagFill",!0);k(this,"_flagStroke",!0);k(this,"_flagLinewidth",!0);k(this,"_flagOpacity",!0);k(this,"_flagVisible",!0);k(this,"_flagSize",!0);k(this,"_flagSizeAttenuation",!0);k(this,"_length",0);k(this,"_fill","#fff");k(this,"_stroke","#000");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_size",1);k(this,"_sizeAttenuation",!1);k(this,"_beginning",0);k(this,"_ending",1);k(this,"_dashes",null);k(this,"noFill",Ne.prototype.noFill);k(this,"noStroke",Ne.prototype.noStroke);k(this,"corner",Ne.prototype.corner);k(this,"center",Ne.prototype.center);k(this,"getBoundingClientRect",Ne.prototype.getBoundingClientRect);k(this,"_updateLength",Ne.prototype._updateLength);for(let r in fc)Object.defineProperty(this,r,fc[r]);this._renderer.type="points",this._renderer.flagVertices=lc.bind(this),this._renderer.bindVertices=cc.bind(this),this._renderer.unbindVertices=dc.bind(this),this._renderer.flagFill=hc.bind(this),this._renderer.flagStroke=uc.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:ti(n.fill),s=typeof n.stroke=="string"?n.stroke:ti(n.stroke),o=new on().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 $e?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new $e().copy(s))}for(let r=0;r<on.Properties.length;r++){const s=on.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new on;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<on.Properties.length;s++){const o=on.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(on.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,u=Yl(l,c,l,c,d,h,d,h,n);r=r.concat(u)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=Gr(this,n*this._length),o=Gr(this,r*this._length),a=Nm(s),l=Pm(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}};k(on,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);let Zr=on;const fc={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 Qe||this._fill instanceof yt||this._fill instanceof bt||this._fill instanceof it)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof yt||this._fill instanceof bt||this._fill instanceof it)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Qe||this._stroke instanceof yt||this._stroke instanceof bt||this._stroke instanceof it)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof yt||this._stroke instanceof bt||this._stroke instanceof it)&&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 $i?this._collection=e:this._collection=new $i(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 pc extends $i{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);ua(this,ks,{});this.attach(n),this.on(G.Types.insert,this.attach),this.on(G.Types.remove,this.detach)}get ids(){return xt(this,ks)}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}}ks=new WeakMap;const _n=class _n extends Ne{constructor(n,r,s,o,a,l,c){const d=c||qs.Resolution*3,h=[];for(let u=0;u<d;u++)h.push(new $e);super(h,!0,!1,!0);k(this,"_flagStartAngle",!1);k(this,"_flagEndAngle",!1);k(this,"_flagInnerRadius",!1);k(this,"_flagOuterRadius",!1);k(this,"_startAngle",0);k(this,"_endAngle",Qn);k(this,"_innerRadius",0);k(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let u in gc)Object.defineProperty(this,u,gc[u]);typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new _n().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<_n.Properties.length;r++){const s=_n.Properties[r];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=Ei(n,Qn)===Ei(r,Qn),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,u=0,f,p,g,m,_,y,b,S,x;for(a?d--:l||(d-=2),f=0,p=d-1;f<d;f++){switch(g=f/p,m=c[u],_=g*(r-n)+n,y=(r-n)/d,b=o*Math.cos(_),S=o*Math.sin(_),f){case 0:h=fe.move;break;default:h=fe.curve}m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===fe.curve&&(x=o*y/Math.PI,m.controls.left.x=x*Math.cos(_-nt),m.controls.left.y=x*Math.sin(_-nt),m.controls.right.x=x*Math.cos(_+nt),m.controls.right.y=x*Math.sin(_+nt),f===1&&m.controls.left.multiplyScalar(2),f===p&&m.controls.right.multiplyScalar(2)),u++}if(l){for(a?(c[u].command=fe.close,u++):(d--,p=d-1),f=0;f<d;f++)g=f/p,m=c[u],_=(1-g)*(r-n)+n,y=(r-n)/d,b=s*Math.cos(_),S=s*Math.sin(_),h=fe.curve,f<=0&&(h=a?fe.move:fe.line),m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===fe.curve&&(x=s*y/Math.PI,m.controls.left.x=x*Math.cos(_+nt),m.controls.left.y=x*Math.sin(_+nt),m.controls.right.x=x*Math.cos(_-nt),m.controls.right.y=x*Math.sin(_-nt),f===1&&m.controls.left.multiplyScalar(2),f===p&&m.controls.right.multiplyScalar(2)),u++;c[u].copy(c[0]),c[u].command=fe.line}else a||(c[u].command=fe.line,c[u].x=0,c[u].y=0,u++,c[u].copy(c[0]),c[u].command=fe.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 _n(0,0,r,s,o,a,l);c.translation.copy(this.translation),c.rotation=this.rotation,c.scale=this.scale,c.skewX=this.skewX,c.skewY=this.skewY,this.matrix.manual&&c.matrix.copy(this.matrix);for(let d=0;d<Ne.Properties.length;d++){const h=Ne.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<_n.Properties.length;r++){const s=_n.Properties[r];n[s]=this[s]}return n}};k(_n,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Us=_n;const gc={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}}},Gs=Math.cos,Ks=Math.sin,yn=class yn extends Ne{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new $e(0,0,0,0,0,0));super(l,!0,!0,!0);k(this,"_flagRadius",!1);k(this,"_radius",0);this._renderer.type="circle";for(let c in mc)Object.defineProperty(this,c,mc[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 yn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<yn.Properties.length;r++){const s=yn.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*Qn,d=s*Gs(c),h=s*Ks(c),u=o*Gs(c-nt),f=o*Ks(c-nt),p=o*Gs(c+nt),g=o*Ks(c+nt),m=this.vertices[a];m.command=a===0?fe.move:fe.curve,m.set(d,h),m.controls.left.set(u,f),m.controls.right.set(p,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new yn(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="circle";for(let r=0;r<yn.Properties.length;r++){const s=yn.Properties[r];n[s]=this[s]}return n}};k(yn,"Properties",["radius"]);let Zs=yn;const mc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Js=Math.cos,Qs=Math.sin,bn=class bn extends Ne{constructor(n,r,s,o,a){typeof o!="number"&&typeof s=="number"&&(o=s);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new $e);super(c,!0,!0,!0);k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_width",0);k(this,"_height",0);this._renderer.type="ellipse";for(let d in _c)Object.defineProperty(this,d,_c[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 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._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*Qn,d=s*Js(c),h=o*Qs(c),u=s*r*Js(c-nt),f=o*r*Qs(c-nt),p=s*r*Js(c+nt),g=o*r*Qs(c+nt),m=this.vertices[a];m.command=a===0?fe.move:fe.curve,m.set(d,h),m.controls.left.set(u,f),m.controls.right.set(p,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 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<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="ellipse";for(let r=0;r<bn.Properties.length;r++){const s=bn.Properties[r];n[s]=this[s]}return n}};k(bn,"Properties",["width","height"]);let eo=bn;const _c={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}}},Rm=Math.cos,Fm=Math.sin,wn=class wn extends Ne{constructor(n,r,s,o){o=Math.max(o||0,3);super();k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_flagSides",!1);k(this,"_radius",0);k(this,"_width",0);k(this,"_height",0);k(this,"_sides",0);this._renderer.type="polygon";for(let a in yc)Object.defineProperty(this,a,yc[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 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._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=Qn*a+Math.PI/2,c=this._width*Rm(l)/2,d=this._height*Fm(l)/2;o>=s?this.vertices.push(new $e(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?fe.move:fe.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 wn(0,0,0,this.sides);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,r.width=this.width,r.height=this.height,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="polygon";for(let r=0;r<wn.Properties.length;r++){const s=wn.Properties[r];n[s]=this[s]}return n}};k(wn,"Properties",["width","height","sides"]);let to=wn;const yc={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}}},mi=class mi extends Ne{constructor(n,r,s,o){const a=[new $e,new $e,new $e,new $e];super(a,!0,!1,!0);k(this,"_flagWidth",0);k(this,"_flagHeight",0);k(this,"_width",0);k(this,"_height",0);k(this,"_origin",null);this._renderer.type="rectangle";for(let l in bc)Object.defineProperty(this,l,bc[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 mi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<mi.Properties.length;r++){const s=mi.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 $e),this.vertices[0].set(-n,-r).sub(this._origin).command=fe.move,this.vertices[1].set(n,-r).sub(this._origin).command=fe.line,this.vertices[2].set(n,r).sub(this._origin).command=fe.line,this.vertices[3].set(-n,r).sub(this._origin).command=fe.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=fe.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new mi(0,0,this.width,this.height);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=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}};k(mi,"Properties",["width","height"]);let no=mi;const bc={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()}}},vn=class vn extends Ne{constructor(n,r,s,o,a){typeof a>"u"&&typeof s=="number"&&typeof o=="number"&&(a=Math.floor(Math.min(s,o)/12));const l=[];for(let c=0;c<10;c++)l.push(new $e(0,0,0,0,0,0,c===0?fe.move:fe.curve));super(l);k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_flagRadius",!1);k(this,"_width",0);k(this,"_height",0);k(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in wc)Object.defineProperty(this,c,wc[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Mm.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 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];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 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<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="rounded-rectangle";for(let r=0;r<vn.Properties.length;r++){const s=vn.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};k(vn,"Properties",["width","height","radius"]);let io=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}},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 Mm(){this._flagRadius=!0}const Am=Math.cos,Om=Math.sin,kn=class kn extends Ne{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();k(this,"_flagInnerRadius",!1);k(this,"_flagOuterRadius",!1);k(this,"_flagSides",!1);k(this,"_innerRadius",0);k(this,"_outerRadius",0);k(this,"_sides",0);this._renderer.type="star";for(let l in vc)Object.defineProperty(this,l,vc[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 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._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=Qn*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*Am(l),h=c*Om(l);o>=s?this.vertices.push(new $e(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?fe.move:fe.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 kn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="star";for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];n[s]=this[s]}return n}};k(kn,"Properties",["innerRadius","outerRadius","sides"]);let ro=kn;const vc={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 so;const kc=Math.min,xc=Math.max;Zt.document&&(so=document.createElement("canvas"));const pt=class pt extends un{constructor(n,r,s,o){super();k(this,"_flagValue",!0);k(this,"_flagFamily",!0);k(this,"_flagSize",!0);k(this,"_flagLeading",!0);k(this,"_flagAlignment",!0);k(this,"_flagBaseline",!0);k(this,"_flagStyle",!0);k(this,"_flagWeight",!0);k(this,"_flagDecoration",!0);k(this,"_flagFill",!0);k(this,"_flagStroke",!0);k(this,"_flagLinewidth",!0);k(this,"_flagOpacity",!0);k(this,"_flagVisible",!0);k(this,"_flagMask",!1);k(this,"_flagClip",!1);k(this,"_flagDirection",!0);k(this,"_value","");k(this,"_family","sans-serif");k(this,"_size",13);k(this,"_leading",17);k(this,"_alignment","center");k(this,"_baseline","middle");k(this,"_style","normal");k(this,"_weight",500);k(this,"_decoration","none");k(this,"_direction","ltr");k(this,"_fill","#000");k(this,"_stroke","none");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_mask",null);k(this,"_clip",!1);k(this,"_dashes",null);for(let a in Cc)Object.defineProperty(this,a,Cc[a]);if(this._renderer.type="text",this._renderer.flagFill=Vm.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,!Ae.isObject(o))return this;for(let a=0;a<pt.Properties.length;a++){const l=pt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(so){const r=so.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*pt.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:ti(n.fill),s=typeof n.stroke=="string"?n.stroke:ti(n.stroke),o=new pt().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<pt.Properties.length;r++){const s=pt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new pt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<pt.Properties.length;s++){const o=pt.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<pt.Properties.length;r++){const s=pt.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}=pt.Measure(this),h=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-h,o=c+h;break;case"right":s=-(c+h),o=h;break;default:s=-(c/2+h),o=c/2+h}switch(this.baseline){case"middle":a=-(d/2+h),l=d/2+h;break;default:a=-(d+h),l=h}const[u,f]=r.multiply(s,a),[p,g]=r.multiply(s,l),[m,_]=r.multiply(o,a),[y,b]=r.multiply(o,l);return a=kc(f,g,_,b),s=kc(u,p,m,y),o=xc(u,p,m,y),l=xc(f,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}};k(pt,"Ratio",.6),k(pt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);let Ri=pt;const Cc={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 Qe||this._fill instanceof yt||this._fill instanceof bt||this._fill instanceof it)&&this._fill.unbind(G.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof yt||this._fill instanceof bt||this._fill instanceof it)&&this._fill.bind(G.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Qe||this._stroke instanceof yt||this._stroke instanceof bt||this._stroke instanceof it)&&this._stroke.unbind(G.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof yt||this._stroke instanceof bt||this._stroke instanceof it)&&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,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 Vm(){this._flagFill=!0}function zm(){this._flagStroke=!0}const Jr=Math.min,Qr=Math.max,xn=class xn extends un{constructor(n){super();k(this,"_flagAdditions",!1);k(this,"_flagSubtractions",!1);k(this,"_flagOrder",!1);k(this,"_flagOpacity",!0);k(this,"_flagBeginning",!1);k(this,"_flagEnding",!1);k(this,"_flagLength",!1);k(this,"_flagMask",!1);k(this,"_fill","#fff");k(this,"_stroke","#000");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_cap","round");k(this,"_join","round");k(this,"_miter",4);k(this,"_closed",!0);k(this,"_curved",!1);k(this,"_automatic",!0);k(this,"_beginning",0);k(this,"_ending",1);k(this,"_length",0);k(this,"_mask",null);for(let r in Sc)Object.defineProperty(this,r,Sc[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++)Bc.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)Bc.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new xn;for(let o=0;o<xn.Properties.length;o++){const a=xn.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:ti(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 Us.fromObject(o);case"circle":return Zs.fromObject(o);case"ellipse":return eo.fromObject(o);case"points":return Zr.fromObject(o);case"polygon":return to.fromObject(o);case"rectangle":return no.fromObject(o);case"rounded-rectangle":return io.fromObject(o);case"star":return ro.fromObject(o);case"path":return Ne.fromObject(o);case"text":return Ri.fromObject(o);case"group":return xn.fromObject(o);case"shape":return un.fromObject(o);case"element":return rr.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 xn,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,u=1/0,f=-1/0;const p=/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||p.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),[x,C]=s.multiply(r.left,r.bottom),[B,v]=s.multiply(r.right,r.bottom);u=Jr(y,S,C,v,u),d=Jr(_,b,x,B,d),h=Qr(_,b,x,B,h),f=Qr(y,S,C,v,f)}else u=Jr(r.top,u),d=Jr(r.left,d),h=Qr(r.right,h),f=Qr(r.bottom,f)}return{top:u,left:d,right:h,bottom:f,width:h-d,height:f-u}}noFill(){return this.children.forEach(function(n){n.noFill()}),this}noStroke(){return this.children.forEach(function(n){n.noStroke()}),this}subdivide(){const n=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,n)}),this}_update(){let n,r,s;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=o*l,h=a*l;for(n=0;n<this.children.length;n++)s=this.children[n],r=s.length,d>c+r?(s.beginning=1,s.ending=1):h<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):h>c&&h<c+r?(s.beginning=0,s.ending=(h-c)/r):(s.beginning=0,s.ending=1),c+=r}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};k(xn,"Children",pc),k(xn,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let fn=xn;const Sc={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=fn.InsertChildren.bind(this),n=fn.RemoveChildren.bind(this),r=fn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new pc(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,Ae.isObject(e)&&!e.clip&&(e.clip=!0)}}};function Bc(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 oo extends Ne{constructor(t,n,r,s){const o=[new $e(t,n),new $e(r,s)];super(o);for(let a in Tc)Object.defineProperty(this,a,Tc[a]);this.vertices[0].command=fe.move,this.vertices[1].command=fe.line,this.automatic=!1}}const Tc={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 Yr("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 Yr("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}};class ao{constructor(t=0,n=0){this.x=t,this.y=n}}class ni{constructor(t=10,n=0,r="A"){k(this,"start",new ao);k(this,"end",new ao);this.width=t,this.angle=n,this.label=r}}const ze={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"}},Im={class:"flex gap-3"},Lm={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},Dm={ref:"drawing-container",class:"size-full"},Hm={},Ec=i.defineComponent({...Hm,__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((P,E)=>new ni(n.value.configuratorParams.linesWidths[E],P,`A-${E+1}`))),u=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),f=i.computed(()=>{var P,E;return n.value.configuratorParams.startTailType&&((P=n.settings.startTailConfigs)!=null&&P[n.value.configuratorParams.startTailType])?(E=n.settings.startTailConfigs)==null?void 0:E[n.value.configuratorParams.startTailType].points:[]}),p=i.computed(()=>{var P,E;return n.value.configuratorParams.endTailType&&((P=n.settings.endTailConfigs)!=null&&P[n.value.configuratorParams.endTailType])?(E=n.settings.endTailConfigs)==null?void 0:E[n.value.configuratorParams.endTailType].points:[]}),g=(P,E=!1)=>{P[0].start.x=0,P[0].start.y=0;let H=0;for(let I=0;I<P.length;I++){const U=P[I],O=P[I-1]??new ni(0,H);H+=!E||I>1?O.angle:0;const z=(!E||I>0?U.angle:0)+H;if(P[I].end.x=U.width*Math.cos(z*Math.PI/180)+P[I].start.x,P[I].end.y=U.width*Math.sin(z*Math.PI/180)+P[I].start.y,I<P.length-1){const Z=I+1;P[Z].start.x=P[I].end.x,P[Z].start.y=P[I].end.y}}return P},m=(P,E,H,I,U=!1)=>{let O=g([...H,...I]);E.length>0&&(O=[...g(E),...O]);let z=0,Z=0,pe=0,re=0;O.forEach(xe=>{z=Math.min(z,xe.start.x,xe.end.x),Z=Math.min(Z,xe.start.y,xe.end.y),pe=Math.max(pe,xe.start.x,xe.end.x),re=Math.max(re,xe.start.y,xe.end.y)});let ge,ie;z===0&&Z===0&&pe===0&&re===0?(ge=1,ie=1):(ge=P.width/Math.abs(pe-z),ie=(U?P.height:P.height-ze.colorSideLabel.size)/Math.abs(re-Z));const Me=Math.min(ge,ie);return z=z<0?-z*Me:0,Z=Z<0?-Z*Me:0,[Me,z,Z]},_=P=>{const E=new Zr([P]);return E._size=ze.anchorPoint.size,E.fill=ze.anchorPoint.color,E.stroke="transparent",E._linewidth=ze.anchorPoint.strokeSize,l.push(E),E},y=(P,E)=>{if(l=[],n.settings.allowChangeFirstPoint){const H=P[0],I=new we(H.vertices[0].x,H.vertices[0].y);I.bind(G.Types.change,()=>{H.vertices[0].copy(I)});const U=_(I);E.add(U)}P.forEach((H,I)=>{const U=P[I+1],O=new we(H.vertices[1].x,H.vertices[1].y);O.bind(G.Types.change,()=>{H.vertices[1].copy(O),U!==void 0&&U.vertices[0].copy(O)});const z=_(O);E.add(z)})},b=P=>P*(Math.PI/180),S=(P,E,H)=>{const I=E.vertices.length-1;P.position.x=E.vertices[I].x,P.position.y=E.vertices[I].y;const U=Math.atan2(E.vertices[I].y-E.vertices[0].y,E.vertices[I].x-E.vertices[0].x);P.rotation=b(H)+U},x=(P,E,H)=>{if(E.vertices[0]===void 0)return;P.position.x=E.vertices[0].x,P.position.y=E.vertices[0].y;const I=E.vertices.length-1,U=Math.atan2(E.vertices[I].y-E.vertices[0].y,E.vertices[I].x-E.vertices[0].x);P.rotation=b(H)+U},C=(P,E,H)=>{const I=new fn;if(P.length===0)return I;const U=[];return[...P].reverse().forEach((O,z)=>{z!==0&&O.angle>0&&(O.angle*=-1),U.push(O)}),P=g(U,!0),x(I,E,P[0].angle),[E.vertices[0],E.vertices[1]].forEach(O=>{O.bind(G.Types.change,()=>{x(I,E,P[0].angle)})}),P.forEach(O=>{const z=O.start.x*H,Z=O.end.x*H,pe=O.start.y*H,re=O.end.y*H,ge=new oo(z,pe,Z,re);ge.linewidth=ze.line.size,ge.stroke=ze.line.color,I.add(ge)}),I},B=(P,E,H)=>{const I=new fn;return P.length===0||(P=g(P,!0),S(I,E,P[0].angle),[E.vertices[0],E.vertices[1]].forEach(U=>{U.bind(G.Types.change,()=>{S(I,E,P[0].angle)})}),P.forEach(U=>{const O=U.start.x*H,z=U.end.x*H,Z=U.start.y*H,pe=U.end.y*H,re=new oo(O,Z,z,pe);re.linewidth=ze.line.size,re.stroke=ze.line.color,I.add(re)})),I},v=(P,E,H,I)=>{const U=E.vertices[0].x+(E.vertices[1].x-E.vertices[0].x)/2-8*Math.sin(P.angle*Math.PI/180),O=E.vertices[0].y+(E.vertices[1].y-E.vertices[0].y)/2-8*Math.cos(P.angle*Math.PI/180),z=new Ri(P.label,U+10,O-10);let Z;z.size=ze.lineLabel.size,z.weight=600,z.fill=ze.lineLabel.color,z.id+=1,z.rotation=ze.lineLabel.rotation,I>0&&(Z=new Ri(`${P.angle}°`,E.vertices[0].x+25,E.vertices[0].y-25),Z.size=ze.angleLabel.size,Z.weight=600,Z.fill=ze.angleLabel.color,Z.rotation=ze.angleLabel.rotation,Z.id+=I,o.push(Z),H.add(Z)),H.add(z),F(z,E,0,Z),F(z,E,1)},$=()=>{const{size:P}=ze.colorSideLabel,E=0,H=0,I=u.value?P/2:P/2-P,U=u.value?P/2-P:P/2,O=new fn;if(!c)return O;const z=5,Z=Math.atan2(U-I,H-E),pe=[new $e(E,I,0,0,0,0,he.Commands.move),new $e(H,U,0,0,0,0,he.Commands.line),new $e(H-z*Math.cos(Z-Math.PI/4),U-z*Math.sin(Z-Math.PI/4),0,0,0,0,he.Commands.line),new $e(H,U,0,0,0,0,he.Commands.move),new $e(H-z*Math.cos(Z+Math.PI/4),U-z*Math.sin(Z+Math.PI/4),0,0,0,0,he.Commands.line)],re=new Ne(pe,!1,!1,!0);re.noFill(),re.cap="round",re.join="round",re.linewidth=P/7,re.stroke=ze.colorSideLabel.color,O.add(re);const ge=new Ri(u.value?"Цвет снизу":"Цвет сверху",10,0);ge.size=P,ge.weight=600,ge.fill=ze.colorSideLabel.color,ge.alignment="left",O.add(ge);const ie=O.getBoundingClientRect();return O.position.x=(c.width-ie.width)*d+10,O.position.y=u.value?c.height+ie.height*2:ie.height/2,O},F=(P,E,H,I)=>{E.vertices[H].bind(G.Types.change,()=>{const U=E.vertices.length-1,O=Math.atan2(E.vertices[0].y-E.vertices[U].y,E.vertices[0].x-E.vertices[U].x)*180/Math.PI,z=E.vertices[0].x+(E.vertices[U].x-E.vertices[0].x)/2-8*Math.sin(O*Math.PI/180),Z=E.vertices[0].y+(E.vertices[U].y-E.vertices[0].y)/2-8*Math.cos(O*Math.PI/180);P.position.x=z+10,P.position.y=Z-10,P.rotation=-.5,I&&(I.position.x=E.vertices[0].x+25,I.position.y=E.vertices[0].y-25)})},R=(P,E,H,I,U=!1)=>{var Ce;if(P.clear(),H.length===0){P.update();return}const O=g(H),[z,Z,pe]=m(P,E,O,I,U),re=new fn,ge=new Array,ie=new Array;U||(o=[],a=[]),O.forEach((Fe,Ie)=>{const kt=Fe.start.x*z+Z,Cn=Fe.end.x*z+Z,At=Fe.start.y*z+pe,qt=Fe.end.y*z+pe,Et=new oo(kt,At,Cn,qt);Et.linewidth=U?ze.previewLine.size:ze.line.size,Et.stroke=U?ze.previewLine.color:ze.line.color,a.push(Et),ge.push(Et),re.add(Et),!U&&Fe.label!==""&&v(Fe,Et,re,Ie)});const Me=ge.at(-1);let xe=re.getBoundingClientRect();if(!U){const Fe=$();ie.push(Fe)}if(E.length>0){const Fe=C(E,ge[0],z);re.add(Fe)}if(I.length>0&&Me){const Fe=B(I,Me,z);re.add(Fe)}if(ie.push(re),P.makeGroup(ie),xe=re.getBoundingClientRect(),re.position.x=0-xe.left+(P.width-xe.width)/(2*(U?1:d)),re.position.y=0-xe.top+(P.height-xe.height)/(2*(U?1:d)),P.update(),!U){const Fe=((Ce=n.value.configuratorParams)==null?void 0:Ce.colorSide)==="top";re.position.y=re.position.y+ze.colorSideLabel.size*Number(Fe),y(ge,re),P.update()}},q=(P,E)=>{if(P&&!E.isNewRec()){const H=new he({width:P.scrollWidth,height:P.scrollHeight});H.appendTo(P),R(H,[],E.points,[],!0)}},M=()=>{c&&R(c,f.value,h.value,p.value,!1)},N=P=>P*(180/Math.PI),A=(P,E)=>{const H=P[1].x-P[0].x,I=P[1].y-P[0].y,U=E[1].x-E[0].x,O=E[1].y-E[0].y;let z=Math.atan2(H*O-I*U,H*U+I*O);return z=N(z),Math.round(z)*-1},L=P=>{const E=a.map((H,I,U)=>{const O=U[I-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let z=Math.ceil(H._length/P/n.settings.lineWidthStep)*n.settings.lineWidthStep;const Z=o[I-1];z<(U.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(z=U.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),z>n.settings.maxLineWidth&&(z=n.settings.maxLineWidth);const pe=A(H.vertices,O.vertices);return Z&&(Z.value=`${pe}°`),new ni(z,pe,`A-${I+1}`)});r("pointer:move",E)},Y=P=>{let E=null,H;const I=Z=>{E=l.find(pe=>{const re=pe.renderer;return(re==null?void 0:re.elem)===Z.target}),[H]=m(P,f.value,h.value.map(pe=>pe),p.value)},U=Z=>{if(E){const pe=E.renderer,re=pe==null?void 0:pe.elem;if(!re)return;const ge=re.getBoundingClientRect();E.vertices[0].x-=ge.x-(Z instanceof MouseEvent?Z.clientX:Z.targetTouches[0].clientX)+ze.anchorPoint.size/2,E.vertices[0].y-=ge.y-(Z instanceof MouseEvent?Z.clientY:Z.targetTouches[0].clientY)+ze.anchorPoint.size/2,L(H),P.update()}},O=()=>{E&&r("pointer:up",h.value),E=null},z=s.value;z&&(z.addEventListener("touchstart",I),z.addEventListener("touchend",O),z.addEventListener("mousedown",I),z.addEventListener("mouseup",O),z.addEventListener("mousemove",U),z.addEventListener("touchmove",U))};return i.onMounted(()=>{s.value&&(c=new he({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{M()},{deep:!0,immediate:!0}),Y(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(P,E)=>(i.openBlock(),i.createElementBlock("div",Im,[i.createVNode(Ea,{"select-template-index":P.selectTemplateIndex,settings:P.settings,"onTemplate:select":E[0]||(E[0]=H=>r("template:select",H)),onInitDrawTemplate:q},null,8,["select-template-index","settings"]),i.createElementVNode("div",Lm,[i.createElementVNode("div",Dm,null,512)])]))}}),Wm={class:"flex max-w-[50rem] flex-col gap-3"},jm={},Xm=i.defineComponent({...jm,__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:{}}),u=i.ref(0),f=(C=0)=>{const B=c.value.allTemplates.at(C);B!==void 0&&(u.value=C,l.value.configuratorParams.linesWidths=B.points.map(v=>W.isArray(v)?v[0]:v.width),l.value.configuratorParams.linesAngles=B.points.map(v=>W.isArray(v)?v[1]:v.angle),y()),m(l.value.configuratorParams)},p=async()=>{const C=prompt("Введите название шаблона:");if(!C)return;a.value=!0;const B={label:C,points:l.value.configuratorParams.linesWidths.map((v,$)=>[v,l.value.configuratorParams.linesAngles[$]])};await te.HttpRequester.getInstance(te.ConfiguratorProvider).createTemplate(n.cartItem.category,B,h.value).then(()=>{c.value.addCustomTemplate(B),u.value=c.value.allTemplates.length-1}).catch(()=>{a.value=!1}),a.value=!1},g=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(u.value=c.value.allTemplates.length-1)},m=async C=>{y(),s.value=!0,await te.HttpRequester.getInstance(te.ConfiguratorProvider).searchProduct(n.cartItem.category,C,h.value).then(B=>{l.value.product=B}).catch(()=>{s.value=!1}),s.value=!1},_=async()=>{o.value=!0,await(l.value.isNewRec()?te.HttpRequester.getInstance(te.CartProvider).addCartItem(n.client,l.value).then(C=>{r("submit-success",C)}).catch(()=>{o.value=!1}):te.HttpRequester.getInstance(te.CartProvider).patchCartItem(n.client,l.value).then(C=>{r("submit-success",C)}).catch(()=>{o.value=!1})),o.value=!1},y=()=>{const C={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach((B,v)=>{C[`lines_widths[${v+1}]`]={},C[`lines_angles[${v+1}]`]={}}),h.value=C},b=C=>{d.value.linesWidths=C.map(B=>B.width),d.value.linesAngles=C.map(B=>B.angle)},S=C=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,y(),g(),m(l.value.configuratorParams)},x=(C,B)=>{d.value.linesWidths=C,d.value.linesAngles=B};return i.onBeforeMount(()=>{f()}),(C,B)=>(i.openBlock(),i.createElementBlock("div",Wm,[i.createVNode(Ec,{value:l.value,"select-template-index":u.value,settings:c.value,"onPointer:up":S,"onPointer:move":b,"onTemplate:select":f},null,8,["value","select-template-index","settings"]),i.createVNode(Pa,{value:l.value,"onUpdate:value":B[0]||(B[0]=v=>l.value=v),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":u.value,"onUpdate:params":B[1]||(B[1]=v=>m(v)),"onUpdate:preview":x,onSubmit:_,"onClick:saveTemplate":p},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])]))}});class Fi extends te.Identity{constructor(n,r){super();k(this,"label","");k(this,"points",[]);k(this,"isCustom",!1);k(this,"id",-1);k(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>W.isArray(s)?new ni(s[0],s[1],`A-${o+1}`):new ni(s.width,s.angle,`A-${o+1}`))):(this.label="-- Новая конфигурация --",this.points=[new ni(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class lo extends Fi{constructor(n){super(n);k(this,"isDefault");this.isDefault=n.isDefault??!1}}class qm{constructor(t){k(this,"minLineWidth");k(this,"maxLineWidth");k(this,"lineWidthStep");k(this,"minLineAngle");k(this,"maxLineAngle");k(this,"lineAngleStep");k(this,"stripMinWidth");k(this,"stripMaxWidth");k(this,"stripMinLength");k(this,"stripMaxLength");k(this,"allowShowTable");k(this,"showOnlyTemplates");k(this,"templates");k(this,"customTemplates",[]);k(this,"startTailConfigs");k(this,"endTailConfigs");k(this,"bendCountForExtended");k(this,"extendedProductCatalog");k(this,"allowChangeFirstPoint");k(this,"allowSaveTemplates");k(this,"userTemplatesPrefix");k(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 Fi(n)),this.templates.forEach((n,r)=>{n.id=r}),this.startTailConfigs=t.startTailConfigs.map(n=>new lo(n)),this.endTailConfigs=t.endTailConfigs.map(n=>new lo(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 Fi(r);return s.isCustom=!0,s.id=+n,s}):[],this.customTemplates.push(new Fi))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(t){var r,s;if(!this.allowSaveTemplates)return;const n=new Fi(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 Ym={},Mi=i.defineComponent({...Ym,__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=W.debounce(()=>s("update:value",o.value),a.value),c=p=>{o.value=p,l()};i.watch(()=>r.value,p=>{o.value=p});const d=i.ref(null);return t({focus:()=>{var p;return(p=d.value)==null?void 0:p.focus()},blur:()=>{var p;return(p=d.value)==null?void 0:p.blur()},select:()=>{var p;return(p=d.value)==null?void 0:p.select()}}),(p,g)=>(i.openBlock(),i.createBlock(i.unref(V.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value,"onUpdate:value":[g[0]||(g[0]=m=>o.value=m),c],clearable:p.clearable,placeholder:p.placeholder,min:p.min,max:p.max,step:p.step,validator:p.validator},null,8,["value","clearable","placeholder","min","max","step","validator"]))}}),Um={class:"flex flex-col gap-3"},Gm={},$c=i.defineComponent({...Gm,__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(W.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 te.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=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{disabled:c.isSubmitProcessing,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.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(Mi,{ref:"first-input-element",value:o.value.width,"onUpdate:value":[d[0]||(d[0]=u=>o.value.width=u),a],class:"w-full",max:c.settings.maxWidth??void 0,min:c.settings.minWidth,validator:u=>!!u&&u>=c.settings.minWidth&&(!c.settings.maxWidth||u<=c.settings.maxWidth),placeholder:"Введите ширину"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.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(Mi,{value:o.value.length,"onUpdate:value":[d[1]||(d[1]=u=>o.value.length=u),a],placeholder:"Введите длину",max:c.settings.maxLength,min:c.settings.minLength,validator:u=>u>=c.settings.minLength&&u<=c.settings.maxLength,class:"w-full"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.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(V.NInputNumber),{value:c.value.quantity,placeholder:"Введите количество",min:1,validator:u=>u>0,class:"w-full","onUpdate:value":d[2]||(d[2]=u=>l("quantity",u??0))},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.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]=u=>l("marker",u))},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(Yi,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",Um,[i.createVNode(i.unref(V.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]=u=>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(V.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[5]||(d[5]=u=>r("click:view-switch"))},{default:i.withCtx(()=>d[6]||(d[6]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[6]})):i.createCommentVNode("",!0)])]),_:1},8,["disabled"])}}}),Km={class:"w-104 px-5"},Zm={},Jm=i.defineComponent({...Zm,__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 te.HttpRequester.getInstance(te.ConfiguratorProvider).searchProduct(n.cartItem.category,h,o.value).then(u=>{s.value.product=u}).catch(()=>{a.value=!1}),a.value=!1},d=async()=>{l.value=!0,await(s.value.isNewRec()?te.HttpRequester.getInstance(te.CartProvider).addCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1}):te.HttpRequester.getInstance(te.CartProvider).patchCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1})),l.value=!1};return(h,u)=>(i.openBlock(),i.createElementBlock("div",Km,[i.createVNode($c,{value:s.value,"onUpdate:value":u[0]||(u[0]=f=>s.value=f),validation:o.value,settings:h.settings,"is-submit-processing":l.value,"onUpdate:params":u[1]||(u[1]=f=>c(f)),onSubmit:u[2]||(u[2]=f=>d())},null,8,["value","validation","settings","is-submit-processing"])]))}}),Qm={key:0,class:"flex items-baseline gap-1"},e0={key:0,class:"flex items-baseline gap-1"},t0={class:"flex gap-3"},n0={},Nc=i.defineComponent({...n0,__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(()=>gt.isPhoneDevice()),o=i.ref(W.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=(f,p)=>{f&&f in o.value&&(o.value[f]=p??0),r("update:params",o.value),u("configuratorParams",o.value)},u=(f,p)=>{const g=new te.CartItemBase(n.value);g[f]=p,r("update:value",g)};return(f,p)=>{const g=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"flex flex-col gap-2 px-4 md:max-w-96"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.netType,"onUpdate:value":[p[0]||(p[0]=m=>o.value.netType=m),h],options:f.settings.netType.map(m=>({label:f.settings.descriptions.net_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.color,"onUpdate:value":p[1]||(p[1]=m=>o.value.color=m),options:f.settings.color.map(m=>({label:f.settings.descriptions.color[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.mountType,"onUpdate:value":[p[2]||(p[2]=m=>o.value.mountType=m),h],options:f.settings.mountType.map(m=>({label:f.settings.descriptions.mount_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:f.validation.width.feedback||"","show-feedback":f.validation.width.showFeedback||o.value.width>=f.settings.minWidth&&o.value.width<=f.settings.maxWidths[o.value.netType],"validation-status":f.validation.width.validationStatus||void 0,label:`Ширина светового проёма от ${f.settings.minWidth-a.value} ${c.value?" до "+c.value:""} мм.`},{feedback:i.withCtx(()=>[!f.validation.width.showFeedback&&o.value.width>=f.settings.minWidth&&o.value.width<=f.settings.maxWidths[o.value.netType]?(i.openBlock(),i.createElementBlock("div",Qm,[i.createVNode(i.unref(V.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(o.value.width+a.value),1)]),_:1}),i.createVNode(i.unref(V.NButton),{quaternary:"",type:"info",size:"tiny",onClick:p[4]||(p[4]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>p[11]||(p[11]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])),_:1,__:[11]})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Mi,{value:o.value.width&&o.value.width-a.value,max:c.value,min:f.settings.minWidth-a.value,placeholder:"Введите ширину светового проёма",class:"w-full","onUpdate:value":p[3]||(p[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(V.NFormItem),{required:!0,feedback:f.validation.height.feedback||"","show-feedback":f.validation.height.showFeedback||o.value.height>=f.settings.minHeight&&o.value.height<=f.settings.maxHeights[o.value.netType],"validation-status":f.validation.height.validationStatus||void 0,label:`Высота светового проёма от ${f.settings.minHeight-l.value} ${d.value?" до "+d.value:""} мм.`},{feedback:i.withCtx(()=>[!f.validation.height.showFeedback&&o.value.height>=f.settings.minHeight&&o.value.height<=f.settings.maxHeights[o.value.netType]?(i.openBlock(),i.createElementBlock("div",e0,[i.createVNode(i.unref(V.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(o.value.height+l.value),1)]),_:1}),i.createVNode(i.unref(V.NButton),{quaternary:"",type:"info",size:"tiny",onClick:p[6]||(p[6]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>p[12]||(p[12]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])),_:1,__:[12]})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Mi,{value:o.value.height&&o.value.height-l.value,max:d.value,min:f.settings.minHeight-l.value,placeholder:"Введите высоту светового проёма",class:"w-full","onUpdate:value":p[5]||(p[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(V.NFormItem),{required:!0,feedback:f.validation.quantity.feedback||"","show-feedback":f.validation.quantity.showFeedback||!1,"validation-status":f.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:f.value.quantity,"onUpdate:value":p[7]||(p[7]=m=>f.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(V.NFormItem),{feedback:f.validation.marker.feedback||"","show-feedback":f.validation.marker.showFeedback||!1,"validation-status":f.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(g,{value:f.value.marker,"onUpdate:value":p[8]||(p[8]=m=>f.value.marker=m),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(Yi,{"is-product-searching":f.isProductSearching,product:f.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",t0,[i.createVNode(i.unref(V.NButton),{loading:f.isSubmitProcessing,disabled:f.isProductSearching||!f.value.product||f.value.product.isNewRec()||o.value.width<f.settings.minHeight-l.value||o.value.height<f.settings.minHeight-l.value,type:"primary",class:"self-start",onClick:p[9]||(p[9]=m=>r("submit",f.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,type:"default",onClick:p[10]||(p[10]=m=>r("click:show-preview-drawer"))},{default:i.withCtx(()=>p[13]||(p[13]=[i.createTextVNode(" Предварительный просмотр ")])),_:1,__:[13]})):i.createCommentVNode("",!0)])]),_:1})}}}),i0="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",r0="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",s0="/img/configurators/mosquitto/measurement-instructions/mount.png",o0="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",a0="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",l0={class:"flex flex-col gap-6"},c0={class:"flex gap-4"},d0={class:"flex flex-col gap-2"},h0={class:"flex gap-4"},u0={class:"flex flex-col gap-2"},f0={class:"flex gap-4"},p0={class:"flex flex-col gap-2"},g0={},Pc=i.defineComponent({...g0,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(e,{emit:t}){const n=gt.initRefDependingOnDeviceResolution("small","small","medium"),r=gt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=t;return(a,l)=>{const c=V.NText;return i.openBlock(),i.createBlock(i.unref(V.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",l0,[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:i0,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:r0,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",c0,[l[9]||(l[9]=i.createElementVNode("img",{src:s0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",d0,[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",h0,[l[15]||(l[15]=i.createElementVNode("img",{src:o0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",u0,[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",f0,[l[21]||(l[21]=i.createElementVNode("img",{src:a0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",p0,[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"])}}}),m0={class:"flex flex-col items-center justify-between rounded-xl"},_0={class:"img-preview relative flex justify-center"},y0={},b0=i.defineComponent({...y0,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(e,{emit:t}){const n=e,r=i.computed(()=>W.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=V.NButton;return i.openBlock(),i.createElementBlock("div",m0,[i.createElementVNode("div",_0,[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]})])}}}),co=Dn(b0,[["__scopeId","data-v-8b43aa68"]]),w0={class:"grid md:grid-cols-2"},v0={},k0=i.defineComponent({...v0,__name:"mosquito-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>gt.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref({width:{},height:{},quantity:{},marker:{}}),d=i.ref(!1),h=i.ref(!1),u=async p=>{p.height>0&&p.width>0&&(d.value=!0,await te.HttpRequester.getInstance(te.ConfiguratorProvider).searchProduct(n.cartItem.category,p,c.value).then(g=>{l.value.product=g}).catch(()=>{d.value=!1}),d.value=!1)},f=async()=>{h.value=!0,await(l.value.isNewRec()?te.HttpRequester.getInstance(te.CartProvider).addCartItem(n.client,l.value).then(p=>{r("submit-success",p)}).catch(()=>{h.value=!1}):te.HttpRequester.getInstance(te.CartProvider).patchCartItem(n.client,l.value).then(p=>{r("submit-success",p)}).catch(()=>{h.value=!1})),h.value=!1};return(p,g)=>{const m=Tr;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(Pc,{show:a.value,"onUpdate:show":g[0]||(g[0]=_=>a.value=_),"height-overlaps":p.settings.heightOverlaps,"width-overlaps":p.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",w0,[s.value?(i.openBlock(),i.createBlock(i.unref(V.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(V.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(V.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(co,{"configurator-params":l.value.configuratorParams,settings:p.settings,onOpenInstructions:g[3]||(g[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(co,{key:0,"configurator-params":l.value.configuratorParams,settings:p.settings,onOpenInstructions:g[1]||(g[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(Nc,{value:l.value,"onUpdate:value":g[5]||(g[5]=_=>l.value=_),validation:c.value,settings:p.settings,"is-product-searching":d.value,"is-submit-processing":h.value,"onUpdate:params":g[6]||(g[6]=_=>u(_)),onSubmit:g[7]||(g[7]=_=>f()),"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)}}}),x0={},Rc=i.defineComponent({...x0,__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 u=Na,f=$a;return i.openBlock(),i.createBlock(i.unref(V.NFormItem),{label:`Полоса №${d.index+1}, мм`,required:!0},{feedback:i.withCtx(()=>[i.createVNode(Yi,{"is-product-searching":a.value,product:d.product},null,8,["is-product-searching","product"])]),default:i.withCtx(()=>[i.createVNode(i.unref(V.NDropdown),{trigger:"click",options:d.suggestionOption,placement:"bottom-start",size:"large",onSelect:l},{default:i.withCtx(()=>[i.createVNode(Mi,{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:p=>!!p&&p>=d.settings.minLineWidth&&p%d.settings.lineWidthStep===0,placeholder:"Введите ширину","onUpdate:value":l},null,8,["value","step","validator"])]),_:1},8,["options"]),i.createVNode(i.unref(V.NButton),{disabled:d.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[0]||(h[0]=p=>s("click:add-line",d.index))},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"]),i.createVNode(i.unref(V.NButton),{disabled:d.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[1]||(h[1]=p=>s("click:remove-line",d.index))},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"])]),_:1},8,["label"])}}}),C0={class:"my-2 flex w-full flex-col"},S0={class:"flex gap-3"},B0={},Fc=i.defineComponent({...B0,__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,u)=>h+u,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,u,f)=>{const p=n.value.at(u);if(p)if(h&&h>=n.settings.minLineWidth&&h%n.settings.lineWidthStep===0){const g={linesWidths:p.configuratorParams.linesWidths.toSpliced(u,1,h)};r("update:params",g,u,f),d("configuratorParams",g)}else p.product.id=-1},d=(h,u)=>{const f=n.value.map(p=>new te.CartItemBase(p));f.forEach(p=>{p[h]=u}),r("update:value",f)};return(h,u)=>{const f=V.NText,p=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.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(Rc,{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":u[0]||(u[0]=y=>r("click:add-line",y)),"onClick:removeLine":u[1]||(u[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",C0,[o.value<0?(i.openBlock(),i.createBlock(f,{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(f,{key:1,type:"error"},{default:i.withCtx(()=>u[8]||(u[8]=[i.createTextVNode(" Остаток резки должен быть равен 0 ")])),_:1,__:[8]})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[u[9]||(u[9]=i.createTextVNode(" Остаток для резки: ")),i.createVNode(f,{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(V.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value<=0||h.value.length>=h.settings.maxLinesCount,type:"primary",class:"self-center",onClick:u[2]||(u[2]=m=>r("click:add-line",h.value.length))},{default:i.withCtx(()=>u[10]||(u[10]=[i.createTextVNode(" Добавить полосу ")])),_:1,__:[10]},8,["loading","disabled"]),i.createVNode(i.unref(V.NFormItem),{required:!0,label:`Метраж ${h.settings.minLength?" от "+h.settings.minLength:""} ${h.settings.maxLength?" до "+h.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(V.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":u[3]||(u[3]=m=>d("length",m??0))},null,8,["value","max","min","step","validator"])]),_:1},8,["label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:n.value[0].quantity,min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full","onUpdate:value":u[4]||(u[4]=m=>d("quantity",m??0))},null,8,["value","validator"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(p,{value:n.value[0].marker,placeholder:"Введите маркировку","onUpdate:value":u[5]||(u[5]=m=>d("marker",m))},null,8,["value"])]),_:1}),i.createElementVNode("div",S0,[i.createVNode(i.unref(V.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:u[6]||(u[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(V.NButton),{key:0,type:"tertiary",class:"self-start",onClick:u[7]||(u[7]=m=>r("click:view-switch"))},{default:i.withCtx(()=>u[11]||(u[11]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[11]})):i.createCommentVNode("",!0)])]}),_:1})}}}),T0={class:"flex grow flex-col"},E0=["src"],$0={class:"w-full"},N0={},Mc=i.defineComponent({...N0,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",T0,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,E0),i.createElementVNode("div",$0,[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)])]))}}),P0={class:"w-104 flex grow flex-col px-5"},R0={},F0=i.defineComponent({...R0,__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(f=>f).reduce((f,p)=>f+p,0)),c=f=>{f===void 0&&(f=s.value.length-1);const p=s.value.at(0);if(!p)return;p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(f+1,0,0),s.value.forEach(m=>{m.configuratorParams.linesWidths=p.configuratorParams.linesWidths});const g=new te.CartItemBase({quantity:(p==null?void 0:p.quantity)??1,category:p==null?void 0:p.category,length:(p==null?void 0:p.length)??n.settings.minLength,marker:p==null?void 0:p.marker,configuratorParams:{linesWidths:p==null?void 0:p.configuratorParams.linesWidths}});s.value=s.value.toSpliced(f+1,0,g)},d=f=>{const p=s.value.at(0);p&&(p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(f,1),s.value.forEach(g=>{g.configuratorParams.linesWidths=p.configuratorParams.linesWidths}),s.value=s.value.toSpliced(f,1),delete o[`linesWidths.${f}`],delete o[`linesWidths.${f}`])},h=async(f,p,g)=>{g.value=!0,await te.HttpRequester.getInstance(te.ConfiguratorProvider).searchProduct(s.value[p].category,{linesWidths:f.linesWidths.at(p)},o.value).then(m=>{s.value[p].product=m,s.value.length<n.settings.maxLinesCount&&l.value<n.settings.width&&c()}).catch(()=>{s.value[p].product=new te.Product,g.value=!1}),g.value=!1},u=async()=>{a.value=!0,await(s.value[0].isNewRec()?te.HttpRequester.getInstance(te.CartProvider).addCartItem(n.client,s.value[0]).then(f=>{r("submit-success",f)}).catch(()=>{a.value=!1}):te.HttpRequester.getInstance(te.CartProvider).patchCartItem(n.client,s.value[0]).then(f=>{r("submit-success",f)}).catch(()=>{a.value=!1})),a.value=!1};return(f,p)=>(i.openBlock(),i.createElementBlock("div",P0,[i.createVNode(Mc,{value:s.value,"onUpdate:value":p[0]||(p[0]=g=>s.value=g),settings:f.settings},null,8,["value","settings"]),i.createVNode(Fc,{value:s.value,"onUpdate:value":p[1]||(p[1]=g=>s.value=g),validation:o.value,settings:f.settings,"is-submit-processing":a.value,"onUpdate:params":h,onSubmit:u,"onClick:addLine":c,"onClick:removeLine":d},null,8,["value","validation","settings","is-submit-processing"])]))}}),M0={class:"flex flex-row gap-2.5"},A0={class:"flex flex-col"},O0={class:"flex flex-col"},V0={},z0=i.defineComponent({...V0,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>te.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 W.forOwn(te.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?Bn.startOfDay(new Date(a)):void 0,to:l?Bn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,u,f,p;const c=V.NButton,d=V.NDatePicker;return i.openBlock(),i.createElementBlock("div",M0,[i.createVNode(d,{value:(u=(h=a.dateRange)==null?void 0:h.from)==null?void 0:u.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",A0,[(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:(p=(f=a.dateRange)==null?void 0:f.to)==null?void 0:p.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",O0,[(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"])])}}}),I0={class:"sc-lbl-date text-nowrap"},L0={},ho=i.defineComponent({...L0,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>Bn.format(t.date,te.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Bn.format(t.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":s.isTimeOnSecondLine})},[i.createElementVNode("span",I0,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))}}),D0={class:"flex flex-row gap-2.5"},H0={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},W0={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},j0={class:"mb-0.5 sm:mb-0 sm:ml-3"},X0={},q0=i.defineComponent({...X0,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(e){return(t,n)=>{const r=Tr,s=V.NButton,o=V.NPopover;return i.openBlock(),i.createElementBlock("div",D0,[i.createElementVNode("div",H0,[i.renderSlot(t.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",W0,[i.renderSlot(t.$slots,"extra-buttons"),i.createElementVNode("div",j0,[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)])])])])}}}),Y0={key:0,class:"flex flex-row gap-2.5"},U0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},G0={},K0=i.defineComponent({...G0,__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},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=gt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=gt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>window.innerWidth*c.value),h=()=>{s("opening"),o.value=!0,s("update:show",o.value)},u=(p="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let g=!1;s("closing",p,()=>{g=!0}),g||(o.value=!1,s("update:show",o.value))},f=()=>{s("accept",g=>{a.value=g})};return i.watch(()=>r.show,p=>{p?h():u("other")}),i.watch(()=>r.processing,p=>{a.value=p}),t({open:h,close:u}),(p,g)=>{const m=V.NButton,_=V.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:p.title,"action-class":p.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:g[1]||(g[1]=y=>u("header")),onEsc:g[2]||(g[2]=y=>u("esc")),onMaskClick:g[3]||(g[3]=y=>u("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(p.$slots,"default")]),_:2},[p.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(p.$slots,"header")]),key:"0"}:void 0,p.$slots.action||p.$slots["extra-action"]||p.acceptButton.show||p.cancelButton.show?{name:"action",fn:i.withCtx(()=>[p.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",Y0,[i.renderSlot(p.$slots,"extra-action")])):i.createCommentVNode("",!0),p.$slots.action||p.acceptButton.show||p.cancelButton.show?(i.openBlock(),i.createElementBlock("div",U0,[i.renderSlot(p.$slots,"action",{disabled:a.value}),p.acceptButton.show??!0?(i.openBlock(),i.createBlock(m,{key:0,disabled:a.value,size:i.unref(l),type:"primary",onClick:f},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(p.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),p.cancelButton.show??!0?(i.openBlock(),i.createBlock(m,{key:1,size:i.unref(l),type:"default",onClick:g[0]||(g[0]=y=>u("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(p.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","action-class"])}}}),Z0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function J0(e,t){return i.openBlock(),i.createElementBlock("svg",Z0,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 Q0=i.markRaw({name:"ion-download-outline",render:J0}),e_={},t_=i.defineComponent({...e_,__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=Q0,c=V.NUploadDragger,d=V.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})}}}),n_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function i_(e,t){return i.openBlock(),i.createElementBlock("svg",n_,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 r_=i.markRaw({name:"ion-checkmark-done-sharp",render:i_}),s_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function o_(e,t){return i.openBlock(),i.createElementBlock("svg",s_,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 a_=i.markRaw({name:"ion-options-outline",render:o_}),l_={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},c_={class:"flex-auto"},d_={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"},h_={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"},u_={},uo=i.defineComponent({...u_,__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=a_,u=V.NButton,f=V.NPopover,p=r_,g=Tr;return i.openBlock(),i.createElementBlock("div",l_,[i.createElementVNode("div",c_,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",d_,[i.createElementVNode("div",h_,[c.showEditButton?(i.openBlock(),i.createBlock(f,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{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(f,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:c.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(p)]),_: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(f,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{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")])])])}}}),f_={},Ac=i.defineComponent({...f_,__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(uo,{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(uo,{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"]))]))}}),p_={},g_=i.defineComponent({...p_,__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=W.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(V.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:c.clearable,placeholder:c.placeholder},null,8,["value","clearable","placeholder"]))}}),m_={},__=i.defineComponent({...m_,__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=W.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(W.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(W.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof ji.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}n.debounceTime?o(d):r("update:value",d)},l=c=>{const d=c.replaceAll(/\D*/g,"");try{const h=ji.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof ji.ParseError)s.value=d;else throw h}};return i.watch(()=>n.value,c=>{var d;(c==null?void 0:c.replaceAll(/\D*/g,""))!==((d=s.value)==null?void 0:d.replaceAll(/\D*/g,""))&&l(c)},{immediate:!0}),i.onBeforeMount(()=>l(s.value??"")),(c,d)=>(i.openBlock(),i.createBlock(i.unref(Lh.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"]))}}),y_=Dn(__,[["__scopeId","data-v-751dbb0e"]]),b_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function w_(e,t){return i.openBlock(),i.createElementBlock("svg",b_,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 v_=i.markRaw({name:"tabler-external-link",render:w_}),k_={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},x_=["href"],C_={},S_=i.defineComponent({...C_,__name:"external-link",props:{text:{},url:{},description:{}},setup(e){return(t,n)=>{const r=v_,s=V.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(W.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",k_,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,x_),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),B_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function T_(e,t){return i.openBlock(),i.createElementBlock("svg",B_,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 E_=i.markRaw({name:"ion-remove-circle-outline",render:T_});let es=[];const Oc=new WeakMap;function $_(){es.forEach(e=>e(...Oc.get(e))),es=[]}function Vc(e,...t){Oc.set(e,t),!es.includes(e)&&es.push(e)===1&&requestAnimationFrame($_)}function or(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function ar(e){return e.composedPath()[0]||null}function lr(e){return typeof e=="string"?e.endsWith("px")?Number(e.slice(0,e.length-2)):Number(e):e}function cr(e){if(e!=null)return typeof e=="number"?`${e}px`:e.endsWith("px")?e:`${e}px`}function Wt(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 zc={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#F00",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function N_(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 P_(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 en="^\\s*",tn="\\s*$",Rn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Mt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",ii="([0-9A-Fa-f])",ri="([0-9A-Fa-f]{2})",Ic=new RegExp(`${en}hsl\\s*\\(${Mt},${Rn},${Rn}\\)${tn}`),Lc=new RegExp(`${en}hsv\\s*\\(${Mt},${Rn},${Rn}\\)${tn}`),Dc=new RegExp(`${en}hsla\\s*\\(${Mt},${Rn},${Rn},${Mt}\\)${tn}`),Hc=new RegExp(`${en}hsva\\s*\\(${Mt},${Rn},${Rn},${Mt}\\)${tn}`),R_=new RegExp(`${en}rgb\\s*\\(${Mt},${Mt},${Mt}\\)${tn}`),F_=new RegExp(`${en}rgba\\s*\\(${Mt},${Mt},${Mt},${Mt}\\)${tn}`),M_=new RegExp(`${en}#${ii}${ii}${ii}${tn}`),A_=new RegExp(`${en}#${ri}${ri}${ri}${tn}`),O_=new RegExp(`${en}#${ii}${ii}${ii}${ii}${tn}`),V_=new RegExp(`${en}#${ri}${ri}${ri}${ri}${tn}`);function Bt(e){return parseInt(e,16)}function z_(e){try{let t;if(t=Dc.exec(e))return[ns(t[1]),Fn(t[5]),Fn(t[9]),oi(t[13])];if(t=Ic.exec(e))return[ns(t[1]),Fn(t[5]),Fn(t[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${e}.`)}catch(t){throw t}}function I_(e){try{let t;if(t=Hc.exec(e))return[ns(t[1]),Fn(t[5]),Fn(t[9]),oi(t[13])];if(t=Lc.exec(e))return[ns(t[1]),Fn(t[5]),Fn(t[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${e}.`)}catch(t){throw t}}function si(e){try{let t;if(t=A_.exec(e))return[Bt(t[1]),Bt(t[2]),Bt(t[3]),1];if(t=R_.exec(e))return[dt(t[1]),dt(t[5]),dt(t[9]),1];if(t=F_.exec(e))return[dt(t[1]),dt(t[5]),dt(t[9]),oi(t[13])];if(t=M_.exec(e))return[Bt(t[1]+t[1]),Bt(t[2]+t[2]),Bt(t[3]+t[3]),1];if(t=V_.exec(e))return[Bt(t[1]),Bt(t[2]),Bt(t[3]),oi(Bt(t[4])/255)];if(t=O_.exec(e))return[Bt(t[1]+t[1]),Bt(t[2]+t[2]),Bt(t[3]+t[3]),oi(Bt(t[4]+t[4])/255)];if(e in zc)return si(zc[e]);if(Ic.test(e)||Dc.test(e)){const[n,r,s,o]=z_(e);return[...P_(n,r,s),o]}else if(Lc.test(e)||Hc.test(e)){const[n,r,s,o]=I_(e);return[...N_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(t){throw t}}function L_(e){return e>1?1:e<0?0:e}function fo(e,t,n,r){return`rgba(${dt(e)}, ${dt(t)}, ${dt(n)}, ${L_(r)})`}function po(e,t,n,r,s){return dt((e*t*(1-r)+n*r)/s)}function D_(e,t){Array.isArray(e)||(e=si(e)),Array.isArray(t)||(t=si(t));const n=e[3],r=t[3],s=oi(n+r-n*r);return fo(po(e[0],n,t[0],r,s),po(e[1],n,t[1],r,s),po(e[2],n,t[2],r,s),s)}function Re(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:si(e);return typeof t.alpha=="number"?fo(n,r,s,t.alpha):fo(n,r,s,o)}function ts(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:si(e),{lightness:a=1,alpha:l=1}=t;return H_([n*a,r*a,s*a,o*l])}function oi(e){const t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function ns(e){const t=Math.round(Number(e));return t>=360||t<0?0:t}function dt(e){const t=Math.round(Number(e));return t>255?255:t<0?0:t}function Fn(e){const t=Math.round(Number(e));return t>100?100:t<0?0:t}function H_(e){const[t,n,r]=e;return 3 in e?`rgba(${dt(t)}, ${dt(n)}, ${dt(r)}, ${oi(e[3])})`:`rgba(${dt(t)}, ${dt(n)}, ${dt(r)}, 1)`}function W_(e=8){return Math.random().toString(16).slice(2,2+e)}function Wc(e){return Array.isArray(e)?e:[e]}const go={STOP:"STOP"};function jc(e,t){const n=t(e);e.children!==void 0&&n!==go.STOP&&e.children.forEach(r=>jc(r,t))}function j_(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 X_(e,t){const{isLeaf:n}=e;return n!==void 0?n:!t(e)}function q_(e){return e.children}function Y_(e){return e.key}function U_(){return!1}function G_(e,t){const{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function K_(e){return e.disabled===!0}function Z_(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function J_(e,t){if(e.isLeaf===!0){const n=t(e);if(Array.isArray(n)&&n.length>0)return!0}return!1}function mo(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 Q_(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function ey(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function ty(e){return(e==null?void 0:e.type)==="group"}function ny(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 iy extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function ry(e,t,n,r){return is(t.concat(e),n,r,!1)}function sy(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 oy(e,t,n,r){const s=is(t,n,r,!1),o=is(e,n,r,!0),a=sy(e,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function yo(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:Q_(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:ey(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=t;let u;s!==void 0?u=oy(s,n,t,d):r!==void 0?u=ry(r,n,t,d):u=is(n,t,d,!1);const f=c==="parent",p=c==="child"||l,g=u,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 x of S){if(x.isLeaf)continue;const{key:C,shallowLoaded:B}=x;if(p&&B&&x.children.forEach(R=>{!R.disabled&&!R.isLeaf&&R.shallowLoaded&&g.has(R.key)&&g.delete(R.key)}),x.disabled||!B)continue;let v=!0,$=!1,F=!0;for(const R of x.children){const q=R.key;if(!R.disabled){if(F&&(F=!1),g.has(q))$=!0;else if(m.has(q)){$=!0,v=!1;break}else if(v=!1,$)break}}v&&!F?(f&&x.children.forEach(R=>{!R.disabled&&g.has(R.key)&&g.delete(R.key)}),g.add(C)):$&&m.add(C),b&&p&&g.has(C)&&g.delete(C)}}return{checkedKeys:Array.from(g),indeterminateKeys:Array.from(m)}}function is(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&&jc(d,h=>{if(h.disabled)return go.STOP;const{key:u}=h;if(!a.has(u)&&(a.add(u),l.add(u),Z_(h.rawNode,o))){if(r)return go.STOP;if(!n)throw new iy}})}),l}function ay(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 ly(e){if(e.length===0)return null;const t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function cy(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 Xc(e,t,{loop:n=!1,includeDisabled:r=!1}={}){const s=t==="prev"?dy:cy,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=bo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const u=hy(d);u!=null&&u.isGroup?c(s(u,n)):n&&c(s(d,!0))}}}}return c(e),l}function dy(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 hy(e){return e.parent}function bo(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=bo(d,t);if(h!==null)return h}else return d}}return null}const uy={getChild(){return this.ignored?null:bo(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return Xc(this,"next",e)},getPrev(e={}){return Xc(this,"prev",e)}};function fy(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 py(e,t){const n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}var gy={};function qc(e,t,n,r,s,o=null,a=0){const l=[];return e.forEach((c,d)=>{var h;gy.NODE_ENV!=="production"&&J_(c,s)&&console.error("[treemate]: node",c,"is invalid");const u=Object.create(r);if(u.rawNode=c,u.siblings=l,u.level=a,u.index=d,u.isFirstChild=d===0,u.isLastChild=d+1===e.length,u.parent=o,!u.ignored){const f=s(c);Array.isArray(f)&&(u.children=qc(f,t,n,r,s,u,a+1))}l.push(u),t.set(u.key,u),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(u)}),l}function my(e,t={}){var n;const r=new Map,s=new Map,{getDisabled:o=K_,getIgnored:a=U_,getIsGroup:l=ty,getKey:c=Y_}=t,d=(n=t.getChildren)!==null&&n!==void 0?n:q_,h=t.ignoreEmptyChildren?x=>{const C=d(x);return Array.isArray(C)?C.length?C:null:C}:d,u=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return X_(this.rawNode,h)},get shallowLoaded(){return G_(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(x){return py(this,x)}},uy),f=qc(e,r,s,u,h);function p(x){if(x==null)return null;const C=r.get(x);return C&&!C.isGroup&&!C.ignored?C:null}function g(x){if(x==null)return null;const C=r.get(x);return C&&!C.ignored?C:null}function m(x,C){const B=g(x);return B?B.getPrev(C):null}function _(x,C){const B=g(x);return B?B.getNext(C):null}function y(x){const C=g(x);return C?C.getParent():null}function b(x){const C=g(x);return C?C.getChild():null}const S={treeNodes:f,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(x){return fy(f,x)},getNode:p,getPrev:m,getNext:_,getParent:y,getChild:b,getFirstAvailableNode(){return ly(f)},getPath(x,C={}){return ay(x,C,S)},getCheckedKeys(x,C={}){const{cascade:B=!0,leafOnly:v=!1,checkStrategy:$="all",allowNotLoaded:F=!1}=C;return yo({checkedKeys:mo(x),indeterminateKeys:_o(x),cascade:B,leafOnly:v,checkStrategy:$,allowNotLoaded:F},S)},check(x,C,B={}){const{cascade:v=!0,leafOnly:$=!1,checkStrategy:F="all",allowNotLoaded:R=!1}=B;return yo({checkedKeys:mo(C),indeterminateKeys:_o(C),keysToCheck:x==null?[]:Wc(x),cascade:v,leafOnly:$,checkStrategy:F,allowNotLoaded:R},S)},uncheck(x,C,B={}){const{cascade:v=!0,leafOnly:$=!1,checkStrategy:F="all",allowNotLoaded:R=!1}=B;return yo({checkedKeys:mo(C),indeterminateKeys:_o(C),keysToUncheck:x==null?[]:Wc(x),cascade:v,leafOnly:$,checkStrategy:F,allowNotLoaded:R},S)},getNonLeafKeys(x={}){return j_(f,x)}};return S}function rs(e){return e.composedPath()[0]}const _y={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function yy(e,t,n){if(e==="mousemoveoutside"){const r=s=>{t.contains(rs(s))||n(s)};return{mousemove:r,touchstart:r}}else if(e==="clickoutside"){let r=!1;const s=a=>{r=!t.contains(rs(a))},o=a=>{r&&(t.contains(rs(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 Yc(e,t,n){const r=_y[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=yy(e,t,n)),o}function by(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=Yc(e,t,n);return Object.keys(s).forEach(o=>{wt(o,document,s[o],r)}),!0}return!1}function wy(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=Yc(e,t,n);return Object.keys(s).forEach(o=>{et(o,document,s[o],r)}),!0}return!1}function vy(){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(v,$,F){const R=v[$];return v[$]=function(){return F.apply(v,arguments),R.apply(v,arguments)},v}function o(v,$){v[$]=Event.prototype[$]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var v;return(v=a.get(this))!==null&&v!==void 0?v:null}function d(v,$){l!==void 0&&Object.defineProperty(v,"currentTarget",{configurable:!0,enumerable:!0,get:$??l.get})}const h={bubble:{},capture:{}},u={};function f(){const v=function($){const{type:F,eventPhase:R,bubbles:q}=$,M=rs($);if(R===2)return;const N=R===1?"capture":"bubble";let A=M;const L=[];for(;A===null&&(A=window),L.push(A),A!==window;)A=A.parentNode||null;const Y=h.capture[F],P=h.bubble[F];if(s($,"stopPropagation",n),s($,"stopImmediatePropagation",r),d($,c),N==="capture"){if(Y===void 0)return;for(let E=L.length-1;E>=0&&!e.has($);--E){const H=L[E],I=Y.get(H);if(I!==void 0){a.set($,H);for(const U of I){if(t.has($))break;U($)}}if(E===0&&!q&&P!==void 0){const U=P.get(H);if(U!==void 0)for(const O of U){if(t.has($))break;O($)}}}}else if(N==="bubble"){if(P===void 0)return;for(let E=0;E<L.length&&!e.has($);++E){const H=L[E],I=P.get(H);if(I!==void 0){a.set($,H);for(const U of I){if(t.has($))break;U($)}}}}o($,"stopPropagation"),o($,"stopImmediatePropagation"),d($)};return v.displayName="evtdUnifiedHandler",v}function p(){const v=function($){const{type:F,eventPhase:R}=$;if(R!==2)return;const q=u[F];q!==void 0&&q.forEach(M=>M($))};return v.displayName="evtdUnifiedWindowEventHandler",v}const g=f(),m=p();function _(v,$){const F=h[v];return F[$]===void 0&&(F[$]=new Map,window.addEventListener($,g,v==="capture")),F[$]}function y(v){return u[v]===void 0&&(u[v]=new Set,window.addEventListener(v,m)),u[v]}function b(v,$){let F=v.get($);return F===void 0&&v.set($,F=new Set),F}function S(v,$,F,R){const q=h[$][F];if(q!==void 0){const M=q.get(v);if(M!==void 0&&M.has(R))return!0}return!1}function x(v,$){const F=u[v];return!!(F!==void 0&&F.has($))}function C(v,$,F,R){let q;if(typeof R=="object"&&R.once===!0?q=Y=>{B(v,$,q,R),F(Y)}:q=F,by(v,$,q,R))return;const N=R===!0||typeof R=="object"&&R.capture===!0?"capture":"bubble",A=_(N,v),L=b(A,$);if(L.has(q)||L.add(q),$===window){const Y=y(v);Y.has(q)||Y.add(q)}}function B(v,$,F,R){if(wy(v,$,F,R))return;const M=R===!0||typeof R=="object"&&R.capture===!0,N=M?"capture":"bubble",A=_(N,v),L=b(A,$);if($===window&&!S($,M?"bubble":"capture",v,F)&&x(v,F)){const P=u[v];P.delete(F),P.size===0&&(window.removeEventListener(v,m),u[v]=void 0)}L.has(F)&&L.delete(F),L.size===0&&A.delete($),A.size===0&&(window.removeEventListener(v,g,N==="capture"),h[N][v]=void 0)}return{on:C,off:B}}const{on:wt,off:et}=vy(),Ai="@@mmoContext",ky={mounted(e,{value:t}){e[Ai]={handler:void 0},typeof t=="function"&&(e[Ai].handler=t,wt("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[Ai];typeof t=="function"?n.handler?n.handler!==t&&(et("mousemoveoutside",e,n.handler),n.handler=t,wt("mousemoveoutside",e,t)):(e[Ai].handler=t,wt("mousemoveoutside",e,t)):n.handler&&(et("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[Ai];t&&et("mousemoveoutside",e,t),e[Ai].handler=void 0}},Oi="@@coContext",ss={mounted(e,{value:t,modifiers:n}){e[Oi]={handler:void 0},typeof t=="function"&&(e[Oi].handler=t,wt("clickoutside",e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){const r=e[Oi];typeof t=="function"?r.handler?r.handler!==t&&(et("clickoutside",e,r.handler,{capture:n.capture}),r.handler=t,wt("clickoutside",e,t,{capture:n.capture})):(e[Oi].handler=t,wt("clickoutside",e,t,{capture:n.capture})):r.handler&&(et("clickoutside",e,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:n}=e[Oi];n&&et("clickoutside",e,n,{capture:t.capture}),e[Oi].handler=void 0}};function xy(e,t){console.error(`[vdirs/${e}]: ${t}`)}class Cy{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&&xy("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 wo=new Cy,Vi="@@ziContext",Uc={mounted(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n;e[Vi]={enabled:!!s,initialized:!1},s&&(wo.ensureZIndex(e,r),e[Vi].initialized=!0)},updated(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n,o=e[Vi].enabled;s&&!o&&(wo.ensureZIndex(e,r),e[Vi].initialized=!0),e[Vi].enabled=!!s},unmounted(e,t){if(!e[Vi].initialized)return;const{value:n={}}=t,{zIndex:r}=n;wo.unregister(e,r)}};function Sy(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 It(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 By=typeof window<"u";let zi,dr;(()=>{var e,t;zi=By?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,dr=!1,zi!==void 0?zi.then(()=>{dr=!0}):dr=!0})();function Ty(e){if(dr)return;let t=!1;i.onMounted(()=>{dr||zi==null||zi.then(()=>{t||e()})}),i.onBeforeUnmount(()=>{t=!0})}function vo(e,t){return i.watch(e,n=>{n!==void 0&&(t.value=n)}),i.computed(()=>e.value===void 0?t.value:e.value)}function os(){const e=i.ref(!1);return i.onMounted(()=>{e.value=!0}),i.readonly(e)}function Gc(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 Ey=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function $y(){return Ey}function ko(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function xo(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)){xo(r,t,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&xo(r.children,t,n)}else r.type!==i.Comment&&n.push(r)}}),n}function Kc(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);const s=xo(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}let Mn=null;function Zc(){if(Mn===null&&(Mn=document.getElementById("v-binder-view-measurer"),Mn===null)){Mn=document.createElement("div"),Mn.id="v-binder-view-measurer";const{style:e}=Mn;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(Mn)}return Mn.getBoundingClientRect()}function Ny(e,t){const n=Zc();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function Co(e){const t=e.getBoundingClientRect(),n=Zc();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 Py(e){return e.nodeType===9?null:e.parentNode}function Jc(e){if(e===null)return null;const t=Py(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 Jc(t)}const Qc=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=Jc(y),y!==null;)o.push(y);for(const b of o)wt("scroll",b,u,!0)},l=()=>{for(const y of o)et("scroll",y,u,!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()},u=()=>{Vc(f)},f=()=>{c.forEach(y=>y())},p=new Set,g=y=>{p.size===0&&wt("resize",window,_),p.has(y)||p.add(y)},m=y=>{p.has(y)&&p.delete(y),p.size===0&&et("resize",window,_)},_=()=>{p.forEach(y=>y())};return i.onBeforeUnmount(()=>{et("resize",window,_),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:g,removeResizeListener:m}},render(){return ko("binder",this.$slots)}}),ed=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(Kc("follower",this.$slots),[[t]]):Kc("follower",this.$slots)}}),Ry="@css-render/vue3-ssr";function Fy(e,t){return`<style cssr-id="${e}">
|
103
|
+
`}},Wr=Xn.Multiply,Qg=[1,0,0,0,1,0,0,0,1],Nn=new Yt(9),em=lt.Utils,Il=new Z,js=new Yt([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 Xn,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 Yt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,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=lt.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=lt.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,u,f,p,g,m;const _=t._renderer.vertices,y=this.canvas,b=this.ctx,S=e.renderer.ratio,x=Il.copy(t._renderer.scale).multiply(S),C=t._stroke,B=t._linewidth,v=t._fill,$=t._renderer.opacity||t._opacity,F=t._cap,R=t._join,X=t._miter,M=t._closed,N=t.dashes,A=_.length,L=A-1;y.width=Math.max(Math.ceil(t._renderer.rect.width*x.x),1),y.height=Math.max(Math.ceil(t._renderer.rect.height*x.y),1);const Y=t._renderer.rect.centroid,P=Y.x,E=Y.y;if(b.clearRect(0,0,y.width,y.height),v)if(typeof v=="string")b.fillStyle=v;else{const ge=lt.Utils.getRendererType(v._renderer.type);ye[ge].render.call(v,b,t),b.fillStyle=v._renderer.effect}if(C){if(typeof C=="string")b.strokeStyle=C;else{const ge=lt.Utils.getRendererType(C._renderer.type);ye[ge].render.call(C,b,t),b.strokeStyle=C._renderer.effect}B&&(b.lineWidth=B),X&&(b.miterLimit=X),R&&(b.lineJoin=R),!M&&F&&(b.lineCap=F)}typeof $=="number"&&(b.globalAlpha=$),N&&N.length>0&&(b.lineDashOffset=N.offset||0,b.setLineDash(N));let H,I,U,O,z,J,pe,re;b.save(),b.scale(x.x,x.y),b.translate(P,E),b.beginPath();for(let ge=0;ge<_.length;ge++){const ie=_[ge];switch(p=ie.x,g=ie.y,ie.command){case ee.close:b.closePath();break;case ee.arc:I=ie.rx,U=ie.ry,O=ie.xAxisRotation,z=ie.largeArcFlag,J=ie.sweepFlag,n=M?$t(ge-1,A):Math.max(ge-1,0),r=_[n],pe=r.x,re=r.y,em.renderSvgArcCommand(b,pe,re,I,U,z,J,O,p,g);break;case ee.curve:n=M?$t(ge-1,A):Math.max(ge-1,0),r=_[n],d=r.controls&&r.controls.right||Z.zero,h=ie.controls&&ie.controls.left||Z.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),ie._relative?(o=h.x+ie.x,a=h.y+ie.y):(o=h.x,a=h.y),b.bezierCurveTo(l,c,o,a,p,g),ge>=L&&M&&(s=H,u=ie.controls&&ie.controls.right||Z.zero,f=s.controls&&s.controls.left||Z.zero,ie._relative?(l=u.x+ie.x,c=u.y+ie.y):(l=u.x,c=u.y),s._relative?(o=f.x+s.x,a=f.y+s.y):(o=f.x,a=f.y),p=s.x,g=s.y,b.bezierCurveTo(l,c,o,a,p,g));break;case ee.line:b.lineTo(p,g);break;case ee.move:H=ie,b.moveTo(p,g);break}}M&&b.closePath(),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.fill(),m&&b.restore()),ye.isHidden.test(C)||(m=C._renderer&&C._renderer.offset,m&&(b.save(),b.translate(-C._renderer.offset.x,-C._renderer.offset.y),b.scale(C._renderer.scale.x,C._renderer.scale.y),b.lineWidth=B/C._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,u=d.y,f=d.controls;let p,g,m,_,y,b;o=Math.min(u,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(u,a),d.controls&&(y=f.left,b=f.right,!(!y||!b)&&(p=d._relative?y.x+h:y.x,g=d._relative?y.y+u:y.y,m=d._relative?b.x+h:b.x,_=d._relative?b.y+u:b.y,!(!p||!g||!m||!_)&&(o=Math.min(g,_,o),r=Math.min(p,m,r),s=Math.max(p,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=lt.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 Oe&&(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 Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Oe&&(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 Ee&&(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 Yt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let u,f;this._scale instanceof Z?(u=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=f<0?-f:f,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 u=lt.Utils.getRendererType(this._mask._renderer.type);ye[u].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,js,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,u=t._size*o;let f=u;ye.isHidden.test(a)||(f+=l),r.width=Da(f),r.height=r.width;const p=f/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 _=lt.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 _=lt.Utils.getRendererType(a._renderer.type);ye[_].render.call(a,s,t),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=l/p)}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,u/p*.5,0,ot),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,u=this._renderer.parent!==s,f=this._renderer.vertices,p=this._renderer.collection.length,g=this._flagVertices,m=this._flagFill||this._fill instanceof Oe&&(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 Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Oe&&(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 Ee&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||s._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||h||u){this._renderer.matrix||(this._renderer.matrix=new Yt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,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,u&&(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,f,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,p),this.flagReset())}},text:{updateCanvas:function(e,t){const n=this.canvas,r=this.ctx,s=e.renderer.ratio,o=Il.copy(t._renderer.scale).multiply(s),a=t._stroke,l=t._linewidth,c=t._fill,d=t._renderer.opacity||t._opacity,h=t.dashes,u=t._decoration,f=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 p=t._renderer.rect.centroid,g=p.x,m=p.y;let _,y,b,S,x,C,B,v,$,F,R;const X=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),X||(r.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=f,c)if(typeof c=="string")r.fillStyle=c;else{const M=lt.Utils.getRendererType(c._renderer.type);ye[M].render.call(c,r,t),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const M=lt.Utils.getRendererType(a._renderer.type);ye[M].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?(C=c._renderer.scale.x,B=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(C,B),_=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?(C=a._renderer.scale.x,B=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(C,B),_=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,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(u)){const M=r.measureText(t.value);switch(u){case"underline":$=M.actualBoundingBoxDescent,R=M.actualBoundingBoxDescent;break;case"strikethrough":$=0,R=0;break}v=-M.width/2,F=M.width/2,r.lineWidth=Math.max(Math.floor(t._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(v,$),r.lineTo(F,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=lt.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 Oe&&(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 Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Oe&&(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 Ee&&(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 Yt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let h,u;this._scale instanceof Z?(h=this._scale.x*r._renderer.scale.x,u=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,u=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=u<0?-u:u,l&&(this._renderer.parent=r)}if(this._mask){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=lt.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,js,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=lt.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 Ct("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 Tr};ye.ctx=ye.canvas.getContext("2d");var Ll=class extends j{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 Ge,this.scene.parent=this,this._renderer={type:"renderer",matrix:new Yt(Qg),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 Ct("unable to create a webgl context. Try using another renderer.");r=Vt.create(t,Vt.path.vertex,Vt.types.vertex),s=Vt.create(t,Vt.path.fragment,Vt.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,js,t.STATIC_DRAW),r=Vt.create(t,Vt.points.vertex,Vt.types.vertex),s=Vt.create(t,Vt.points.fragment,Vt.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"?Rs(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(j.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(Ll,"Utils",ye);var tm=ae.extend({Error:Ct,getRatio:Rs,read:Le,xhr:Fl},ae,gt,Oa,Va),tr=class{constructor(e){w(this,"_events",new j),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:tr.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=tr.Types[n])}this.renderer=new tr[this.type](this),this.setPlaying(t.autostart),this.frameCount=0,t.fullscreen?(this.fit=nm.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"}),Nt.bind(this.fit.domElement,"resize",this.fit),this.fit()):t.fitted?(this.fit=im.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(j.Types.resize,rm.bind(this)),this.scene=this.renderer.scene,tr.Instances.push(this),t.autostart&&nr.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,nr.init(),this.trigger(j.Types.play)}pause(){return this.playing=!1,this.trigger(j.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&&(Nt.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(j.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(j.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 Ds(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 Se(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 En(e,t,n,r);return this.scene.add(s),s}makeRoundedRectangle(e,t,n,r,s){const o=new Qi(e,t,n,r,s);return this.scene.add(o),o}makeCircle(e,t,n,r){const s=new Zi(e,t,n,r);return this.scene.add(s),s}makeEllipse(e,t,n,r,s){const o=new Ji(e,t,n,r,s);return this.scene.add(o),o}makeStar(e,t,n,r,s){const o=new Ar(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 Se(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 Mr(e,t,n,r);return this.scene.add(s),s}makeArcSegment(e,t,n,r,s,o,a){const l=new Rr(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 Fr(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 Se(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 At(e,t,n,r);return this.add(s),s}makeLinearGradient(e,t,n,r){const s=Array.prototype.slice.call(arguments,4),o=new Oe(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 Pr(e,t,n,r,s,o);return a&&l.play(),this.add(l),l}makeImageSequence(e,t,n,r,s){const o=new zr(e,t,n,r);return s&&o.play(),this.add(o),o}makeTexture(e,t){return new Ee(e,t)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const t=new Ge;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 Le))return null;const s=Le[r].call(this,e);return n?this.add(t&&s instanceof Ge?s.children:s):s.parent&&s.remove(),s}load(e,t){const n=new Ge;let r,s,o;const a=(function(l){for(Nt.temp.innerHTML=l,s=0;s<Nt.temp.children.length;s++)r=Nt.temp.children[s],o=this.interpret(r,!1,!1),o!==null&&n.add(o);if(typeof t=="function"){const c=Nt.temp.children.length<=1?Nt.temp.children[0]:Nt.temp.children;t(n,c)}}).bind(this);return/\.svg$/i.test(e)?(Fl(e,a),n):(a(e),n)}},he=tr;w(he,"NextFrameId",mt.NextFrameId),w(he,"Types",mt.Types),w(he,"Version",mt.Version),w(he,"PublishDate",mt.PublishDate),w(he,"Identifier",mt.Identifier),w(he,"Resolution",mt.Resolution),w(he,"AutoCalculateImportedMatrices",mt.AutoCalculateImportedMatrices),w(he,"Instances",mt.Instances),w(he,"uniqueId",mt.uniqueId),w(he,"Anchor",ve),w(he,"Collection",Bn),w(he,"Events",j),w(he,"Group",Ge),w(he,"Matrix",Xn),w(he,"Path",Se),w(he,"Registry",Tr),w(he,"Element",Dn),w(he,"Shape",dn),w(he,"Text",At),w(he,"Vector",Z),w(he,"Gradient",Ye),w(he,"ImageSequence",zr),w(he,"LinearGradient",Oe),w(he,"RadialGradient",Ve),w(he,"Sprite",Pr),w(he,"Stop",Ut),w(he,"Texture",Ee),w(he,"ArcSegment",Rr),w(he,"Circle",Zi),w(he,"Ellipse",Ji),w(he,"Line",Ds),w(he,"Points",Fr),w(he,"Polygon",Mr),w(he,"Rectangle",En),w(he,"RoundedRectangle",Qi),w(he,"Star",Ar),w(he,"CanvasRenderer",lt),w(he,"SVGRenderer",zl),w(he,"WebGLRenderer",Ll),w(he,"Commands",ee),w(he,"Utils",tm);function nm(){const e=document.body.getBoundingClientRect(),t=this.width=e.width,n=this.height=e.height;this.renderer.setSize(t,n,this.ratio)}function im(){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 rm(e,t){this.width=e,this.height=t,this.trigger(j.Types.resize,e,t)}var nr=Nt.getRequestAnimationFrame();function Dl(){for(let e=0;e<he.Instances.length;e++){const t=he.Instances[e];t.playing&&t.update()}he.NextFrameId=nr(Dl)}nr.init=function(){Dl(),nr.init=function(){}};let Kt;typeof window<"u"?Kt=window:typeof global<"u"?Kt=global:typeof self<"u"&&(Kt=self);let Hl;const Jn=Math.PI*2,tt=Math.PI*.5;function sm(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 om(e){Hl=e}function am(e,t){t=t&&t.identity()||new Hl;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 Zt(e,t,n){return n*(t-e)+e}function Ti(e,t){for(;e<0;)e+=t;return e%t}const Wl=Kt.Float32Array||Array,lm=Math.floor;function Jt(e){return lm(e*1e6)/1e6}const fe={move:"M",line:"L",curve:"C",close:"Z"};class K{constructor(){k(this,"_events",{});k(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}}k(K,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),k(K,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const jl={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))}}},it=class it extends K{constructor(n=0,r=0){super();k(this,"_x",0);k(this,"_y",0);for(let s in jl)Object.defineProperty(this,s,jl[s]);this.x=n,this.y=r}static add(n,r){return new it(n.x+r.x,n.y+r.y)}static sub(n,r){return new it(n.x-r.x,n.y-r.y)}static subtract(n,r){return it.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(it.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 it(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:Jt(this.x),y:Jt(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}};k(it,"zero",new it),k(it,"left",new it(-1,0)),k(it,"right",new it(1,0)),k(it,"up",new it(0,-1)),k(it,"down",new it(0,1));let we=it;class $e extends we{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=fe.move){super(n,r);k(this,"controls",{left:new we,right:new we});k(this,"_command",fe.move);k(this,"_relative",!0);k(this,"_rx",0);k(this,"_ry",0);k(this,"_xAxisRotation",0);k(this,"_largeArcFlag",0);k(this,"_sweepFlag",1);for(let h in Xl)Object.defineProperty(this,h,Xl[h]);this.command=c,this.relative=!0;const d=$e.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 $e().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 $e().copy(this)}toObject(){return{x:Jt(this.x),y:Jt(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Jt(this.rx),ry:Jt(this.ry),xAxisRotation:Jt(this.xAxisRotation),largeArcFlag:Jt(this.largeArcFlag),sweepFlag:Jt(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Xl={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 cm=0;const Xs={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return cm++}},jr={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 Xr(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 ql(e,t,n,r,s,o,a,l,c){c=c||jr.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new $e(a,l)];const h=[];for(let u=0;u<d;u++){const f=u/d,p=Xr(f,e,n,s,a),g=Xr(f,t,r,o,l);h.push(new $e(p,g))}return h}function dm(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,u=3*(n-e),f=9*(r-o)+3*(l-t),p=6*(t+o)-12*r,g=3*(r-t);function m(_){const y=(d*_+h)*_+u,b=(f*_+p)*_+g;return Math.sqrt(y*y+b*b)}return um(m,0,1,c||jr.RecursionLimit)}function hm(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,f,p,g,m,_,y;for(let C=0;C<2;++C){if(C==0?(u=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,f=3*n-3*e):(u=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,f=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;p=-f/u,0<p&&p<1&&c.push(p);continue}_=u*u-4*f*h,y=Math.sqrt(_),!(_<0)&&(g=(-u+y)/(2*h),0<g&&g<1&&c.push(g),m=(-u-y)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,x;for(;b--;)p=c[b],x=1-p,d[0][b]=x*x*x*e+3*x*x*p*n+3*x*p*p*s+p*p*p*a,d[1][b]=x*x*x*t+3*x*x*p*r+3*x*p*p*o+p*p*p*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 um(e,t,n,r){let s=jr.abscissas[r-2],o=jr.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 u=a*s[c];h+=o[c++]*(e(l+u)+e(l-u))}return a*h}function fm(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?Ti(s-1,n):Math.max(s-1,0),l=t?Ti(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];pm(c,d,h),d.command=s===0?fe.move:fe.curve}}function pm(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+=tt:l-=tt,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 ir=(pi=class extends K{constructor(){super();k(this,"_flagId",!1);k(this,"_flagClassName",!1);k(this,"_renderer",{});k(this,"_id",Xs.Identifier+Xs.uniqueId());k(this,"_className","");k(this,"classList",[]);for(let n in Yl)Object.defineProperty(this,n,Yl[n])}static fromObject(n){const r=new pi().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}}},k(pi,"Properties",["renderer","id","className"]),pi);const Yl={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 qr extends Error{constructor(n){super();k(this,"name","Two.js");k(this,"message");this.message=n}}class gm{constructor(){k(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 Yr;const Ul={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Kt.document&&(Yr=document.createElement("a"));const We=class We extends ir{constructor(n,r){super();k(this,"_flagSrc",!1);k(this,"_flagImage",!1);k(this,"_flagVideo",!1);k(this,"_flagLoaded",!1);k(this,"_flagRepeat",!1);k(this,"_flagOffset",!1);k(this,"_flagScale",!1);k(this,"_src","");k(this,"_image",null);k(this,"_loaded",!1);k(this,"_repeat","no-repeat");k(this,"_scale",1);k(this,"_offset",null);for(let s in Gl)Object.defineProperty(this,s,Gl[s]);if(this._renderer.type="texture",this._renderer.flagOffset=mm.bind(this),this._renderer.flagScale=_m.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 Yr?(Yr.href=n,Yr.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 Kt.document?Ul.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}};k(We,"Properties",["src","loaded","repeat","scale","offset","image"]),k(We,"RegularExpressions",Ul),k(We,"ImageRegistry",new gm),k(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 qr("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 qr("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 nt=We;const Gl={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=nt.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}nt.ImageRegistry.contains(n)?this._image=nt.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 mm(){this._flagOffset=!0}function _m(){this._flagScale=!0}class Ei extends Array{constructor(){super();ha(this,rt,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 kt(this,rt)}set _events(n){zh(this,rt,n)}get _bound(){return kt(this,rt)._bound}set _bound(n){kt(this,rt)._bound=n}addEventListener(){return kt(this,rt).addEventListener.apply(this,arguments)}on(){return kt(this,rt).on.apply(this,arguments)}bind(){return kt(this,rt).bind.apply(this,arguments)}removeEventListener(){return kt(this,rt).removeEventListener.apply(this,arguments)}off(){return kt(this,rt).off.apply(this,arguments)}unbind(){return kt(this,rt).unbind.apply(this,arguments)}dispatchEvent(){return kt(this,rt).dispatchEvent.apply(this,arguments)}trigger(){return kt(this,rt).trigger.apply(this,arguments)}listen(){return kt(this,rt).listen.apply(this,arguments)}ignore(){return kt(this,rt).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}}rt=new WeakMap;const Kl=Array.prototype.slice;function ym(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=Kl.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=Kl.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=!ym(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:Kt.performance&&Kt.performance.now?Kt.performance:Date},Bt=class Bt extends ir{constructor(n,r,s){super();k(this,"_flagOffset",!0);k(this,"_flagOpacity",!0);k(this,"_flagColor",!0);k(this,"_offset",0);k(this,"_opacity",1);k(this,"_color","#fff");for(let o in Zl)Object.defineProperty(this,o,Zl[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Bt.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Bt.Index<=0?"#fff":"#000",Bt.Index=(Bt.Index+1)%2}static fromObject(n){const r=new Bt().copy(n);return"id"in n&&(r.id=n.id),r}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;return Ae.each(Bt.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(Bt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};k(Bt,"Index",0),k(Bt,"Properties",["offset","opacity","color"]);let Qn=Bt;const Zl={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)}}},nn=class nn extends ir{constructor(n){super();k(this,"_flagStops",!1);k(this,"_flagSpread",!1);k(this,"_flagUnits",!1);k(this,"_spread","");k(this,"_units","");for(let r in Jl)Object.defineProperty(this,r,Jl[r]);this._renderer.type="gradient",this._renderer.flagStops=bm.bind(this),this._renderer.bindStops=wm.bind(this),this._renderer.unbindStops=vm.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 Qn?o:new Qn().copy(o)));const s=new nn().copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new nn(r);return Ae.each(nn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<nn.Properties.length;r++){const s=nn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Ae.each(nn.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}};k(nn,"Stop",Qn),k(nn,"Properties",["spread","stops","units"]);let Je=nn;const Jl={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 Ei((e||[]).slice(0)),this._stops.bind(K.Types.insert,t).bind(K.Types.remove,n),t(this._stops)}}};function bm(){this._flagStops=!0}function wm(e){let t=e.length;for(;t--;)e[t].bind(K.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function vm(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 Je{constructor(n,r,s,o,a){super(a);k(this,"_flagEndPoints",!1);k(this,"_left",null);k(this,"_right",null);for(let l in Ql)Object.defineProperty(this,l,Ql[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=km.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(Je.Properties,function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return n.left=this.left.toObject(),n.right=this.right.toObject(),n}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(K.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};k(On,"Stop",Qn),k(On,"Properties",["left","right"]);let _t=On;const Ql={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 km(){this._flagEndPoints=!0}const rn=class rn extends Je{constructor(n,r,s,o,a,l){super(o);k(this,"_flagRadius",!1);k(this,"_flagCenter",!1);k(this,"_flagFocal",!1);k(this,"_radius",0);k(this,"_center",null);k(this,"_focal",null);for(let c in ec)Object.defineProperty(this,c,ec[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=xm.bind(this),this._renderer.flagFocal=Cm.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 rn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<rn.Properties.length;r++){const s=rn.Properties[r];s in n&&(/(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 rn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Ae.each(Je.Properties.concat(rn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Ae.each(rn.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}};k(rn,"Stop",Qn),k(rn,"Properties",["center","radius","focal"]);let yt=rn;const ec={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 xm(){this._flagCenter=!0}function Cm(){this._flagFocal=!0}function tc(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 Ur(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 nc(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,f=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(f||e).x,d=(f||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),f&&e._relative&&(o+=e.x,d+=e.y),dm(r,l,s,c,o,d,a,h,n)}function ic(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,f=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(f||e).x,d=(f||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),f&&e._relative&&(o+=e.x,d+=e.y),ql(r,l,s,c,o,d,a,h,n)}function ei(e){switch(e.renderer.type){case"texture":return nt.fromObject(e);case"gradient":return Je.fromObject(e);case"linear-gradient":return _t.fromObject(e);case"radial-gradient":return yt.fromObject(e)}return e}const Sm=Math.cos,Bm=Math.sin,rc=Math.tan,qs=[],wt=class wt extends K{constructor(n,r,s,o,a,l){super();k(this,"elements",new Wl(9));k(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 v=n;let $,F,R;const X=r[0]||0,M=r[1]||0,N=r[2]||0;return $=v[0]*X+v[1]*M+v[2]*N,F=v[3]*X+v[4]*M+v[5]*N,R=v[6]*X+v[7]*M+v[8]*N,[$,F,R]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],u=n[6],f=n[7],p=n[8],g=r[0],m=r[1],_=r[2],y=r[3],b=r[4],S=r[5],x=r[6],C=r[7],B=r[8];return s=s||new Wl(9),s[0]=o*g+a*y+l*x,s[1]=o*m+a*b+l*C,s[2]=o*_+a*S+l*B,s[3]=c*g+d*y+h*x,s[4]=c*m+d*b+h*C,s[5]=c*_+d*S+h*B,s[6]=u*g+f*y+p*x,s[7]=u*m+f*b+p*C,s[8]=u*_+f*S+p*B,s}static fromObject(n){return new wt().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const u=n;n=u[0],r=u[1],s=u[2],o=u[3],a=u[4],l=u[5],c=u[6],d=u[7],h=u[8]}return this.elements[0]=n,this.elements[1]=r,this.elements[2]=s,this.elements[3]=o,this.elements[4]=a,this.elements[5]=l,this.elements[6]=c,this.elements[7]=d,this.elements[8]=h,this.trigger(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]=wt.Identity[0],this.elements[1]=wt.Identity[1],this.elements[2]=wt.Identity[2],this.elements[3]=wt.Identity[3],this.elements[4]=wt.Identity[4],this.elements[5]=wt.Identity[5],this.elements[6]=wt.Identity[6],this.elements[7]=wt.Identity[7],this.elements[8]=wt.Identity[8],this.trigger(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 L=a[0]*n+a[1]*r+a[2]*s,Y=a[3]*n+a[4]*r+a[5]*s,P=a[6]*n+a[7]*r+a[8]*s;return[L,Y,P]}const u=this.elements,f=[n,r,s,o,a,l,c,d,h],p=u[0],g=u[1],m=u[2],_=u[3],y=u[4],b=u[5],S=u[6],x=u[7],C=u[8],B=f[0],v=f[1],$=f[2],F=f[3],R=f[4],X=f[5],M=f[6],N=f[7],A=f[8];return this.elements[0]=p*B+g*F+m*M,this.elements[1]=p*v+g*R+m*N,this.elements[2]=p*$+g*X+m*A,this.elements[3]=_*B+y*F+b*M,this.elements[4]=_*v+y*R+b*N,this.elements[5]=_*$+y*X+b*A,this.elements[6]=S*B+x*F+C*M,this.elements[7]=S*v+x*R+C*N,this.elements[8]=S*$+x*X+C*A,this.trigger(K.Types.change)}inverse(n){const r=this.elements;n=n||new wt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],u=r[7],f=r[8],p=f*c-d*u,g=-f*l+d*h,m=u*l-c*h;let _=s*p+o*g+a*m;return _?(_=1/_,n.elements[0]=p*_,n.elements[1]=(-f*o+a*u)*_,n.elements[2]=(d*o-a*c)*_,n.elements[3]=g*_,n.elements[4]=(f*s-a*h)*_,n.elements[5]=(-d*s+a*l)*_,n.elements[6]=m*_,n.elements[7]=(-u*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=Sm(n),s=Bm(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=rc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=rc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return qs.length=0,this.toTransformArray(n,qs),qs.map(Jt).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const f=s[6],p=s[7],g=s[8];if(o){r[0]=a,r[1]=d,r[2]=f,r[3]=l,r[4]=h,r[5]=p,r[6]=c,r[7]=u,r[8]=g;return}return[a,d,f,l,h,p,c,u,g]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=u;return}return[a,d,l,h,c,u]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const f=s[6],p=s[7],g=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u,r[6]=f,r[7]=p,r[8]=g;return}return[a,l,c,d,h,u,f,p,g]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u;return}return[a,l,c,d,h,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new wt().copy(this)}};k(wt,"Identity",[1,0,0,0,1,0,0,0,1]);let rr=wt;om(rr);const br=class br extends ir{constructor(){super();k(this,"_flagMatrix",!0);k(this,"_flagScale",!1);k(this,"_matrix",null);k(this,"_worldMatrix",null);k(this,"_position",null);k(this,"_rotation",0);k(this,"_scale",1);k(this,"_skewX",0);k(this,"_skewY",0);for(let n in Gr)Object.defineProperty(this,n,Gr[n]);this._renderer.flagMatrix=sc.bind(this),this.isShape=!0,this.matrix=new rr,this.worldMatrix=new rr,this.position=new we,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new br().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 Gr.position.get.apply(this,arguments)}set translation(n){Gr.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 br;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}};k(br,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let hn=br;const Gr={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),sc.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 am(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function sc(){this._flagMatrix=!0}const $i=Math.min,Ni=Math.max,Tm=Math.ceil,Em=Math.floor,$m=new we,jt=class jt extends hn{constructor(n,r,s,o){super();k(this,"_flagVertices",!0);k(this,"_flagLength",!0);k(this,"_flagFill",!0);k(this,"_flagStroke",!0);k(this,"_flagLinewidth",!0);k(this,"_flagOpacity",!0);k(this,"_flagVisible",!0);k(this,"_flagCap",!0);k(this,"_flagJoin",!0);k(this,"_flagMiter",!0);k(this,"_flagMask",!1);k(this,"_flagClip",!1);k(this,"_length",0);k(this,"_fill","#fff");k(this,"_stroke","#000");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_cap","round");k(this,"_join","round");k(this,"_miter",4);k(this,"_closed",!0);k(this,"_curved",!1);k(this,"_automatic",!0);k(this,"_beginning",0);k(this,"_ending",1);k(this,"_mask",null);k(this,"_clip",!1);k(this,"_dashes",null);for(let a in oc)Object.defineProperty(this,a,oc[a]);this._renderer.type="path",this._renderer.flagVertices=ac.bind(this),this._renderer.bindVertices=lc.bind(this),this._renderer.unbindVertices=cc.bind(this),this._renderer.flagFill=dc.bind(this),this._renderer.flagStroke=hc.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!s,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=n,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ei(n.fill),s=typeof n.stroke=="string"?n.stroke:ei(n.stroke),o=new jt().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 $e?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new $e().copy(s))}for(let r=0;r<jt.Properties.length;r++){const s=jt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new jt;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<jt.Properties.length;s++){const o=jt.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(jt.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,u=1/0,f=-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:p,scaleY:g}=sm(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof p=="number"&&typeof g=="number"&&(s=Math.max(p,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[p,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,x]=r.multiply(y,b),C=c.controls.left.x,B=c.controls.left.y;c.relative&&(C+=c.x,B+=c.y);let[v,$]=r.multiply(C,B);const F=hm(p,g,S,x,v,$,m,_);u=$i(F.min.y-s,u),d=$i(F.min.x-s,d),h=Ni(F.max.x+s,h),f=Ni(F.max.y+s,f)}else a<=1&&(u=$i(g-s,u),d=$i(p-s,d),h=Ni(p+s,h),f=Ni(g+s,f)),u=$i(_-s,u),d=$i(m-s,d),h=Ni(m+s,h),f=Ni(_+s,f)}return{top:u,left:d,right:h,bottom:f,width:h-d,height:f-u}}getPointAt(n,r){let s,o,a,l,c,d,h,u,f,p,g,m,_,y,b,S=this.length*Math.min(Math.max(n,0),1);const x=this.vertices.length,C=x-1;let B=null,v=null;for(let E=0,H=this._lengths.length,I=0;E<H;E++){if(I+this._lengths[E]>=S){this._closed?(s=Ti(E,x),o=Ti(E-1,x),E===0&&(s=o,o=E)):(s=E,o=Math.min(Math.max(E-1,0),C)),B=this.vertices[s],v=this.vertices[o],S-=I,this._lengths[E]!==0?n=S/this._lengths[E]:n=0;break}I+=this._lengths[E]}if(B===null||v===null)return null;if(B){if(!v)return B}else return v;b=v.controls&&v.controls.right,y=B.controls&&B.controls.left,c=v.x,p=v.y,d=(b||v).x,g=(b||v).y,h=(y||B).x,m=(y||B).y,u=B.x,_=B.y,b&&v.relative&&(d+=v.x,g+=v.y),y&&B.relative&&(h+=B.x,m+=B.y),l=Xr(n,c,d,h,u),f=Xr(n,p,g,m,_);const $=Zt(c,d,n),F=Zt(p,g,n),R=Zt(d,h,n),X=Zt(g,m,n),M=Zt(h,u,n),N=Zt(m,_,n),A=Zt($,R,n),L=Zt(F,X,n),Y=Zt(R,M,n),P=Zt(X,N,n);return Ae.isObject(r)?(r.x=l,r.y=f,r instanceof $e&&(r.controls.left.x=A,r.controls.left.y=L,r.controls.right.x=Y,r.controls.right.y=P,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=f,r.controls.right.x-=l,r.controls.right.y-=f)),r.t=n,r):(a=new $e(l,f,A-l,L-f,Y-l,P-f,this._curved?fe.curve:fe.line),a.t=n,a)}plot(){if(this.curved)return fm(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?fe.move:fe.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===fe.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===fe.move){a.push(new $e(o.x,o.y)),d>0&&(a[a.length-1].command=fe.line),o=c;return}l=ic(c,o,n),a=a.concat(l),Ae.each(l,function(h,u){u<=0&&o.command===fe.move?h.command=fe.move:h.command=fe.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=ic(c,o,n),a=a.concat(l),Ae.each(l,function(h,u){u<=0&&o.command===fe.move?h.command=fe.move:h.command=fe.line})),a.push(new $e(c.x,c.y)),a[a.length-1].command=s?fe.close:fe.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===fe.move){a=c,this._lengths[d]=0;return}this._lengths[d]=nc(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=Ur(this,s*this._length),l=Ur(this,o*this._length),c=Tm(a),d=Em(l);let h,u,f,p,g,m;for(this._renderer.vertices.length=0,m=0;m<n;m++)this._renderer.collection.length<=m&&this._renderer.collection.push(new $e),m>d&&!u?(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),u=g,f=this._collection[m-1],f&&f.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),f.relative?this._renderer.collection[m-1].controls.right.copy(f.controls.right).lerp(we.zero,1-g.t):this._renderer.collection[m-1].controls.right.copy(f.controls.right).lerp(f,1-g.t))):m>=c&&m<=d&&(g=this._renderer.collection[m].copy(this._collection[m]),this._renderer.vertices.push(g),m===d&&tc(this,o)?(u=g,!r&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):m===c&&tc(this,s)&&(h=g,h.command=fe.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=fe.move,this._renderer.vertices.unshift(g),p=this._collection[m+1],p&&p.controls&&(g.controls.left.clear(),p.relative?this._renderer.collection[m+1].controls.left.copy(p.controls.left).lerp(we.zero,g.t):($m.copy(p),this._renderer.collection[m+1].controls.left.copy(p.controls.left).lerp(p,g.t))))}return hn.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,hn.prototype.flagReset.call(this),this}};k(jt,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),k(jt,"Utils",{getCurveLength:nc});let Ne=jt;const oc={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 Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&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 Ei?this._collection=e:this._collection=new Ei(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 ac(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function lc(e){let t=e.length;for(;t--;)e[t].bind(K.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function cc(e){let t=e.length;for(;t--;)e[t].unbind(K.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function dc(){this._flagFill=!0}function hc(){this._flagStroke=!0}const Nm=Math.ceil,Pm=Math.floor,sn=class sn extends hn{constructor(n){super();k(this,"_flagVertices",!0);k(this,"_flagLength",!0);k(this,"_flagFill",!0);k(this,"_flagStroke",!0);k(this,"_flagLinewidth",!0);k(this,"_flagOpacity",!0);k(this,"_flagVisible",!0);k(this,"_flagSize",!0);k(this,"_flagSizeAttenuation",!0);k(this,"_length",0);k(this,"_fill","#fff");k(this,"_stroke","#000");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_size",1);k(this,"_sizeAttenuation",!1);k(this,"_beginning",0);k(this,"_ending",1);k(this,"_dashes",null);k(this,"noFill",Ne.prototype.noFill);k(this,"noStroke",Ne.prototype.noStroke);k(this,"corner",Ne.prototype.corner);k(this,"center",Ne.prototype.center);k(this,"getBoundingClientRect",Ne.prototype.getBoundingClientRect);k(this,"_updateLength",Ne.prototype._updateLength);for(let r in uc)Object.defineProperty(this,r,uc[r]);this._renderer.type="points",this._renderer.flagVertices=ac.bind(this),this._renderer.bindVertices=lc.bind(this),this._renderer.unbindVertices=cc.bind(this),this._renderer.flagFill=dc.bind(this),this._renderer.flagStroke=hc.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=n,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ei(n.fill),s=typeof n.stroke=="string"?n.stroke:ei(n.stroke),o=new sn().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 $e?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new $e().copy(s))}for(let r=0;r<sn.Properties.length;r++){const s=sn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new sn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<sn.Properties.length;s++){const o=sn.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(sn.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,u=ql(l,c,l,c,d,h,d,h,n);r=r.concat(u)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=Ur(this,n*this._length),o=Ur(this,r*this._length),a=Nm(s),l=Pm(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}};k(sn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);let Kr=sn;const uc={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 Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&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 Ei?this._collection=e:this._collection=new Ei(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 fc extends Ei{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);ha(this,vs,{});this.attach(n),this.on(K.Types.insert,this.attach),this.on(K.Types.remove,this.detach)}get ids(){return kt(this,vs)}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}}vs=new WeakMap;const mn=class mn extends Ne{constructor(n,r,s,o,a,l,c){const d=c||Xs.Resolution*3,h=[];for(let u=0;u<d;u++)h.push(new $e);super(h,!0,!1,!0);k(this,"_flagStartAngle",!1);k(this,"_flagEndAngle",!1);k(this,"_flagInnerRadius",!1);k(this,"_flagOuterRadius",!1);k(this,"_startAngle",0);k(this,"_endAngle",Jn);k(this,"_innerRadius",0);k(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let u in pc)Object.defineProperty(this,u,pc[u]);typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new mn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<mn.Properties.length;r++){const s=mn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,s=this._innerRadius,o=this._outerRadius,a=Ti(n,Jn)===Ti(r,Jn),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,u=0,f,p,g,m,_,y,b,S,x;for(a?d--:l||(d-=2),f=0,p=d-1;f<d;f++){switch(g=f/p,m=c[u],_=g*(r-n)+n,y=(r-n)/d,b=o*Math.cos(_),S=o*Math.sin(_),f){case 0:h=fe.move;break;default:h=fe.curve}m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===fe.curve&&(x=o*y/Math.PI,m.controls.left.x=x*Math.cos(_-tt),m.controls.left.y=x*Math.sin(_-tt),m.controls.right.x=x*Math.cos(_+tt),m.controls.right.y=x*Math.sin(_+tt),f===1&&m.controls.left.multiplyScalar(2),f===p&&m.controls.right.multiplyScalar(2)),u++}if(l){for(a?(c[u].command=fe.close,u++):(d--,p=d-1),f=0;f<d;f++)g=f/p,m=c[u],_=(1-g)*(r-n)+n,y=(r-n)/d,b=s*Math.cos(_),S=s*Math.sin(_),h=fe.curve,f<=0&&(h=a?fe.move:fe.line),m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===fe.curve&&(x=s*y/Math.PI,m.controls.left.x=x*Math.cos(_+tt),m.controls.left.y=x*Math.sin(_+tt),m.controls.right.x=x*Math.cos(_-tt),m.controls.right.y=x*Math.sin(_-tt),f===1&&m.controls.left.multiplyScalar(2),f===p&&m.controls.right.multiplyScalar(2)),u++;c[u].copy(c[0]),c[u].command=fe.line}else a||(c[u].command=fe.line,c[u].x=0,c[u].y=0,u++,c[u].copy(c[0]),c[u].command=fe.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 mn(0,0,r,s,o,a,l);c.translation.copy(this.translation),c.rotation=this.rotation,c.scale=this.scale,c.skewX=this.skewX,c.skewY=this.skewY,this.matrix.manual&&c.matrix.copy(this.matrix);for(let d=0;d<Ne.Properties.length;d++){const h=Ne.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<mn.Properties.length;r++){const s=mn.Properties[r];n[s]=this[s]}return n}};k(mn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Ys=mn;const pc={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}}},Us=Math.cos,Gs=Math.sin,_n=class _n extends Ne{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new $e(0,0,0,0,0,0));super(l,!0,!0,!0);k(this,"_flagRadius",!1);k(this,"_radius",0);this._renderer.type="circle";for(let c in gc)Object.defineProperty(this,c,gc[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 _n().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<_n.Properties.length;r++){const s=_n.Properties[r];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*Jn,d=s*Us(c),h=s*Gs(c),u=o*Us(c-tt),f=o*Gs(c-tt),p=o*Us(c+tt),g=o*Gs(c+tt),m=this.vertices[a];m.command=a===0?fe.move:fe.curve,m.set(d,h),m.controls.left.set(u,f),m.controls.right.set(p,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new _n(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="circle";for(let r=0;r<_n.Properties.length;r++){const s=_n.Properties[r];n[s]=this[s]}return n}};k(_n,"Properties",["radius"]);let Ks=_n;const gc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Zs=Math.cos,Js=Math.sin,yn=class yn extends Ne{constructor(n,r,s,o,a){typeof o!="number"&&typeof s=="number"&&(o=s);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new $e);super(c,!0,!0,!0);k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_width",0);k(this,"_height",0);this._renderer.type="ellipse";for(let d in mc)Object.defineProperty(this,d,mc[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 yn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<yn.Properties.length;r++){const s=yn.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*Jn,d=s*Zs(c),h=o*Js(c),u=s*r*Zs(c-tt),f=o*r*Js(c-tt),p=s*r*Zs(c+tt),g=o*r*Js(c+tt),m=this.vertices[a];m.command=a===0?fe.move:fe.curve,m.set(d,h),m.controls.left.set(u,f),m.controls.right.set(p,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 yn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="ellipse";for(let r=0;r<yn.Properties.length;r++){const s=yn.Properties[r];n[s]=this[s]}return n}};k(yn,"Properties",["width","height"]);let Qs=yn;const mc={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}}},Rm=Math.cos,Fm=Math.sin,bn=class bn extends Ne{constructor(n,r,s,o){o=Math.max(o||0,3);super();k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_flagSides",!1);k(this,"_radius",0);k(this,"_width",0);k(this,"_height",0);k(this,"_sides",0);this._renderer.type="polygon";for(let a in _c)Object.defineProperty(this,a,_c[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 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._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=Jn*a+Math.PI/2,c=this._width*Rm(l)/2,d=this._height*Fm(l)/2;o>=s?this.vertices.push(new $e(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?fe.move:fe.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 bn(0,0,0,this.sides);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,r.width=this.width,r.height=this.height,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="polygon";for(let r=0;r<bn.Properties.length;r++){const s=bn.Properties[r];n[s]=this[s]}return n}};k(bn,"Properties",["width","height","sides"]);let eo=bn;const _c={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}}},gi=class gi extends Ne{constructor(n,r,s,o){const a=[new $e,new $e,new $e,new $e];super(a,!0,!1,!0);k(this,"_flagWidth",0);k(this,"_flagHeight",0);k(this,"_width",0);k(this,"_height",0);k(this,"_origin",null);this._renderer.type="rectangle";for(let l in yc)Object.defineProperty(this,l,yc[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 gi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<gi.Properties.length;r++){const s=gi.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 $e),this.vertices[0].set(-n,-r).sub(this._origin).command=fe.move,this.vertices[1].set(n,-r).sub(this._origin).command=fe.line,this.vertices[2].set(n,r).sub(this._origin).command=fe.line,this.vertices[3].set(-n,r).sub(this._origin).command=fe.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=fe.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new gi(0,0,this.width,this.height);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ne.Properties.length;s++){const o=Ne.Properties[s];r[o]=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}};k(gi,"Properties",["width","height"]);let to=gi;const yc={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()}}},wn=class wn extends Ne{constructor(n,r,s,o,a){typeof a>"u"&&typeof s=="number"&&typeof o=="number"&&(a=Math.floor(Math.min(s,o)/12));const l=[];for(let c=0;c<10;c++)l.push(new $e(0,0,0,0,0,0,c===0?fe.move:fe.curve));super(l);k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_flagRadius",!1);k(this,"_width",0);k(this,"_height",0);k(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in bc)Object.defineProperty(this,c,bc[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Mm.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 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];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 wn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="rounded-rectangle";for(let r=0;r<wn.Properties.length;r++){const s=wn.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};k(wn,"Properties",["width","height","radius"]);let no=wn;const bc={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 Mm(){this._flagRadius=!0}const Am=Math.cos,Om=Math.sin,vn=class vn extends Ne{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();k(this,"_flagInnerRadius",!1);k(this,"_flagOuterRadius",!1);k(this,"_flagSides",!1);k(this,"_innerRadius",0);k(this,"_outerRadius",0);k(this,"_sides",0);this._renderer.type="star";for(let l in wc)Object.defineProperty(this,l,wc[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 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._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=Jn*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*Am(l),h=c*Om(l);o>=s?this.vertices.push(new $e(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?fe.move:fe.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 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<Ne.Properties.length;l++){const c=Ne.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="star";for(let r=0;r<vn.Properties.length;r++){const s=vn.Properties[r];n[s]=this[s]}return n}};k(vn,"Properties",["innerRadius","outerRadius","sides"]);let io=vn;const wc={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 ro;const vc=Math.min,kc=Math.max;Kt.document&&(ro=document.createElement("canvas"));const ft=class ft extends hn{constructor(n,r,s,o){super();k(this,"_flagValue",!0);k(this,"_flagFamily",!0);k(this,"_flagSize",!0);k(this,"_flagLeading",!0);k(this,"_flagAlignment",!0);k(this,"_flagBaseline",!0);k(this,"_flagStyle",!0);k(this,"_flagWeight",!0);k(this,"_flagDecoration",!0);k(this,"_flagFill",!0);k(this,"_flagStroke",!0);k(this,"_flagLinewidth",!0);k(this,"_flagOpacity",!0);k(this,"_flagVisible",!0);k(this,"_flagMask",!1);k(this,"_flagClip",!1);k(this,"_flagDirection",!0);k(this,"_value","");k(this,"_family","sans-serif");k(this,"_size",13);k(this,"_leading",17);k(this,"_alignment","center");k(this,"_baseline","middle");k(this,"_style","normal");k(this,"_weight",500);k(this,"_decoration","none");k(this,"_direction","ltr");k(this,"_fill","#000");k(this,"_stroke","none");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_mask",null);k(this,"_clip",!1);k(this,"_dashes",null);for(let a in xc)Object.defineProperty(this,a,xc[a]);if(this._renderer.type="text",this._renderer.flagFill=Vm.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,!Ae.isObject(o))return this;for(let a=0;a<ft.Properties.length;a++){const l=ft.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(ro){const r=ro.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*ft.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:ei(n.fill),s=typeof n.stroke=="string"?n.stroke:ei(n.stroke),o=new ft().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<ft.Properties.length;r++){const s=ft.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new ft(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<ft.Properties.length;s++){const o=ft.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<ft.Properties.length;r++){const s=ft.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}=ft.Measure(this),h=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-h,o=c+h;break;case"right":s=-(c+h),o=h;break;default:s=-(c/2+h),o=c/2+h}switch(this.baseline){case"middle":a=-(d/2+h),l=d/2+h;break;default:a=-(d+h),l=h}const[u,f]=r.multiply(s,a),[p,g]=r.multiply(s,l),[m,_]=r.multiply(o,a),[y,b]=r.multiply(o,l);return a=vc(f,g,_,b),s=vc(u,p,m,y),o=kc(u,p,m,y),l=kc(f,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}};k(ft,"Ratio",.6),k(ft,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);let Pi=ft;const xc={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 Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&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 Vm(){this._flagFill=!0}function zm(){this._flagStroke=!0}const Zr=Math.min,Jr=Math.max,kn=class kn extends hn{constructor(n){super();k(this,"_flagAdditions",!1);k(this,"_flagSubtractions",!1);k(this,"_flagOrder",!1);k(this,"_flagOpacity",!0);k(this,"_flagBeginning",!1);k(this,"_flagEnding",!1);k(this,"_flagLength",!1);k(this,"_flagMask",!1);k(this,"_fill","#fff");k(this,"_stroke","#000");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_cap","round");k(this,"_join","round");k(this,"_miter",4);k(this,"_closed",!0);k(this,"_curved",!1);k(this,"_automatic",!0);k(this,"_beginning",0);k(this,"_ending",1);k(this,"_length",0);k(this,"_mask",null);for(let r in Cc)Object.defineProperty(this,r,Cc[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++)Sc.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)Sc.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new kn;for(let o=0;o<kn.Properties.length;o++){const a=kn.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:ei(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 Ys.fromObject(o);case"circle":return Ks.fromObject(o);case"ellipse":return Qs.fromObject(o);case"points":return Kr.fromObject(o);case"polygon":return eo.fromObject(o);case"rectangle":return to.fromObject(o);case"rounded-rectangle":return no.fromObject(o);case"star":return io.fromObject(o);case"path":return Ne.fromObject(o);case"text":return Pi.fromObject(o);case"group":return kn.fromObject(o);case"shape":return hn.fromObject(o);case"element":return ir.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 kn,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,u=1/0,f=-1/0;const p=/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||p.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),[x,C]=s.multiply(r.left,r.bottom),[B,v]=s.multiply(r.right,r.bottom);u=Zr(y,S,C,v,u),d=Zr(_,b,x,B,d),h=Jr(_,b,x,B,h),f=Jr(y,S,C,v,f)}else u=Zr(r.top,u),d=Zr(r.left,d),h=Jr(r.right,h),f=Jr(r.bottom,f)}return{top:u,left:d,right:h,bottom:f,width:h-d,height:f-u}}noFill(){return this.children.forEach(function(n){n.noFill()}),this}noStroke(){return this.children.forEach(function(n){n.noStroke()}),this}subdivide(){const n=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,n)}),this}_update(){let n,r,s;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=o*l,h=a*l;for(n=0;n<this.children.length;n++)s=this.children[n],r=s.length,d>c+r?(s.beginning=1,s.ending=1):h<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):h>c&&h<c+r?(s.beginning=0,s.ending=(h-c)/r):(s.beginning=0,s.ending=1),c+=r}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};k(kn,"Children",fc),k(kn,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let un=kn;const Cc={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=un.InsertChildren.bind(this),n=un.RemoveChildren.bind(this),r=un.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new fc(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 Sc(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 so extends Ne{constructor(t,n,r,s){const o=[new $e(t,n),new $e(r,s)];super(o);for(let a in Bc)Object.defineProperty(this,a,Bc[a]);this.vertices[0].command=fe.move,this.vertices[1].command=fe.line,this.automatic=!1}}const Bc={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 qr("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 qr("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}};class oo{constructor(t=0,n=0){this.x=t,this.y=n}}class ti{constructor(t=10,n=0,r="A"){k(this,"start",new oo);k(this,"end",new oo);this.width=t,this.angle=n,this.label=r}}const ze={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"}},Im={class:"flex gap-3"},Lm={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},Dm={ref:"drawing-container",class:"size-full"},Hm={},Tc=i.defineComponent({...Hm,__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((P,E)=>new ti(n.value.configuratorParams.linesWidths[E],P,`A-${E+1}`))),u=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),f=i.computed(()=>{var P,E;return n.value.configuratorParams.startTailType&&((P=n.settings.startTailConfigs)!=null&&P[n.value.configuratorParams.startTailType])?(E=n.settings.startTailConfigs)==null?void 0:E[n.value.configuratorParams.startTailType].points:[]}),p=i.computed(()=>{var P,E;return n.value.configuratorParams.endTailType&&((P=n.settings.endTailConfigs)!=null&&P[n.value.configuratorParams.endTailType])?(E=n.settings.endTailConfigs)==null?void 0:E[n.value.configuratorParams.endTailType].points:[]}),g=(P,E=!1)=>{P[0].start.x=0,P[0].start.y=0;let H=0;for(let I=0;I<P.length;I++){const U=P[I],O=P[I-1]??new ti(0,H);H+=!E||I>1?O.angle:0;const z=(!E||I>0?U.angle:0)+H;if(P[I].end.x=U.width*Math.cos(z*Math.PI/180)+P[I].start.x,P[I].end.y=U.width*Math.sin(z*Math.PI/180)+P[I].start.y,I<P.length-1){const J=I+1;P[J].start.x=P[I].end.x,P[J].start.y=P[I].end.y}}return P},m=(P,E,H,I,U=!1)=>{let O=g([...H,...I]);E.length>0&&(O=[...g(E),...O]);let z=0,J=0,pe=0,re=0;O.forEach(xe=>{z=Math.min(z,xe.start.x,xe.end.x),J=Math.min(J,xe.start.y,xe.end.y),pe=Math.max(pe,xe.start.x,xe.end.x),re=Math.max(re,xe.start.y,xe.end.y)});let ge,ie;z===0&&J===0&&pe===0&&re===0?(ge=1,ie=1):(ge=P.width/Math.abs(pe-z),ie=(U?P.height:P.height-ze.colorSideLabel.size)/Math.abs(re-J));const Me=Math.min(ge,ie);return z=z<0?-z*Me:0,J=J<0?-J*Me:0,[Me,z,J]},_=P=>{const E=new Kr([P]);return E._size=ze.anchorPoint.size,E.fill=ze.anchorPoint.color,E.stroke="transparent",E._linewidth=ze.anchorPoint.strokeSize,l.push(E),E},y=(P,E)=>{if(l=[],n.settings.allowChangeFirstPoint){const H=P[0],I=new we(H.vertices[0].x,H.vertices[0].y);I.bind(K.Types.change,()=>{H.vertices[0].copy(I)});const U=_(I);E.add(U)}P.forEach((H,I)=>{const U=P[I+1],O=new we(H.vertices[1].x,H.vertices[1].y);O.bind(K.Types.change,()=>{H.vertices[1].copy(O),U!==void 0&&U.vertices[0].copy(O)});const z=_(O);E.add(z)})},b=P=>P*(Math.PI/180),S=(P,E,H)=>{const I=E.vertices.length-1;P.position.x=E.vertices[I].x,P.position.y=E.vertices[I].y;const U=Math.atan2(E.vertices[I].y-E.vertices[0].y,E.vertices[I].x-E.vertices[0].x);P.rotation=b(H)+U},x=(P,E,H)=>{if(E.vertices[0]===void 0)return;P.position.x=E.vertices[0].x,P.position.y=E.vertices[0].y;const I=E.vertices.length-1,U=Math.atan2(E.vertices[I].y-E.vertices[0].y,E.vertices[I].x-E.vertices[0].x);P.rotation=b(H)+U},C=(P,E,H)=>{const I=new un;if(P.length===0)return I;const U=[];return[...P].reverse().forEach((O,z)=>{z!==0&&O.angle>0&&(O.angle*=-1),U.push(O)}),P=g(U,!0),x(I,E,P[0].angle),[E.vertices[0],E.vertices[1]].forEach(O=>{O.bind(K.Types.change,()=>{x(I,E,P[0].angle)})}),P.forEach(O=>{const z=O.start.x*H,J=O.end.x*H,pe=O.start.y*H,re=O.end.y*H,ge=new so(z,pe,J,re);ge.linewidth=ze.line.size,ge.stroke=ze.line.color,I.add(ge)}),I},B=(P,E,H)=>{const I=new un;return P.length===0||(P=g(P,!0),S(I,E,P[0].angle),[E.vertices[0],E.vertices[1]].forEach(U=>{U.bind(K.Types.change,()=>{S(I,E,P[0].angle)})}),P.forEach(U=>{const O=U.start.x*H,z=U.end.x*H,J=U.start.y*H,pe=U.end.y*H,re=new so(O,J,z,pe);re.linewidth=ze.line.size,re.stroke=ze.line.color,I.add(re)})),I},v=(P,E,H,I)=>{const U=E.vertices[0].x+(E.vertices[1].x-E.vertices[0].x)/2-8*Math.sin(P.angle*Math.PI/180),O=E.vertices[0].y+(E.vertices[1].y-E.vertices[0].y)/2-8*Math.cos(P.angle*Math.PI/180),z=new Pi(P.label,U+10,O-10);let J;z.size=ze.lineLabel.size,z.weight=600,z.fill=ze.lineLabel.color,z.id+=1,z.rotation=ze.lineLabel.rotation,I>0&&(J=new Pi(`${P.angle}°`,E.vertices[0].x+25,E.vertices[0].y-25),J.size=ze.angleLabel.size,J.weight=600,J.fill=ze.angleLabel.color,J.rotation=ze.angleLabel.rotation,J.id+=I,o.push(J),H.add(J)),H.add(z),F(z,E,0,J),F(z,E,1)},$=()=>{const{size:P}=ze.colorSideLabel,E=0,H=0,I=u.value?P/2:P/2-P,U=u.value?P/2-P:P/2,O=new un;if(!c)return O;const z=5,J=Math.atan2(U-I,H-E),pe=[new $e(E,I,0,0,0,0,he.Commands.move),new $e(H,U,0,0,0,0,he.Commands.line),new $e(H-z*Math.cos(J-Math.PI/4),U-z*Math.sin(J-Math.PI/4),0,0,0,0,he.Commands.line),new $e(H,U,0,0,0,0,he.Commands.move),new $e(H-z*Math.cos(J+Math.PI/4),U-z*Math.sin(J+Math.PI/4),0,0,0,0,he.Commands.line)],re=new Ne(pe,!1,!1,!0);re.noFill(),re.cap="round",re.join="round",re.linewidth=P/7,re.stroke=ze.colorSideLabel.color,O.add(re);const ge=new Pi(u.value?"Цвет снизу":"Цвет сверху",10,0);ge.size=P,ge.weight=600,ge.fill=ze.colorSideLabel.color,ge.alignment="left",O.add(ge);const ie=O.getBoundingClientRect();return O.position.x=(c.width-ie.width)*d+10,O.position.y=u.value?c.height+ie.height*2:ie.height/2,O},F=(P,E,H,I)=>{E.vertices[H].bind(K.Types.change,()=>{const U=E.vertices.length-1,O=Math.atan2(E.vertices[0].y-E.vertices[U].y,E.vertices[0].x-E.vertices[U].x)*180/Math.PI,z=E.vertices[0].x+(E.vertices[U].x-E.vertices[0].x)/2-8*Math.sin(O*Math.PI/180),J=E.vertices[0].y+(E.vertices[U].y-E.vertices[0].y)/2-8*Math.cos(O*Math.PI/180);P.position.x=z+10,P.position.y=J-10,P.rotation=-.5,I&&(I.position.x=E.vertices[0].x+25,I.position.y=E.vertices[0].y-25)})},R=(P,E,H,I,U=!1)=>{var Ce;if(P.clear(),H.length===0){P.update();return}const O=g(H),[z,J,pe]=m(P,E,O,I,U),re=new un,ge=new Array,ie=new Array;U||(o=[],a=[]),O.forEach((Fe,Ie)=>{const vt=Fe.start.x*z+J,xn=Fe.end.x*z+J,Mt=Fe.start.y*z+pe,Xt=Fe.end.y*z+pe,Tt=new so(vt,Mt,xn,Xt);Tt.linewidth=U?ze.previewLine.size:ze.line.size,Tt.stroke=U?ze.previewLine.color:ze.line.color,a.push(Tt),ge.push(Tt),re.add(Tt),!U&&Fe.label!==""&&v(Fe,Tt,re,Ie)});const Me=ge.at(-1);let xe=re.getBoundingClientRect();if(!U){const Fe=$();ie.push(Fe)}if(E.length>0){const Fe=C(E,ge[0],z);re.add(Fe)}if(I.length>0&&Me){const Fe=B(I,Me,z);re.add(Fe)}if(ie.push(re),P.makeGroup(ie),xe=re.getBoundingClientRect(),re.position.x=0-xe.left+(P.width-xe.width)/(2*(U?1:d)),re.position.y=0-xe.top+(P.height-xe.height)/(2*(U?1:d)),P.update(),!U){const Fe=((Ce=n.value.configuratorParams)==null?void 0:Ce.colorSide)==="top";re.position.y=re.position.y+ze.colorSideLabel.size*Number(Fe),y(ge,re),P.update()}},X=(P,E)=>{if(P&&!E.isNewRec()){const H=new he({width:P.scrollWidth,height:P.scrollHeight});H.appendTo(P),R(H,[],E.points,[],!0)}},M=()=>{c&&R(c,f.value,h.value,p.value,!1)},N=P=>P*(180/Math.PI),A=(P,E)=>{const H=P[1].x-P[0].x,I=P[1].y-P[0].y,U=E[1].x-E[0].x,O=E[1].y-E[0].y;let z=Math.atan2(H*O-I*U,H*U+I*O);return z=N(z),Math.round(z)*-1},L=P=>{const E=a.map((H,I,U)=>{const O=U[I-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let z=Math.ceil(H._length/P/n.settings.lineWidthStep)*n.settings.lineWidthStep;const J=o[I-1];z<(U.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(z=U.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),z>n.settings.maxLineWidth&&(z=n.settings.maxLineWidth);const pe=A(H.vertices,O.vertices);return J&&(J.value=`${pe}°`),new ti(z,pe,`A-${I+1}`)});r("pointer:move",E)},Y=P=>{let E=null,H;const I=J=>{E=l.find(pe=>{const re=pe.renderer;return(re==null?void 0:re.elem)===J.target}),[H]=m(P,f.value,h.value.map(pe=>pe),p.value)},U=J=>{if(E){const pe=E.renderer,re=pe==null?void 0:pe.elem;if(!re)return;const ge=re.getBoundingClientRect();E.vertices[0].x-=ge.x-(J instanceof MouseEvent?J.clientX:J.targetTouches[0].clientX)+ze.anchorPoint.size/2,E.vertices[0].y-=ge.y-(J instanceof MouseEvent?J.clientY:J.targetTouches[0].clientY)+ze.anchorPoint.size/2,L(H),P.update()}},O=()=>{E&&r("pointer:up",h.value),E=null},z=s.value;z&&(z.addEventListener("touchstart",I),z.addEventListener("touchend",O),z.addEventListener("mousedown",I),z.addEventListener("mouseup",O),z.addEventListener("mousemove",U),z.addEventListener("touchmove",U))};return i.onMounted(()=>{s.value&&(c=new he({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{M()},{deep:!0,immediate:!0}),Y(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(P,E)=>(i.openBlock(),i.createElementBlock("div",Im,[i.createVNode(Ta,{"select-template-index":P.selectTemplateIndex,settings:P.settings,"onTemplate:select":E[0]||(E[0]=H=>r("template:select",H)),onInitDrawTemplate:X},null,8,["select-template-index","settings"]),i.createElementVNode("div",Lm,[i.createElementVNode("div",Dm,null,512)])]))}}),Wm={class:"flex max-w-[50rem] flex-col gap-3"},jm={},Xm=i.defineComponent({...jm,__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:{}}),u=i.ref(0),f=(C=0)=>{const B=c.value.allTemplates.at(C);B!==void 0&&(u.value=C,l.value.configuratorParams.linesWidths=B.points.map(v=>W.isArray(v)?v[0]:v.width),l.value.configuratorParams.linesAngles=B.points.map(v=>W.isArray(v)?v[1]:v.angle),y()),m(l.value.configuratorParams)},p=async()=>{const C=prompt("Введите название шаблона:");if(!C)return;a.value=!0;const B={label:C,points:l.value.configuratorParams.linesWidths.map((v,$)=>[v,l.value.configuratorParams.linesAngles[$]])};await G.HttpRequester.getInstance(G.ConfiguratorProvider).createTemplate(n.cartItem.category,B,h.value).then(()=>{c.value.addCustomTemplate(B),u.value=c.value.allTemplates.length-1}).catch(()=>{a.value=!1}),a.value=!1},g=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(u.value=c.value.allTemplates.length-1)},m=async C=>{y(),s.value=!0,await G.HttpRequester.getInstance(G.ConfiguratorProvider).searchProduct(n.cartItem.category,C,h.value).then(B=>{l.value.product=B}).catch(()=>{s.value=!1}),s.value=!1},_=async()=>{o.value=!0,await(l.value.isNewRec()?G.HttpRequester.getInstance(G.CartProvider).addCartItem(n.client,l.value).then(C=>{r("submit-success",C)}).catch(()=>{o.value=!1}):G.HttpRequester.getInstance(G.CartProvider).patchCartItem(n.client,l.value).then(C=>{r("submit-success",C)}).catch(()=>{o.value=!1})),o.value=!1},y=()=>{const C={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach((B,v)=>{C[`lines_widths[${v+1}]`]={},C[`lines_angles[${v+1}]`]={}}),h.value=C},b=C=>{d.value.linesWidths=C.map(B=>B.width),d.value.linesAngles=C.map(B=>B.angle)},S=C=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,y(),g(),m(l.value.configuratorParams)},x=(C,B)=>{d.value.linesWidths=C,d.value.linesAngles=B};return i.onBeforeMount(()=>{f()}),(C,B)=>(i.openBlock(),i.createElementBlock("div",Wm,[i.createVNode(Tc,{value:l.value,"select-template-index":u.value,settings:c.value,"onPointer:up":S,"onPointer:move":b,"onTemplate:select":f},null,8,["value","select-template-index","settings"]),i.createVNode(Na,{value:l.value,"onUpdate:value":B[0]||(B[0]=v=>l.value=v),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":u.value,"onUpdate:params":B[1]||(B[1]=v=>m(v)),"onUpdate:preview":x,onSubmit:_,"onClick:saveTemplate":p},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])]))}});class Ri extends G.Identity{constructor(n,r){super();k(this,"label","");k(this,"points",[]);k(this,"isCustom",!1);k(this,"id",-1);k(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>W.isArray(s)?new ti(s[0],s[1],`A-${o+1}`):new ti(s.width,s.angle,`A-${o+1}`))):(this.label="-- Новая конфигурация --",this.points=[new ti(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class ao extends Ri{constructor(n){super(n);k(this,"isDefault");this.isDefault=n.isDefault??!1}}class qm{constructor(t){k(this,"minLineWidth");k(this,"maxLineWidth");k(this,"lineWidthStep");k(this,"minLineAngle");k(this,"maxLineAngle");k(this,"lineAngleStep");k(this,"stripMinWidth");k(this,"stripMaxWidth");k(this,"stripMinLength");k(this,"stripMaxLength");k(this,"allowShowTable");k(this,"showOnlyTemplates");k(this,"templates");k(this,"customTemplates",[]);k(this,"startTailConfigs");k(this,"endTailConfigs");k(this,"bendCountForExtended");k(this,"extendedProductCatalog");k(this,"allowChangeFirstPoint");k(this,"allowSaveTemplates");k(this,"userTemplatesPrefix");k(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 Ri(n)),this.templates.forEach((n,r)=>{n.id=r}),this.startTailConfigs=t.startTailConfigs.map(n=>new ao(n)),this.endTailConfigs=t.endTailConfigs.map(n=>new ao(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 Ri(r);return s.isCustom=!0,s.id=+n,s}):[],this.customTemplates.push(new Ri))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(t){var r,s;if(!this.allowSaveTemplates)return;const n=new Ri(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 Ym={},Fi=i.defineComponent({...Ym,__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=W.debounce(()=>s("update:value",o.value),a.value),c=p=>{o.value=p,l()};i.watch(()=>r.value,p=>{o.value=p});const d=i.ref(null);return t({focus:()=>{var p;return(p=d.value)==null?void 0:p.focus()},blur:()=>{var p;return(p=d.value)==null?void 0:p.blur()},select:()=>{var p;return(p=d.value)==null?void 0:p.select()}}),(p,g)=>(i.openBlock(),i.createBlock(i.unref(V.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value,"onUpdate:value":[g[0]||(g[0]=m=>o.value=m),c],clearable:p.clearable,placeholder:p.placeholder,min:p.min,max:p.max,step:p.step,validator:p.validator},null,8,["value","clearable","placeholder","min","max","step","validator"]))}}),Um={class:"flex flex-col gap-3"},Gm={},Ec=i.defineComponent({...Gm,__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(W.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 G.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=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{disabled:c.isSubmitProcessing,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.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(Fi,{ref:"first-input-element",value:o.value.width,"onUpdate:value":[d[0]||(d[0]=u=>o.value.width=u),a],class:"w-full",max:c.settings.maxWidth??void 0,min:c.settings.minWidth,validator:u=>!!u&&u>=c.settings.minWidth&&(!c.settings.maxWidth||u<=c.settings.maxWidth),placeholder:"Введите ширину"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.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(Fi,{value:o.value.length,"onUpdate:value":[d[1]||(d[1]=u=>o.value.length=u),a],placeholder:"Введите длину",max:c.settings.maxLength,min:c.settings.minLength,validator:u=>u>=c.settings.minLength&&u<=c.settings.maxLength,class:"w-full"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.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(V.NInputNumber),{value:c.value.quantity,placeholder:"Введите количество",min:1,validator:u=>u>0,class:"w-full","onUpdate:value":d[2]||(d[2]=u=>l("quantity",u??0))},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.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]=u=>l("marker",u))},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(qi,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",Um,[i.createVNode(i.unref(V.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]=u=>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(V.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[5]||(d[5]=u=>r("click:view-switch"))},{default:i.withCtx(()=>d[6]||(d[6]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[6]})):i.createCommentVNode("",!0)])]),_:1},8,["disabled"])}}}),Km={class:"w-104 px-5"},Zm={},Jm=i.defineComponent({...Zm,__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 G.HttpRequester.getInstance(G.ConfiguratorProvider).searchProduct(n.cartItem.category,h,o.value).then(u=>{s.value.product=u}).catch(()=>{a.value=!1}),a.value=!1},d=async()=>{l.value=!0,await(s.value.isNewRec()?G.HttpRequester.getInstance(G.CartProvider).addCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1}):G.HttpRequester.getInstance(G.CartProvider).patchCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1})),l.value=!1};return(h,u)=>(i.openBlock(),i.createElementBlock("div",Km,[i.createVNode(Ec,{value:s.value,"onUpdate:value":u[0]||(u[0]=f=>s.value=f),validation:o.value,settings:h.settings,"is-submit-processing":l.value,"onUpdate:params":u[1]||(u[1]=f=>c(f)),onSubmit:u[2]||(u[2]=f=>d())},null,8,["value","validation","settings","is-submit-processing"])]))}}),Qm={key:0,class:"flex items-baseline gap-1"},e0={key:0,class:"flex items-baseline gap-1"},t0={class:"flex gap-3"},n0={},$c=i.defineComponent({...n0,__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(()=>pt.isPhoneDevice()),o=i.ref(W.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=(f,p)=>{f&&f in o.value&&(o.value[f]=p??0),r("update:params",o.value),u("configuratorParams",o.value)},u=(f,p)=>{const g=new G.CartItemBase(n.value);g[f]=p,r("update:value",g)};return(f,p)=>{const g=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"flex flex-col gap-2 px-4 md:max-w-96"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.netType,"onUpdate:value":[p[0]||(p[0]=m=>o.value.netType=m),h],options:f.settings.netType.map(m=>({label:f.settings.descriptions.net_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.color,"onUpdate:value":p[1]||(p[1]=m=>o.value.color=m),options:f.settings.color.map(m=>({label:f.settings.descriptions.color[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.mountType,"onUpdate:value":[p[2]||(p[2]=m=>o.value.mountType=m),h],options:f.settings.mountType.map(m=>({label:f.settings.descriptions.mount_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:f.validation.width.feedback||"","show-feedback":f.validation.width.showFeedback||o.value.width>=f.settings.minWidth&&o.value.width<=f.settings.maxWidths[o.value.netType],"validation-status":f.validation.width.validationStatus||void 0,label:`Ширина светового проёма от ${f.settings.minWidth-a.value} ${c.value?" до "+c.value:""} мм.`},{feedback:i.withCtx(()=>[!f.validation.width.showFeedback&&o.value.width>=f.settings.minWidth&&o.value.width<=f.settings.maxWidths[o.value.netType]?(i.openBlock(),i.createElementBlock("div",Qm,[i.createVNode(i.unref(V.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(o.value.width+a.value),1)]),_:1}),i.createVNode(i.unref(V.NButton),{quaternary:"",type:"info",size:"tiny",onClick:p[4]||(p[4]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>p[11]||(p[11]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])),_:1,__:[11]})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Fi,{value:o.value.width&&o.value.width-a.value,max:c.value,min:f.settings.minWidth-a.value,placeholder:"Введите ширину светового проёма",class:"w-full","onUpdate:value":p[3]||(p[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(V.NFormItem),{required:!0,feedback:f.validation.height.feedback||"","show-feedback":f.validation.height.showFeedback||o.value.height>=f.settings.minHeight&&o.value.height<=f.settings.maxHeights[o.value.netType],"validation-status":f.validation.height.validationStatus||void 0,label:`Высота светового проёма от ${f.settings.minHeight-l.value} ${d.value?" до "+d.value:""} мм.`},{feedback:i.withCtx(()=>[!f.validation.height.showFeedback&&o.value.height>=f.settings.minHeight&&o.value.height<=f.settings.maxHeights[o.value.netType]?(i.openBlock(),i.createElementBlock("div",e0,[i.createVNode(i.unref(V.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(o.value.height+l.value),1)]),_:1}),i.createVNode(i.unref(V.NButton),{quaternary:"",type:"info",size:"tiny",onClick:p[6]||(p[6]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>p[12]||(p[12]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])),_:1,__:[12]})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Fi,{value:o.value.height&&o.value.height-l.value,max:d.value,min:f.settings.minHeight-l.value,placeholder:"Введите высоту светового проёма",class:"w-full","onUpdate:value":p[5]||(p[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(V.NFormItem),{required:!0,feedback:f.validation.quantity.feedback||"","show-feedback":f.validation.quantity.showFeedback||!1,"validation-status":f.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:f.value.quantity,"onUpdate:value":p[7]||(p[7]=m=>f.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(V.NFormItem),{feedback:f.validation.marker.feedback||"","show-feedback":f.validation.marker.showFeedback||!1,"validation-status":f.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(g,{value:f.value.marker,"onUpdate:value":p[8]||(p[8]=m=>f.value.marker=m),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(qi,{"is-product-searching":f.isProductSearching,product:f.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",t0,[i.createVNode(i.unref(V.NButton),{loading:f.isSubmitProcessing,disabled:f.isProductSearching||!f.value.product||f.value.product.isNewRec()||o.value.width<f.settings.minHeight-l.value||o.value.height<f.settings.minHeight-l.value,type:"primary",class:"self-start",onClick:p[9]||(p[9]=m=>r("submit",f.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,type:"default",onClick:p[10]||(p[10]=m=>r("click:show-preview-drawer"))},{default:i.withCtx(()=>p[13]||(p[13]=[i.createTextVNode(" Предварительный просмотр ")])),_:1,__:[13]})):i.createCommentVNode("",!0)])]),_:1})}}}),i0="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",r0="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",s0="/img/configurators/mosquitto/measurement-instructions/mount.png",o0="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",a0="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",l0={class:"flex flex-col gap-6"},c0={class:"flex gap-4"},d0={class:"flex flex-col gap-2"},h0={class:"flex gap-4"},u0={class:"flex flex-col gap-2"},f0={class:"flex gap-4"},p0={class:"flex flex-col gap-2"},g0={},Nc=i.defineComponent({...g0,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(e,{emit:t}){const n=pt.initRefDependingOnDeviceResolution("small","small","medium"),r=pt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=t;return(a,l)=>{const c=V.NText;return i.openBlock(),i.createBlock(i.unref(V.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",l0,[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:i0,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:r0,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",c0,[l[9]||(l[9]=i.createElementVNode("img",{src:s0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",d0,[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",h0,[l[15]||(l[15]=i.createElementVNode("img",{src:o0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",u0,[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",f0,[l[21]||(l[21]=i.createElementVNode("img",{src:a0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",p0,[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"])}}}),m0={class:"flex flex-col items-center justify-between rounded-xl"},_0={class:"img-preview relative flex justify-center"},y0={},b0=i.defineComponent({...y0,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(e,{emit:t}){const n=e,r=i.computed(()=>W.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=V.NButton;return i.openBlock(),i.createElementBlock("div",m0,[i.createElementVNode("div",_0,[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]})])}}}),lo=Ln(b0,[["__scopeId","data-v-8b43aa68"]]),w0={class:"grid md:grid-cols-2"},v0={},k0=i.defineComponent({...v0,__name:"mosquito-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>pt.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref({width:{},height:{},quantity:{},marker:{}}),d=i.ref(!1),h=i.ref(!1),u=async p=>{p.height>0&&p.width>0&&(d.value=!0,await G.HttpRequester.getInstance(G.ConfiguratorProvider).searchProduct(n.cartItem.category,p,c.value).then(g=>{l.value.product=g}).catch(()=>{d.value=!1}),d.value=!1)},f=async()=>{h.value=!0,await(l.value.isNewRec()?G.HttpRequester.getInstance(G.CartProvider).addCartItem(n.client,l.value).then(p=>{r("submit-success",p)}).catch(()=>{h.value=!1}):G.HttpRequester.getInstance(G.CartProvider).patchCartItem(n.client,l.value).then(p=>{r("submit-success",p)}).catch(()=>{h.value=!1})),h.value=!1};return(p,g)=>{const m=Br;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(Nc,{show:a.value,"onUpdate:show":g[0]||(g[0]=_=>a.value=_),"height-overlaps":p.settings.heightOverlaps,"width-overlaps":p.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",w0,[s.value?(i.openBlock(),i.createBlock(i.unref(V.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(V.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(V.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(lo,{"configurator-params":l.value.configuratorParams,settings:p.settings,onOpenInstructions:g[3]||(g[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(lo,{key:0,"configurator-params":l.value.configuratorParams,settings:p.settings,onOpenInstructions:g[1]||(g[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode($c,{value:l.value,"onUpdate:value":g[5]||(g[5]=_=>l.value=_),validation:c.value,settings:p.settings,"is-product-searching":d.value,"is-submit-processing":h.value,"onUpdate:params":g[6]||(g[6]=_=>u(_)),onSubmit:g[7]||(g[7]=_=>f()),"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)}}}),x0={},Pc=i.defineComponent({...x0,__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 u=$a,f=Ea;return i.openBlock(),i.createBlock(i.unref(V.NFormItem),{label:`Полоса №${d.index+1}, мм`,required:!0},{feedback:i.withCtx(()=>[i.createVNode(qi,{"is-product-searching":a.value,product:d.product},null,8,["is-product-searching","product"])]),default:i.withCtx(()=>[i.createVNode(i.unref(V.NDropdown),{trigger:"click",options:d.suggestionOption,placement:"bottom-start",size:"large",onSelect:l},{default:i.withCtx(()=>[i.createVNode(Fi,{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:p=>!!p&&p>=d.settings.minLineWidth&&p%d.settings.lineWidthStep===0,placeholder:"Введите ширину","onUpdate:value":l},null,8,["value","step","validator"])]),_:1},8,["options"]),i.createVNode(i.unref(V.NButton),{disabled:d.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[0]||(h[0]=p=>s("click:add-line",d.index))},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"]),i.createVNode(i.unref(V.NButton),{disabled:d.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[1]||(h[1]=p=>s("click:remove-line",d.index))},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"])]),_:1},8,["label"])}}}),C0={class:"my-2 flex w-full flex-col"},S0={class:"flex gap-3"},B0={},Rc=i.defineComponent({...B0,__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,u)=>h+u,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,u,f)=>{const p=n.value.at(u);if(p)if(h&&h>=n.settings.minLineWidth&&h%n.settings.lineWidthStep===0){const g={linesWidths:p.configuratorParams.linesWidths.toSpliced(u,1,h)};r("update:params",g,u,f),d("configuratorParams",g)}else p.product.id=-1},d=(h,u)=>{const f=n.value.map(p=>new G.CartItemBase(p));f.forEach(p=>{p[h]=u}),r("update:value",f)};return(h,u)=>{const f=V.NText,p=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.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(Pc,{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":u[0]||(u[0]=y=>r("click:add-line",y)),"onClick:removeLine":u[1]||(u[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",C0,[o.value<0?(i.openBlock(),i.createBlock(f,{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(f,{key:1,type:"error"},{default:i.withCtx(()=>u[8]||(u[8]=[i.createTextVNode(" Остаток резки должен быть равен 0 ")])),_:1,__:[8]})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[u[9]||(u[9]=i.createTextVNode(" Остаток для резки: ")),i.createVNode(f,{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(V.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value<=0||h.value.length>=h.settings.maxLinesCount,type:"primary",class:"self-center",onClick:u[2]||(u[2]=m=>r("click:add-line",h.value.length))},{default:i.withCtx(()=>u[10]||(u[10]=[i.createTextVNode(" Добавить полосу ")])),_:1,__:[10]},8,["loading","disabled"]),i.createVNode(i.unref(V.NFormItem),{required:!0,label:`Метраж ${h.settings.minLength?" от "+h.settings.minLength:""} ${h.settings.maxLength?" до "+h.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(V.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":u[3]||(u[3]=m=>d("length",m??0))},null,8,["value","max","min","step","validator"])]),_:1},8,["label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:n.value[0].quantity,min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full","onUpdate:value":u[4]||(u[4]=m=>d("quantity",m??0))},null,8,["value","validator"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(p,{value:n.value[0].marker,placeholder:"Введите маркировку","onUpdate:value":u[5]||(u[5]=m=>d("marker",m))},null,8,["value"])]),_:1}),i.createElementVNode("div",S0,[i.createVNode(i.unref(V.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:u[6]||(u[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(V.NButton),{key:0,type:"tertiary",class:"self-start",onClick:u[7]||(u[7]=m=>r("click:view-switch"))},{default:i.withCtx(()=>u[11]||(u[11]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[11]})):i.createCommentVNode("",!0)])]}),_:1})}}}),T0={class:"flex grow flex-col"},E0=["src"],$0={class:"w-full"},N0={},Fc=i.defineComponent({...N0,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",T0,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,E0),i.createElementVNode("div",$0,[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)])]))}}),P0={class:"w-104 flex grow flex-col px-5"},R0={},F0=i.defineComponent({...R0,__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(f=>f).reduce((f,p)=>f+p,0)),c=f=>{f===void 0&&(f=s.value.length-1);const p=s.value.at(0);if(!p)return;p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(f+1,0,0),s.value.forEach(m=>{m.configuratorParams.linesWidths=p.configuratorParams.linesWidths});const g=new G.CartItemBase({quantity:(p==null?void 0:p.quantity)??1,category:p==null?void 0:p.category,length:(p==null?void 0:p.length)??n.settings.minLength,marker:p==null?void 0:p.marker,configuratorParams:{linesWidths:p==null?void 0:p.configuratorParams.linesWidths}});s.value=s.value.toSpliced(f+1,0,g)},d=f=>{const p=s.value.at(0);p&&(p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(f,1),s.value.forEach(g=>{g.configuratorParams.linesWidths=p.configuratorParams.linesWidths}),s.value=s.value.toSpliced(f,1),delete o[`linesWidths.${f}`],delete o[`linesWidths.${f}`])},h=async(f,p,g)=>{g.value=!0,await G.HttpRequester.getInstance(G.ConfiguratorProvider).searchProduct(s.value[p].category,{linesWidths:f.linesWidths.at(p)},o.value).then(m=>{s.value[p].product=m,s.value.length<n.settings.maxLinesCount&&l.value<n.settings.width&&c()}).catch(()=>{s.value[p].product=new G.Product,g.value=!1}),g.value=!1},u=async()=>{a.value=!0,await(s.value[0].isNewRec()?G.HttpRequester.getInstance(G.CartProvider).addCartItem(n.client,s.value[0]).then(f=>{r("submit-success",f)}).catch(()=>{a.value=!1}):G.HttpRequester.getInstance(G.CartProvider).patchCartItem(n.client,s.value[0]).then(f=>{r("submit-success",f)}).catch(()=>{a.value=!1})),a.value=!1};return(f,p)=>(i.openBlock(),i.createElementBlock("div",P0,[i.createVNode(Fc,{value:s.value,"onUpdate:value":p[0]||(p[0]=g=>s.value=g),settings:f.settings},null,8,["value","settings"]),i.createVNode(Rc,{value:s.value,"onUpdate:value":p[1]||(p[1]=g=>s.value=g),validation:o.value,settings:f.settings,"is-submit-processing":a.value,"onUpdate:params":h,onSubmit:u,"onClick:addLine":c,"onClick:removeLine":d},null,8,["value","validation","settings","is-submit-processing"])]))}}),M0={class:"flex flex-row gap-2.5"},A0={class:"flex flex-col"},O0={class:"flex flex-col"},V0={},z0=i.defineComponent({...V0,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>G.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 W.forOwn(G.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?Sn.startOfDay(new Date(a)):void 0,to:l?Sn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,u,f,p;const c=V.NButton,d=V.NDatePicker;return i.openBlock(),i.createElementBlock("div",M0,[i.createVNode(d,{value:(u=(h=a.dateRange)==null?void 0:h.from)==null?void 0:u.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",A0,[(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:(p=(f=a.dateRange)==null?void 0:f.to)==null?void 0:p.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",O0,[(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"])])}}}),I0={class:"sc-lbl-date text-nowrap"},L0={},co=i.defineComponent({...L0,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>Sn.format(t.date,G.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Sn.format(t.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":s.isTimeOnSecondLine})},[i.createElementVNode("span",I0,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))}}),D0={class:"flex flex-row gap-2.5"},H0={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},W0={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},j0={class:"mb-0.5 sm:mb-0 sm:ml-3"},X0={},q0=i.defineComponent({...X0,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(e){return(t,n)=>{const r=Br,s=V.NButton,o=V.NPopover;return i.openBlock(),i.createElementBlock("div",D0,[i.createElementVNode("div",H0,[i.renderSlot(t.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",W0,[i.renderSlot(t.$slots,"extra-buttons"),i.createElementVNode("div",j0,[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)])])])])}}}),Y0={key:0,class:"flex flex-row gap-2.5"},U0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},G0={},K0=i.defineComponent({...G0,__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},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=pt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=pt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>window.innerWidth*c.value),h=()=>{s("opening"),o.value=!0,s("update:show",o.value)},u=(p="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let g=!1;s("closing",p,()=>{g=!0}),g||(o.value=!1,s("update:show",o.value))},f=()=>{s("accept",g=>{a.value=g})};return i.watch(()=>r.show,p=>{p?h():u("other")}),i.watch(()=>r.processing,p=>{a.value=p}),t({open:h,close:u}),(p,g)=>{const m=V.NButton,_=V.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:p.title,"action-class":p.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:g[1]||(g[1]=y=>u("header")),onEsc:g[2]||(g[2]=y=>u("esc")),onMaskClick:g[3]||(g[3]=y=>u("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(p.$slots,"default")]),_:2},[p.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(p.$slots,"header")]),key:"0"}:void 0,p.$slots.action||p.$slots["extra-action"]||p.acceptButton.show||p.cancelButton.show?{name:"action",fn:i.withCtx(()=>[p.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",Y0,[i.renderSlot(p.$slots,"extra-action")])):i.createCommentVNode("",!0),p.$slots.action||p.acceptButton.show||p.cancelButton.show?(i.openBlock(),i.createElementBlock("div",U0,[i.renderSlot(p.$slots,"action",{disabled:a.value}),p.acceptButton.show??!0?(i.openBlock(),i.createBlock(m,{key:0,disabled:a.value,size:i.unref(l),type:"primary",onClick:f},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(p.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),p.cancelButton.show??!0?(i.openBlock(),i.createBlock(m,{key:1,size:i.unref(l),type:"default",onClick:g[0]||(g[0]=y=>u("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(p.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","action-class"])}}}),Z0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function J0(e,t){return i.openBlock(),i.createElementBlock("svg",Z0,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 Q0=i.markRaw({name:"ion-download-outline",render:J0}),e_={},t_=i.defineComponent({...e_,__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=Q0,c=V.NUploadDragger,d=V.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})}}}),n_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function i_(e,t){return i.openBlock(),i.createElementBlock("svg",n_,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 r_=i.markRaw({name:"ion-checkmark-done-sharp",render:i_}),s_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function o_(e,t){return i.openBlock(),i.createElementBlock("svg",s_,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 a_=i.markRaw({name:"ion-options-outline",render:o_}),l_={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},c_={class:"flex-auto"},d_={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"},h_={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"},u_={},ho=i.defineComponent({...u_,__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=a_,u=V.NButton,f=V.NPopover,p=r_,g=Br;return i.openBlock(),i.createElementBlock("div",l_,[i.createElementVNode("div",c_,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",d_,[i.createElementVNode("div",h_,[c.showEditButton?(i.openBlock(),i.createBlock(f,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{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(f,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:c.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(p)]),_: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(f,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{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")])])])}}}),f_={},Mc=i.defineComponent({...f_,__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(ho,{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(ho,{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"]))]))}}),p_={},g_=i.defineComponent({...p_,__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=W.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(V.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:c.clearable,placeholder:c.placeholder},null,8,["value","clearable","placeholder"]))}}),m_={},__=i.defineComponent({...m_,__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=W.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(W.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(W.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof Wi.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=Wi.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof Wi.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(Ih.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"]))}}),y_=Ln(__,[["__scopeId","data-v-751dbb0e"]]),b_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function w_(e,t){return i.openBlock(),i.createElementBlock("svg",b_,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 v_=i.markRaw({name:"tabler-external-link",render:w_}),k_={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},x_=["href"],C_={},S_=i.defineComponent({...C_,__name:"external-link",props:{text:{},url:{},description:{}},setup(e){return(t,n)=>{const r=v_,s=V.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(W.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",k_,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,x_),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),B_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function T_(e,t){return i.openBlock(),i.createElementBlock("svg",B_,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 E_=i.markRaw({name:"ion-remove-circle-outline",render:T_});let Qr=[];const Ac=new WeakMap;function $_(){Qr.forEach(e=>e(...Ac.get(e))),Qr=[]}function Oc(e,...t){Ac.set(e,t),!Qr.includes(e)&&Qr.push(e)===1&&requestAnimationFrame($_)}function sr(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function or(e){return e.composedPath()[0]||null}function ar(e){return typeof e=="string"?e.endsWith("px")?Number(e.slice(0,e.length-2)):Number(e):e}function lr(e){if(e!=null)return typeof e=="number"?`${e}px`:e.endsWith("px")?e:`${e}px`}function Ht(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 Vc={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#F00",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function N_(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 P_(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 Qt="^\\s*",en="\\s*$",Pn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Ft="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",ni="([0-9A-Fa-f])",ii="([0-9A-Fa-f]{2})",zc=new RegExp(`${Qt}hsl\\s*\\(${Ft},${Pn},${Pn}\\)${en}`),Ic=new RegExp(`${Qt}hsv\\s*\\(${Ft},${Pn},${Pn}\\)${en}`),Lc=new RegExp(`${Qt}hsla\\s*\\(${Ft},${Pn},${Pn},${Ft}\\)${en}`),Dc=new RegExp(`${Qt}hsva\\s*\\(${Ft},${Pn},${Pn},${Ft}\\)${en}`),R_=new RegExp(`${Qt}rgb\\s*\\(${Ft},${Ft},${Ft}\\)${en}`),F_=new RegExp(`${Qt}rgba\\s*\\(${Ft},${Ft},${Ft},${Ft}\\)${en}`),M_=new RegExp(`${Qt}#${ni}${ni}${ni}${en}`),A_=new RegExp(`${Qt}#${ii}${ii}${ii}${en}`),O_=new RegExp(`${Qt}#${ni}${ni}${ni}${ni}${en}`),V_=new RegExp(`${Qt}#${ii}${ii}${ii}${ii}${en}`);function St(e){return parseInt(e,16)}function z_(e){try{let t;if(t=Lc.exec(e))return[ts(t[1]),Rn(t[5]),Rn(t[9]),si(t[13])];if(t=zc.exec(e))return[ts(t[1]),Rn(t[5]),Rn(t[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${e}.`)}catch(t){throw t}}function I_(e){try{let t;if(t=Dc.exec(e))return[ts(t[1]),Rn(t[5]),Rn(t[9]),si(t[13])];if(t=Ic.exec(e))return[ts(t[1]),Rn(t[5]),Rn(t[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${e}.`)}catch(t){throw t}}function ri(e){try{let t;if(t=A_.exec(e))return[St(t[1]),St(t[2]),St(t[3]),1];if(t=R_.exec(e))return[ct(t[1]),ct(t[5]),ct(t[9]),1];if(t=F_.exec(e))return[ct(t[1]),ct(t[5]),ct(t[9]),si(t[13])];if(t=M_.exec(e))return[St(t[1]+t[1]),St(t[2]+t[2]),St(t[3]+t[3]),1];if(t=V_.exec(e))return[St(t[1]),St(t[2]),St(t[3]),si(St(t[4])/255)];if(t=O_.exec(e))return[St(t[1]+t[1]),St(t[2]+t[2]),St(t[3]+t[3]),si(St(t[4]+t[4])/255)];if(e in Vc)return ri(Vc[e]);if(zc.test(e)||Lc.test(e)){const[n,r,s,o]=z_(e);return[...P_(n,r,s),o]}else if(Ic.test(e)||Dc.test(e)){const[n,r,s,o]=I_(e);return[...N_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(t){throw t}}function L_(e){return e>1?1:e<0?0:e}function uo(e,t,n,r){return`rgba(${ct(e)}, ${ct(t)}, ${ct(n)}, ${L_(r)})`}function fo(e,t,n,r,s){return ct((e*t*(1-r)+n*r)/s)}function D_(e,t){Array.isArray(e)||(e=ri(e)),Array.isArray(t)||(t=ri(t));const n=e[3],r=t[3],s=si(n+r-n*r);return uo(fo(e[0],n,t[0],r,s),fo(e[1],n,t[1],r,s),fo(e[2],n,t[2],r,s),s)}function Re(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:ri(e);return typeof t.alpha=="number"?uo(n,r,s,t.alpha):uo(n,r,s,o)}function es(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:ri(e),{lightness:a=1,alpha:l=1}=t;return H_([n*a,r*a,s*a,o*l])}function si(e){const t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function ts(e){const t=Math.round(Number(e));return t>=360||t<0?0:t}function ct(e){const t=Math.round(Number(e));return t>255?255:t<0?0:t}function Rn(e){const t=Math.round(Number(e));return t>100?100:t<0?0:t}function H_(e){const[t,n,r]=e;return 3 in e?`rgba(${ct(t)}, ${ct(n)}, ${ct(r)}, ${si(e[3])})`:`rgba(${ct(t)}, ${ct(n)}, ${ct(r)}, 1)`}function W_(e=8){return Math.random().toString(16).slice(2,2+e)}function Hc(e){return Array.isArray(e)?e:[e]}const po={STOP:"STOP"};function Wc(e,t){const n=t(e);e.children!==void 0&&n!==po.STOP&&e.children.forEach(r=>Wc(r,t))}function j_(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 X_(e,t){const{isLeaf:n}=e;return n!==void 0?n:!t(e)}function q_(e){return e.children}function Y_(e){return e.key}function U_(){return!1}function G_(e,t){const{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function K_(e){return e.disabled===!0}function Z_(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function J_(e,t){if(e.isLeaf===!0){const n=t(e);if(Array.isArray(n)&&n.length>0)return!0}return!1}function go(e){var t;return e==null?[]:Array.isArray(e)?e:(t=e.checkedKeys)!==null&&t!==void 0?t:[]}function mo(e){var t;return e==null||Array.isArray(e)?[]:(t=e.indeterminateKeys)!==null&&t!==void 0?t:[]}function Q_(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function ey(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function ty(e){return(e==null?void 0:e.type)==="group"}function ny(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 iy extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function ry(e,t,n,r){return ns(t.concat(e),n,r,!1)}function sy(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 oy(e,t,n,r){const s=ns(t,n,r,!1),o=ns(e,n,r,!0),a=sy(e,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function _o(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:Q_(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:ey(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=t;let u;s!==void 0?u=oy(s,n,t,d):r!==void 0?u=ry(r,n,t,d):u=ns(n,t,d,!1);const f=c==="parent",p=c==="child"||l,g=u,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 x of S){if(x.isLeaf)continue;const{key:C,shallowLoaded:B}=x;if(p&&B&&x.children.forEach(R=>{!R.disabled&&!R.isLeaf&&R.shallowLoaded&&g.has(R.key)&&g.delete(R.key)}),x.disabled||!B)continue;let v=!0,$=!1,F=!0;for(const R of x.children){const X=R.key;if(!R.disabled){if(F&&(F=!1),g.has(X))$=!0;else if(m.has(X)){$=!0,v=!1;break}else if(v=!1,$)break}}v&&!F?(f&&x.children.forEach(R=>{!R.disabled&&g.has(R.key)&&g.delete(R.key)}),g.add(C)):$&&m.add(C),b&&p&&g.has(C)&&g.delete(C)}}return{checkedKeys:Array.from(g),indeterminateKeys:Array.from(m)}}function ns(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&&Wc(d,h=>{if(h.disabled)return po.STOP;const{key:u}=h;if(!a.has(u)&&(a.add(u),l.add(u),Z_(h.rawNode,o))){if(r)return po.STOP;if(!n)throw new iy}})}),l}function ay(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 ly(e){if(e.length===0)return null;const t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function cy(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 jc(e,t,{loop:n=!1,includeDisabled:r=!1}={}){const s=t==="prev"?dy:cy,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=yo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const u=hy(d);u!=null&&u.isGroup?c(s(u,n)):n&&c(s(d,!0))}}}}return c(e),l}function dy(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 hy(e){return e.parent}function yo(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=yo(d,t);if(h!==null)return h}else return d}}return null}const uy={getChild(){return this.ignored?null:yo(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return jc(this,"next",e)},getPrev(e={}){return jc(this,"prev",e)}};function fy(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 py(e,t){const n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}var gy={};function Xc(e,t,n,r,s,o=null,a=0){const l=[];return e.forEach((c,d)=>{var h;gy.NODE_ENV!=="production"&&J_(c,s)&&console.error("[treemate]: node",c,"is invalid");const u=Object.create(r);if(u.rawNode=c,u.siblings=l,u.level=a,u.index=d,u.isFirstChild=d===0,u.isLastChild=d+1===e.length,u.parent=o,!u.ignored){const f=s(c);Array.isArray(f)&&(u.children=Xc(f,t,n,r,s,u,a+1))}l.push(u),t.set(u.key,u),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(u)}),l}function my(e,t={}){var n;const r=new Map,s=new Map,{getDisabled:o=K_,getIgnored:a=U_,getIsGroup:l=ty,getKey:c=Y_}=t,d=(n=t.getChildren)!==null&&n!==void 0?n:q_,h=t.ignoreEmptyChildren?x=>{const C=d(x);return Array.isArray(C)?C.length?C:null:C}:d,u=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return X_(this.rawNode,h)},get shallowLoaded(){return G_(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(x){return py(this,x)}},uy),f=Xc(e,r,s,u,h);function p(x){if(x==null)return null;const C=r.get(x);return C&&!C.isGroup&&!C.ignored?C:null}function g(x){if(x==null)return null;const C=r.get(x);return C&&!C.ignored?C:null}function m(x,C){const B=g(x);return B?B.getPrev(C):null}function _(x,C){const B=g(x);return B?B.getNext(C):null}function y(x){const C=g(x);return C?C.getParent():null}function b(x){const C=g(x);return C?C.getChild():null}const S={treeNodes:f,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(x){return fy(f,x)},getNode:p,getPrev:m,getNext:_,getParent:y,getChild:b,getFirstAvailableNode(){return ly(f)},getPath(x,C={}){return ay(x,C,S)},getCheckedKeys(x,C={}){const{cascade:B=!0,leafOnly:v=!1,checkStrategy:$="all",allowNotLoaded:F=!1}=C;return _o({checkedKeys:go(x),indeterminateKeys:mo(x),cascade:B,leafOnly:v,checkStrategy:$,allowNotLoaded:F},S)},check(x,C,B={}){const{cascade:v=!0,leafOnly:$=!1,checkStrategy:F="all",allowNotLoaded:R=!1}=B;return _o({checkedKeys:go(C),indeterminateKeys:mo(C),keysToCheck:x==null?[]:Hc(x),cascade:v,leafOnly:$,checkStrategy:F,allowNotLoaded:R},S)},uncheck(x,C,B={}){const{cascade:v=!0,leafOnly:$=!1,checkStrategy:F="all",allowNotLoaded:R=!1}=B;return _o({checkedKeys:go(C),indeterminateKeys:mo(C),keysToUncheck:x==null?[]:Hc(x),cascade:v,leafOnly:$,checkStrategy:F,allowNotLoaded:R},S)},getNonLeafKeys(x={}){return j_(f,x)}};return S}function is(e){return e.composedPath()[0]}const _y={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function yy(e,t,n){if(e==="mousemoveoutside"){const r=s=>{t.contains(is(s))||n(s)};return{mousemove:r,touchstart:r}}else if(e==="clickoutside"){let r=!1;const s=a=>{r=!t.contains(is(a))},o=a=>{r&&(t.contains(is(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 qc(e,t,n){const r=_y[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=yy(e,t,n)),o}function by(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=qc(e,t,n);return Object.keys(s).forEach(o=>{bt(o,document,s[o],r)}),!0}return!1}function wy(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=qc(e,t,n);return Object.keys(s).forEach(o=>{Qe(o,document,s[o],r)}),!0}return!1}function vy(){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(v,$,F){const R=v[$];return v[$]=function(){return F.apply(v,arguments),R.apply(v,arguments)},v}function o(v,$){v[$]=Event.prototype[$]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var v;return(v=a.get(this))!==null&&v!==void 0?v:null}function d(v,$){l!==void 0&&Object.defineProperty(v,"currentTarget",{configurable:!0,enumerable:!0,get:$??l.get})}const h={bubble:{},capture:{}},u={};function f(){const v=function($){const{type:F,eventPhase:R,bubbles:X}=$,M=is($);if(R===2)return;const N=R===1?"capture":"bubble";let A=M;const L=[];for(;A===null&&(A=window),L.push(A),A!==window;)A=A.parentNode||null;const Y=h.capture[F],P=h.bubble[F];if(s($,"stopPropagation",n),s($,"stopImmediatePropagation",r),d($,c),N==="capture"){if(Y===void 0)return;for(let E=L.length-1;E>=0&&!e.has($);--E){const H=L[E],I=Y.get(H);if(I!==void 0){a.set($,H);for(const U of I){if(t.has($))break;U($)}}if(E===0&&!X&&P!==void 0){const U=P.get(H);if(U!==void 0)for(const O of U){if(t.has($))break;O($)}}}}else if(N==="bubble"){if(P===void 0)return;for(let E=0;E<L.length&&!e.has($);++E){const H=L[E],I=P.get(H);if(I!==void 0){a.set($,H);for(const U of I){if(t.has($))break;U($)}}}}o($,"stopPropagation"),o($,"stopImmediatePropagation"),d($)};return v.displayName="evtdUnifiedHandler",v}function p(){const v=function($){const{type:F,eventPhase:R}=$;if(R!==2)return;const X=u[F];X!==void 0&&X.forEach(M=>M($))};return v.displayName="evtdUnifiedWindowEventHandler",v}const g=f(),m=p();function _(v,$){const F=h[v];return F[$]===void 0&&(F[$]=new Map,window.addEventListener($,g,v==="capture")),F[$]}function y(v){return u[v]===void 0&&(u[v]=new Set,window.addEventListener(v,m)),u[v]}function b(v,$){let F=v.get($);return F===void 0&&v.set($,F=new Set),F}function S(v,$,F,R){const X=h[$][F];if(X!==void 0){const M=X.get(v);if(M!==void 0&&M.has(R))return!0}return!1}function x(v,$){const F=u[v];return!!(F!==void 0&&F.has($))}function C(v,$,F,R){let X;if(typeof R=="object"&&R.once===!0?X=Y=>{B(v,$,X,R),F(Y)}:X=F,by(v,$,X,R))return;const N=R===!0||typeof R=="object"&&R.capture===!0?"capture":"bubble",A=_(N,v),L=b(A,$);if(L.has(X)||L.add(X),$===window){const Y=y(v);Y.has(X)||Y.add(X)}}function B(v,$,F,R){if(wy(v,$,F,R))return;const M=R===!0||typeof R=="object"&&R.capture===!0,N=M?"capture":"bubble",A=_(N,v),L=b(A,$);if($===window&&!S($,M?"bubble":"capture",v,F)&&x(v,F)){const P=u[v];P.delete(F),P.size===0&&(window.removeEventListener(v,m),u[v]=void 0)}L.has(F)&&L.delete(F),L.size===0&&A.delete($),A.size===0&&(window.removeEventListener(v,g,N==="capture"),h[N][v]=void 0)}return{on:C,off:B}}const{on:bt,off:Qe}=vy(),Mi="@@mmoContext",ky={mounted(e,{value:t}){e[Mi]={handler:void 0},typeof t=="function"&&(e[Mi].handler=t,bt("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[Mi];typeof t=="function"?n.handler?n.handler!==t&&(Qe("mousemoveoutside",e,n.handler),n.handler=t,bt("mousemoveoutside",e,t)):(e[Mi].handler=t,bt("mousemoveoutside",e,t)):n.handler&&(Qe("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[Mi];t&&Qe("mousemoveoutside",e,t),e[Mi].handler=void 0}},Ai="@@coContext",rs={mounted(e,{value:t,modifiers:n}){e[Ai]={handler:void 0},typeof t=="function"&&(e[Ai].handler=t,bt("clickoutside",e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){const r=e[Ai];typeof t=="function"?r.handler?r.handler!==t&&(Qe("clickoutside",e,r.handler,{capture:n.capture}),r.handler=t,bt("clickoutside",e,t,{capture:n.capture})):(e[Ai].handler=t,bt("clickoutside",e,t,{capture:n.capture})):r.handler&&(Qe("clickoutside",e,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:n}=e[Ai];n&&Qe("clickoutside",e,n,{capture:t.capture}),e[Ai].handler=void 0}};function xy(e,t){console.error(`[vdirs/${e}]: ${t}`)}class Cy{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&&xy("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 bo=new Cy,Oi="@@ziContext",Yc={mounted(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n;e[Oi]={enabled:!!s,initialized:!1},s&&(bo.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&&(bo.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;bo.unregister(e,r)}};function Sy(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 zt(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 By=typeof window<"u";let Vi,cr;(()=>{var e,t;Vi=By?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,cr=!1,Vi!==void 0?Vi.then(()=>{cr=!0}):cr=!0})();function Ty(e){if(cr)return;let t=!1;i.onMounted(()=>{cr||Vi==null||Vi.then(()=>{t||e()})}),i.onBeforeUnmount(()=>{t=!0})}function wo(e,t){return i.watch(e,n=>{n!==void 0&&(t.value=n)}),i.computed(()=>e.value===void 0?t.value:e.value)}function ss(){const e=i.ref(!1);return i.onMounted(()=>{e.value=!0}),i.readonly(e)}function Uc(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 Ey=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function $y(){return Ey}function vo(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function ko(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)){ko(r,t,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ko(r.children,t,n)}else r.type!==i.Comment&&n.push(r)}}),n}function Gc(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);const s=ko(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}let Fn=null;function Kc(){if(Fn===null&&(Fn=document.getElementById("v-binder-view-measurer"),Fn===null)){Fn=document.createElement("div"),Fn.id="v-binder-view-measurer";const{style:e}=Fn;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(Fn)}return Fn.getBoundingClientRect()}function Ny(e,t){const n=Kc();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function xo(e){const t=e.getBoundingClientRect(),n=Kc();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 Py(e){return e.nodeType===9?null:e.parentNode}function Zc(e){if(e===null)return null;const t=Py(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 Zc(t)}const Jc=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=Zc(y),y!==null;)o.push(y);for(const b of o)bt("scroll",b,u,!0)},l=()=>{for(const y of o)Qe("scroll",y,u,!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()},u=()=>{Oc(f)},f=()=>{c.forEach(y=>y())},p=new Set,g=y=>{p.size===0&&bt("resize",window,_),p.has(y)||p.add(y)},m=y=>{p.has(y)&&p.delete(y),p.size===0&&Qe("resize",window,_)},_=()=>{p.forEach(y=>y())};return i.onBeforeUnmount(()=>{Qe("resize",window,_),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:g,removeResizeListener:m}},render(){return vo("binder",this.$slots)}}),Qc=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(Gc("follower",this.$slots),[[t]]):Gc("follower",this.$slots)}}),Ry="@css-render/vue3-ssr";function Fy(e,t){return`<style cssr-id="${e}">
|
104
104
|
${t}
|
105
|
-
</style>`}function My(e,t,n){const{styles:r,ids:s}=n;s.has(e)||r!==null&&(s.add(e),r.push(Fy(e,t)))}const Ay=typeof document<"u";function
|
106
|
-
`+Object.entries(e).map(n=>t+` ${
|
105
|
+
</style>`}function My(e,t,n){const{styles:r,ids:s}=n;s.has(e)||r!==null&&(s.add(e),r.push(Fy(e,t)))}const Ay=typeof document<"u";function oi(){if(Ay)return;const e=i.inject(Ry,null);if(e!==null)return{adapter:(t,n)=>My(t,n,e),context:e}}function ed(e,t){console.error(`[vueuc/${e}]: ${t}`)}function Oy(e){let t=0;for(let n=0;n<e.length;++n)e[n]==="&"&&++t;return t}const td=/\s*,(?![^(]*\))\s*/g,Vy=/\s+/g;function zy(e,t){const n=[];return t.split(td).forEach(r=>{let s=Oy(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 Iy(e,t){const n=[];return t.split(td).forEach(r=>{e.forEach(s=>{n.push((s&&s+" ")+r)})}),n}function Ly(e){let t=[""];return e.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?t=zy(t,n):t=Iy(t,n))}),t.join(", ").replace(Vy," ")}function nd(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function os(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function Dy(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function as(e){return e?/^\s*@(s|m)/.test(e):!1}const Hy=/[A-Z]/g;function id(e){return e.replace(Hy,t=>"-"+t.toLowerCase())}function Wy(e,t=" "){return typeof e=="object"&&e!==null?` {
|
106
|
+
`+Object.entries(e).map(n=>t+` ${id(n[0])}: ${n[1]};`).join(`
|
107
107
|
`)+`
|
108
|
-
`+t+"}":`: ${e};`}function jy(e,t,n){return typeof e=="function"?e({context:t.context,props:n}):e}function
|
108
|
+
`+t+"}":`: ${e};`}function jy(e,t,n){return typeof e=="function"?e({context:t.context,props:n}):e}function rd(e,t,n,r){if(!t)return"";const s=jy(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=
|
114
|
-
`)}function
|
113
|
+
`);return}l=id(l),c!=null&&a.push(` ${l}${Wy(c)}`)}),e&&a.push("}"),a.join(`
|
114
|
+
`)}function Co(e,t,n){e&&e.forEach(r=>{if(Array.isArray(r))Co(r,t,n);else if(typeof r=="function"){const s=r(t);Array.isArray(s)?Co(s,t,n):s&&n(s)}else r&&n(r)})}function sd(e,t,n,r,s){const o=e.$;let a="";if(!o||typeof o=="string")as(o)?a=o:t.push(o);else if(typeof o=="function"){const d=o({context:r.context,props:s});as(d)?a=d:t.push(d)}else if(o.before&&o.before(r.context),!o.$||typeof o.$=="string")as(o.$)?a=o.$:t.push(o.$);else if(o.$){const d=o.$({context:r.context,props:s});as(d)?a=d:t.push(d)}const l=Ly(t),c=rd(l,e.props,r,s);a?n.push(`${a} {`):c.length&&n.push(c),e.children&&Co(e.children,{context:r.context,props:s},d=>{if(typeof d=="string"){const h=rd(l,{raw:d},r,s);n.push(h)}else sd(d,t,n,r,s)}),t.pop(),a&&n.push("}"),o&&o.after&&o.after(r.context)}function Xy(e,t,n){const r=[];return sd(e,[],r,t,n),r.join(`
|
115
115
|
|
116
|
-
`)}function Bo(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 qy(e,t,n,r){const{els:s}=t;if(n===void 0)s.forEach(id),t.els=[];else{const o=as(n,r);o&&s.includes(o)&&(id(o),t.els=s.filter(a=>a!==o))}}function ad(e,t){e.push(t)}function Yy(e,t,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=t.render(r),n=Bo(d)),c){c.adapter(n,d??t.render(r));return}l===void 0&&(l=document.head);const h=as(n,l);if(h!==null&&!o)return h;const u=h??Dy(n);if(d===void 0&&(d=t.render(r)),u.textContent=d,h!==null)return h;if(a){const f=l.querySelector(`meta[name="${a}"]`);if(f)return l.insertBefore(u,f),ad(t.els,u),u}return s?l.insertBefore(u,l.querySelector("style, link")):l.appendChild(u),ad(t.els,u),u}function Uy(e){return Xy(this,this.instance,e)}function Gy(e={}){const{id:t,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=e;return Yy(this.instance,this,t,r,s,o,a,l,n)}function Ky(e={}){const{id:t,parent:n}=e;qy(this.instance,this,t,n)}const cs=function(e,t,n,r){return{instance:e,$:t,props:n,children:r,els:[],render:Uy,mount:Gy,unmount:Ky}},Zy=function(e,t,n,r){return Array.isArray(t)?cs(e,{$:null},null,t):Array.isArray(n)?cs(e,t,null,n):Array.isArray(r)?cs(e,t,n,r):cs(e,t,n,null)};function ld(e={}){const t={c:(...n)=>Zy(t,...n),use:(n,...r)=>n.install(t,...r),find:as,context:{},config:e};return t}function Jy(e,t){if(e===void 0)return!1;if(t){const{context:{ids:n}}=t;return n.has(e)}return as(e)!==null}const{c:An}=ld(),To="vueuc-style";function cd(e){return e&-e}class dd{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+=cd(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-=cd(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 hd(e){return typeof e=="string"?document.querySelector(e):e()}const Qy=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(e){return{showTeleport:Sy(i.toRef(e,"show")),mergedTo:i.computed(()=>{const{to:t}=e;return t??"body"})}},render(){return this.showTeleport?this.disabled?ko("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},ko("lazy-teleport",this.$slots)):null}}),ds={top:"bottom",bottom:"top",left:"right",right:"left"},ud={start:"end",center:"center",end:"start"},Eo={top:"height",bottom:"height",left:"width",right:"width"},eb={"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"},tb={"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"},nb={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},fd={top:!0,bottom:!1,left:!0,right:!1},pd={top:"end",bottom:"start",left:"end",right:"start"};function ib(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=(p,g,m)=>{let _=0,y=0;const b=n[p]-t[g]-t[p];return b>0&&r&&(m?y=fd[g]?b:-b:_=fd[g]?b:-b),{left:_,top:y}},u=a==="left"||a==="right";if(c!=="center"){const p=nb[e],g=ds[p],m=Eo[p];if(n[m]>t[m]){if(t[p]+t[m]<n[m]){const _=(n[m]-t[m])/2;t[p]<_||t[g]<_?t[p]<t[g]?(c=ud[l],d=h(m,g,u)):d=h(m,p,u):c="center"}}else n[m]<t[m]&&t[g]<0&&t[p]>t[g]&&(c=ud[l])}else{const p=a==="bottom"||a==="top"?"left":"top",g=ds[p],m=Eo[p],_=(n[m]-t[m])/2;(t[p]<_||t[g]<_)&&(t[p]>t[g]?(c=pd[p],d=h(m,p,u)):(c=pd[g],d=h(m,g,u)))}let f=a;return t[a]<n[Eo[a]]&&t[a]<t[ds[a]]&&(f=ds[a]),{placement:c!=="center"?`${f}-${c}`:f,left:d.left,top:d.top}}function rb(e,t){return t?tb[e]:eb[e]}function sb(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 ob=An([An(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),An(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[An("> *",{pointerEvents:"all"})])]),gd=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=It(()=>e.enabled!==void 0?e.enabled:e.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:f}=e;f.includes("scroll")&&t.addScrollListener(c),f.includes("resize")&&t.addResizeListener(c)},a=()=>{t.removeScrollListener(c),t.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=ai();ob.mount({id:"vueuc/binder",head:!0,anchorMetaName:To,ssr:l}),i.onBeforeUnmount(()=>{a()}),Ty(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const f=r.value;if(f===null)return;const p=t.targetRef,{x:g,y:m,overlap:_}=e,y=g!==void 0&&m!==void 0?Ny(g,m):Co(p);f.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),f.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:b,minWidth:S,placement:x,internalShift:C,flip:B}=e;f.setAttribute("v-placement",x),_?f.setAttribute("v-overlap",""):f.removeAttribute("v-overlap");const{style:v}=f;b==="target"?v.width=`${y.width}px`:b!==void 0?v.width=b:v.width="",S==="target"?v.minWidth=`${y.width}px`:S!==void 0?v.minWidth=S:v.minWidth="";const $=Co(f),F=Co(s.value),{left:R,top:q,placement:M}=ib(x,y,$,C,B,_),N=rb(M,_),{left:A,top:L,transform:Y}=sb(M,F,y,q,R,_);f.setAttribute("v-placement",M),f.style.setProperty("--v-offset-left",`${Math.round(R)}px`),f.style.setProperty("--v-offset-top",`${Math.round(q)}px`),f.style.transform=`translateX(${A}) translateY(${L}) ${Y}`,f.style.setProperty("--v-transform-origin",N),f.style.transformOrigin=N};i.watch(n,f=>{f?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(f=>console.error(f))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(f=>{i.watch(i.toRef(e,f),c)}),["teleportDisabled"].forEach(f=>{i.watch(i.toRef(e,f),d)}),i.watch(i.toRef(e,"syncTrigger"),f=>{f.includes("resize")?t.addResizeListener(c):t.removeResizeListener(c),f.includes("scroll")?t.addScrollListener(c):t.removeScrollListener(c)});const h=os(),u=It(()=>{const{to:f}=e;if(f!==void 0)return f;h.value});return{VBinder:t,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:u,syncPosition:c}},render(){return i.h(Qy,{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,[[Uc,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var li=[],ab=function(){return li.some(function(e){return e.activeTargets.length>0})},lb=function(){return li.some(function(e){return e.skippedTargets.length>0})},md="ResizeObserver loop completed with undelivered notifications.",cb=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:md}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=md),window.dispatchEvent(e)},hr;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(hr||(hr={}));var ci=function(e){return Object.freeze(e)},db=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,ci(this)}return e}(),_d=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,ci(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}(),$o=function(e){return e instanceof SVGElement&&"getBBox"in e},yd=function(e){if($o(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)},bd=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)},hb=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},ur=typeof window<"u"?window:{},hs=new WeakMap,wd=/auto|scroll/,ub=/^tb|vertical/,fb=/msie|trident/i.test(ur.navigator&&ur.navigator.userAgent),nn=function(e){return parseFloat(e||"0")},Ii=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new db((n?t:e)||0,(n?e:t)||0)},vd=ci({devicePixelContentBoxSize:Ii(),borderBoxSize:Ii(),contentBoxSize:Ii(),contentRect:new _d(0,0,0,0)}),kd=function(e,t){if(t===void 0&&(t=!1),hs.has(e)&&!t)return hs.get(e);if(yd(e))return hs.set(e,vd),vd;var n=getComputedStyle(e),r=$o(e)&&e.ownerSVGElement&&e.getBBox(),s=!fb&&n.boxSizing==="border-box",o=ub.test(n.writingMode||""),a=!r&&wd.test(n.overflowY||""),l=!r&&wd.test(n.overflowX||""),c=r?0:nn(n.paddingTop),d=r?0:nn(n.paddingRight),h=r?0:nn(n.paddingBottom),u=r?0:nn(n.paddingLeft),f=r?0:nn(n.borderTopWidth),p=r?0:nn(n.borderRightWidth),g=r?0:nn(n.borderBottomWidth),m=r?0:nn(n.borderLeftWidth),_=u+d,y=c+h,b=m+p,S=f+g,x=l?e.offsetHeight-S-e.clientHeight:0,C=a?e.offsetWidth-b-e.clientWidth:0,B=s?_+b:0,v=s?y+S:0,$=r?r.width:nn(n.width)-B-C,F=r?r.height:nn(n.height)-v-x,R=$+_+C+b,q=F+y+x+S,M=ci({devicePixelContentBoxSize:Ii(Math.round($*devicePixelRatio),Math.round(F*devicePixelRatio),o),borderBoxSize:Ii(R,q,o),contentBoxSize:Ii($,F,o),contentRect:new _d(u,c,$,F)});return hs.set(e,M),M},xd=function(e,t,n){var r=kd(e,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case hr.DEVICE_PIXEL_CONTENT_BOX:return a;case hr.BORDER_BOX:return s;default:return o}},pb=function(){function e(t){var n=kd(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=ci([n.borderBoxSize]),this.contentBoxSize=ci([n.contentBoxSize]),this.devicePixelContentBoxSize=ci([n.devicePixelContentBoxSize])}return e}(),Cd=function(e){if(yd(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},gb=function(){var e=1/0,t=[];li.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var h=new pb(d.target),u=Cd(d.target);l.push(h),d.lastReportedSize=xd(d.target,d.observedBox),u<e&&(e=u)}),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},Sd=function(e){li.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(Cd(s.target)>e?n.activeTargets.push(s):n.skippedTargets.push(s))})})},mb=function(){var e=0;for(Sd(e);ab();)e=gb(),Sd(e);return lb()&&cb(),e>0},No,Bd=[],_b=function(){return Bd.splice(0).forEach(function(e){return e()})},yb=function(e){if(!No){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return _b()}).observe(n,r),No=function(){n.textContent="".concat(t?t--:t++)}}Bd.push(e),No()},bb=function(e){yb(function(){requestAnimationFrame(e)})},us=0,wb=function(){return!!us},vb=250,kb={attributes:!0,characterData:!0,childList:!0,subtree:!0},Td=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Ed=function(e){return e===void 0&&(e=0),Date.now()+e},Po=!1,xb=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=vb),!Po){Po=!0;var r=Ed(t);bb(function(){var s=!1;try{s=mb()}finally{if(Po=!1,t=r-Ed(),!wb())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,kb)};document.body?n():ur.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Td.forEach(function(n){return ur.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Td.forEach(function(n){return ur.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),Ro=new xb,$d=function(e){!us&&e>0&&Ro.start(),us+=e,!us&&Ro.stop()},Cb=function(e){return!$o(e)&&!hb(e)&&getComputedStyle(e).display==="inline"},Sb=function(){function e(t,n){this.target=t,this.observedBox=n||hr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=xd(this.target,this.observedBox,!0);return Cb(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Bb=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),fs=new WeakMap,Nd=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},ps=function(){function e(){}return e.connect=function(t,n){var r=new Bb(t,n);fs.set(t,r)},e.observe=function(t,n,r){var s=fs.get(t),o=s.observationTargets.length===0;Nd(s.observationTargets,n)<0&&(o&&li.push(s),s.observationTargets.push(new Sb(n,r&&r.box)),$d(1),Ro.schedule())},e.unobserve=function(t,n){var r=fs.get(t),s=Nd(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&li.splice(li.indexOf(r),1),r.observationTargets.splice(s,1),$d(-1))},e.disconnect=function(t){var n=this,r=fs.get(t);r.observationTargets.slice().forEach(function(s){return n.unobserve(t,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Tb=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.");ps.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(!bd(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ps.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(!bd(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ps.unobserve(this,t)},e.prototype.disconnect=function(){ps.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();class Eb{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Tb)(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 fr=new Eb,gs=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){td("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){td("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(fr.registerHandler(s.nextElementSibling,r),t=!0)}),i.onBeforeUnmount(()=>{t&&fr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let ms;function $b(){return typeof document>"u"?!1:(ms===void 0&&("matchMedia"in window?ms=window.matchMedia("(pointer:coarse)").matches:ms=!1),ms)}let Fo;function Pd(){return typeof document>"u"?1:(Fo===void 0&&(Fo="chrome"in window?window.devicePixelRatio:1),Fo)}const Rd="VVirtualListXScroll";function Nb({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 dd(d.length,0);return d.forEach((u,f)=>{h.add(f,u.width)}),h}),a=It(()=>{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=It(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,e.value.length-1):0});return i.provide(Rd,{startIndexRef:a,endIndexRef:c,columnsRef:e,renderColRef:t,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Fd=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(Rd);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}}),Pb=An(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[An("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[An("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Rb=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=ai();Pb.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:To,ssr:t}),i.onMounted(()=>{const{defaultScrollIndex:N,defaultScrollKey:A}=e;N!=null?_({index:N}):A!=null&&_({key:A})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}_({top:p.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=It(()=>{if(e.renderCol==null&&e.renderItemWithCols==null||e.columns.length===0)return;let N=0;return e.columns.forEach(A=>{N+=A.width}),N}),o=i.computed(()=>{const N=new Map,{keyField:A}=e;return e.items.forEach((L,Y)=>{N.set(L[A],Y)}),N}),{scrollLeftRef:a,listWidthRef:l}=Nb({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,u=i.computed(()=>{const{items:N,itemSize:A,keyField:L}=e,Y=new dd(N.length,A);return N.forEach((P,E)=>{const H=P[L],I=h.get(H);I!==void 0&&Y.add(E,I)}),Y}),f=i.ref(0),p=i.ref(0),g=It(()=>Math.max(u.value.getBound(p.value-lr(e.paddingTop))-1,0)),m=i.computed(()=>{const{value:N}=d;if(N===void 0)return[];const{items:A,itemSize:L}=e,Y=g.value,P=Math.min(Y+Math.ceil(N/L+1),A.length-1),E=[];for(let H=Y;H<=P;++H)E.push(A[H]);return E}),_=(N,A)=>{if(typeof N=="number"){x(N,A,"auto");return}const{left:L,top:Y,index:P,key:E,position:H,behavior:I,debounce:U=!0}=N;if(L!==void 0||Y!==void 0)x(L,Y,I);else if(P!==void 0)S(P,I,U);else if(E!==void 0){const O=o.value.get(E);O!==void 0&&S(O,I,U)}else H==="bottom"?x(0,Number.MAX_SAFE_INTEGER,I):H==="top"&&x(0,0,I)};let y,b=null;function S(N,A,L){const{value:Y}=u,P=Y.sum(N)+lr(e.paddingTop);if(!L)c.value.scrollTo({left:0,top:P,behavior:A});else{y=N,b!==null&&window.clearTimeout(b),b=window.setTimeout(()=>{y=void 0,b=null},16);const{scrollTop:E,offsetHeight:H}=c.value;if(P>E){const I=Y.get(N);P+I<=E+H||c.value.scrollTo({left:0,top:P+I-H,behavior:A})}else c.value.scrollTo({left:0,top:P,behavior:A})}}function x(N,A,L){c.value.scrollTo({left:N,top:A,behavior:L})}function C(N,A){var L,Y,P;if(n||e.ignoreItemResize||M(A.target))return;const{value:E}=u,H=o.value.get(N),I=E.get(H),U=(P=(Y=(L=A.borderBoxSize)===null||L===void 0?void 0:L[0])===null||Y===void 0?void 0:Y.blockSize)!==null&&P!==void 0?P:A.contentRect.height;if(U===I)return;U-e.itemSize===0?h.delete(N):h.set(N,U-e.itemSize);const z=U-I;if(z===0)return;E.add(H,z);const Z=c.value;if(Z!=null){if(y===void 0){const pe=E.sum(H);Z.scrollTop>pe&&Z.scrollBy(0,z)}else if(H<y)Z.scrollBy(0,z);else if(H===y){const pe=E.sum(H);U+pe>Z.scrollTop+Z.offsetHeight&&Z.scrollBy(0,z)}q()}f.value++}const B=!$b();let v=!1;function $(N){var A;(A=e.onScroll)===null||A===void 0||A.call(e,N),(!B||!v)&&q()}function F(N){var A;if((A=e.onWheel)===null||A===void 0||A.call(e,N),B){const L=c.value;if(L!=null){if(N.deltaX===0&&(L.scrollTop===0&&N.deltaY<=0||L.scrollTop+L.offsetHeight>=L.scrollHeight&&N.deltaY>=0))return;N.preventDefault(),L.scrollTop+=N.deltaY/Pd(),L.scrollLeft+=N.deltaX/Pd(),q(),v=!0,Vc(()=>{v=!1})}}}function R(N){if(n||M(N.target))return;if(e.renderCol==null&&e.renderItemWithCols==null){if(N.contentRect.height===d.value)return}else if(N.contentRect.height===d.value&&N.contentRect.width===l.value)return;d.value=N.contentRect.height,l.value=N.contentRect.width;const{onResize:A}=e;A!==void 0&&A(N)}function q(){const{value:N}=c;N!=null&&(p.value=N.scrollTop,a.value=N.scrollLeft)}function M(N){let A=N;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:N}=e,A=cr(u.value.sum());return f.value,[e.itemsStyle,{boxSizing:"content-box",width:cr(s.value),height:N?"":A,minHeight:N?A:"",paddingTop:cr(e.paddingTop),paddingBottom:cr(e.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(f.value,{transform:`translateY(${cr(u.value.sum(g.value))})`})),viewportItems:m,listElRef:c,itemsElRef:i.ref(null),scrollTo:_,handleListResize:R,handleListScroll:$,handleListWheel:F,handleItemResize:C}},render(){const{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:r}=this;return i.h(gs,{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),u=a!=null?i.h(Fd,{index:h,item:c}):void 0,f=l!=null?i.h(Fd,{index:h,item:c}):void 0,p=this.$slots.default({item:c,renderedCols:u,renderedItemWithCols:f,index:h})[0];return e?i.h(gs,{key:d,onResize:g=>this.handleItemResize(d,g)},{default:()=>p}):(p.key=d,p)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),pn="v-hidden",Fb=An("[v-hidden]",{display:"none!important"}),Md=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(pn)&&h.removeAttribute(pn);const{children:u}=l;if(a.showAllItemsBeforeCalculate)for(const S of u)S.hasAttribute(pn)&&S.removeAttribute(pn);const f=l.offsetWidth,p=[],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 x=u[S];if(_){x.hasAttribute(pn)||x.setAttribute(pn,"");continue}else x.hasAttribute(pn)&&x.removeAttribute(pn);const C=x.offsetWidth;if(m+=C,p[S]=C,m>f){const{updateCounter:B}=e;for(let v=S;v>=0;--v){const $=y-1-v;B!==void 0?B($):h.textContent=`${$}`;const F=h.offsetWidth;if(m-=p[v],m+F<=f||v===0){_=!0,S=v-1,g&&(S===-1?(g.style.maxWidth=`${f-F}px`,g.style.boxSizing="border-box"):g.style.maxWidth="");const{onUpdateCount:R}=e;R&&R($);break}}}}const{onUpdateOverflow:b}=e;_?b!==void 0&&b(!0):(b!==void 0&&b(!1),h.setAttribute(pn,""))}const o=ai();return Fb.mount({id:"vueuc/overflow",head:!0,anchorMetaName:To,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 Ad(e){return e instanceof HTMLElement}function Od(e){for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes[t];if(Ad(n)&&(zd(n)||Od(n)))return!0}return!1}function Vd(e){for(let t=e.childNodes.length-1;t>=0;t--){const n=e.childNodes[t];if(Ad(n)&&(zd(n)||Vd(n)))return!0}return!1}function zd(e){if(!Mb(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function Mb(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 pr=[];const Ab=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=W_(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return pr[pr.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,_=>{_?(u(),wt("keydown",document,c)):(et("keydown",document,c),s&&f())},{immediate:!0})}),i.onBeforeUnmount(()=>{et("keydown",document,c),s&&f()});function d(_){if(!o&&l()){const y=h();if(y===null||y.contains(ar(_)))return;p("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 u(){var _;if(!e.disabled){if(pr.push(t),e.autoFocus){const{initialFocusTo:y}=e;y===void 0?p("first"):(_=hd(y))===null||_===void 0||_.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function f(){var _;if(e.disabled||(document.removeEventListener("focus",d,!0),pr=pr.filter(b=>b!==t),l()))return;const{finalFocusTo:y}=e;y!==void 0?(_=hd(y))===null||_===void 0||_.focus({preventScroll:!0}):e.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function p(_){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 x=_==="first"?Od(S):Vd(S);o=!1,x||(o=!0,y.focus({preventScroll:!0}),o=!1)}}}function g(_){if(o)return;const y=h();y!==null&&(_.relatedTarget!==null&&y.contains(_.relatedTarget)?p("last"):p("first"))}function m(_){o||(_.relatedTarget!==null&&_.relatedTarget===n.value?p("last"):p("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 yk(e){return e}const Mo="n-internal-select-menu",Id="n-internal-select-menu-body",Ld="n-drawer-body",Dd="n-modal-body",Hd="n-popover-body",Wd="__disabled__";function gn(e){const t=i.inject(Dd,null),n=i.inject(Ld,null),r=i.inject(Hd,null),s=i.inject(Id,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{wt("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{et("fullscreenchange",document,a)})}return It(()=>{var a;const{to:l}=e;return l!==void 0?l===!1?Wd: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")})}gn.tdkey=Wd,gn.propTo={type:[String,Object,Boolean],default:void 0};function Ob(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 jd(e,t){t&&(i.onMounted(()=>{const{value:n}=e;n&&fr.registerHandler(n,t)}),i.watch(e,(n,r)=>{r&&fr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=e;n&&fr.unregisterHandler(n)}))}function Xd(e){return e.replace(/#|\(|\)|,|\s|\./g,"_")}const Vb=/^(\d|\.)+$/,qd=/(\d|\.)+/;function Ao(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(Vb.test(e)){const s=(Number(e)+n)*t;return r?s===0?"0":`${s}px`:`${s}`}else{const s=qd.exec(e);return s?e.replace(qd,String((Number(s[0])+n)*t)):e}return e}function Yd(e){const{left:t,right:n,top:r,bottom:s}=Wt(e);return`${r} ${t} ${s} ${n}`}var Ud={};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,_;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(x=>x.trim());function b(x){return y.map(C=>`&${(_==null?void 0:_.bPrefix)||t}${m.bem.b}${x!==void 0?`${n}${x}`:""}${r}${C}`).join(", ")}const S=m.bem.els;if(S!==null){if(Ud.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(Ud.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 Ib=".n-",Lb="__",Db="--",Gd=ld(),Kd=zb({blockPrefix:Ib,elementPrefix:Lb,modifierPrefix:Db});Gd.use(Kd);const{c:oe,find:wk}=Gd,{cB:ue,cE:_e,cM:Be,cNotM:jt}=Kd,Hb=(...e)=>oe(">",[ue(...e)]);function Ye(e,t){return e+(t==="default"?"":t.replace(/^[a-z]/,n=>n.toUpperCase()))}let Oo;function Wb(){return Oo===void 0&&(Oo=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Oo}const jb=new WeakSet;function Xb(e){jb.add(e)}function Zd(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}const Jd=new Set;function On(e,t){const n=`[naive/${e}]: ${t}`;Jd.has(n)||(Jd.add(n),console.error(n))}function Qd(e,t){console.error(`[naive/${e}]: ${t}`)}function eh(e,t){throw new Error(`[naive/${e}]: ${t}`)}function ht(e,...t){if(Array.isArray(e))e.forEach(n=>ht(n,...t));else return e(...t)}function Vo(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)){Vo(r,t,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Vo(r.children,t,n)}else{if(r.type===i.Comment&&t)return;n.push(r)}}}),n}function qb(e,t="default",n=void 0){const r=e[t];if(!r)return Qd("getFirstSlotVNode",`slot[${t}] is empty`),null;const s=Vo(r(n));return s.length===1?s[0]:(Qd("getFirstSlotVNode",`slot[${t}] should have exactly one child`),null)}function Yb(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 Li(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 Io(e,t){return e&&_s(e())||t()}function di(e,t){const n=e&&_s(e());return t(n||null)}function th(e){return!(e&&_s(e()))}const Lo=i.defineComponent({render(){var e,t;return(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)}}),hi="n-config-provider",Ub="n";function ui(e={},t={defaultBordered:!0}){const n=i.inject(hi,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(Ub),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function fi(e,t,n,r){n||eh("useThemeClass","cssVarsRef is not passed");const s=i.inject(hi,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=ai();let d;const h=`__${e}`,u=()=>{let f=h;const p=t?t.value:void 0,g=o==null?void 0:o.value;g&&(f+=`-${g}`),p&&(f+=`-${p}`);const{themeOverrides:m,builtinThemeOverrides:_}=r;m&&(f+=`-${Bo(JSON.stringify(m))}`),_&&(f+=`-${Bo(JSON.stringify(_))}`),l.value=f,d=()=>{const y=n.value;let b="";for(const S in y)b+=`${S}: ${y[S]};`;oe(`.${f}`,b).mount({id:f,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{u()}),{themeClass:l,onRender:()=>{d==null||d()}}}const nh="n-form-item";function Gb(e,{defaultSize:t="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(nh,null);i.provide(nh,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 Kb={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 Do(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function gr(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 mr(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)?Jb(l,u=>u.test(a)):Zb(l,u=>u.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 Zb(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Jb(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Qb(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 e1={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"}},t1=(e,t,n)=>{let r;const s=e1[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},n1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},i1=(e,t,n,r)=>n1[e],r1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},s1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},o1={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"]},a1={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"]},l1={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"}},c1={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"}},d1={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:gr({values:r1,defaultWidth:"wide"}),quarter:gr({values:s1,defaultWidth:"wide",argumentCallback:e=>e-1}),month:gr({values:o1,defaultWidth:"wide"}),day:gr({values:a1,defaultWidth:"wide"}),dayPeriod:gr({values:l1,defaultWidth:"wide",formattingValues:c1,defaultFormattingWidth:"wide"})},h1=/^(\d+)(th|st|nd|rd)?/i,u1=/\d+/i,f1={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},p1={any:[/^b/i,/^(a|c)/i]},g1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},m1={any:[/1/i,/2/i,/3/i,/4/i]},_1={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},y1={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]},b1={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},w1={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]},v1={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},k1={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}},x1={ordinalNumber:Qb({matchPattern:h1,parsePattern:u1,valueCallback:e=>parseInt(e,10)}),era:mr({matchPatterns:f1,defaultMatchWidth:"wide",parsePatterns:p1,defaultParseWidth:"any"}),quarter:mr({matchPatterns:g1,defaultMatchWidth:"wide",parsePatterns:m1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:mr({matchPatterns:_1,defaultMatchWidth:"wide",parsePatterns:y1,defaultParseWidth:"any"}),day:mr({matchPatterns:b1,defaultMatchWidth:"wide",parsePatterns:w1,defaultParseWidth:"any"}),dayPeriod:mr({matchPatterns:v1,defaultMatchWidth:"any",parsePatterns:k1,defaultParseWidth:"any"})},C1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},S1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},B1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},T1={date:Do({formats:C1,defaultWidth:"full"}),time:Do({formats:S1,defaultWidth:"full"}),dateTime:Do({formats:B1,defaultWidth:"full"})},E1={name:"en-US",locale:{code:"en-US",formatDistance:t1,formatLong:T1,formatRelative:i1,localize:d1,match:x1,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function ih(e){const{mergedLocaleRef:t,mergedDateLocaleRef:n}=i.inject(hi,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:Kb[e]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:E1}),localeRef:r}}const _r="naive-ui-style";function ys(e,t,n){if(!t)return;const r=ai(),s=i.computed(()=>{const{value:l}=t;if(!l)return;const c=l[e];if(c)return c}),o=i.inject(hi,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${e}Rtl`;if(Jy(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 yr={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:$1,fontFamily:N1,lineHeight:P1}=yr,rh=oe("body",`
|
116
|
+
`)}function So(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 qy(e,t,n,r){const{els:s}=t;if(n===void 0)s.forEach(nd),t.els=[];else{const o=os(n,r);o&&s.includes(o)&&(nd(o),t.els=s.filter(a=>a!==o))}}function od(e,t){e.push(t)}function Yy(e,t,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=t.render(r),n=So(d)),c){c.adapter(n,d??t.render(r));return}l===void 0&&(l=document.head);const h=os(n,l);if(h!==null&&!o)return h;const u=h??Dy(n);if(d===void 0&&(d=t.render(r)),u.textContent=d,h!==null)return h;if(a){const f=l.querySelector(`meta[name="${a}"]`);if(f)return l.insertBefore(u,f),od(t.els,u),u}return s?l.insertBefore(u,l.querySelector("style, link")):l.appendChild(u),od(t.els,u),u}function Uy(e){return Xy(this,this.instance,e)}function Gy(e={}){const{id:t,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=e;return Yy(this.instance,this,t,r,s,o,a,l,n)}function Ky(e={}){const{id:t,parent:n}=e;qy(this.instance,this,t,n)}const ls=function(e,t,n,r){return{instance:e,$:t,props:n,children:r,els:[],render:Uy,mount:Gy,unmount:Ky}},Zy=function(e,t,n,r){return Array.isArray(t)?ls(e,{$:null},null,t):Array.isArray(n)?ls(e,t,null,n):Array.isArray(r)?ls(e,t,n,r):ls(e,t,n,null)};function ad(e={}){const t={c:(...n)=>Zy(t,...n),use:(n,...r)=>n.install(t,...r),find:os,context:{},config:e};return t}function Jy(e,t){if(e===void 0)return!1;if(t){const{context:{ids:n}}=t;return n.has(e)}return os(e)!==null}const{c:Mn}=ad(),Bo="vueuc-style";function ld(e){return e&-e}class cd{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+=ld(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-=ld(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 dd(e){return typeof e=="string"?document.querySelector(e):e()}const Qy=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(e){return{showTeleport:Sy(i.toRef(e,"show")),mergedTo:i.computed(()=>{const{to:t}=e;return t??"body"})}},render(){return this.showTeleport?this.disabled?vo("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},vo("lazy-teleport",this.$slots)):null}}),cs={top:"bottom",bottom:"top",left:"right",right:"left"},hd={start:"end",center:"center",end:"start"},To={top:"height",bottom:"height",left:"width",right:"width"},eb={"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"},tb={"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"},nb={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},ud={top:!0,bottom:!1,left:!0,right:!1},fd={top:"end",bottom:"start",left:"end",right:"start"};function ib(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=(p,g,m)=>{let _=0,y=0;const b=n[p]-t[g]-t[p];return b>0&&r&&(m?y=ud[g]?b:-b:_=ud[g]?b:-b),{left:_,top:y}},u=a==="left"||a==="right";if(c!=="center"){const p=nb[e],g=cs[p],m=To[p];if(n[m]>t[m]){if(t[p]+t[m]<n[m]){const _=(n[m]-t[m])/2;t[p]<_||t[g]<_?t[p]<t[g]?(c=hd[l],d=h(m,g,u)):d=h(m,p,u):c="center"}}else n[m]<t[m]&&t[g]<0&&t[p]>t[g]&&(c=hd[l])}else{const p=a==="bottom"||a==="top"?"left":"top",g=cs[p],m=To[p],_=(n[m]-t[m])/2;(t[p]<_||t[g]<_)&&(t[p]>t[g]?(c=fd[p],d=h(m,p,u)):(c=fd[g],d=h(m,g,u)))}let f=a;return t[a]<n[To[a]]&&t[a]<t[cs[a]]&&(f=cs[a]),{placement:c!=="center"?`${f}-${c}`:f,left:d.left,top:d.top}}function rb(e,t){return t?tb[e]:eb[e]}function sb(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 ob=Mn([Mn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Mn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Mn("> *",{pointerEvents:"all"})])]),pd=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=zt(()=>e.enabled!==void 0?e.enabled:e.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:f}=e;f.includes("scroll")&&t.addScrollListener(c),f.includes("resize")&&t.addResizeListener(c)},a=()=>{t.removeScrollListener(c),t.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=oi();ob.mount({id:"vueuc/binder",head:!0,anchorMetaName:Bo,ssr:l}),i.onBeforeUnmount(()=>{a()}),Ty(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const f=r.value;if(f===null)return;const p=t.targetRef,{x:g,y:m,overlap:_}=e,y=g!==void 0&&m!==void 0?Ny(g,m):xo(p);f.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),f.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:b,minWidth:S,placement:x,internalShift:C,flip:B}=e;f.setAttribute("v-placement",x),_?f.setAttribute("v-overlap",""):f.removeAttribute("v-overlap");const{style:v}=f;b==="target"?v.width=`${y.width}px`:b!==void 0?v.width=b:v.width="",S==="target"?v.minWidth=`${y.width}px`:S!==void 0?v.minWidth=S:v.minWidth="";const $=xo(f),F=xo(s.value),{left:R,top:X,placement:M}=ib(x,y,$,C,B,_),N=rb(M,_),{left:A,top:L,transform:Y}=sb(M,F,y,X,R,_);f.setAttribute("v-placement",M),f.style.setProperty("--v-offset-left",`${Math.round(R)}px`),f.style.setProperty("--v-offset-top",`${Math.round(X)}px`),f.style.transform=`translateX(${A}) translateY(${L}) ${Y}`,f.style.setProperty("--v-transform-origin",N),f.style.transformOrigin=N};i.watch(n,f=>{f?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(f=>console.error(f))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(f=>{i.watch(i.toRef(e,f),c)}),["teleportDisabled"].forEach(f=>{i.watch(i.toRef(e,f),d)}),i.watch(i.toRef(e,"syncTrigger"),f=>{f.includes("resize")?t.addResizeListener(c):t.removeResizeListener(c),f.includes("scroll")?t.addScrollListener(c):t.removeScrollListener(c)});const h=ss(),u=zt(()=>{const{to:f}=e;if(f!==void 0)return f;h.value});return{VBinder:t,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:u,syncPosition:c}},render(){return i.h(Qy,{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,[[Yc,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var ai=[],ab=function(){return ai.some(function(e){return e.activeTargets.length>0})},lb=function(){return ai.some(function(e){return e.skippedTargets.length>0})},gd="ResizeObserver loop completed with undelivered notifications.",cb=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:gd}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=gd),window.dispatchEvent(e)},dr;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(dr||(dr={}));var li=function(e){return Object.freeze(e)},db=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,li(this)}return e}(),md=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,li(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}(),Eo=function(e){return e instanceof SVGElement&&"getBBox"in e},_d=function(e){if(Eo(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)},yd=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)},hb=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},hr=typeof window<"u"?window:{},ds=new WeakMap,bd=/auto|scroll/,ub=/^tb|vertical/,fb=/msie|trident/i.test(hr.navigator&&hr.navigator.userAgent),tn=function(e){return parseFloat(e||"0")},zi=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new db((n?t:e)||0,(n?e:t)||0)},wd=li({devicePixelContentBoxSize:zi(),borderBoxSize:zi(),contentBoxSize:zi(),contentRect:new md(0,0,0,0)}),vd=function(e,t){if(t===void 0&&(t=!1),ds.has(e)&&!t)return ds.get(e);if(_d(e))return ds.set(e,wd),wd;var n=getComputedStyle(e),r=Eo(e)&&e.ownerSVGElement&&e.getBBox(),s=!fb&&n.boxSizing==="border-box",o=ub.test(n.writingMode||""),a=!r&&bd.test(n.overflowY||""),l=!r&&bd.test(n.overflowX||""),c=r?0:tn(n.paddingTop),d=r?0:tn(n.paddingRight),h=r?0:tn(n.paddingBottom),u=r?0:tn(n.paddingLeft),f=r?0:tn(n.borderTopWidth),p=r?0:tn(n.borderRightWidth),g=r?0:tn(n.borderBottomWidth),m=r?0:tn(n.borderLeftWidth),_=u+d,y=c+h,b=m+p,S=f+g,x=l?e.offsetHeight-S-e.clientHeight:0,C=a?e.offsetWidth-b-e.clientWidth:0,B=s?_+b:0,v=s?y+S:0,$=r?r.width:tn(n.width)-B-C,F=r?r.height:tn(n.height)-v-x,R=$+_+C+b,X=F+y+x+S,M=li({devicePixelContentBoxSize:zi(Math.round($*devicePixelRatio),Math.round(F*devicePixelRatio),o),borderBoxSize:zi(R,X,o),contentBoxSize:zi($,F,o),contentRect:new md(u,c,$,F)});return ds.set(e,M),M},kd=function(e,t,n){var r=vd(e,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case dr.DEVICE_PIXEL_CONTENT_BOX:return a;case dr.BORDER_BOX:return s;default:return o}},pb=function(){function e(t){var n=vd(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=li([n.borderBoxSize]),this.contentBoxSize=li([n.contentBoxSize]),this.devicePixelContentBoxSize=li([n.devicePixelContentBoxSize])}return e}(),xd=function(e){if(_d(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},gb=function(){var e=1/0,t=[];ai.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var h=new pb(d.target),u=xd(d.target);l.push(h),d.lastReportedSize=kd(d.target,d.observedBox),u<e&&(e=u)}),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},Cd=function(e){ai.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(xd(s.target)>e?n.activeTargets.push(s):n.skippedTargets.push(s))})})},mb=function(){var e=0;for(Cd(e);ab();)e=gb(),Cd(e);return lb()&&cb(),e>0},$o,Sd=[],_b=function(){return Sd.splice(0).forEach(function(e){return e()})},yb=function(e){if(!$o){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return _b()}).observe(n,r),$o=function(){n.textContent="".concat(t?t--:t++)}}Sd.push(e),$o()},bb=function(e){yb(function(){requestAnimationFrame(e)})},hs=0,wb=function(){return!!hs},vb=250,kb={attributes:!0,characterData:!0,childList:!0,subtree:!0},Bd=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Td=function(e){return e===void 0&&(e=0),Date.now()+e},No=!1,xb=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=vb),!No){No=!0;var r=Td(t);bb(function(){var s=!1;try{s=mb()}finally{if(No=!1,t=r-Td(),!wb())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,kb)};document.body?n():hr.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Bd.forEach(function(n){return hr.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Bd.forEach(function(n){return hr.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),Po=new xb,Ed=function(e){!hs&&e>0&&Po.start(),hs+=e,!hs&&Po.stop()},Cb=function(e){return!Eo(e)&&!hb(e)&&getComputedStyle(e).display==="inline"},Sb=function(){function e(t,n){this.target=t,this.observedBox=n||dr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=kd(this.target,this.observedBox,!0);return Cb(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),Bb=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),us=new WeakMap,$d=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},fs=function(){function e(){}return e.connect=function(t,n){var r=new Bb(t,n);us.set(t,r)},e.observe=function(t,n,r){var s=us.get(t),o=s.observationTargets.length===0;$d(s.observationTargets,n)<0&&(o&&ai.push(s),s.observationTargets.push(new Sb(n,r&&r.box)),Ed(1),Po.schedule())},e.unobserve=function(t,n){var r=us.get(t),s=$d(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&ai.splice(ai.indexOf(r),1),r.observationTargets.splice(s,1),Ed(-1))},e.disconnect=function(t){var n=this,r=us.get(t);r.observationTargets.slice().forEach(function(s){return n.unobserve(t,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Tb=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.");fs.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(!yd(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");fs.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(!yd(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");fs.unobserve(this,t)},e.prototype.disconnect=function(){fs.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();class Eb{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Tb)(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 ur=new Eb,ps=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){ed("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){ed("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(ur.registerHandler(s.nextElementSibling,r),t=!0)}),i.onBeforeUnmount(()=>{t&&ur.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let gs;function $b(){return typeof document>"u"?!1:(gs===void 0&&("matchMedia"in window?gs=window.matchMedia("(pointer:coarse)").matches:gs=!1),gs)}let Ro;function Nd(){return typeof document>"u"?1:(Ro===void 0&&(Ro="chrome"in window?window.devicePixelRatio:1),Ro)}const Pd="VVirtualListXScroll";function Nb({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 cd(d.length,0);return d.forEach((u,f)=>{h.add(f,u.width)}),h}),a=zt(()=>{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=zt(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,e.value.length-1):0});return i.provide(Pd,{startIndexRef:a,endIndexRef:c,columnsRef:e,renderColRef:t,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Rd=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(Pd);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}}),Pb=Mn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Mn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Mn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Rb=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=oi();Pb.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Bo,ssr:t}),i.onMounted(()=>{const{defaultScrollIndex:N,defaultScrollKey:A}=e;N!=null?_({index:N}):A!=null&&_({key:A})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}_({top:p.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=zt(()=>{if(e.renderCol==null&&e.renderItemWithCols==null||e.columns.length===0)return;let N=0;return e.columns.forEach(A=>{N+=A.width}),N}),o=i.computed(()=>{const N=new Map,{keyField:A}=e;return e.items.forEach((L,Y)=>{N.set(L[A],Y)}),N}),{scrollLeftRef:a,listWidthRef:l}=Nb({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,u=i.computed(()=>{const{items:N,itemSize:A,keyField:L}=e,Y=new cd(N.length,A);return N.forEach((P,E)=>{const H=P[L],I=h.get(H);I!==void 0&&Y.add(E,I)}),Y}),f=i.ref(0),p=i.ref(0),g=zt(()=>Math.max(u.value.getBound(p.value-ar(e.paddingTop))-1,0)),m=i.computed(()=>{const{value:N}=d;if(N===void 0)return[];const{items:A,itemSize:L}=e,Y=g.value,P=Math.min(Y+Math.ceil(N/L+1),A.length-1),E=[];for(let H=Y;H<=P;++H)E.push(A[H]);return E}),_=(N,A)=>{if(typeof N=="number"){x(N,A,"auto");return}const{left:L,top:Y,index:P,key:E,position:H,behavior:I,debounce:U=!0}=N;if(L!==void 0||Y!==void 0)x(L,Y,I);else if(P!==void 0)S(P,I,U);else if(E!==void 0){const O=o.value.get(E);O!==void 0&&S(O,I,U)}else H==="bottom"?x(0,Number.MAX_SAFE_INTEGER,I):H==="top"&&x(0,0,I)};let y,b=null;function S(N,A,L){const{value:Y}=u,P=Y.sum(N)+ar(e.paddingTop);if(!L)c.value.scrollTo({left:0,top:P,behavior:A});else{y=N,b!==null&&window.clearTimeout(b),b=window.setTimeout(()=>{y=void 0,b=null},16);const{scrollTop:E,offsetHeight:H}=c.value;if(P>E){const I=Y.get(N);P+I<=E+H||c.value.scrollTo({left:0,top:P+I-H,behavior:A})}else c.value.scrollTo({left:0,top:P,behavior:A})}}function x(N,A,L){c.value.scrollTo({left:N,top:A,behavior:L})}function C(N,A){var L,Y,P;if(n||e.ignoreItemResize||M(A.target))return;const{value:E}=u,H=o.value.get(N),I=E.get(H),U=(P=(Y=(L=A.borderBoxSize)===null||L===void 0?void 0:L[0])===null||Y===void 0?void 0:Y.blockSize)!==null&&P!==void 0?P:A.contentRect.height;if(U===I)return;U-e.itemSize===0?h.delete(N):h.set(N,U-e.itemSize);const z=U-I;if(z===0)return;E.add(H,z);const J=c.value;if(J!=null){if(y===void 0){const pe=E.sum(H);J.scrollTop>pe&&J.scrollBy(0,z)}else if(H<y)J.scrollBy(0,z);else if(H===y){const pe=E.sum(H);U+pe>J.scrollTop+J.offsetHeight&&J.scrollBy(0,z)}X()}f.value++}const B=!$b();let v=!1;function $(N){var A;(A=e.onScroll)===null||A===void 0||A.call(e,N),(!B||!v)&&X()}function F(N){var A;if((A=e.onWheel)===null||A===void 0||A.call(e,N),B){const L=c.value;if(L!=null){if(N.deltaX===0&&(L.scrollTop===0&&N.deltaY<=0||L.scrollTop+L.offsetHeight>=L.scrollHeight&&N.deltaY>=0))return;N.preventDefault(),L.scrollTop+=N.deltaY/Nd(),L.scrollLeft+=N.deltaX/Nd(),X(),v=!0,Oc(()=>{v=!1})}}}function R(N){if(n||M(N.target))return;if(e.renderCol==null&&e.renderItemWithCols==null){if(N.contentRect.height===d.value)return}else if(N.contentRect.height===d.value&&N.contentRect.width===l.value)return;d.value=N.contentRect.height,l.value=N.contentRect.width;const{onResize:A}=e;A!==void 0&&A(N)}function X(){const{value:N}=c;N!=null&&(p.value=N.scrollTop,a.value=N.scrollLeft)}function M(N){let A=N;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:N}=e,A=lr(u.value.sum());return f.value,[e.itemsStyle,{boxSizing:"content-box",width:lr(s.value),height:N?"":A,minHeight:N?A:"",paddingTop:lr(e.paddingTop),paddingBottom:lr(e.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(f.value,{transform:`translateY(${lr(u.value.sum(g.value))})`})),viewportItems:m,listElRef:c,itemsElRef:i.ref(null),scrollTo:_,handleListResize:R,handleListScroll:$,handleListWheel:F,handleItemResize:C}},render(){const{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:r}=this;return i.h(ps,{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),u=a!=null?i.h(Rd,{index:h,item:c}):void 0,f=l!=null?i.h(Rd,{index:h,item:c}):void 0,p=this.$slots.default({item:c,renderedCols:u,renderedItemWithCols:f,index:h})[0];return e?i.h(ps,{key:d,onResize:g=>this.handleItemResize(d,g)},{default:()=>p}):(p.key=d,p)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),fn="v-hidden",Fb=Mn("[v-hidden]",{display:"none!important"}),Fd=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(fn)&&h.removeAttribute(fn);const{children:u}=l;if(a.showAllItemsBeforeCalculate)for(const S of u)S.hasAttribute(fn)&&S.removeAttribute(fn);const f=l.offsetWidth,p=[],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 x=u[S];if(_){x.hasAttribute(fn)||x.setAttribute(fn,"");continue}else x.hasAttribute(fn)&&x.removeAttribute(fn);const C=x.offsetWidth;if(m+=C,p[S]=C,m>f){const{updateCounter:B}=e;for(let v=S;v>=0;--v){const $=y-1-v;B!==void 0?B($):h.textContent=`${$}`;const F=h.offsetWidth;if(m-=p[v],m+F<=f||v===0){_=!0,S=v-1,g&&(S===-1?(g.style.maxWidth=`${f-F}px`,g.style.boxSizing="border-box"):g.style.maxWidth="");const{onUpdateCount:R}=e;R&&R($);break}}}}const{onUpdateOverflow:b}=e;_?b!==void 0&&b(!0):(b!==void 0&&b(!1),h.setAttribute(fn,""))}const o=oi();return Fb.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Bo,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 Md(e){return e instanceof HTMLElement}function Ad(e){for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes[t];if(Md(n)&&(Vd(n)||Ad(n)))return!0}return!1}function Od(e){for(let t=e.childNodes.length-1;t>=0;t--){const n=e.childNodes[t];if(Md(n)&&(Vd(n)||Od(n)))return!0}return!1}function Vd(e){if(!Mb(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function Mb(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 fr=[];const Ab=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=W_(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return fr[fr.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,_=>{_?(u(),bt("keydown",document,c)):(Qe("keydown",document,c),s&&f())},{immediate:!0})}),i.onBeforeUnmount(()=>{Qe("keydown",document,c),s&&f()});function d(_){if(!o&&l()){const y=h();if(y===null||y.contains(or(_)))return;p("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 u(){var _;if(!e.disabled){if(fr.push(t),e.autoFocus){const{initialFocusTo:y}=e;y===void 0?p("first"):(_=dd(y))===null||_===void 0||_.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function f(){var _;if(e.disabled||(document.removeEventListener("focus",d,!0),fr=fr.filter(b=>b!==t),l()))return;const{finalFocusTo:y}=e;y!==void 0?(_=dd(y))===null||_===void 0||_.focus({preventScroll:!0}):e.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function p(_){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 x=_==="first"?Ad(S):Od(S);o=!1,x||(o=!0,y.focus({preventScroll:!0}),o=!1)}}}function g(_){if(o)return;const y=h();y!==null&&(_.relatedTarget!==null&&y.contains(_.relatedTarget)?p("last"):p("first"))}function m(_){o||(_.relatedTarget!==null&&_.relatedTarget===n.value?p("last"):p("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 wk(e){return e}const Fo="n-internal-select-menu",zd="n-internal-select-menu-body",Id="n-drawer-body",Ld="n-modal-body",Dd="n-popover-body",Hd="__disabled__";function pn(e){const t=i.inject(Ld,null),n=i.inject(Id,null),r=i.inject(Dd,null),s=i.inject(zd,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(()=>{Qe("fullscreenchange",document,a)})}return zt(()=>{var a;const{to:l}=e;return l!==void 0?l===!1?Hd: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")})}pn.tdkey=Hd,pn.propTo={type:[String,Object,Boolean],default:void 0};function Ob(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 Wd(e,t){t&&(i.onMounted(()=>{const{value:n}=e;n&&ur.registerHandler(n,t)}),i.watch(e,(n,r)=>{r&&ur.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=e;n&&ur.unregisterHandler(n)}))}function jd(e){return e.replace(/#|\(|\)|,|\s|\./g,"_")}const Vb=/^(\d|\.)+$/,Xd=/(\d|\.)+/;function Mo(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(Vb.test(e)){const s=(Number(e)+n)*t;return r?s===0?"0":`${s}px`:`${s}`}else{const s=Xd.exec(e);return s?e.replace(Xd,String((Number(s[0])+n)*t)):e}return e}function qd(e){const{left:t,right:n,top:r,bottom:s}=Ht(e);return`${r} ${t} ${s} ${n}`}var Yd={};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,_;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(x=>x.trim());function b(x){return y.map(C=>`&${(_==null?void 0:_.bPrefix)||t}${m.bem.b}${x!==void 0?`${n}${x}`:""}${r}${C}`).join(", ")}const S=m.bem.els;if(S!==null){if(Yd.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(Yd.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 Ib=".n-",Lb="__",Db="--",Ud=ad(),Gd=zb({blockPrefix:Ib,elementPrefix:Lb,modifierPrefix:Db});Ud.use(Gd);const{c:oe,find:kk}=Ud,{cB:ue,cE:_e,cM:Be,cNotM:Wt}=Gd,Hb=(...e)=>oe(">",[ue(...e)]);function qe(e,t){return e+(t==="default"?"":t.replace(/^[a-z]/,n=>n.toUpperCase()))}let Ao;function Wb(){return Ao===void 0&&(Ao=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Ao}const jb=new WeakSet;function Xb(e){jb.add(e)}function Kd(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}const Zd=new Set;function An(e,t){const n=`[naive/${e}]: ${t}`;Zd.has(n)||(Zd.add(n),console.error(n))}function Jd(e,t){console.error(`[naive/${e}]: ${t}`)}function Qd(e,t){throw new Error(`[naive/${e}]: ${t}`)}function dt(e,...t){if(Array.isArray(e))e.forEach(n=>dt(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 qb(e,t="default",n=void 0){const r=e[t];if(!r)return Jd("getFirstSlotVNode",`slot[${t}] is empty`),null;const s=Oo(r(n));return s.length===1?s[0]:(Jd("getFirstSlotVNode",`slot[${t}] should have exactly one child`),null)}function Yb(e,t=[],n){const r={};return t.forEach(s=>{r[s]=e[s]}),Object.assign(r,n)}function Vo(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 Ii(e,...t){return typeof e=="function"?e(...t):typeof e=="string"?i.createTextVNode(e):typeof e=="number"?i.createTextVNode(String(e)):null}function ms(e){return e.some(t=>i.isVNode(t)?!(t.type===i.Comment||t.type===i.Fragment&&!ms(t.children)):!0)?e:null}function zo(e,t){return e&&ms(e())||t()}function ci(e,t){const n=e&&ms(e());return t(n||null)}function eh(e){return!(e&&ms(e()))}const Io=i.defineComponent({render(){var e,t;return(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)}}),di="n-config-provider",Ub="n";function hi(e={},t={defaultBordered:!0}){const n=i.inject(di,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(Ub),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function ui(e,t,n,r){n||Qd("useThemeClass","cssVarsRef is not passed");const s=i.inject(di,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=oi();let d;const h=`__${e}`,u=()=>{let f=h;const p=t?t.value:void 0,g=o==null?void 0:o.value;g&&(f+=`-${g}`),p&&(f+=`-${p}`);const{themeOverrides:m,builtinThemeOverrides:_}=r;m&&(f+=`-${So(JSON.stringify(m))}`),_&&(f+=`-${So(JSON.stringify(_))}`),l.value=f,d=()=>{const y=n.value;let b="";for(const S in y)b+=`${S}: ${y[S]};`;oe(`.${f}`,b).mount({id:f,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{u()}),{themeClass:l,onRender:()=>{d==null||d()}}}const th="n-form-item";function Gb(e,{defaultSize:t="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(th,null);i.provide(th,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 Kb={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 Lo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function pr(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 gr(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)?Jb(l,u=>u.test(a)):Zb(l,u=>u.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 Zb(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Jb(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Qb(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 e1={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"}},t1=(e,t,n)=>{let r;const s=e1[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},n1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},i1=(e,t,n,r)=>n1[e],r1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},s1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},o1={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"]},a1={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"]},l1={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"}},c1={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"}},d1={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:pr({values:r1,defaultWidth:"wide"}),quarter:pr({values:s1,defaultWidth:"wide",argumentCallback:e=>e-1}),month:pr({values:o1,defaultWidth:"wide"}),day:pr({values:a1,defaultWidth:"wide"}),dayPeriod:pr({values:l1,defaultWidth:"wide",formattingValues:c1,defaultFormattingWidth:"wide"})},h1=/^(\d+)(th|st|nd|rd)?/i,u1=/\d+/i,f1={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},p1={any:[/^b/i,/^(a|c)/i]},g1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},m1={any:[/1/i,/2/i,/3/i,/4/i]},_1={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},y1={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]},b1={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},w1={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]},v1={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},k1={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}},x1={ordinalNumber:Qb({matchPattern:h1,parsePattern:u1,valueCallback:e=>parseInt(e,10)}),era:gr({matchPatterns:f1,defaultMatchWidth:"wide",parsePatterns:p1,defaultParseWidth:"any"}),quarter:gr({matchPatterns:g1,defaultMatchWidth:"wide",parsePatterns:m1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:gr({matchPatterns:_1,defaultMatchWidth:"wide",parsePatterns:y1,defaultParseWidth:"any"}),day:gr({matchPatterns:b1,defaultMatchWidth:"wide",parsePatterns:w1,defaultParseWidth:"any"}),dayPeriod:gr({matchPatterns:v1,defaultMatchWidth:"any",parsePatterns:k1,defaultParseWidth:"any"})},C1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},S1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},B1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},T1={date:Lo({formats:C1,defaultWidth:"full"}),time:Lo({formats:S1,defaultWidth:"full"}),dateTime:Lo({formats:B1,defaultWidth:"full"})},E1={name:"en-US",locale:{code:"en-US",formatDistance:t1,formatLong:T1,formatRelative:i1,localize:d1,match:x1,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function nh(e){const{mergedLocaleRef:t,mergedDateLocaleRef:n}=i.inject(di,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:Kb[e]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:E1}),localeRef:r}}const mr="naive-ui-style";function _s(e,t,n){if(!t)return;const r=oi(),s=i.computed(()=>{const{value:l}=t;if(!l)return;const c=l[e];if(c)return c}),o=i.inject(di,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${e}Rtl`;if(Jy(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:mr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const _r={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:$1,fontFamily:N1,lineHeight:P1}=_r,ih=oe("body",`
|
117
117
|
margin: 0;
|
118
118
|
font-size: ${$1};
|
119
119
|
font-family: ${N1};
|
@@ -123,7 +123,7 @@ ${s}
|
|
123
123
|
`,[oe("input",`
|
124
124
|
font-family: inherit;
|
125
125
|
font-size: inherit;
|
126
|
-
`)]);var R1={};function
|
126
|
+
`)]);var R1={};function ys(e,t,n){if(!t){R1.NODE_ENV!=="production"&&Qd("use-style","No style is specified.");return}const r=oi(),s=i.inject(di,null),o=()=>{const a=n.value;t.mount({id:a===void 0?e:a+e,head:!0,anchorMetaName:mr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget}),s!=null&&s.preflightStyleDisabled||ih.mount({id:"n-global",head:!0,anchorMetaName:mr,ssr:r,parent:s==null?void 0:s.styleMountTarget})};r?o():i.onBeforeMount(o)}function Sk(e){return e}function ht(e,t,n,r,s,o){const a=oi(),l=i.inject(di,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:mr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||ih.mount({id:"n-global",head:!0,anchorMetaName:mr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:h,self:u,peers:f={}}={},themeOverrides:p={},builtinThemeOverrides:g={}}=s,{common:m,peers:_}=p,{common:y=void 0,[e]:{common:b=void 0,self:S=void 0,peers:x={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:C=void 0,[e]:B={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:v,peers:$={}}=B,F=W.merge({},h||b||y||r.common,C,v,m),R=W.merge((d=u||S||r.self)===null||d===void 0?void 0:d(F),g,B,p);return{common:F,self:R,peers:W.merge({},r.peers,x,f),peerOverrides:W.merge({},g.peers,$,_)}})}ht.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const F1=ue("base-icon",`
|
127
127
|
height: 1em;
|
128
128
|
width: 1em;
|
129
129
|
line-height: 1em;
|
@@ -135,7 +135,7 @@ ${s}
|
|
135
135
|
`,[oe("svg",`
|
136
136
|
height: 1em;
|
137
137
|
width: 1em;
|
138
|
-
`)]),
|
138
|
+
`)]),yr=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){ys("-base-icon",F1,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)}}),rh=i.defineComponent({name:"BaseIconSwitchTransition",setup(e,{slots:t}){const n=ss();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},t)}});function sh(e,t){const n=i.defineComponent({render(){return t()}});return i.defineComponent({name:W.upperFirst(e),setup(){var r;const s=(r=i.inject(di,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 M1=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"})))}}),A1=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"}))}}),O1=sh("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"}))))),V1=sh("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:I1}=_r;function Do({originalTransform:e="",left:t=0,top:n=0,transition:r=`all .3s ${I1} !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 L1=ue("base-clear",`
|
139
139
|
flex-shrink: 0;
|
140
140
|
height: 1em;
|
141
141
|
width: 1em;
|
@@ -159,7 +159,7 @@ ${s}
|
|
159
159
|
left: 50%;
|
160
160
|
top: 50%;
|
161
161
|
transform: translateX(-50%) translateY(-50%);
|
162
|
-
`,[
|
162
|
+
`,[Do({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),D1=i.defineComponent({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return ys("-base-clear",L1,i.toRef(e,"clsPrefix")),{handleMouseDown(t){t.preventDefault()}}},render(){const{clsPrefix:e}=this;return i.h("div",{class:`${e}-base-clear`},i.h(rh,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},zo(this.$slots.icon,()=>[i.h(yr,{clsPrefix:e},{default:()=>i.h(O1,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))}}))}}),H1=ue("base-close",`
|
163
163
|
display: flex;
|
164
164
|
align-items: center;
|
165
165
|
justify-content: center;
|
@@ -187,7 +187,7 @@ ${s}
|
|
187
187
|
transform: translateY(-50%) translateX(-50%);
|
188
188
|
transition: inherit;
|
189
189
|
border-radius: inherit;
|
190
|
-
`),
|
190
|
+
`),Wt("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);
|
@@ -203,7 +203,7 @@ ${s}
|
|
203
203
|
background-color: transparent;
|
204
204
|
`),Be("round",[oe("&::before",`
|
205
205
|
border-radius: 50%;
|
206
|
-
`)])]),W1=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
|
206
|
+
`)])]),W1=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 ys("-base-close",H1,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(yr,{clsPrefix:t},{default:()=>i.h(V1,null)}))}}}),j1=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})}}),X1=oe([oe("@keyframes rotator",`
|
207
207
|
0% {
|
208
208
|
-webkit-transform: rotate(0deg);
|
209
209
|
transform: rotate(0deg);
|
@@ -220,17 +220,17 @@ ${s}
|
|
220
220
|
position: absolute;
|
221
221
|
width: 100%;
|
222
222
|
height: 100%;
|
223
|
-
`,[
|
223
|
+
`,[Do()]),_e("placeholder",`
|
224
224
|
position: absolute;
|
225
225
|
left: 50%;
|
226
226
|
top: 50%;
|
227
227
|
transform: translateX(-50%) translateY(-50%);
|
228
|
-
`,[
|
228
|
+
`,[Do({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),_e("container",`
|
229
229
|
animation: rotator 3s linear infinite both;
|
230
230
|
`,[_e("icon",`
|
231
231
|
height: 1em;
|
232
232
|
width: 1em;
|
233
|
-
`)])])]),
|
233
|
+
`)])])]),Ho="1.6s",q1={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},oh=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}},q1),setup(e){ys("-base-loading",X1,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(rh,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:Ho,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:Ho,fill:"freeze",repeatCount:"indefinite"}),i.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*t};${1.42*t};${5.67*t}`,begin:"0s",dur:Ho,fill:"freeze",repeatCount:"indefinite"})))))):i.h("div",{key:"placeholder",class:`${e}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:ah}=_r;function Y1({name:e="fade-in",enterDuration:t="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=ah,leaveCubicBezier:s=ah}={}){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"},U1=ri(de.neutralBase),lh=ri(de.neutralInvertBase),G1=`rgba(${lh.slice(0,3).join(", ")}, `;function ch(e){return`${G1+String(e)})`}function ut(e){const t=Array.from(lh);return t[3]=Number(e),D_(U1,t)}const fi=Object.assign(Object.assign({name:"common"},_r),{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:ut(de.alpha4),placeholderColor:ut(de.alpha4),placeholderColorDisabled:ut(de.alpha5),iconColor:ut(de.alpha4),iconColorHover:es(ut(de.alpha4),{lightness:.75}),iconColorPressed:es(ut(de.alpha4),{lightness:.9}),iconColorDisabled:ut(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:ut(Number(de.alphaClose)),closeIconColorHover:ut(Number(de.alphaClose)),closeIconColorPressed:ut(Number(de.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:ut(de.alpha4),clearColorHover:es(ut(de.alpha4),{lightness:.75}),clearColorPressed:es(ut(de.alpha4),{lightness:.9}),scrollbarColor:ch(de.alphaScrollbar),scrollbarColorHover:ch(de.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:ut(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:ut(de.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:ut(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)"}),K1={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function Z1(e){const{scrollbarColor:t,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:s,scrollbarBorderRadius:o}=e;return Object.assign(Object.assign({},K1),{height:r,width:s,borderRadius:o,color:t,colorHover:n})}const dh={name:"Scrollbar",common:fi,self:Z1},J1=ue("scrollbar",`
|
234
234
|
overflow: hidden;
|
235
235
|
position: relative;
|
236
236
|
z-index: auto;
|
@@ -295,7 +295,7 @@ ${s}
|
|
295
295
|
pointer-events: all;
|
296
296
|
background-color: var(--n-scrollbar-color);
|
297
297
|
transition: background-color .2s var(--n-scrollbar-bezier);
|
298
|
-
`,[Y1(),oe("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),Q1=Object.assign(Object.assign({},ut.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),uh=i.defineComponent({name:"Scrollbar",props:Q1,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedRtlRef:r}=ui(e),s=ys("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),u=i.ref(null),f=i.ref(null),p=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 x=!1,C=!1,B,v,$=0,F=0,R=0,q=0;const M=$y(),N=ut("Scrollbar","-scrollbar",J1,hh,e,t),A=i.computed(()=>{const{value:T}=f,{value:D}=h,{value:J}=g;return T===null||D===null||J===null?0:Math.min(T,J*T/D+lr(N.value.self.width)*1.5)}),L=i.computed(()=>`${A.value}px`),Y=i.computed(()=>{const{value:T}=p,{value:D}=u,{value:J}=m;return T===null||D===null||J===null?0:J*T/D+lr(N.value.self.height)*1.5}),P=i.computed(()=>`${Y.value}px`),E=i.computed(()=>{const{value:T}=f,{value:D}=_,{value:J}=h,{value:le}=g;if(T===null||J===null||le===null)return 0;{const ce=J-T;return ce?D/ce*(le-A.value):0}}),H=i.computed(()=>`${E.value}px`),I=i.computed(()=>{const{value:T}=p,{value:D}=y,{value:J}=u,{value:le}=m;if(T===null||J===null||le===null)return 0;{const ce=J-T;return ce?D/ce*(le-Y.value):0}}),U=i.computed(()=>`${I.value}px`),O=i.computed(()=>{const{value:T}=f,{value:D}=h;return T!==null&&D!==null&&D>T}),z=i.computed(()=>{const{value:T}=p,{value:D}=u;return T!==null&&D!==null&&D>T}),Z=i.computed(()=>{const{trigger:T}=e;return T==="none"||b.value}),pe=i.computed(()=>{const{trigger:T}=e;return T==="none"||S.value}),re=i.computed(()=>{const{container:T}=e;return T?T():a.value}),ge=i.computed(()=>{const{content:T}=e;return T?T():l.value}),ie=(T,D)=>{if(!e.scrollable)return;if(typeof T=="number"){Ie(T,D??0,0,!1,"auto");return}const{left:J,top:le,index:ce,elSize:me,position:be,behavior:ke,el:Xe,debounce:ln=!0}=T;(J!==void 0||le!==void 0)&&Ie(J??0,le??0,0,!1,ke),Xe!==void 0?Ie(0,Xe.offsetTop,Xe.offsetHeight,ln,ke):ce!==void 0&&me!==void 0?Ie(0,ce*me,me,ln,ke):be==="bottom"?Ie(0,Number.MAX_SAFE_INTEGER,0,!1,ke):be==="top"&&Ie(0,0,0,!1,ke)},Me=Ob(()=>{e.container||ie({top:_.value,left:y.value})}),xe=()=>{Me.isDeactivated||ne()},Ce=T=>{if(Me.isDeactivated)return;const{onResize:D}=e;D&&D(T),ne()},Fe=(T,D)=>{if(!e.scrollable)return;const{value:J}=re;J&&(typeof T=="object"?J.scrollBy(T):J.scrollBy(T,D||0))};function Ie(T,D,J,le,ce){const{value:me}=re;if(me){if(le){const{scrollTop:be,offsetHeight:ke}=me;if(D>be){D+J<=be+ke||me.scrollTo({left:T,top:D+J-ke,behavior:ce});return}}me.scrollTo({left:T,top:D,behavior:ce})}}function kt(){_i(),yi(),ne()}function Cn(){At()}function At(){qt(),Et()}function qt(){v!==void 0&&window.clearTimeout(v),v=window.setTimeout(()=>{S.value=!1},e.duration)}function Et(){B!==void 0&&window.clearTimeout(B),B=window.setTimeout(()=>{b.value=!1},e.duration)}function _i(){B!==void 0&&window.clearTimeout(B),b.value=!0}function yi(){v!==void 0&&window.clearTimeout(v),S.value=!0}function zn(T){const{onScroll:D}=e;D&&D(T),an()}function an(){const{value:T}=re;T&&(_.value=T.scrollTop,y.value=T.scrollLeft*(s!=null&&s.value?-1:1))}function ot(){const{value:T}=ge;T&&(h.value=T.offsetHeight,u.value=T.offsetWidth);const{value:D}=re;D&&(f.value=D.offsetHeight,p.value=D.offsetWidth);const{value:J}=d,{value:le}=c;J&&(m.value=J.offsetWidth),le&&(g.value=le.offsetHeight)}function ee(){const{value:T}=re;T&&(_.value=T.scrollTop,y.value=T.scrollLeft*(s!=null&&s.value?-1:1),f.value=T.offsetHeight,p.value=T.offsetWidth,h.value=T.scrollHeight,u.value=T.scrollWidth);const{value:D}=d,{value:J}=c;D&&(m.value=D.offsetWidth),J&&(g.value=J.offsetHeight)}function ne(){e.scrollable&&(e.useUnifiedContainer?ee():(ot(),an()))}function je(T){var D;return!(!((D=o.value)===null||D===void 0)&&D.contains(ar(T)))}function vr(T){T.preventDefault(),T.stopPropagation(),C=!0,wt("mousemove",window,Di,!0),wt("mouseup",window,bi,!0),F=y.value,R=s!=null&&s.value?window.innerWidth-T.clientX:T.clientX}function Di(T){if(!C)return;B!==void 0&&window.clearTimeout(B),v!==void 0&&window.clearTimeout(v);const{value:D}=p,{value:J}=u,{value:le}=Y;if(D===null||J===null)return;const me=(s!=null&&s.value?window.innerWidth-T.clientX-R:T.clientX-R)*(J-D)/(D-le),be=J-D;let ke=F+me;ke=Math.min(be,ke),ke=Math.max(ke,0);const{value:Xe}=re;if(Xe){Xe.scrollLeft=ke*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:ln}=e;ln&&ln(ke)}}function bi(T){T.preventDefault(),T.stopPropagation(),et("mousemove",window,Di,!0),et("mouseup",window,bi,!0),C=!1,ne(),je(T)&&At()}function Hi(T){T.preventDefault(),T.stopPropagation(),x=!0,wt("mousemove",window,In,!0),wt("mouseup",window,wi,!0),$=_.value,q=T.clientY}function In(T){if(!x)return;B!==void 0&&window.clearTimeout(B),v!==void 0&&window.clearTimeout(v);const{value:D}=f,{value:J}=h,{value:le}=A;if(D===null||J===null)return;const me=(T.clientY-q)*(J-D)/(D-le),be=J-D;let ke=$+me;ke=Math.min(be,ke),ke=Math.max(ke,0);const{value:Xe}=re;Xe&&(Xe.scrollTop=ke)}function wi(T){T.preventDefault(),T.stopPropagation(),et("mousemove",window,In,!0),et("mouseup",window,wi,!0),x=!1,ne(),je(T)&&At()}i.watchEffect(()=>{const{value:T}=z,{value:D}=O,{value:J}=t,{value:le}=d,{value:ce}=c;le&&(T?le.classList.remove(`${J}-scrollbar-rail--disabled`):le.classList.add(`${J}-scrollbar-rail--disabled`)),ce&&(D?ce.classList.remove(`${J}-scrollbar-rail--disabled`):ce.classList.add(`${J}-scrollbar-rail--disabled`))}),i.onMounted(()=>{e.container||ne()}),i.onBeforeUnmount(()=>{B!==void 0&&window.clearTimeout(B),v!==void 0&&window.clearTimeout(v),et("mousemove",window,In,!0),et("mouseup",window,wi,!0)});const Wi=i.computed(()=>{const{common:{cubicBezierEaseInOut:T},self:{color:D,colorHover:J,height:le,width:ce,borderRadius:me,railInsetHorizontalTop:be,railInsetHorizontalBottom:ke,railInsetVerticalRight:Xe,railInsetVerticalLeft:ln,railColor:Go}}=N.value,{top:Ko,right:Zo,bottom:Jo,left:Qo}=Wt(be),{top:ea,right:ta,bottom:na,left:ia}=Wt(ke),{top:ra,right:sa,bottom:oa,left:aa}=Wt(s!=null&&s.value?Yd(Xe):Xe),{top:la,right:ca,bottom:da,left:ha}=Wt(s!=null&&s.value?Yd(ln):ln);return{"--n-scrollbar-bezier":T,"--n-scrollbar-color":D,"--n-scrollbar-color-hover":J,"--n-scrollbar-border-radius":me,"--n-scrollbar-width":ce,"--n-scrollbar-height":le,"--n-scrollbar-rail-top-horizontal-top":Ko,"--n-scrollbar-rail-right-horizontal-top":Zo,"--n-scrollbar-rail-bottom-horizontal-top":Jo,"--n-scrollbar-rail-left-horizontal-top":Qo,"--n-scrollbar-rail-top-horizontal-bottom":ea,"--n-scrollbar-rail-right-horizontal-bottom":ta,"--n-scrollbar-rail-bottom-horizontal-bottom":na,"--n-scrollbar-rail-left-horizontal-bottom":ia,"--n-scrollbar-rail-top-vertical-right":ra,"--n-scrollbar-rail-right-vertical-right":sa,"--n-scrollbar-rail-bottom-vertical-right":oa,"--n-scrollbar-rail-left-vertical-right":aa,"--n-scrollbar-rail-top-vertical-left":la,"--n-scrollbar-rail-right-vertical-left":ca,"--n-scrollbar-rail-bottom-vertical-left":da,"--n-scrollbar-rail-left-vertical-left":ha,"--n-scrollbar-rail-color":Go}}),Yt=n?fi("scrollbar",void 0,Wi,e):void 0;return Object.assign(Object.assign({},{scrollTo:ie,scrollBy:Fe,sync:ne,syncUnifiedContainer:ee,handleMouseEnterWrapper:kt,handleMouseLeaveWrapper:Cn}),{mergedClsPrefix:t,rtlEnabled:s,containerScrollTop:_,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:O,needXBar:z,yBarSizePx:L,xBarSizePx:P,yBarTopPx:H,xBarLeftPx:U,isShowXBar:Z,isShowYBar:pe,isIos:M,handleScroll:zn,handleContentResize:xe,handleContainerResize:Ce,handleYScrollMouseDown:Hi,handleXScrollMouseDown:vr,cssVars:n?void 0:Wi,themeClass:Yt==null?void 0:Yt.themeClass,onRender:Yt==null?void 0:Yt.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=(p,g)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,p],"data-scrollbar-rail":!0,style:[g||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?Lo:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),u=()=>{var p,g;return(p=this.onRender)===null||p===void 0||p.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(gs,{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?Lo: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}))])},f=this.container?u():i.h(gs,{onResize:this.handleContainerResize},{default:u});return o?i.h(i.Fragment,null,f,h(this.themeClass,this.cssVars)):f}}),ew=uh,tw={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function nw(e){const{textColorDisabled:t,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=e;return Object.assign(Object.assign({},tw),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:t,iconColor:n,extraTextColor:r})}const fh={name:"Empty",common:pi,self:nw},iw=ue("empty",`
|
298
|
+
`,[Y1(),oe("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),Q1=Object.assign(Object.assign({},ht.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"}}),hh=i.defineComponent({name:"Scrollbar",props:Q1,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedRtlRef:r}=hi(e),s=_s("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),u=i.ref(null),f=i.ref(null),p=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 x=!1,C=!1,B,v,$=0,F=0,R=0,X=0;const M=$y(),N=ht("Scrollbar","-scrollbar",J1,dh,e,t),A=i.computed(()=>{const{value:T}=f,{value:D}=h,{value:Q}=g;return T===null||D===null||Q===null?0:Math.min(T,Q*T/D+ar(N.value.self.width)*1.5)}),L=i.computed(()=>`${A.value}px`),Y=i.computed(()=>{const{value:T}=p,{value:D}=u,{value:Q}=m;return T===null||D===null||Q===null?0:Q*T/D+ar(N.value.self.height)*1.5}),P=i.computed(()=>`${Y.value}px`),E=i.computed(()=>{const{value:T}=f,{value:D}=_,{value:Q}=h,{value:le}=g;if(T===null||Q===null||le===null)return 0;{const ce=Q-T;return ce?D/ce*(le-A.value):0}}),H=i.computed(()=>`${E.value}px`),I=i.computed(()=>{const{value:T}=p,{value:D}=y,{value:Q}=u,{value:le}=m;if(T===null||Q===null||le===null)return 0;{const ce=Q-T;return ce?D/ce*(le-Y.value):0}}),U=i.computed(()=>`${I.value}px`),O=i.computed(()=>{const{value:T}=f,{value:D}=h;return T!==null&&D!==null&&D>T}),z=i.computed(()=>{const{value:T}=p,{value:D}=u;return T!==null&&D!==null&&D>T}),J=i.computed(()=>{const{trigger:T}=e;return T==="none"||b.value}),pe=i.computed(()=>{const{trigger:T}=e;return T==="none"||S.value}),re=i.computed(()=>{const{container:T}=e;return T?T():a.value}),ge=i.computed(()=>{const{content:T}=e;return T?T():l.value}),ie=(T,D)=>{if(!e.scrollable)return;if(typeof T=="number"){Ie(T,D??0,0,!1,"auto");return}const{left:Q,top:le,index:ce,elSize:me,position:be,behavior:ke,el:Xe,debounce:an=!0}=T;(Q!==void 0||le!==void 0)&&Ie(Q??0,le??0,0,!1,ke),Xe!==void 0?Ie(0,Xe.offsetTop,Xe.offsetHeight,an,ke):ce!==void 0&&me!==void 0?Ie(0,ce*me,me,an,ke):be==="bottom"?Ie(0,Number.MAX_SAFE_INTEGER,0,!1,ke):be==="top"&&Ie(0,0,0,!1,ke)},Me=Ob(()=>{e.container||ie({top:_.value,left:y.value})}),xe=()=>{Me.isDeactivated||ne()},Ce=T=>{if(Me.isDeactivated)return;const{onResize:D}=e;D&&D(T),ne()},Fe=(T,D)=>{if(!e.scrollable)return;const{value:Q}=re;Q&&(typeof T=="object"?Q.scrollBy(T):Q.scrollBy(T,D||0))};function Ie(T,D,Q,le,ce){const{value:me}=re;if(me){if(le){const{scrollTop:be,offsetHeight:ke}=me;if(D>be){D+Q<=be+ke||me.scrollTo({left:T,top:D+Q-ke,behavior:ce});return}}me.scrollTo({left:T,top:D,behavior:ce})}}function vt(){mi(),_i(),ne()}function xn(){Mt()}function Mt(){Xt(),Tt()}function Xt(){v!==void 0&&window.clearTimeout(v),v=window.setTimeout(()=>{S.value=!1},e.duration)}function Tt(){B!==void 0&&window.clearTimeout(B),B=window.setTimeout(()=>{b.value=!1},e.duration)}function mi(){B!==void 0&&window.clearTimeout(B),b.value=!0}function _i(){v!==void 0&&window.clearTimeout(v),S.value=!0}function Vn(T){const{onScroll:D}=e;D&&D(T),on()}function on(){const{value:T}=re;T&&(_.value=T.scrollTop,y.value=T.scrollLeft*(s!=null&&s.value?-1:1))}function st(){const{value:T}=ge;T&&(h.value=T.offsetHeight,u.value=T.offsetWidth);const{value:D}=re;D&&(f.value=D.offsetHeight,p.value=D.offsetWidth);const{value:Q}=d,{value:le}=c;Q&&(m.value=Q.offsetWidth),le&&(g.value=le.offsetHeight)}function te(){const{value:T}=re;T&&(_.value=T.scrollTop,y.value=T.scrollLeft*(s!=null&&s.value?-1:1),f.value=T.offsetHeight,p.value=T.offsetWidth,h.value=T.scrollHeight,u.value=T.scrollWidth);const{value:D}=d,{value:Q}=c;D&&(m.value=D.offsetWidth),Q&&(g.value=Q.offsetHeight)}function ne(){e.scrollable&&(e.useUnifiedContainer?te():(st(),on()))}function je(T){var D;return!(!((D=o.value)===null||D===void 0)&&D.contains(or(T)))}function wr(T){T.preventDefault(),T.stopPropagation(),C=!0,bt("mousemove",window,Li,!0),bt("mouseup",window,yi,!0),F=y.value,R=s!=null&&s.value?window.innerWidth-T.clientX:T.clientX}function Li(T){if(!C)return;B!==void 0&&window.clearTimeout(B),v!==void 0&&window.clearTimeout(v);const{value:D}=p,{value:Q}=u,{value:le}=Y;if(D===null||Q===null)return;const me=(s!=null&&s.value?window.innerWidth-T.clientX-R:T.clientX-R)*(Q-D)/(D-le),be=Q-D;let ke=F+me;ke=Math.min(be,ke),ke=Math.max(ke,0);const{value:Xe}=re;if(Xe){Xe.scrollLeft=ke*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:an}=e;an&&an(ke)}}function yi(T){T.preventDefault(),T.stopPropagation(),Qe("mousemove",window,Li,!0),Qe("mouseup",window,yi,!0),C=!1,ne(),je(T)&&Mt()}function Di(T){T.preventDefault(),T.stopPropagation(),x=!0,bt("mousemove",window,zn,!0),bt("mouseup",window,bi,!0),$=_.value,X=T.clientY}function zn(T){if(!x)return;B!==void 0&&window.clearTimeout(B),v!==void 0&&window.clearTimeout(v);const{value:D}=f,{value:Q}=h,{value:le}=A;if(D===null||Q===null)return;const me=(T.clientY-X)*(Q-D)/(D-le),be=Q-D;let ke=$+me;ke=Math.min(be,ke),ke=Math.max(ke,0);const{value:Xe}=re;Xe&&(Xe.scrollTop=ke)}function bi(T){T.preventDefault(),T.stopPropagation(),Qe("mousemove",window,zn,!0),Qe("mouseup",window,bi,!0),x=!1,ne(),je(T)&&Mt()}i.watchEffect(()=>{const{value:T}=z,{value:D}=O,{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&&(D?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),v!==void 0&&window.clearTimeout(v),Qe("mousemove",window,zn,!0),Qe("mouseup",window,bi,!0)});const Hi=i.computed(()=>{const{common:{cubicBezierEaseInOut:T},self:{color:D,colorHover:Q,height:le,width:ce,borderRadius:me,railInsetHorizontalTop:be,railInsetHorizontalBottom:ke,railInsetVerticalRight:Xe,railInsetVerticalLeft:an,railColor:Uo}}=N.value,{top:Go,right:Ko,bottom:Zo,left:Jo}=Ht(be),{top:Qo,right:ea,bottom:ta,left:na}=Ht(ke),{top:ia,right:ra,bottom:sa,left:oa}=Ht(s!=null&&s.value?qd(Xe):Xe),{top:aa,right:la,bottom:ca,left:da}=Ht(s!=null&&s.value?qd(an):an);return{"--n-scrollbar-bezier":T,"--n-scrollbar-color":D,"--n-scrollbar-color-hover":Q,"--n-scrollbar-border-radius":me,"--n-scrollbar-width":ce,"--n-scrollbar-height":le,"--n-scrollbar-rail-top-horizontal-top":Go,"--n-scrollbar-rail-right-horizontal-top":Ko,"--n-scrollbar-rail-bottom-horizontal-top":Zo,"--n-scrollbar-rail-left-horizontal-top":Jo,"--n-scrollbar-rail-top-horizontal-bottom":Qo,"--n-scrollbar-rail-right-horizontal-bottom":ea,"--n-scrollbar-rail-bottom-horizontal-bottom":ta,"--n-scrollbar-rail-left-horizontal-bottom":na,"--n-scrollbar-rail-top-vertical-right":ia,"--n-scrollbar-rail-right-vertical-right":ra,"--n-scrollbar-rail-bottom-vertical-right":sa,"--n-scrollbar-rail-left-vertical-right":oa,"--n-scrollbar-rail-top-vertical-left":aa,"--n-scrollbar-rail-right-vertical-left":la,"--n-scrollbar-rail-bottom-vertical-left":ca,"--n-scrollbar-rail-left-vertical-left":da,"--n-scrollbar-rail-color":Uo}}),qt=n?ui("scrollbar",void 0,Hi,e):void 0;return Object.assign(Object.assign({},{scrollTo:ie,scrollBy:Fe,sync:ne,syncUnifiedContainer:te,handleMouseEnterWrapper:vt,handleMouseLeaveWrapper:xn}),{mergedClsPrefix:t,rtlEnabled:s,containerScrollTop:_,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:O,needXBar:z,yBarSizePx:L,xBarSizePx:P,yBarTopPx:H,xBarLeftPx:U,isShowXBar:J,isShowYBar:pe,isIos:M,handleScroll:Vn,handleContentResize:xe,handleContainerResize:Ce,handleYScrollMouseDown:Di,handleXScrollMouseDown:wr,cssVars:n?void 0:Hi,themeClass:qt==null?void 0:qt.themeClass,onRender:qt==null?void 0:qt.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=(p,g)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,p],"data-scrollbar-rail":!0,style:[g||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?Io:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),u=()=>{var p,g;return(p=this.onRender)===null||p===void 0||p.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(ps,{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?Io: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}))])},f=this.container?u():i.h(ps,{onResize:this.handleContainerResize},{default:u});return o?i.h(i.Fragment,null,f,h(this.themeClass,this.cssVars)):f}}),ew=hh,tw={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function nw(e){const{textColorDisabled:t,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=e;return Object.assign(Object.assign({},tw),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:t,iconColor:n,extraTextColor:r})}const uh={name:"Empty",common:fi,self:nw},iw=ue("empty",`
|
299
299
|
display: flex;
|
300
300
|
flex-direction: column;
|
301
301
|
align-items: center;
|
@@ -318,7 +318,7 @@ ${s}
|
|
318
318
|
transition: color .3s var(--n-bezier);
|
319
319
|
margin-top: 12px;
|
320
320
|
color: var(--n-extra-text-color);
|
321
|
-
`)]),rw=Object.assign(Object.assign({},
|
321
|
+
`)]),rw=Object.assign(Object.assign({},ht.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),sw=i.defineComponent({name:"Empty",props:rw,slots:Object,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:r}=hi(e),s=ht("Empty","-empty",iw,uh,e,t),{localeRef:o}=nh("Empty"),a=i.computed(()=>{var h,u,f;return(h=e.description)!==null&&h!==void 0?h:(f=(u=r==null?void 0:r.value)===null||u===void 0?void 0:u.Empty)===null||f===void 0?void 0:f.description}),l=i.computed(()=>{var h,u;return((u=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||u===void 0?void 0:u.renderIcon)||(()=>i.h(z1,null))}),c=i.computed(()=>{const{size:h}=e,{common:{cubicBezierEaseInOut:u},self:{[qe("iconSize",h)]:f,[qe("fontSize",h)]:p,textColor:g,iconColor:m,extraTextColor:_}}=s.value;return{"--n-icon-size":f,"--n-font-size":p,"--n-bezier":u,"--n-text-color":g,"--n-icon-color":m,"--n-extra-text-color":_}}),d=n?ui("empty",i.computed(()=>{let h="";const{size:u}=e;return h+=u[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(yr,{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)}}),ow={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 aw(e){const{borderRadius:t,popoverColor:n,textColor3:r,dividerColor:s,textColor2:o,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:h,fontSizeTiny:u,fontSizeSmall:f,fontSizeMedium:p,fontSizeLarge:g,fontSizeHuge:m,heightTiny:_,heightSmall:y,heightMedium:b,heightLarge:S,heightHuge:x}=e;return Object.assign(Object.assign({},ow),{optionFontSizeTiny:u,optionFontSizeSmall:f,optionFontSizeMedium:p,optionFontSizeLarge:g,optionFontSizeHuge:m,optionHeightTiny:_,optionHeightSmall:y,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 fh={name:"InternalSelectMenu",common:fi,peers:{Scrollbar:dh,Empty:uh},self:aw},ph=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(Fo);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):Ii(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 lw(e,t){return i.h(i.Transition,{name:"fade-in-scale-up-transition"},{default:()=>e?i.h(yr,{clsPrefix:t,class:`${t}-base-select-option__check`},{default:()=>i.h(M1)}):null})}const gh=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:u,handleOptionMouseEnter:f}=i.inject(Fo),p=zt(()=>{const{value:y}=n;return y?e.tmNode.key===y.key:!1});function g(y){const{tmNode:b}=e;b.disabled||u(y,b)}function m(y){const{tmNode:b}=e;b.disabled||f(y,b)}function _(y){const{tmNode:b}=e,{value:S}=p;b.disabled||S||f(y,b)}return{multiple:r,isGrouped:zt(()=>{const{tmNode:y}=e,{parent:b}=y;return b&&b.rawNode.type==="group"}),showCheckmark:d,nodeProps:h,isPending:p,isSelected:zt(()=>{const{value:y}=t,{value:b}=r;if(y===null)return!1;const S=e.tmNode.rawNode[c.value];if(b){const{value:x}=s;return x.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:u}=this,f=lw(n,e),p=c?[c(t,n),o&&f]:[Ii(t[this.labelField],t,n),o&&f],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:Vo([d,g==null?void 0:g.onClick]),onMouseenter:Vo([h,g==null?void 0:g.onMouseenter]),onMousemove:Vo([u,g==null?void 0:g.onMousemove])}),i.h("div",{class:`${e}-base-select-option__content`},p));return t.render?t.render({node:m,option:t,selected:n}):l?l({node:m,option:t,selected:n}):m}}),{cubicBezierEaseIn:mh,cubicBezierEaseOut:_h}=_r;function yh({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} ${mh}, transform ${t} ${mh} ${s&&`,${s}`}`}),oe("&.fade-in-scale-up-transition-enter-active",{transformOrigin:e,transition:`opacity ${t} ${_h}, transform ${t} ${_h} ${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 cw=ue("base-select-menu",`
|
322
322
|
line-height: 1.5;
|
323
323
|
outline: none;
|
324
324
|
z-index: 0;
|
@@ -414,7 +414,7 @@ ${s}
|
|
414
414
|
background-color: var(--n-option-color-active-pending);
|
415
415
|
`)])]),Be("disabled",`
|
416
416
|
cursor: not-allowed;
|
417
|
-
`,[
|
417
|
+
`,[Wt("selected",`
|
418
418
|
color: var(--n-option-text-color-disabled);
|
419
419
|
`),Be("selected",`
|
420
420
|
opacity: var(--n-option-opacity-disabled);
|
@@ -425,7 +425,7 @@ ${s}
|
|
425
425
|
top: calc(50% - 7px);
|
426
426
|
color: var(--n-option-check-color);
|
427
427
|
transition: color .3s var(--n-bezier);
|
428
|
-
`,[
|
428
|
+
`,[yh({enterScale:"0.5"})])])]),dw=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},ht.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}=hi(e),r=_s("InternalSelectMenu",n,t),s=ht("InternalSelectMenu","-internal-select-menu",cw,fh,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(()=>ny(c.value)),h=i.ref(null);function u(){const{treeMate:O}=e;let z=null;const{value:J}=e;J===null?z=O.getFirstAvailableNode():(e.multiple?z=O.getNode((J||[])[(J||[]).length-1]):z=O.getNode(J),(!z||z.disabled)&&(z=O.getFirstAvailableNode())),A(z||null)}function f(){const{value:O}=h;O&&!e.treeMate.getNode(O.key)&&(h.value=null)}let p;i.watch(()=>e.show,O=>{O?p=i.watch(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?u():f(),i.nextTick(L)):f()},{immediate:!0}):p==null||p()},{immediate:!0}),i.onBeforeUnmount(()=>{p==null||p()});const g=i.computed(()=>ar(s.value.self[qe("optionHeight",e.size)])),m=i.computed(()=>Ht(s.value.self[qe("padding",e.size)])),_=i.computed(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),y=i.computed(()=>{const O=c.value;return O&&O.length===0});function b(O){const{onToggle:z}=e;z&&z(O)}function S(O){const{onScroll:z}=e;z&&z(O)}function x(O){var z;(z=l.value)===null||z===void 0||z.sync(),S(O)}function C(){var O;(O=l.value)===null||O===void 0||O.sync()}function B(){const{value:O}=h;return O||null}function v(O,z){z.disabled||A(z,!1)}function $(O,z){z.disabled||b(z)}function F(O){var z;sr(O,"action")||(z=e.onKeyup)===null||z===void 0||z.call(e,O)}function R(O){var z;sr(O,"action")||(z=e.onKeydown)===null||z===void 0||z.call(e,O)}function X(O){var z;(z=e.onMousedown)===null||z===void 0||z.call(e,O),!e.focusable&&O.preventDefault()}function M(){const{value:O}=h;O&&A(O.getNext({loop:!0}),!0)}function N(){const{value:O}=h;O&&A(O.getPrev({loop:!0}),!0)}function A(O,z=!1){h.value=O,z&&L()}function L(){var O,z;const J=h.value;if(!J)return;const pe=d.value(J.key);pe!==null&&(e.virtualScroll?(O=a.value)===null||O===void 0||O.scrollTo({index:pe}):(z=l.value)===null||z===void 0||z.scrollTo({index:pe,elSize:g.value}))}function Y(O){var z,J;!((z=o.value)===null||z===void 0)&&z.contains(O.target)&&((J=e.onFocus)===null||J===void 0||J.call(e,O))}function P(O){var z,J;!((z=o.value)===null||z===void 0)&&z.contains(O.relatedTarget)||(J=e.onBlur)===null||J===void 0||J.call(e,O)}i.provide(Fo,{handleOptionMouseEnter:v,handleOptionClick:$,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(zd,o),i.onMounted(()=>{const{value:O}=l;O&&O.sync()});const E=i.computed(()=>{const{size:O}=e,{common:{cubicBezierEaseInOut:z},self:{height:J,borderRadius:pe,color:re,groupHeaderTextColor:ge,actionDividerColor:ie,optionTextColorPressed:Me,optionTextColor:xe,optionTextColorDisabled:Ce,optionTextColorActive:Fe,optionOpacityDisabled:Ie,optionCheckColor:vt,actionTextColor:xn,optionColorPending:Mt,optionColorActive:Xt,loadingColor:Tt,loadingSize:mi,optionColorActivePending:_i,[qe("optionFontSize",O)]:Vn,[qe("optionHeight",O)]:on,[qe("optionPadding",O)]:st}}=s.value;return{"--n-height":J,"--n-action-divider-color":ie,"--n-action-text-color":xn,"--n-bezier":z,"--n-border-radius":pe,"--n-color":re,"--n-option-font-size":Vn,"--n-group-header-text-color":ge,"--n-option-check-color":vt,"--n-option-color-pending":Mt,"--n-option-color-active":Xt,"--n-option-color-active-pending":_i,"--n-option-height":on,"--n-option-opacity-disabled":Ie,"--n-option-text-color":xe,"--n-option-text-color-active":Fe,"--n-option-text-color-disabled":Ce,"--n-option-text-color-pressed":Me,"--n-option-padding":st,"--n-option-padding-left":Ht(st,"left"),"--n-option-padding-right":Ht(st,"right"),"--n-loading-color":Tt,"--n-loading-size":mi}}),{inlineThemeDisabled:H}=e,I=H?ui("internal-select-menu",i.computed(()=>e.size[0]),E,e):void 0,U={selfRef:o,next:M,prev:N,getPendingTmNode:B};return Wd(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:O}=a;return O==null?void 0:O.listElRef},virtualListContent(){const{value:O}=a;return O==null?void 0:O.itemsElRef},doScroll:S,handleFocusin:Y,handleFocusout:P,handleKeyUp:F,handleKeyDown:R,handleMouseDown:X,handleVirtualListResize:C,handleVirtualListScroll:x,cssVars:H?void 0:E,themeClass:I==null?void 0:I.themeClass,onRender:I==null?void 0:I.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},ci(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(oh,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},zo(e.empty,()=>[i.h(sw,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(hh,{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(Rb,{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(ph,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h(gh,{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(ph,{key:a.key,clsPrefix:n,tmNode:a}):i.h(gh,{clsPrefix:n,key:a.key,tmNode:a})))}),ci(e.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(j1,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),hw={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function uw(e){const{boxShadow2:t,popoverColor:n,textColor2:r,borderRadius:s,fontSize:o,dividerColor:a}=e;return Object.assign(Object.assign({},hw),{fontSize:o,borderRadius:s,color:n,dividerColor:a,textColor:r,boxShadow:t})}const bh={name:"Popover",common:fi,self:uw},Wo={top:"bottom",bottom:"top",left:"right",right:"left"},et="var(--n-arrow-height) * 1.414",fw=oe([ue("popover",`
|
429
429
|
transition:
|
430
430
|
box-shadow .3s var(--n-bezier),
|
431
431
|
background-color .3s var(--n-bezier),
|
@@ -438,10 +438,10 @@ ${s}
|
|
438
438
|
`,[oe(">",[ue("scrollbar",`
|
439
439
|
height: inherit;
|
440
440
|
max-height: inherit;
|
441
|
-
`)]),
|
441
|
+
`)]),Wt("raw",`
|
442
442
|
background-color: var(--n-color);
|
443
443
|
border-radius: var(--n-border-radius);
|
444
|
-
`,[
|
444
|
+
`,[Wt("scrollable",[Wt("show-header-or-footer","padding: var(--n-padding);")])]),_e("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);
|
@@ -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(${
|
465
|
-
height: calc(${
|
464
|
+
width: calc(${et});
|
465
|
+
height: calc(${et});
|
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,50 +487,50 @@ ${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
|
-
`)]),
|
491
|
-
top: calc(${
|
492
|
-
left: calc(${
|
493
|
-
`),
|
494
|
-
top: calc(${
|
495
|
-
transform: translateX(calc(${
|
490
|
+
`)]),It("top-start",`
|
491
|
+
top: calc(${et} / -2);
|
492
|
+
left: calc(${gn("top-start")} - var(--v-offset-left));
|
493
|
+
`),It("top",`
|
494
|
+
top: calc(${et} / -2);
|
495
|
+
transform: translateX(calc(${et} / -2)) rotate(45deg);
|
496
496
|
left: 50%;
|
497
|
-
`),
|
498
|
-
top: calc(${
|
499
|
-
right: calc(${
|
500
|
-
`),
|
501
|
-
bottom: calc(${
|
502
|
-
left: calc(${
|
503
|
-
`),
|
504
|
-
bottom: calc(${
|
505
|
-
transform: translateX(calc(${
|
497
|
+
`),It("top-end",`
|
498
|
+
top: calc(${et} / -2);
|
499
|
+
right: calc(${gn("top-end")} + var(--v-offset-left));
|
500
|
+
`),It("bottom-start",`
|
501
|
+
bottom: calc(${et} / -2);
|
502
|
+
left: calc(${gn("bottom-start")} - var(--v-offset-left));
|
503
|
+
`),It("bottom",`
|
504
|
+
bottom: calc(${et} / -2);
|
505
|
+
transform: translateX(calc(${et} / -2)) rotate(45deg);
|
506
506
|
left: 50%;
|
507
|
-
`),
|
508
|
-
bottom: calc(${
|
509
|
-
right: calc(${
|
510
|
-
`),
|
511
|
-
left: calc(${
|
512
|
-
top: calc(${
|
513
|
-
`),
|
514
|
-
left: calc(${
|
515
|
-
transform: translateY(calc(${
|
507
|
+
`),It("bottom-end",`
|
508
|
+
bottom: calc(${et} / -2);
|
509
|
+
right: calc(${gn("bottom-end")} + var(--v-offset-left));
|
510
|
+
`),It("left-start",`
|
511
|
+
left: calc(${et} / -2);
|
512
|
+
top: calc(${gn("left-start")} - var(--v-offset-top));
|
513
|
+
`),It("left",`
|
514
|
+
left: calc(${et} / -2);
|
515
|
+
transform: translateY(calc(${et} / -2)) rotate(45deg);
|
516
516
|
top: 50%;
|
517
|
-
`),
|
518
|
-
left: calc(${
|
519
|
-
bottom: calc(${
|
520
|
-
`),
|
521
|
-
right: calc(${
|
522
|
-
top: calc(${
|
523
|
-
`),
|
524
|
-
right: calc(${
|
525
|
-
transform: translateY(calc(${
|
517
|
+
`),It("left-end",`
|
518
|
+
left: calc(${et} / -2);
|
519
|
+
bottom: calc(${gn("left-end")} + var(--v-offset-top));
|
520
|
+
`),It("right-start",`
|
521
|
+
right: calc(${et} / -2);
|
522
|
+
top: calc(${gn("right-start")} - var(--v-offset-top));
|
523
|
+
`),It("right",`
|
524
|
+
right: calc(${et} / -2);
|
525
|
+
transform: translateY(calc(${et} / -2)) rotate(45deg);
|
526
526
|
top: 50%;
|
527
|
-
`),
|
528
|
-
right: calc(${
|
529
|
-
bottom: calc(${
|
530
|
-
`),...W.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)`} - ${
|
531
|
-
margin-${
|
527
|
+
`),It("right-end",`
|
528
|
+
right: calc(${et} / -2);
|
529
|
+
bottom: calc(${gn("right-end")} + var(--v-offset-top));
|
530
|
+
`),...W.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)`} - ${et}) / 2)`,c=gn(s);return oe(`[v-placement="${s}"] >`,[ue("popover-shared",[Be("center-arrow",[ue("popover-arrow",`${t}: calc(max(${l}, ${c}) ${o?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function gn(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function It(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}"] >`,[ue("popover-shared",`
|
531
|
+
margin-${Wo[n]}: var(--n-space);
|
532
532
|
`,[Be("show-arrow",`
|
533
|
-
margin-${
|
533
|
+
margin-${Wo[n]}: var(--n-space-arrow);
|
534
534
|
`),Be("overlap",`
|
535
535
|
margin: 0;
|
536
536
|
`),Hb("popover-arrow-wrapper",`
|
@@ -539,9 +539,9 @@ ${s}
|
|
539
539
|
top: 0;
|
540
540
|
bottom: 0;
|
541
541
|
${n}: 100%;
|
542
|
-
${
|
542
|
+
${Wo[n]}: auto;
|
543
543
|
${r}
|
544
|
-
`,[ue("popover-arrow",t)])])])}const vh=Object.assign(Object.assign({},ut.props),{to:gn.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 pw({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 gw=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:vh,setup(e,{slots:t,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o}=ui(e),a=ut("Popover","-popover",fw,wh,e,s),l=i.ref(null),c=i.inject("NPopover"),d=i.ref(null),h=i.ref(e.show),u=i.ref(!1);i.watchEffect(()=>{const{show:v}=e;v&&!Wb()&&!e.internalDeactivateImmediately&&(u.value=!0)});const f=i.computed(()=>{const{trigger:v,onClickoutside:$}=e,F=[],{positionManuallyRef:{value:R}}=c;return R||(v==="click"&&!$&&F.push([ss,x,void 0,{capture:!0}]),v==="hover"&&F.push([ky,S])),$&&F.push([ss,x,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&u.value)&&F.push([i.vShow,e.show]),F}),p=i.computed(()=>{const{common:{cubicBezierEaseInOut:v,cubicBezierEaseIn:$,cubicBezierEaseOut:F},self:{space:R,spaceArrow:q,padding:M,fontSize:N,textColor:A,dividerColor:L,color:Y,boxShadow:P,borderRadius:E,arrowHeight:H,arrowOffset:I,arrowOffsetVertical:U}}=a.value;return{"--n-box-shadow":P,"--n-bezier":v,"--n-bezier-ease-in":$,"--n-bezier-ease-out":F,"--n-font-size":N,"--n-text-color":A,"--n-color":Y,"--n-divider-color":L,"--n-border-radius":E,"--n-arrow-height":H,"--n-arrow-offset":I,"--n-arrow-offset-vertical":U,"--n-padding":M,"--n-space":R,"--n-space-arrow":q}}),g=i.computed(()=>{const v=e.width==="trigger"?void 0:Ao(e.width),$=[];v&&$.push({width:v});const{maxWidth:F,minWidth:R}=e;return F&&$.push({maxWidth:Ao(F)}),R&&$.push({maxWidth:Ao(R)}),o||$.push(p.value),$}),m=o?fi("popover",void 0,p,e):void 0;c.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{c.setBodyInstance(null)}),i.watch(i.toRef(e,"show"),v=>{e.animated||(v?h.value=!0:h.value=!1)});function _(){var v;(v=l.value)===null||v===void 0||v.syncPosition()}function y(v){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&c.handleMouseEnter(v)}function b(v){e.trigger==="hover"&&e.keepAliveOnHover&&c.handleMouseLeave(v)}function S(v){e.trigger==="hover"&&!C().contains(ar(v))&&c.handleMouseMoveOutside(v)}function x(v){(e.trigger==="click"&&!C().contains(ar(v))||e.onClickoutside)&&c.handleClickOutside(v)}function C(){return c.getTriggerElement()}i.provide(Hd,d),i.provide(Ld,null),i.provide(Dd,null);function B(){if(m==null||m.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&u.value))return null;let $;const F=c.internalRenderBodyRef.value,{value:R}=s;if(F)$=F([`${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:q}=c.extraClassRef,{internalTrapFocus:M}=e,N=!th(t.header)||!th(t.footer),A=()=>{var L,Y;const P=N?i.h(i.Fragment,null,di(t.header,I=>I?i.h("div",{class:[`${R}-popover__header`,e.headerClass],style:e.headerStyle},I):null),di(t.default,I=>I?i.h("div",{class:[`${R}-popover__content`,e.contentClass],style:e.contentStyle},t):null),di(t.footer,I=>I?i.h("div",{class:[`${R}-popover__footer`,e.footerClass],style:e.footerStyle},I):null)):e.scrollable?(L=t.default)===null||L===void 0?void 0:L.call(t):i.h("div",{class:[`${R}-popover__content`,e.contentClass],style:e.contentStyle},t),E=e.scrollable?i.h(ew,{contentClass:N?void 0:`${R}-popover__content ${(Y=e.contentClass)!==null&&Y!==void 0?Y:""}`,contentStyle:N?void 0:e.contentStyle},{default:()=>P}):P,H=e.showArrow?pw({arrowClass:e.arrowClass,arrowStyle:e.arrowStyle,arrowWrapperClass:e.arrowWrapperClass,arrowWrapperStyle:e.arrowWrapperStyle,clsPrefix:R}):null;return[E,H]};$=i.h("div",i.mergeProps({class:[`${R}-popover`,`${R}-popover-shared`,m==null?void 0:m.themeClass.value,q.map(L=>`${R}-${L}`),{[`${R}-popover--scrollable`]:e.scrollable,[`${R}-popover--show-header-or-footer`]:N,[`${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),M?i.h(Ab,{active:e.show,autoFocus:!0},{default:A}):A())}return i.withDirectives($,f.value)}return{displayed:u,namespace:r,isMounted:c.isMountedRef,zIndex:c.zIndexRef,followerRef:l,adjustedTo:gn(e),followerEnabled:h,renderContentNode:B}},render(){return i.h(gd,{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===gn.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 mw={};const _w=Object.keys(vh),yw={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function bw(e,t,n){yw[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 ww={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:gn.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},vw=Object.assign(Object.assign(Object.assign({},ut.props),ww),{internalOnAfterLeave:Function,internalRenderBody:Function}),kw=i.defineComponent({name:"Popover",inheritAttrs:!1,props:vw,slots:Object,__popover__:!0,setup(e){mw.NODE_ENV!=="production"&&i.watchEffect(()=>{e.maxWidth!==void 0&&On("popover","`max-width` is deprecated, please use `style` instead."),e.minWidth!==void 0&&On("popover","`min-width` is deprecated, please use `style` instead."),e.arrow!==void 0&&On("popover","`arrow` is deprecated, please use `showArrow` instead."),e.onHide!==void 0&&On("popover","`on-hide` is deprecated, please use `on-update:show` instead."),e.onShow!==void 0&&On("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const t=os(),n=i.ref(null),r=i.computed(()=>e.show),s=i.ref(e.defaultShow),o=vo(r,s),a=It(()=>e.disabled?!1:o.value),l=()=>{if(e.disabled)return!0;const{getDisabled:L}=e;return!!(L!=null&&L())},c=()=>l()?!1:o.value,d=Gc(e,["arrow","showArrow"]),h=i.computed(()=>e.overlap?!1:d.value);let u=null;const f=i.ref(null),p=i.ref(null),g=It(()=>e.x!==void 0&&e.y!==void 0);function m(L){const{"onUpdate:show":Y,onUpdateShow:P,onShow:E,onHide:H}=e;s.value=L,Y&&ht(Y,L),P&&ht(P,L),L&&E&&ht(E,!0),L&&H&&ht(H,!1)}function _(){u&&u.syncPosition()}function y(){const{value:L}=f;L&&(window.clearTimeout(L),f.value=null)}function b(){const{value:L}=p;L&&(window.clearTimeout(L),p.value=null)}function S(){const L=l();if(e.trigger==="focus"&&!L){if(c())return;m(!0)}}function x(){const L=l();if(e.trigger==="focus"&&!L){if(!c())return;m(!1)}}function C(){const L=l();if(e.trigger==="hover"&&!L){if(b(),f.value!==null||c())return;const Y=()=>{m(!0),f.value=null},{delay:P}=e;P===0?Y():f.value=window.setTimeout(Y,P)}}function B(){const L=l();if(e.trigger==="hover"&&!L){if(y(),p.value!==null||!c())return;const Y=()=>{m(!1),p.value=null},{duration:P}=e;P===0?Y():p.value=window.setTimeout(Y,P)}}function v(){B()}function $(L){var Y;c()&&(e.trigger==="click"&&(y(),b(),m(!1)),(Y=e.onClickoutside)===null||Y===void 0||Y.call(e,L))}function F(){if(e.trigger==="click"&&!l()){y(),b();const L=!c();m(L)}}function R(L){e.internalTrapFocus&&L.key==="Escape"&&(y(),b(),m(!1))}function q(L){s.value=L}function M(){var L;return(L=n.value)===null||L===void 0?void 0:L.targetRef}function N(L){u=L}return i.provide("NPopover",{getTriggerElement:M,handleKeydown:R,handleMouseEnter:C,handleMouseLeave:B,handleClickOutside:$,handleMouseMoveOutside:v,setBodyInstance:N,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:q,handleClick:F,handleMouseEnter:C,handleMouseLeave:B,handleFocus:S,handleBlur:x,syncPosition:_}},render(){var e;const{positionManually:t,$slots:n}=this;let r,s=!1;if(!t&&(r=qb(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)})}};bw(r,a?"nested":t?"manual":this.trigger,c)}}return i.h(Qc,{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}}),[[Uc,{enabled:o,zIndex:this.zIndex}]]):null,t?null:i.h(ed,null,{default:()=>r}),i.h(gw,Yb(this.$props,_w,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)}})]}})}}),xw={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 Cw(e){const{textColor2:t,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:h,opacityDisabled:u,tagColor:f,closeIconColor:p,closeIconColorHover:g,closeIconColorPressed:m,borderRadiusSmall:_,fontSizeMini:y,fontSizeTiny:b,fontSizeSmall:S,fontSizeMedium:x,heightMini:C,heightTiny:B,heightSmall:v,heightMedium:$,closeColorHover:F,closeColorPressed:R,buttonColor2Hover:q,buttonColor2Pressed:M,fontWeightStrong:N}=e;return Object.assign(Object.assign({},xw),{closeBorderRadius:_,heightTiny:C,heightSmall:B,heightMedium:v,heightLarge:$,borderRadius:_,opacityDisabled:u,fontSizeTiny:y,fontSizeSmall:b,fontSizeMedium:S,fontSizeLarge:x,fontWeightStrong:N,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:q,colorPressedCheckable:M,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${h}`,textColor:t,color:f,colorBordered:"rgb(250, 250, 252)",closeIconColor:p,closeIconColorHover:g,closeIconColorPressed:m,closeColorHover:F,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 Sw={common:pi,self:Cw},Bw={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},Tw=ue("tag",`
|
544
|
+
`,[ue("popover-arrow",t)])])])}const wh=Object.assign(Object.assign({},ht.props),{to:pn.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 pw({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 gw=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:wh,setup(e,{slots:t,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o}=hi(e),a=ht("Popover","-popover",fw,bh,e,s),l=i.ref(null),c=i.inject("NPopover"),d=i.ref(null),h=i.ref(e.show),u=i.ref(!1);i.watchEffect(()=>{const{show:v}=e;v&&!Wb()&&!e.internalDeactivateImmediately&&(u.value=!0)});const f=i.computed(()=>{const{trigger:v,onClickoutside:$}=e,F=[],{positionManuallyRef:{value:R}}=c;return R||(v==="click"&&!$&&F.push([rs,x,void 0,{capture:!0}]),v==="hover"&&F.push([ky,S])),$&&F.push([rs,x,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&u.value)&&F.push([i.vShow,e.show]),F}),p=i.computed(()=>{const{common:{cubicBezierEaseInOut:v,cubicBezierEaseIn:$,cubicBezierEaseOut:F},self:{space:R,spaceArrow:X,padding:M,fontSize:N,textColor:A,dividerColor:L,color:Y,boxShadow:P,borderRadius:E,arrowHeight:H,arrowOffset:I,arrowOffsetVertical:U}}=a.value;return{"--n-box-shadow":P,"--n-bezier":v,"--n-bezier-ease-in":$,"--n-bezier-ease-out":F,"--n-font-size":N,"--n-text-color":A,"--n-color":Y,"--n-divider-color":L,"--n-border-radius":E,"--n-arrow-height":H,"--n-arrow-offset":I,"--n-arrow-offset-vertical":U,"--n-padding":M,"--n-space":R,"--n-space-arrow":X}}),g=i.computed(()=>{const v=e.width==="trigger"?void 0:Mo(e.width),$=[];v&&$.push({width:v});const{maxWidth:F,minWidth:R}=e;return F&&$.push({maxWidth:Mo(F)}),R&&$.push({maxWidth:Mo(R)}),o||$.push(p.value),$}),m=o?ui("popover",void 0,p,e):void 0;c.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{c.setBodyInstance(null)}),i.watch(i.toRef(e,"show"),v=>{e.animated||(v?h.value=!0:h.value=!1)});function _(){var v;(v=l.value)===null||v===void 0||v.syncPosition()}function y(v){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&c.handleMouseEnter(v)}function b(v){e.trigger==="hover"&&e.keepAliveOnHover&&c.handleMouseLeave(v)}function S(v){e.trigger==="hover"&&!C().contains(or(v))&&c.handleMouseMoveOutside(v)}function x(v){(e.trigger==="click"&&!C().contains(or(v))||e.onClickoutside)&&c.handleClickOutside(v)}function C(){return c.getTriggerElement()}i.provide(Dd,d),i.provide(Id,null),i.provide(Ld,null);function B(){if(m==null||m.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&u.value))return null;let $;const F=c.internalRenderBodyRef.value,{value:R}=s;if(F)$=F([`${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:X}=c.extraClassRef,{internalTrapFocus:M}=e,N=!eh(t.header)||!eh(t.footer),A=()=>{var L,Y;const P=N?i.h(i.Fragment,null,ci(t.header,I=>I?i.h("div",{class:[`${R}-popover__header`,e.headerClass],style:e.headerStyle},I):null),ci(t.default,I=>I?i.h("div",{class:[`${R}-popover__content`,e.contentClass],style:e.contentStyle},t):null),ci(t.footer,I=>I?i.h("div",{class:[`${R}-popover__footer`,e.footerClass],style:e.footerStyle},I):null)):e.scrollable?(L=t.default)===null||L===void 0?void 0:L.call(t):i.h("div",{class:[`${R}-popover__content`,e.contentClass],style:e.contentStyle},t),E=e.scrollable?i.h(ew,{contentClass:N?void 0:`${R}-popover__content ${(Y=e.contentClass)!==null&&Y!==void 0?Y:""}`,contentStyle:N?void 0:e.contentStyle},{default:()=>P}):P,H=e.showArrow?pw({arrowClass:e.arrowClass,arrowStyle:e.arrowStyle,arrowWrapperClass:e.arrowWrapperClass,arrowWrapperStyle:e.arrowWrapperStyle,clsPrefix:R}):null;return[E,H]};$=i.h("div",i.mergeProps({class:[`${R}-popover`,`${R}-popover-shared`,m==null?void 0:m.themeClass.value,X.map(L=>`${R}-${L}`),{[`${R}-popover--scrollable`]:e.scrollable,[`${R}-popover--show-header-or-footer`]:N,[`${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),M?i.h(Ab,{active:e.show,autoFocus:!0},{default:A}):A())}return i.withDirectives($,f.value)}return{displayed:u,namespace:r,isMounted:c.isMountedRef,zIndex:c.zIndexRef,followerRef:l,adjustedTo:pn(e),followerEnabled:h,renderContentNode:B}},render(){return i.h(pd,{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===pn.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 mw={};const _w=Object.keys(wh),yw={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function bw(e,t,n){yw[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 ww={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:pn.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},vw=Object.assign(Object.assign(Object.assign({},ht.props),ww),{internalOnAfterLeave:Function,internalRenderBody:Function}),kw=i.defineComponent({name:"Popover",inheritAttrs:!1,props:vw,slots:Object,__popover__:!0,setup(e){mw.NODE_ENV!=="production"&&i.watchEffect(()=>{e.maxWidth!==void 0&&An("popover","`max-width` is deprecated, please use `style` instead."),e.minWidth!==void 0&&An("popover","`min-width` is deprecated, please use `style` instead."),e.arrow!==void 0&&An("popover","`arrow` is deprecated, please use `showArrow` instead."),e.onHide!==void 0&&An("popover","`on-hide` is deprecated, please use `on-update:show` instead."),e.onShow!==void 0&&An("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const t=ss(),n=i.ref(null),r=i.computed(()=>e.show),s=i.ref(e.defaultShow),o=wo(r,s),a=zt(()=>e.disabled?!1:o.value),l=()=>{if(e.disabled)return!0;const{getDisabled:L}=e;return!!(L!=null&&L())},c=()=>l()?!1:o.value,d=Uc(e,["arrow","showArrow"]),h=i.computed(()=>e.overlap?!1:d.value);let u=null;const f=i.ref(null),p=i.ref(null),g=zt(()=>e.x!==void 0&&e.y!==void 0);function m(L){const{"onUpdate:show":Y,onUpdateShow:P,onShow:E,onHide:H}=e;s.value=L,Y&&dt(Y,L),P&&dt(P,L),L&&E&&dt(E,!0),L&&H&&dt(H,!1)}function _(){u&&u.syncPosition()}function y(){const{value:L}=f;L&&(window.clearTimeout(L),f.value=null)}function b(){const{value:L}=p;L&&(window.clearTimeout(L),p.value=null)}function S(){const L=l();if(e.trigger==="focus"&&!L){if(c())return;m(!0)}}function x(){const L=l();if(e.trigger==="focus"&&!L){if(!c())return;m(!1)}}function C(){const L=l();if(e.trigger==="hover"&&!L){if(b(),f.value!==null||c())return;const Y=()=>{m(!0),f.value=null},{delay:P}=e;P===0?Y():f.value=window.setTimeout(Y,P)}}function B(){const L=l();if(e.trigger==="hover"&&!L){if(y(),p.value!==null||!c())return;const Y=()=>{m(!1),p.value=null},{duration:P}=e;P===0?Y():p.value=window.setTimeout(Y,P)}}function v(){B()}function $(L){var Y;c()&&(e.trigger==="click"&&(y(),b(),m(!1)),(Y=e.onClickoutside)===null||Y===void 0||Y.call(e,L))}function F(){if(e.trigger==="click"&&!l()){y(),b();const L=!c();m(L)}}function R(L){e.internalTrapFocus&&L.key==="Escape"&&(y(),b(),m(!1))}function X(L){s.value=L}function M(){var L;return(L=n.value)===null||L===void 0?void 0:L.targetRef}function N(L){u=L}return i.provide("NPopover",{getTriggerElement:M,handleKeydown:R,handleMouseEnter:C,handleMouseLeave:B,handleClickOutside:$,handleMouseMoveOutside:v,setBodyInstance:N,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:X,handleClick:F,handleMouseEnter:C,handleMouseLeave:B,handleFocus:S,handleBlur:x,syncPosition:_}},render(){var e;const{positionManually:t,$slots:n}=this;let r,s=!1;if(!t&&(r=qb(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)})}};bw(r,a?"nested":t?"manual":this.trigger,c)}}return i.h(Jc,{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}}),[[Yc,{enabled:o,zIndex:this.zIndex}]]):null,t?null:i.h(Qc,null,{default:()=>r}),i.h(gw,Yb(this.$props,_w,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)}})]}})}}),xw={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 Cw(e){const{textColor2:t,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:h,opacityDisabled:u,tagColor:f,closeIconColor:p,closeIconColorHover:g,closeIconColorPressed:m,borderRadiusSmall:_,fontSizeMini:y,fontSizeTiny:b,fontSizeSmall:S,fontSizeMedium:x,heightMini:C,heightTiny:B,heightSmall:v,heightMedium:$,closeColorHover:F,closeColorPressed:R,buttonColor2Hover:X,buttonColor2Pressed:M,fontWeightStrong:N}=e;return Object.assign(Object.assign({},xw),{closeBorderRadius:_,heightTiny:C,heightSmall:B,heightMedium:v,heightLarge:$,borderRadius:_,opacityDisabled:u,fontSizeTiny:y,fontSizeSmall:b,fontSizeMedium:S,fontSizeLarge:x,fontWeightStrong:N,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:X,colorPressedCheckable:M,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${h}`,textColor:t,color:f,colorBordered:"rgb(250, 250, 252)",closeIconColor:p,closeIconColorHover:g,closeIconColorPressed:m,closeColorHover:F,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 Sw={common:fi,self:Cw},Bw={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},Tw=ue("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;
|
@@ -608,10 +608,10 @@ ${s}
|
|
608
608
|
box-shadow: none;
|
609
609
|
color: var(--n-text-color-checkable);
|
610
610
|
background-color: var(--n-color-checkable);
|
611
|
-
`,[
|
611
|
+
`,[Wt("disabled",[oe("&:hover","background-color: var(--n-color-hover-checkable);",[Wt("checked","color: var(--n-text-color-hover-checkable);")]),oe("&:active","background-color: var(--n-color-pressed-checkable);",[Wt("checked","color: var(--n-text-color-pressed-checkable);")])]),Be("checked",`
|
612
612
|
color: var(--n-text-color-checked);
|
613
613
|
background-color: var(--n-color-checked);
|
614
|
-
`,[
|
614
|
+
`,[Wt("disabled",[oe("&:hover","background-color: var(--n-color-checked-hover);"),oe("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var Ew={};const $w=Object.assign(Object.assign(Object.assign({},ht.props),Bw),{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}),Nw="n-tag",jo=i.defineComponent({name:"Tag",props:$w,slots:Object,setup(e){Ew.NODE_ENV!=="production"&&i.watchEffect(()=>{e.onCheckedChange!==void 0&&An("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}=hi(e),a=ht("Tag","-tag",Tw,Sw,e,r);i.provide(Nw,{roundRef:i.toRef(e,"round")});function l(){if(!e.disabled&&e.checkable){const{checked:p,onCheckedChange:g,onUpdateChecked:m,"onUpdate:checked":_}=e;m&&m(!p),_&&_(!p),g&&g(!p)}}function c(p){if(e.triggerClickOnClose||p.stopPropagation(),!e.disabled){const{onClose:g}=e;g&&dt(g,p)}}const d={setTextContent(p){const{value:g}=t;g&&(g.textContent=p)}},h=_s("Tag",o,r),u=i.computed(()=>{const{type:p,size:g,color:{color:m,textColor:_}={}}=e,{common:{cubicBezierEaseInOut:y},self:{padding:b,closeMargin:S,borderRadius:x,opacityDisabled:C,textColorCheckable:B,textColorHoverCheckable:v,textColorPressedCheckable:$,textColorChecked:F,colorCheckable:R,colorHoverCheckable:X,colorPressedCheckable:M,colorChecked:N,colorCheckedHover:A,colorCheckedPressed:L,closeBorderRadius:Y,fontWeightStrong:P,[qe("colorBordered",p)]:E,[qe("closeSize",g)]:H,[qe("closeIconSize",g)]:I,[qe("fontSize",g)]:U,[qe("height",g)]:O,[qe("color",p)]:z,[qe("textColor",p)]:J,[qe("border",p)]:pe,[qe("closeIconColor",p)]:re,[qe("closeIconColorHover",p)]:ge,[qe("closeIconColorPressed",p)]:ie,[qe("closeColorHover",p)]:Me,[qe("closeColorPressed",p)]:xe}}=a.value,Ce=Ht(S);return{"--n-font-weight-strong":P,"--n-avatar-size-override":`calc(${O} - 8px)`,"--n-bezier":y,"--n-border-radius":x,"--n-border":pe,"--n-close-icon-size":I,"--n-close-color-pressed":xe,"--n-close-color-hover":Me,"--n-close-border-radius":Y,"--n-close-icon-color":re,"--n-close-icon-color-hover":ge,"--n-close-icon-color-pressed":ie,"--n-close-icon-color-disabled":re,"--n-close-margin-top":Ce.top,"--n-close-margin-right":Ce.right,"--n-close-margin-bottom":Ce.bottom,"--n-close-margin-left":Ce.left,"--n-close-size":H,"--n-color":m||(n.value?E:z),"--n-color-checkable":R,"--n-color-checked":N,"--n-color-checked-hover":A,"--n-color-checked-pressed":L,"--n-color-hover-checkable":X,"--n-color-pressed-checkable":M,"--n-font-size":U,"--n-height":O,"--n-opacity-disabled":C,"--n-padding":b,"--n-text-color":_||J,"--n-text-color-checkable":B,"--n-text-color-checked":F,"--n-text-color-hover-checkable":v,"--n-text-color-pressed-checkable":$}}),f=s?ui("tag",i.computed(()=>{let p="";const{type:g,size:m,color:{color:_,textColor:y}={}}=e;return p+=g[0],p+=m[0],_&&(p+=`a${jd(_)}`),y&&(p+=`b${jd(y)}`),n.value&&(p+="c"),p}),u,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:u,themeClass:f==null?void 0:f.themeClass,onRender:f==null?void 0:f.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=ci(c.avatar,u=>u&&i.h("div",{class:`${n}-tag__avatar`},u)),h=ci(c.icon,u=>u&&i.h("div",{class:`${n}-tag__icon`},u));return i.h("div",{class:[`${n}-tag`,this.themeClass,{[`${n}-tag--rtl`]:r,[`${n}-tag--strong`]:this.strong,[`${n}-tag--disabled`]:this.disabled,[`${n}-tag--checkable`]:this.checkable,[`${n}-tag--checked`]:this.checkable&&this.checked,[`${n}-tag--round`]:a,[`${n}-tag--avatar`]:d,[`${n}-tag--icon`]:h,[`${n}-tag--closable`]:s}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},h||d,i.h("span",{class:`${n}-tag__content`,ref:"contentRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)),!this.checkable&&s?i.h(W1,{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)}}),Pw=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(oh,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?i.h(D1,{clsPrefix:n,show:e.showClear,onClear:e.onClear},{placeholder:()=>i.h(yr,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>zo(t.default,()=>[i.h(A1,null)])})}):null})}}}),Rw={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function Fw(e){const{borderRadius:t,textColor2:n,textColorDisabled:r,inputColor:s,inputColorDisabled:o,primaryColor:a,primaryColorHover:l,warningColor:c,warningColorHover:d,errorColor:h,errorColorHover:u,borderColor:f,iconColor:p,iconColorDisabled:g,clearColor:m,clearColorHover:_,clearColorPressed:y,placeholderColor:b,placeholderColorDisabled:S,fontSizeTiny:x,fontSizeSmall:C,fontSizeMedium:B,fontSizeLarge:v,heightTiny:$,heightSmall:F,heightMedium:R,heightLarge:X,fontWeight:M}=e;return Object.assign(Object.assign({},Rw),{fontSizeTiny:x,fontSizeSmall:C,fontSizeMedium:B,fontSizeLarge:v,heightTiny:$,heightSmall:F,heightMedium:R,heightLarge:X,borderRadius:t,fontWeight:M,textColor:n,textColorDisabled:r,placeholderColor:b,placeholderColorDisabled:S,color:s,colorDisabled:o,colorActive:s,border:`1px solid ${f}`,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:p,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 ${u}`,borderActiveError:`1px solid ${h}`,borderFocusError:`1px solid ${u}`,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 vh={name:"InternalSelection",common:fi,peers:{Popover:bh},self:Fw},Mw=oe([ue("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;
|
@@ -728,7 +728,7 @@ ${s}
|
|
728
728
|
white-space: nowrap;
|
729
729
|
`)]),_e("render-label",`
|
730
730
|
color: var(--n-text-color);
|
731
|
-
`)]),
|
731
|
+
`)]),Wt("disabled",[oe("&:hover",[_e("state-border",`
|
732
732
|
box-shadow: var(--n-box-shadow-hover);
|
733
733
|
border: var(--n-border-hover);
|
734
734
|
`)]),Be("focus",[_e("state-border",`
|
@@ -786,7 +786,7 @@ ${s}
|
|
786
786
|
user-select: none;
|
787
787
|
-webkit-user-select: none;
|
788
788
|
opacity: 0;
|
789
|
-
`)]),["warning","error"].map(e=>Be(`${e}-status`,[_e("state-border",`border: var(--n-border-${e});`),
|
789
|
+
`)]),["warning","error"].map(e=>Be(`${e}-status`,[_e("state-border",`border: var(--n-border-${e});`),Wt("disabled",[oe("&:hover",[_e("state-border",`
|
790
790
|
box-shadow: var(--n-box-shadow-hover-${e});
|
791
791
|
border: var(--n-border-hover-${e});
|
792
792
|
`)]),Be("active",[_e("state-border",`
|
@@ -811,7 +811,7 @@ ${s}
|
|
811
811
|
line-height: 1.25;
|
812
812
|
text-overflow: ellipsis;
|
813
813
|
overflow: hidden;
|
814
|
-
`)])])]),Aw=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},ut.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=ui(e),r=ys("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),u=i.ref(null),f=i.ref(null),p=i.ref(null),g=i.ref(!1),m=i.ref(!1),_=i.ref(!1),y=ut("InternalSelection","-internal-selection",Mw,kh,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):Li(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),x=i.computed(()=>{const ee=e.selectedOption;if(ee)return ee[e.labelField]}),C=i.computed(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function B(){var ee;const{value:ne}=s;if(ne){const{value:je}=o;je&&(je.style.width=`${ne.offsetWidth}px`,e.maxTagCount!=="responsive"&&((ee=f.value)===null||ee===void 0||ee.sync({showAllItemsBeforeCalculate:!1})))}}function v(){const{value:ee}=p;ee&&(ee.style.display="none")}function $(){const{value:ee}=p;ee&&(ee.style.display="inline-block")}i.watch(i.toRef(e,"active"),ee=>{ee||v()}),i.watch(i.toRef(e,"pattern"),()=>{e.multiple&&i.nextTick(B)});function F(ee){const{onFocus:ne}=e;ne&&ne(ee)}function R(ee){const{onBlur:ne}=e;ne&&ne(ee)}function q(ee){const{onDeleteOption:ne}=e;ne&&ne(ee)}function M(ee){const{onClear:ne}=e;ne&&ne(ee)}function N(ee){const{onPatternInput:ne}=e;ne&&ne(ee)}function A(ee){var ne;(!ee.relatedTarget||!(!((ne=a.value)===null||ne===void 0)&&ne.contains(ee.relatedTarget)))&&F(ee)}function L(ee){var ne;!((ne=a.value)===null||ne===void 0)&&ne.contains(ee.relatedTarget)||R(ee)}function Y(ee){M(ee)}function P(){_.value=!0}function E(){_.value=!1}function H(ee){!e.active||!e.filterable||ee.target!==o.value&&ee.preventDefault()}function I(ee){q(ee)}const U=i.ref(!1);function O(ee){if(ee.key==="Backspace"&&!U.value&&!e.pattern.length){const{selectedOptions:ne}=e;ne!=null&&ne.length&&I(ne[ne.length-1])}}let z=null;function Z(ee){const{value:ne}=s;if(ne){const je=ee.target.value;ne.textContent=je,B()}e.ignoreComposition&&U.value?z=ee:N(ee)}function pe(){U.value=!0}function re(){U.value=!1,e.ignoreComposition&&N(z),z=null}function ge(ee){var ne;m.value=!0,(ne=e.onPatternFocus)===null||ne===void 0||ne.call(e,ee)}function ie(ee){var ne;m.value=!1,(ne=e.onPatternBlur)===null||ne===void 0||ne.call(e,ee)}function Me(){var ee,ne;if(e.filterable)m.value=!1,(ee=d.value)===null||ee===void 0||ee.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 xe(){var ee,ne,je;e.filterable?(m.value=!1,(ee=d.value)===null||ee===void 0||ee.focus()):e.multiple?(ne=l.value)===null||ne===void 0||ne.focus():(je=c.value)===null||je===void 0||je.focus()}function Ce(){const{value:ee}=o;ee&&($(),ee.focus())}function Fe(){const{value:ee}=o;ee&&ee.blur()}function Ie(ee){const{value:ne}=h;ne&&ne.setTextContent(`+${ee}`)}function kt(){const{value:ee}=u;return ee}function Cn(){return o.value}let At=null;function qt(){At!==null&&window.clearTimeout(At)}function Et(){e.active||(qt(),At=window.setTimeout(()=>{C.value&&(g.value=!0)},100))}function _i(){qt()}function yi(ee){ee||(qt(),g.value=!1)}i.watch(C,ee=>{ee||(g.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const ee=d.value;ee&&(e.disabled?ee.removeAttribute("tabindex"):ee.tabIndex=m.value?-1:0)})}),jd(a,e.onResize);const{inlineThemeDisabled:zn}=e,an=i.computed(()=>{const{size:ee}=e,{common:{cubicBezierEaseInOut:ne},self:{fontWeight:je,borderRadius:vr,color:Di,placeholderColor:bi,textColor:Hi,paddingSingle:In,paddingMultiple:wi,caretColor:Wi,colorDisabled:Yt,textColorDisabled:Sn,placeholderColorDisabled:T,colorActive:D,boxShadowFocus:J,boxShadowActive:le,boxShadowHover:ce,border:me,borderFocus:be,borderHover:ke,borderActive:Xe,arrowColor:ln,arrowColorDisabled:Go,loadingColor:Ko,colorActiveWarning:Zo,boxShadowFocusWarning:Jo,boxShadowActiveWarning:Qo,boxShadowHoverWarning:ea,borderWarning:ta,borderFocusWarning:na,borderHoverWarning:ia,borderActiveWarning:ra,colorActiveError:sa,boxShadowFocusError:oa,boxShadowActiveError:aa,boxShadowHoverError:la,borderError:ca,borderFocusError:da,borderHoverError:ha,borderActiveError:ak,clearColor:lk,clearColorHover:ck,clearColorPressed:dk,clearSize:hk,arrowSize:uk,[Ye("height",ee)]:fk,[Ye("fontSize",ee)]:pk}}=y.value,xs=Wt(In),Cs=Wt(wi);return{"--n-bezier":ne,"--n-border":me,"--n-border-active":Xe,"--n-border-focus":be,"--n-border-hover":ke,"--n-border-radius":vr,"--n-box-shadow-active":le,"--n-box-shadow-focus":J,"--n-box-shadow-hover":ce,"--n-caret-color":Wi,"--n-color":Di,"--n-color-active":D,"--n-color-disabled":Yt,"--n-font-size":pk,"--n-height":fk,"--n-padding-single-top":xs.top,"--n-padding-multiple-top":Cs.top,"--n-padding-single-right":xs.right,"--n-padding-multiple-right":Cs.right,"--n-padding-single-left":xs.left,"--n-padding-multiple-left":Cs.left,"--n-padding-single-bottom":xs.bottom,"--n-padding-multiple-bottom":Cs.bottom,"--n-placeholder-color":bi,"--n-placeholder-color-disabled":T,"--n-text-color":Hi,"--n-text-color-disabled":Sn,"--n-arrow-color":ln,"--n-arrow-color-disabled":Go,"--n-loading-color":Ko,"--n-color-active-warning":Zo,"--n-box-shadow-focus-warning":Jo,"--n-box-shadow-active-warning":Qo,"--n-box-shadow-hover-warning":ea,"--n-border-warning":ta,"--n-border-focus-warning":na,"--n-border-hover-warning":ia,"--n-border-active-warning":ra,"--n-color-active-error":sa,"--n-box-shadow-focus-error":oa,"--n-box-shadow-active-error":aa,"--n-box-shadow-hover-error":la,"--n-border-error":ca,"--n-border-focus-error":da,"--n-border-hover-error":ha,"--n-border-active-error":ak,"--n-clear-size":hk,"--n-clear-color":lk,"--n-clear-color-hover":ck,"--n-clear-color-pressed":dk,"--n-arrow-size":uk,"--n-font-weight":je}}),ot=zn?fi("internal-selection",i.computed(()=>e.size[0]),an,e):void 0;return{mergedTheme:y,mergedClearable:b,mergedClsPrefix:t,rtlEnabled:r,patternInputFocused:m,filterablePlaceholder:S,label:x,selected:C,showTagsPanel:g,isComposing:U,counterRef:h,counterWrapperRef:u,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:f,inputTagElRef:p,handleMouseDown:H,handleFocusin:A,handleClear:Y,handleMouseEnter:P,handleMouseLeave:E,handleDeleteOption:I,handlePatternKeyDown:O,handlePatternInputInput:Z,handlePatternInputBlur:ie,handlePatternInputFocus:ge,handleMouseEnterCounter:Et,handleMouseLeaveCounter:_i,handleFocusout:L,handleCompositionEnd:re,handleCompositionStart:pe,onPopoverUpdateShow:yi,focus:xe,focusInput:Ce,blur:Me,blurInput:Fe,updateCounter:Ie,getCounter:kt,getTail:Cn,renderLabel:e.renderLabel,cssVars:zn?void 0:an,themeClass:ot==null?void 0:ot.themeClass,onRender:ot==null?void 0:ot.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:u}=this;d==null||d();const f=o==="responsive",p=typeof o=="number",g=f||p,m=i.h(Lo,null,{default:()=>i.h(Pw,{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=N=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:N.value},h?h({option:N,handleClose:()=>{this.handleDeleteOption(N)}}):i.h(Xo,{size:n,closable:!N.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(N)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>u?u(N,!0):Li(N[y],N,!0)})),S=()=>(p?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,C=f?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(Xo,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let B;if(p){const N=this.selectedOptions.length-o;N>0&&(B=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(Xo,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${N}`})))}const v=f?s?i.h(Md,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:C,tail:()=>x}):i.h(Md,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:C}):p&&B?S().concat(B):S(),$=g?()=>i.h("div",{class:`${l}-base-selection-popover`},f?S():this.selectedOptions.map(b)):void 0,F=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,q=(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,M=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},v,f?null:x,m):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},v,m);_=i.h(i.Fragment,null,g?i.h(kw,Object.assign({},F,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>M,default:$}):M,q)}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:Zd(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:()=>{}}):u?u(this.selectedOption,!0):Li(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:Zd(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):Li(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 Ow(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const Vw={name:"Select",common:pi,peers:{InternalSelection:kh,InternalSelectMenu:ph},self:Ow},zw=oe([ue("select",`
|
814
|
+
`)])])]),Aw=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},ht.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}=hi(e),r=_s("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),u=i.ref(null),f=i.ref(null),p=i.ref(null),g=i.ref(!1),m=i.ref(!1),_=i.ref(!1),y=ht("InternalSelection","-internal-selection",Mw,vh,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):Ii(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),x=i.computed(()=>{const te=e.selectedOption;if(te)return te[e.labelField]}),C=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=f.value)===null||te===void 0||te.sync({showAllItemsBeforeCalculate:!1})))}}function v(){const{value:te}=p;te&&(te.style.display="none")}function $(){const{value:te}=p;te&&(te.style.display="inline-block")}i.watch(i.toRef(e,"active"),te=>{te||v()}),i.watch(i.toRef(e,"pattern"),()=>{e.multiple&&i.nextTick(B)});function F(te){const{onFocus:ne}=e;ne&&ne(te)}function R(te){const{onBlur:ne}=e;ne&&ne(te)}function X(te){const{onDeleteOption:ne}=e;ne&&ne(te)}function M(te){const{onClear:ne}=e;ne&&ne(te)}function N(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)))&&F(te)}function L(te){var ne;!((ne=a.value)===null||ne===void 0)&&ne.contains(te.relatedTarget)||R(te)}function Y(te){M(te)}function P(){_.value=!0}function E(){_.value=!1}function H(te){!e.active||!e.filterable||te.target!==o.value&&te.preventDefault()}function I(te){X(te)}const U=i.ref(!1);function O(te){if(te.key==="Backspace"&&!U.value&&!e.pattern.length){const{selectedOptions:ne}=e;ne!=null&&ne.length&&I(ne[ne.length-1])}}let z=null;function J(te){const{value:ne}=s;if(ne){const je=te.target.value;ne.textContent=je,B()}e.ignoreComposition&&U.value?z=te:N(te)}function pe(){U.value=!0}function re(){U.value=!1,e.ignoreComposition&&N(z),z=null}function ge(te){var ne;m.value=!0,(ne=e.onPatternFocus)===null||ne===void 0||ne.call(e,te)}function ie(te){var ne;m.value=!1,(ne=e.onPatternBlur)===null||ne===void 0||ne.call(e,te)}function Me(){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 xe(){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 Ce(){const{value:te}=o;te&&($(),te.focus())}function Fe(){const{value:te}=o;te&&te.blur()}function Ie(te){const{value:ne}=h;ne&&ne.setTextContent(`+${te}`)}function vt(){const{value:te}=u;return te}function xn(){return o.value}let Mt=null;function Xt(){Mt!==null&&window.clearTimeout(Mt)}function Tt(){e.active||(Xt(),Mt=window.setTimeout(()=>{C.value&&(g.value=!0)},100))}function mi(){Xt()}function _i(te){te||(Xt(),g.value=!1)}i.watch(C,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)})}),Wd(a,e.onResize);const{inlineThemeDisabled:Vn}=e,on=i.computed(()=>{const{size:te}=e,{common:{cubicBezierEaseInOut:ne},self:{fontWeight:je,borderRadius:wr,color:Li,placeholderColor:yi,textColor:Di,paddingSingle:zn,paddingMultiple:bi,caretColor:Hi,colorDisabled:qt,textColorDisabled:Cn,placeholderColorDisabled:T,colorActive:D,boxShadowFocus:Q,boxShadowActive:le,boxShadowHover:ce,border:me,borderFocus:be,borderHover:ke,borderActive:Xe,arrowColor:an,arrowColorDisabled:Uo,loadingColor:Go,colorActiveWarning:Ko,boxShadowFocusWarning:Zo,boxShadowActiveWarning:Jo,boxShadowHoverWarning:Qo,borderWarning:ea,borderFocusWarning:ta,borderHoverWarning:na,borderActiveWarning:ia,colorActiveError:ra,boxShadowFocusError:sa,boxShadowActiveError:oa,boxShadowHoverError:aa,borderError:la,borderFocusError:ca,borderHoverError:da,borderActiveError:ck,clearColor:dk,clearColorHover:hk,clearColorPressed:uk,clearSize:fk,arrowSize:pk,[qe("height",te)]:gk,[qe("fontSize",te)]:mk}}=y.value,ks=Ht(zn),xs=Ht(bi);return{"--n-bezier":ne,"--n-border":me,"--n-border-active":Xe,"--n-border-focus":be,"--n-border-hover":ke,"--n-border-radius":wr,"--n-box-shadow-active":le,"--n-box-shadow-focus":Q,"--n-box-shadow-hover":ce,"--n-caret-color":Hi,"--n-color":Li,"--n-color-active":D,"--n-color-disabled":qt,"--n-font-size":mk,"--n-height":gk,"--n-padding-single-top":ks.top,"--n-padding-multiple-top":xs.top,"--n-padding-single-right":ks.right,"--n-padding-multiple-right":xs.right,"--n-padding-single-left":ks.left,"--n-padding-multiple-left":xs.left,"--n-padding-single-bottom":ks.bottom,"--n-padding-multiple-bottom":xs.bottom,"--n-placeholder-color":yi,"--n-placeholder-color-disabled":T,"--n-text-color":Di,"--n-text-color-disabled":Cn,"--n-arrow-color":an,"--n-arrow-color-disabled":Uo,"--n-loading-color":Go,"--n-color-active-warning":Ko,"--n-box-shadow-focus-warning":Zo,"--n-box-shadow-active-warning":Jo,"--n-box-shadow-hover-warning":Qo,"--n-border-warning":ea,"--n-border-focus-warning":ta,"--n-border-hover-warning":na,"--n-border-active-warning":ia,"--n-color-active-error":ra,"--n-box-shadow-focus-error":sa,"--n-box-shadow-active-error":oa,"--n-box-shadow-hover-error":aa,"--n-border-error":la,"--n-border-focus-error":ca,"--n-border-hover-error":da,"--n-border-active-error":ck,"--n-clear-size":fk,"--n-clear-color":dk,"--n-clear-color-hover":hk,"--n-clear-color-pressed":uk,"--n-arrow-size":pk,"--n-font-weight":je}}),st=Vn?ui("internal-selection",i.computed(()=>e.size[0]),on,e):void 0;return{mergedTheme:y,mergedClearable:b,mergedClsPrefix:t,rtlEnabled:r,patternInputFocused:m,filterablePlaceholder:S,label:x,selected:C,showTagsPanel:g,isComposing:U,counterRef:h,counterWrapperRef:u,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:f,inputTagElRef:p,handleMouseDown:H,handleFocusin:A,handleClear:Y,handleMouseEnter:P,handleMouseLeave:E,handleDeleteOption:I,handlePatternKeyDown:O,handlePatternInputInput:J,handlePatternInputBlur:ie,handlePatternInputFocus:ge,handleMouseEnterCounter:Tt,handleMouseLeaveCounter:mi,handleFocusout:L,handleCompositionEnd:re,handleCompositionStart:pe,onPopoverUpdateShow:_i,focus:xe,focusInput:Ce,blur:Me,blurInput:Fe,updateCounter:Ie,getCounter:vt,getTail:xn,renderLabel:e.renderLabel,cssVars:Vn?void 0:on,themeClass:st==null?void 0:st.themeClass,onRender:st==null?void 0:st.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:u}=this;d==null||d();const f=o==="responsive",p=typeof o=="number",g=f||p,m=i.h(Io,null,{default:()=>i.h(Pw,{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=N=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:N.value},h?h({option:N,handleClose:()=>{this.handleDeleteOption(N)}}):i.h(jo,{size:n,closable:!N.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(N)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>u?u(N,!0):Ii(N[y],N,!0)})),S=()=>(p?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,C=f?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(jo,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let B;if(p){const N=this.selectedOptions.length-o;N>0&&(B=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(jo,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${N}`})))}const v=f?s?i.h(Fd,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:C,tail:()=>x}):i.h(Fd,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:C}):p&&B?S().concat(B):S(),$=g?()=>i.h("div",{class:`${l}-base-selection-popover`},f?S():this.selectedOptions.map(b)):void 0,F=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,X=(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,M=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},v,f?null:x,m):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},v,m);_=i.h(i.Fragment,null,g?i.h(kw,Object.assign({},F,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>M,default:$}):M,X)}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:Kd(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:()=>{}}):u?u(this.selectedOption,!0):Ii(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:Kd(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):Ii(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 Ow(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const Vw={name:"Select",common:fi,peers:{InternalSelection:vh,InternalSelectMenu:fh},self:Ow},zw=oe([ue("select",`
|
815
815
|
z-index: auto;
|
816
816
|
outline: none;
|
817
817
|
width: 100%;
|
@@ -820,5 +820,5 @@ ${s}
|
|
820
820
|
`),ue("select-menu",`
|
821
821
|
margin: 4px 0;
|
822
822
|
box-shadow: var(--n-menu-box-shadow);
|
823
|
-
`,[bh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function ws(e){return e.type==="group"}function xh(e){return e.type==="ignored"}function qo(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function Iw(e,t){return{getIsGroup:ws,getIgnored:xh,getKey(r){return ws(r)?r.name||r.key||"key-required":r[e]},getChildren(r){return r[t]}}}function Lw(e,t,n,r){if(!t)return e;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(ws(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(xh(l))continue;t(n,l)&&a.push(l)}return a}return s(e)}function Dw(e,t,n){const r=new Map;return e.forEach(s=>{ws(s)?s[n].forEach(o=>{r.set(o[t],o)}):r.set(s[t],s)}),r}var Hw={};const Ww=Object.assign(Object.assign({},ut.props),{to:gn.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}),jw=i.defineComponent({name:"Select",props:Ww,slots:Object,setup(e){Hw.NODE_ENV!=="production"&&i.watchEffect(()=>{e.items!==void 0&&On("select","`items` is deprecated, please use `options` instead."),e.onChange!==void 0&&On("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=ui(e),o=ut("Select","-select",zw,Vw,e,t),a=i.ref(e.defaultValue),l=i.toRef(e,"value"),c=vo(l,a),d=i.ref(!1),h=i.ref(""),u=Gc(e,["items","options"]),f=i.ref([]),p=i.ref([]),g=i.computed(()=>p.value.concat(f.value).concat(u.value)),m=i.computed(()=>{const{filter:T}=e;if(T)return T;const{labelField:D,valueField:J}=e;return(le,ce)=>{if(!ce)return!1;const me=ce[D];if(typeof me=="string")return qo(le,me);const be=ce[J];return typeof be=="string"?qo(le,be):typeof be=="number"?qo(le,String(be)):!1}}),_=i.computed(()=>{if(e.remote)return u.value;{const{value:T}=g,{value:D}=h;return!D.length||!e.filterable?T:Lw(T,m.value,D,e.childrenField)}}),y=i.computed(()=>{const{valueField:T,childrenField:D}=e,J=Iw(T,D);return my(_.value,J)}),b=i.computed(()=>Dw(g.value,e.valueField,e.childrenField)),S=i.ref(!1),x=vo(i.toRef(e,"show"),S),C=i.ref(null),B=i.ref(null),v=i.ref(null),{localeRef:$}=ih("Select"),F=i.computed(()=>{var T;return(T=e.placeholder)!==null&&T!==void 0?T:$.value.placeholder}),R=[],q=i.ref(new Map),M=i.computed(()=>{const{fallbackOption:T}=e;if(T===void 0){const{labelField:D,valueField:J}=e;return le=>({[D]:String(le),[J]:le})}return T===!1?!1:D=>Object.assign(T(D),{value:D})});function N(T){const D=e.remote,{value:J}=q,{value:le}=b,{value:ce}=M,me=[];return T.forEach(be=>{if(le.has(be))me.push(le.get(be));else if(D&&J.has(be))me.push(J.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)?N(T):[]}return null}),L=i.computed(()=>{const{value:T}=c;return!e.multiple&&!Array.isArray(T)?T===null?null:N([T])[0]||null:null}),Y=Gb(e),{mergedSizeRef:P,mergedDisabledRef:E,mergedStatusRef:H}=Y;function I(T,D){const{onChange:J,"onUpdate:value":le,onUpdateValue:ce}=e,{nTriggerFormChange:me,nTriggerFormInput:be}=Y;J&&ht(J,T,D),ce&&ht(ce,T,D),le&&ht(le,T,D),a.value=T,me(),be()}function U(T){const{onBlur:D}=e,{nTriggerFormBlur:J}=Y;D&&ht(D,T),J()}function O(){const{onClear:T}=e;T&&ht(T)}function z(T){const{onFocus:D,showOnFocus:J}=e,{nTriggerFormFocus:le}=Y;D&&ht(D,T),le(),J&&ie()}function Z(T){const{onSearch:D}=e;D&&ht(D,T)}function pe(T){const{onScroll:D}=e;D&&ht(D,T)}function re(){var T;const{remote:D,multiple:J}=e;if(D){const{value:le}=q;if(J){const{valueField:ce}=e;(T=A.value)===null||T===void 0||T.forEach(me=>{le.set(me[ce],me)})}else{const ce=L.value;ce&&le.set(ce[e.valueField],ce)}}}function ge(T){const{onUpdateShow:D,"onUpdate:show":J}=e;D&&ht(D,T),J&&ht(J,T),S.value=T}function ie(){E.value||(ge(!0),S.value=!0,e.filterable&&In())}function Me(){ge(!1)}function xe(){h.value="",p.value=R}const Ce=i.ref(!1);function Fe(){e.filterable&&(Ce.value=!0)}function Ie(){e.filterable&&(Ce.value=!1,x.value||xe())}function kt(){E.value||(x.value?e.filterable?In():Me():ie())}function Cn(T){var D,J;!((J=(D=v.value)===null||D===void 0?void 0:D.selfRef)===null||J===void 0)&&J.contains(T.relatedTarget)||(d.value=!1,U(T),Me())}function At(T){z(T),d.value=!0}function qt(){d.value=!0}function Et(T){var D;!((D=C.value)===null||D===void 0)&&D.$el.contains(T.relatedTarget)||(d.value=!1,U(T),Me())}function _i(){var T;(T=C.value)===null||T===void 0||T.focus(),Me()}function yi(T){var D;x.value&&(!((D=C.value)===null||D===void 0)&&D.$el.contains(ar(T))||Me())}function zn(T){if(!Array.isArray(T))return[];if(M.value)return Array.from(T);{const{remote:D}=e,{value:J}=b;if(D){const{value:le}=q;return T.filter(ce=>J.has(ce)||le.has(ce))}else return T.filter(le=>J.has(le))}}function an(T){ot(T.rawNode)}function ot(T){if(E.value)return;const{tag:D,remote:J,clearFilterAfterSelect:le,valueField:ce}=e;if(D&&!J){const{value:me}=p,be=me[0]||null;if(be){const ke=f.value;ke.length?ke.push(be):f.value=[be],p.value=R}}if(J&&q.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),D&&!J){const ke=ee(T[ce]);~ke&&(f.value.splice(ke,1),le&&(h.value=""))}}else me.push(T[ce]),le&&(h.value="");I(me,N(me))}else{if(D&&!J){const me=ee(T[ce]);~me?f.value=[f.value[me]]:f.value=R}Hi(),Me(),I(T[ce],T)}}function ee(T){return f.value.findIndex(J=>J[e.valueField]===T)}function ne(T){x.value||ie();const{value:D}=T.target;h.value=D;const{tag:J,remote:le}=e;if(Z(D),J&&!le){if(!D){p.value=R;return}const{onCreate:ce}=e,me=ce?ce(D):{[e.labelField]:D,[e.valueField]:D},{valueField:be,labelField:ke}=e;u.value.some(Xe=>Xe[be]===me[be]||Xe[ke]===me[ke])||f.value.some(Xe=>Xe[be]===me[be]||Xe[ke]===me[ke])?p.value=R:p.value=[me]}}function je(T){T.stopPropagation();const{multiple:D}=e;!D&&e.filterable&&Me(),O(),D?I([],[]):I(null,null)}function vr(T){!or(T,"action")&&!or(T,"empty")&&!or(T,"header")&&T.preventDefault()}function Di(T){pe(T)}function bi(T){var D,J,le,ce,me;if(!e.keyboard){T.preventDefault();return}switch(T.key){case" ":if(e.filterable)break;T.preventDefault();case"Enter":if(!(!((D=C.value)===null||D===void 0)&&D.isComposing)){if(x.value){const be=(J=v.value)===null||J===void 0?void 0:J.getPendingTmNode();be?an(be):e.filterable||(Me(),Hi())}else if(ie(),e.tag&&Ce.value){const be=p.value[0];if(be){const ke=be[e.valueField],{value:Xe}=c;e.multiple&&Array.isArray(Xe)&&Xe.includes(ke)||ot(be)}}}T.preventDefault();break;case"ArrowUp":if(T.preventDefault(),e.loading)return;x.value&&((le=v.value)===null||le===void 0||le.prev());break;case"ArrowDown":if(T.preventDefault(),e.loading)return;x.value?(ce=v.value)===null||ce===void 0||ce.next():ie();break;case"Escape":x.value&&(Xb(T),Me()),(me=C.value)===null||me===void 0||me.focus();break}}function Hi(){var T;(T=C.value)===null||T===void 0||T.focus()}function In(){var T;(T=C.value)===null||T===void 0||T.focusInput()}function wi(){var T;x.value&&((T=B.value)===null||T===void 0||T.syncPosition())}re(),i.watch(i.toRef(e,"options"),re);const Wi={focus:()=>{var T;(T=C.value)===null||T===void 0||T.focus()},focusInput:()=>{var T;(T=C.value)===null||T===void 0||T.focusInput()},blur:()=>{var T;(T=C.value)===null||T===void 0||T.blur()},blurInput:()=>{var T;(T=C.value)===null||T===void 0||T.blurInput()}},Yt=i.computed(()=>{const{self:{menuBoxShadow:T}}=o.value;return{"--n-menu-box-shadow":T}}),Sn=s?fi("select",void 0,Yt,e):void 0;return Object.assign(Object.assign({},Wi),{mergedStatus:H,mergedClsPrefix:t,mergedBordered:n,namespace:r,treeMate:y,isMounted:os(),triggerRef:C,menuRef:v,pattern:h,uncontrolledShow:S,mergedShow:x,adjustedTo:gn(e),uncontrolledValue:a,mergedValue:c,followerRef:B,localizedPlaceholder:F,selectedOption:L,selectedOptions:A,mergedSize:P,mergedDisabled:E,focused:d,activeWithoutMenuOpen:Ce,inlineThemeDisabled:s,onTriggerInputFocus:Fe,onTriggerInputBlur:Ie,handleTriggerOrMenuResize:wi,handleMenuFocus:qt,handleMenuBlur:Et,handleMenuTabOut:_i,handleTriggerClick:kt,handleToggle:an,handleDeleteOption:ot,handlePatternInput:ne,handleClear:je,handleTriggerBlur:Cn,handleTriggerFocus:At,handleKeydown:bi,handleMenuAfterLeave:xe,handleMenuClickOutside:yi,handleMenuScroll:Di,handleMenuKeydown:bi,handleMenuMousedown:vr,mergedTheme:o,cssVars:s?void 0:Yt,themeClass:Sn==null?void 0:Sn.themeClass,onRender:Sn==null?void 0:Sn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(Qc,null,{default:()=>[i.h(ed,null,{default:()=>i.h(Aw,{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(gd,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===gn.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(dw,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],[ss,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[ss,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),Xw={},Ch=i.defineComponent({...Xw,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},wrapContent:{type:Boolean,default:!1},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:3},consistentMenuWidth:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>W.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"),u=b=>{b.length<r.minTermLength||(d.value=!0,r.searchDataHandler(b,d).then(S=>{if(W.isEmpty(S))return;const x=o.value?r.value:r.value?[r.value]:[],C=S.filter(B=>!x.some(v=>v.id===B.id));l.value=r.optionsListConverter([...x,...C])}).finally(()=>{d.value=!1}))};let f="";const p=W.debounce(()=>u(f),800),g=b=>{f=b,p()},m=b=>{var S;if(W.isArray(b)){const x=b.length>0?b.map(C=>{var B;return i.toRaw((B=l.value.find(v=>v.value===C))==null?void 0:B.item)}):[];s("update:value",x)}else if(b>0){const x=i.toRaw((S=l.value.find(C=>C.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(jw),{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"]))}}),qw={},Sh=i.defineComponent({...qw,__name:"searchable-product-select",props:{wrapContent:{type:Boolean,default:!1},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:3},consistentMenuWidth:{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 u=>r.searchType==="categories"?te.HttpRequester.getInstance(te.ProductCategoryDataProvider).publicSimpleSearch(u):r.searchType==="products"?te.HttpRequester.getInstance(te.ProductDataProvider).publicSimpleSearch(u):new Promise(f=>{f([])}),l=u=>r.searchType==="categories"?cn.convertReferencesToSelectOptionsList(u,!0,!1,f=>f!=null&&f.isNewRec()?"-":f.name):r.searchType==="products"?cn.convertReferencesToSelectOptionsList(u,!0,!1,f=>f!=null&&f.isNewRec()?"-":`[${f.code}] ${f.name}`):[],c=(u,f)=>{if(r.renderLabel)return r.renderLabel(u,f);if(r.searchType==="products"){const p=u.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},p.code),i.h("span",{},[p.name])])}if(r.searchType==="categories"){const p=u.item;return i.h("div",{},[p.name])}};return t({focus:()=>{var u;return(u=o.value)==null?void 0:u.focus()},blur:()=>{var u;return(u=o.value)==null?void 0:u.blur()}}),(u,f)=>(i.openBlock(),i.createBlock(Ch,{ref:"select-component",value:u.value,clearable:u.clearable,disabled:u.disabled,placeholder:u.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":u.consistentMenuWidth,"wrap-content":u.wrapContent,"min-term-length":u.minTermLength,"render-label":c,"render-tag":u.renderTag,"onUpdate:value":f[0]||(f[0]=p=>s("update:value",p))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),Yw={class:"col-span-2 flex flex-row gap-2.5"},Uw={class:"flex-1"},Gw={class:"text-sc-grey"},Kw={class:"ml-2.5"},Zw={key:0,class:"flex-none"},Jw={},Qw=i.defineComponent({...Jw,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default: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(u=>i.toRaw(u)))},c=u=>{u&&(a.value=[...a.value.map(f=>i.toRaw(f)),...(W.isArray(u)?u:[u]).filter(f=>!a.value.some(p=>p.id===f.id))],i.nextTick(()=>{s.value=null}),l())},d=u=>{u&&(a.value=a.value.map(f=>f.id===u.id?u:i.toRaw(f)),l())},h=u=>{a.value=a.value.filter(f=>f.id!==u.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(u,f)=>{const p=V.NListItem,g=E_,m=V.NButton,_=V.NList;return i.openBlock(),i.createBlock(_,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(u.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Sh,{value:s.value,"onUpdate:value":[f[0]||(f[0]=y=>s.value=y),c],clearable:!0,disabled:u.disabled,"min-term-length":u.minTermLength,"search-type":u.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(p,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>f[1]||(f[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(p,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(m,{disabled:u.disabled,quaternary:"",type:"error",onClick:b=>h(y)},{default:i.withCtx(()=>[i.createVNode(g)]),_:2},1032,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",Yw,[i.createElementVNode("span",Uw,[i.createElementVNode("span",Gw,i.toDisplayString(y.code),1),i.createElementVNode("span",Kw,i.toDisplayString(y.name),1)]),u.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",Zw,[i.renderSlot(u.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),ev={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tv(e,t){return i.openBlock(),i.createElementBlock("svg",ev,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 nv=i.markRaw({name:"tabler-truck-filled",render:tv}),iv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rv(e,t){return i.openBlock(),i.createElementBlock("svg",iv,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 sv=i.markRaw({name:"tabler-truck-delivery",render:rv}),ov={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function av(e,t){return i.openBlock(),i.createElementBlock("svg",ov,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 lv=i.markRaw({name:"tabler-truck-loading",render:av}),cv={class:"flex flex-col gap-1"},dv={key:0,class:"flex flex-row gap-1"},hv={key:1,class:"text-sc-dark-grey"},uv={class:"text-sc-grey mr-1.5"},fv={key:0},pv={key:1},gv={key:2},mv={},vs=i.defineComponent({...mv,__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=te.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Bn.format(r.delivery.date,"dd.MM.yyyy")),r=e;return(s,o)=>{var d,h,u,f,p,g,m,_;const a=lv,l=sv,c=nv;return i.openBlock(),i.createElementBlock("div",cv,[s.showType?(i.openBlock(),i.createElementBlock("span",dv,[((d=t.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0,class:"text-sm"})):i.createCommentVNode("",!0),((h=t.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1,class:"text-sm"})):i.createCommentVNode("",!0),((u=t.value)==null?void 0:u.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2,class:"text-sm"})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((f=t.value)==null?void 0:f.name),1)])):i.createCommentVNode("",!0),s.showDetails?(i.openBlock(),i.createElementBlock("span",hv,[i.createElementVNode("span",uv,i.toDisplayString(n.value),1),(g=(p=s.delivery)==null?void 0:p.address)!=null&&g.address?(i.openBlock(),i.createElementBlock("span",fv,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",pv,"со склада "+i.toDisplayString(s.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",gv,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),_v={class:"flex flex-col gap-2.5"},yv=["href"],bv={class:"text-sc-grey"},wv={},Bh=i.defineComponent({...wv,__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=te.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",_v,[i.createElementVNode("span",null,[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,yv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ")),i.createVNode(ho,{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",bv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(Br,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(vs,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),vv={},Th=i.defineComponent({...vv,__name:"order-payment",props:{payment:{}},setup(e){const t=e,n=i.computed(()=>{var r;return(r=te.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)}}}),kv={class:"flex flex-row gap-1.5"},xv={class:"flex-none text-nowrap"},Cv={class:"flex flex-1 flex-col"},Sv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1"},Bv={key:0},Tv={key:1},Ev={},Eh=i.defineComponent({...Ev,__name:"order-product-info",props:{product:{},index:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",kv,[i.createElementVNode("span",xv,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Cv,[i.createVNode(qi,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",Sv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",Bv,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",Tv,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)])])]))}}),$v={},Nv=i.defineComponent({...$v,__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",{},[a+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:o=>i.h("span",{},[o.product.code])},{title:"Наименование",key:"name",resizable:!0,render:o=>i.h(qi,{product:o.product,showCode:!1,showPlanningDates:!1})},{title:"Кол-во",key:"quantity",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-nowrap"},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",{},[`${o.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h("span",{},[`${o.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])}];switch(gt.getDeviceTypeByResolution()){case qe.phone:case qe.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(Eh,{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=V.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)}}}),$h=Dn(Nv,[["__scopeId","data-v-5305a359"]]),Pv={},Yo=i.defineComponent({...Pv,__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",null,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))}}),Rv={class:"ml-4 grid grid-cols-3 gap-1.5"},Fv={class:"col-span-2"},Mv={class:"col-span-2"},Av={class:"btn btn-primary",href:"{{ invoice }}"},Ov={},Nh=i.defineComponent({...Ov,__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",Rv,[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(Yo,{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(Br,{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(xa,{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",Fv,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(Th,{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(vs,{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",Mv,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(Yo,{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",Av," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),Vv={key:0},zv={class:"text-sc-dark-grey my-2 text-center"},Iv={key:1,class:"text-sc-dark-grey my-2 text-center"},Lv={key:2},Dv={class:"text-sc-dark-grey mt-4 text-right font-bold"},Hv={class:"text-sc-primary"},Wv={},Ph=i.defineComponent({...Wv,__name:"order-info",props:{order:{}},setup(e){const t=e,n=i.ref(!1),r=i.ref(new te.Order(t.order)),s=()=>{n.value=!0,te.HttpRequester.getInstance(te.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=V.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",Vv,[i.createElementVNode("div",zv,[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",Iv," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",Lv,[i.createVNode($h,{order:r.value},null,8,["order"]),i.createElementVNode("div",Dv,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ")),i.createElementVNode("span",Hv,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode(Nh,{order:r.value},null,8,["order"])]))}}}),jv={},Xv=i.defineComponent({...jv,__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(()=>te.useReferencesStore().orderStatusReference),l=()=>{const m=t.fields.length>0?t.fields:[Ge.CreatedAt,Ge.Id,Ge.DeliveryInfo,Ge.Status,Ge.SalesDirections,Ge.AttachedUser],_={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},y={type:"expand",expandable:W.constant(!0),renderExpand:S=>i.h(Ph,{order:S,class:"pl-10 pt-3 pb-10"}),width:"30"},b=[{title:"Дата заказа",key:Ge.CreatedAt,resizable:!0,minWidth:100,render:S=>i.h(ho,{date:S.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0})},{title:"Номер заказа",key:Ge.Id,resizable:!0,minWidth:70,render:S=>i.h("a",{href:t.orderUrl.replace(":id",S.id.toString()),target:"_blank"},S.id)},{title:"Клиент",key:Ge.ClientInfo,resizable:!0,render:S=>i.h(Br,{client:S.client})},{title:"Тип доставки",key:Ge.DeliveryInfo,resizable:!0,render:S=>i.h(vs,{delivery:S.delivery})},{title:"Статус",key:Ge.Status,resizable:!0,minWidth:90,render:S=>{var x,C;return i.h("span",{},[((C=(x=a.value)==null?void 0:x.find(B=>B.id===(S.status??-1)))==null?void 0:C.name)??""])}},{title:"Напр. продаж",key:Ge.SalesDirections,resizable:!0,minWidth:70,render:S=>i.h("span",{},[S.salesDirection.name])},{title:"Закреплено за",key:Ge.AttachedUser,resizable:!0,render:S=>{var x;return i.h("span",{},[(x=S==null?void 0:S.attachedUser)==null?void 0:x.name])}}];switch(gt.getDeviceTypeByResolution()){case qe.phone:case qe.tablet:return[y,{key:"order",title:"Заказ",resizable:!0,render:S=>i.h(Bh,{order:S,fields:m,orderUrl:t.orderUrl})}];case qe.laptop:return[y,...m.map(S=>b.find(x=>x.key===S)??_)];default:return[_]}},c=i.ref(l()),d=i.ref(new te.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,te.HttpRequester.getInstance(te.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}))},u=m=>{d.value.page=m,h()},f=m=>{d.value.pageSize=m,h()},p=m=>{W.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=V.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":u,"onUpdate:pageSize":f,"onUpdate:sorter":p},null,8,["columns","data","row-key","pagination","loading"])}}}),qv=Dn(Xv,[["__scopeId","data-v-f2a707a3"]]),Yv=["href"],Uv={class:"text-sc-dark-grey"},Gv={},Kv=i.defineComponent({...Gv,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>Bn.format(n.order.createdAt,te.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{W.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,Yv),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",Uv,"автор: "+i.toDisplayString(a.order.creator.name)+" ["+i.toDisplayString(a.order.creator.type)+"]",1)],64))}}),Zv={class:"sc-page flex flex-col"},Jv={class:"flex flex-row"},Qv={class:"sc-title grow"},e2={key:0,class:"sc-title-buttons mt-1 flex-1 grow-0 lg:mt-3"},t2={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},n2={key:0,class:"sc-title-extra mt-2 sm:mt-4"},i2={},Rh=i.defineComponent({...i2,__name:"page",props:{title:{}},setup(e){return(t,n)=>{const r=V.NH1;return i.openBlock(),i.createElementBlock("div",Zv,[i.createElementVNode("div",Jv,[i.createElementVNode("div",Qv,[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",e2,[i.createElementVNode("div",t2,[i.renderSlot(t.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),t.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",n2,[i.renderSlot(t.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"default")])}}}),r2={class:"overflow-hidden transition-all duration-300"},s2={class:"text-lg font-medium leading-none"},o2={},Fh=i.defineComponent({...o2,__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(gt.getDeviceTypeByResolution()){case qe.phone:return window.innerWidth*.66;case qe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?W.isUndefined(n.drawerWidth)?s.value=a():s.value=W.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=V.NDrawerContent,u=V.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",r2,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(u,{show:o.value,"onUpdate:show":d[0]||(d[0]=f=>o.value=f),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",s2,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)}}}),a2={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},l2={key:0},c2={class:"sc-page-preview-panel grow"},d2={key:1,class:"sc-page-preview-panel-extra flex-none"},h2={},u2=i.defineComponent({...h2,__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=V.NButton;return i.openBlock(),i.createBlock(Rh,{title:a.title},i.createSlots({default:i.withCtx(()=>[a.$slots["preview-panel"]||a.$slots["preview-panel-extra"]||a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",a2,[a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",l2,[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",d2,[i.renderSlot(a.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Fh,{"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"])}}}),f2={},p2=i.defineComponent({...f2,__name:"reference-select",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},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(()=>W.isArray(r.value)),a=new te.Reference,l=i.computed(()=>{const p=o.value?[]:a,g=W.isUndefined(r.value)?p:r.value;return W.isArray(g)?g.map(m=>m.id):g==null?void 0:g.id}),c=i.computed(()=>cn.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,r.showEmptyValue)),d=p=>{var g;if(W.isArray(p)){const m=p.length>0?p.map(_=>{var y;return(y=c.value.find(b=>b.value===_))==null?void 0:y.item}):[];s("update:value",m)}else{const m=p===a.id||(g=c.value.find(_=>_.value===p))==null?void 0:g.item;s("update:value",m)}},h=i.useTemplateRef("select-component");return t({focus:()=>{var p;return(p=h.value)==null?void 0:p.focus()},blur:()=>{var p;return(p=h.value)==null?void 0:p.blur()}}),(p,g)=>(i.openBlock(),i.createBlock(i.unref(V.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":p.consistentMenuWidth,disabled:p.disabled||c.value.length===0,filterable:p.filterable,"max-tag-count":p.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"]))}}),g2={},m2=i.defineComponent({...g2,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},managerReferenceList:{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(()=>W.isArray(r.value)),a=i.computed(()=>{var f;return W.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>{var g;let f=r.showEmptyValue?[te.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList,p=[];if(r.showActualOnly){const m=W.isArray(r.value)?r.value.map(_=>_.id):[(g=r.value)==null?void 0:g.id];p=r.managerReferenceList.filter(_=>!_.isActive).map(_=>_.id),f=r.managerReferenceList.filter(_=>_.isActive||m.includes(_.id))}return cn.convertReferencesToSelectOptionsList(f,!0,!0,m=>m.salesDirection.isNewRec()?m.name:`${m.name} (${m.salesDirection.name})`,m=>p.includes(m.id))}),c=i.useTemplateRef("select-component"),d=f=>{var p;if(W.isArray(f)){const g=f.length>0?f.map(m=>{var _;return(_=l.value.find(y=>y.value===m))==null?void 0:_.item}):[];s("update:value",g)}else{const g=f>0?(p=l.value.find(m=>m.value===f))==null?void 0:p.item:new te.Manager;s("update:value",g)}};return t({focus:()=>{var f;return(f=c.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=c.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(V.NSelect),{ref:"select-component",value:a.value,clearable:f.clearable,disabled:l.value.length===0,multiple:o.value,options:l.value,placeholder:"","onUpdate:value":d},null,8,["value","clearable","disabled","multiple","options"]))}}),_2={class:"m-0.5 flex flex-col p-0.5"},y2={class:"flex flex-row gap-1"},b2={key:0},w2={key:1},v2={key:2},k2={key:3},x2={class:"flex flex-row gap-1"},C2={key:0},S2={key:1},B2={key:2},T2={key:3},E2={},Mh=i.defineComponent({...E2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",_2,[i.createElementVNode("span",y2,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",b2,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",w2,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",v2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",k2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",x2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",C2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",S2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",B2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",T2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Uo={clearable:!1,value:"",field:void 0,disabled:!1},$2={},N2=i.defineComponent({...$2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},searchDataHandler:{}},{...Uo,searchDataHandler:()=>e=>te.HttpRequester.getInstance(te.DataSuggestionProvider).searchAddresses(e)}),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=W.debounce(()=>h(),800),h=async()=>{!o.value||o.value.length<4||(a.value=!0,l.value=await r.searchDataHandler(o.value,a).finally(()=>{a.value=!1}))},u=(m,_)=>{const y=l.value.find(b=>b.id===m.value)||{};return i.h(Mh,{addr:y,selected:_},{default:W.constant("-")})},f=m=>{d.cancel();const _=l.value.find(y=>y.id===m)||{};s("select",_)},p=i.ref(null);function g(){p.value.focus()}return t({focus:g}),(m,_)=>{const y=V.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:p,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":u,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),P2={class:"m-0.5 flex flex-col p-0.5"},R2={class:"font-medium"},F2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},M2={key:0},A2={key:1},O2={},Ah=i.defineComponent({...O2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",P2,[i.createElementVNode("span",R2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",F2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",M2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",A2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),V2={},z2=i.defineComponent({...V2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{}},Uo),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=W.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<4)){a.value=!0;try{l.value=await te.HttpRequester.getInstance(te.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},u=(m,_)=>{const y=l.value.find(b=>b.id===m.value)||{};return i.h(Ah,{bank:y,selected:_},{default:W.constant("-")})},f=m=>{d.cancel();const _=l.value.find(y=>y.id===m)||{};s("select",_)},p=i.ref(null);function g(){p.value.focus()}return t({focus:g}),(m,_)=>{const y=V.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:p,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":u,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),I2={class:"font-medium"},L2={key:0,class:"flex flex-row gap-2"},D2={key:0,class:"text-xs font-light text-blue-800"},H2={key:1,class:"text-sc-dark-grey text-xs font-light"},W2={},Oh=i.defineComponent({...W2,__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",I2,i.toDisplayString(s.org.name),1),s.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",L2,[s.org.inn?(i.openBlock(),i.createElementBlock("span",D2,i.toDisplayString(s.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",H2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),j2={},X2=i.defineComponent({...j2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},allowSelectTerminated:{type:Boolean}},Uo),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(()=>cn.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=W.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<4)){a.value=!0;try{l.value=await te.HttpRequester.getInstance(te.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},f=(_,y)=>{const b=l.value.find(S=>S.id===_.value)||{};return i.h(Oh,{org:b,selected:y},{default:W.constant("-")})},p=_=>{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=V.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":f,placeholder:"",onSelect:p},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),q2={},Y2=i.defineComponent({...q2,__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=V.NButton,h=V.NPopover,u=V.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(u,{show:s.value,"onUpdate:show":c[1]||(c[1]=f=>s.value=f),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]=f=>s.value=!1)},{default:i.withCtx(()=>c[3]||(c[3]=[i.createTextVNode(" Отмена ")])),_:1,__:[3]})]),_:1},8,["show","content","title"])])}}}),U2={key:0,class:"whitespace-pre-line"},G2={key:1,class:"text-sc-dark-grey"},K2={},Z2=i.defineComponent({...K2,__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=V.NInput;return i.openBlock(),i.createBlock(Ac,{disabled:l.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[l.comment?(i.openBlock(),i.createElementBlock("span",U2,i.toDisplayString(l.comment),1)):(i.openBlock(),i.createElementBlock("span",G2," - Комментарий отсутствует - "))])]),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"])}}}),J2={key:0},Q2={key:1},ek={},tk=i.defineComponent({...ek,__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("small",J2,[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",Q2,[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)]))}}),nk={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ik(e,t){return i.openBlock(),i.createElementBlock("svg",nk,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 rk=i.markRaw({name:"ion-warning",render:ik}),sk={},ok=i.defineComponent({...sk,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(e){return(t,n)=>{const r=rk,s=V.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"])}}});j.ConfiguratorSettingsKozyrek=qm,j.ContentHelper=Ln,j.KozyrekLine=ni,j.KozyrekTailTemplate=lo,j.KozyrekTemplate=Fi,j.OrdersTableFields=Ge,j.Point=ao,j.ScAddProductToCartForm=Tf,j.ScAddressSuggestion=N2,j.ScAddressSuggestionLabel=Mh,j.ScBankSuggestion=z2,j.ScBankSuggestionLabel=Ah,j.ScBaseDialog=K0,j.ScButtonWithConfirmAction=Y2,j.ScCategoryCollapse=ka,j.ScClientNameWithShortInfo=Br,j.ScCollapse=va,j.ScCollapseItem=ma,j.ScCommentEditor=Z2,j.ScConfiguratorsProductInfo=Yi,j.ScContragentWithShortInfo=xa,j.ScDateRange=z0,j.ScDateTimeLabel=ho,j.ScDebouncedInput=g_,j.ScDebouncedInputNumber=Mi,j.ScDebt=tk,j.ScDialogHeader=q0,j.ScEmail=Xf,j.ScExternalLink=S_,j.ScImageGallery=wa,j.ScInlineEditableItem=Ac,j.ScInlineView=uo,j.ScKozyrekConfigurator=Xm,j.ScKozyrekConfiguratorParamsForm=Pa,j.ScKozyrekConfiguratorPreview=Ec,j.ScKozyrekConfiguratorTemplates=Ea,j.ScLightGallery=ba,j.ScManagerSelect=m2,j.ScMetalForDoorsConfigurator=Jm,j.ScMetalForDoorsConfiguratorForm=$c,j.ScMosquitoConfigurator=k0,j.ScMosquitoConfiguratorForm=Nc,j.ScMosquitoConfiguratorMeasurementInstructions=Pc,j.ScMosquitoConfiguratorPreview=co,j.ScOrderCommonInfo=Bh,j.ScOrderDeliveryLabel=vs,j.ScOrderDetails=Nh,j.ScOrderInfo=Ph,j.ScOrderItemsList=$h,j.ScOrderPayment=Th,j.ScOrderProductInfo=Eh,j.ScOrdersList=qv,j.ScOrgSuggestion=X2,j.ScOrgSuggestionLabel=Oh,j.ScPage=Rh,j.ScPageWithSlidingPanel=u2,j.ScPersonContactsBlock=Ap,j.ScPhone=gp,j.ScPhoneInput=y_,j.ScProductName=qi,j.ScProductsList=Qw,j.ScReferenceSelect=p2,j.ScSearchableProductSelect=Sh,j.ScSearchableReferenceSelect=Ch,j.ScShortTextOrderInfo=Kv,j.ScSingleFileUploadSelector=t_,j.ScSlidingContentWithDrawer=Fh,j.ScStripConfigurator=F0,j.ScStripConfiguratorForm=Fc,j.ScStripConfiguratorLineItem=Rc,j.ScStripConfiguratorPreview=Mc,j.ScUserShortInfo=Yo,j.ScWarningIcon=ok,j.SelectOptionHelper=cn,j.UiProvider=gt,j.WindowResolutionEnum=qe,j.componentSizeInjectionKey=kr,j.naiveUiTheme=ku,j.renderConfig=ze,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})});
|
823
|
+
`,[yh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function bs(e){return e.type==="group"}function kh(e){return e.type==="ignored"}function Xo(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function Iw(e,t){return{getIsGroup:bs,getIgnored:kh,getKey(r){return bs(r)?r.name||r.key||"key-required":r[e]},getChildren(r){return r[t]}}}function Lw(e,t,n,r){if(!t)return e;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(bs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(kh(l))continue;t(n,l)&&a.push(l)}return a}return s(e)}function Dw(e,t,n){const r=new Map;return e.forEach(s=>{bs(s)?s[n].forEach(o=>{r.set(o[t],o)}):r.set(s[t],s)}),r}var Hw={};const Ww=Object.assign(Object.assign({},ht.props),{to:pn.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}),jw=i.defineComponent({name:"Select",props:Ww,slots:Object,setup(e){Hw.NODE_ENV!=="production"&&i.watchEffect(()=>{e.items!==void 0&&An("select","`items` is deprecated, please use `options` instead."),e.onChange!==void 0&&An("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=hi(e),o=ht("Select","-select",zw,Vw,e,t),a=i.ref(e.defaultValue),l=i.toRef(e,"value"),c=wo(l,a),d=i.ref(!1),h=i.ref(""),u=Uc(e,["items","options"]),f=i.ref([]),p=i.ref([]),g=i.computed(()=>p.value.concat(f.value).concat(u.value)),m=i.computed(()=>{const{filter:T}=e;if(T)return T;const{labelField:D,valueField:Q}=e;return(le,ce)=>{if(!ce)return!1;const me=ce[D];if(typeof me=="string")return Xo(le,me);const be=ce[Q];return typeof be=="string"?Xo(le,be):typeof be=="number"?Xo(le,String(be)):!1}}),_=i.computed(()=>{if(e.remote)return u.value;{const{value:T}=g,{value:D}=h;return!D.length||!e.filterable?T:Lw(T,m.value,D,e.childrenField)}}),y=i.computed(()=>{const{valueField:T,childrenField:D}=e,Q=Iw(T,D);return my(_.value,Q)}),b=i.computed(()=>Dw(g.value,e.valueField,e.childrenField)),S=i.ref(!1),x=wo(i.toRef(e,"show"),S),C=i.ref(null),B=i.ref(null),v=i.ref(null),{localeRef:$}=nh("Select"),F=i.computed(()=>{var T;return(T=e.placeholder)!==null&&T!==void 0?T:$.value.placeholder}),R=[],X=i.ref(new Map),M=i.computed(()=>{const{fallbackOption:T}=e;if(T===void 0){const{labelField:D,valueField:Q}=e;return le=>({[D]:String(le),[Q]:le})}return T===!1?!1:D=>Object.assign(T(D),{value:D})});function N(T){const D=e.remote,{value:Q}=X,{value:le}=b,{value:ce}=M,me=[];return T.forEach(be=>{if(le.has(be))me.push(le.get(be));else if(D&&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)?N(T):[]}return null}),L=i.computed(()=>{const{value:T}=c;return!e.multiple&&!Array.isArray(T)?T===null?null:N([T])[0]||null:null}),Y=Gb(e),{mergedSizeRef:P,mergedDisabledRef:E,mergedStatusRef:H}=Y;function I(T,D){const{onChange:Q,"onUpdate:value":le,onUpdateValue:ce}=e,{nTriggerFormChange:me,nTriggerFormInput:be}=Y;Q&&dt(Q,T,D),ce&&dt(ce,T,D),le&&dt(le,T,D),a.value=T,me(),be()}function U(T){const{onBlur:D}=e,{nTriggerFormBlur:Q}=Y;D&&dt(D,T),Q()}function O(){const{onClear:T}=e;T&&dt(T)}function z(T){const{onFocus:D,showOnFocus:Q}=e,{nTriggerFormFocus:le}=Y;D&&dt(D,T),le(),Q&&ie()}function J(T){const{onSearch:D}=e;D&&dt(D,T)}function pe(T){const{onScroll:D}=e;D&&dt(D,T)}function re(){var T;const{remote:D,multiple:Q}=e;if(D){const{value:le}=X;if(Q){const{valueField:ce}=e;(T=A.value)===null||T===void 0||T.forEach(me=>{le.set(me[ce],me)})}else{const ce=L.value;ce&&le.set(ce[e.valueField],ce)}}}function ge(T){const{onUpdateShow:D,"onUpdate:show":Q}=e;D&&dt(D,T),Q&&dt(Q,T),S.value=T}function ie(){E.value||(ge(!0),S.value=!0,e.filterable&&zn())}function Me(){ge(!1)}function xe(){h.value="",p.value=R}const Ce=i.ref(!1);function Fe(){e.filterable&&(Ce.value=!0)}function Ie(){e.filterable&&(Ce.value=!1,x.value||xe())}function vt(){E.value||(x.value?e.filterable?zn():Me():ie())}function xn(T){var D,Q;!((Q=(D=v.value)===null||D===void 0?void 0:D.selfRef)===null||Q===void 0)&&Q.contains(T.relatedTarget)||(d.value=!1,U(T),Me())}function Mt(T){z(T),d.value=!0}function Xt(){d.value=!0}function Tt(T){var D;!((D=C.value)===null||D===void 0)&&D.$el.contains(T.relatedTarget)||(d.value=!1,U(T),Me())}function mi(){var T;(T=C.value)===null||T===void 0||T.focus(),Me()}function _i(T){var D;x.value&&(!((D=C.value)===null||D===void 0)&&D.$el.contains(or(T))||Me())}function Vn(T){if(!Array.isArray(T))return[];if(M.value)return Array.from(T);{const{remote:D}=e,{value:Q}=b;if(D){const{value:le}=X;return T.filter(ce=>Q.has(ce)||le.has(ce))}else return T.filter(le=>Q.has(le))}}function on(T){st(T.rawNode)}function st(T){if(E.value)return;const{tag:D,remote:Q,clearFilterAfterSelect:le,valueField:ce}=e;if(D&&!Q){const{value:me}=p,be=me[0]||null;if(be){const ke=f.value;ke.length?ke.push(be):f.value=[be],p.value=R}}if(Q&&X.value.set(T[ce],T),e.multiple){const me=Vn(c.value),be=me.findIndex(ke=>ke===T[ce]);if(~be){if(me.splice(be,1),D&&!Q){const ke=te(T[ce]);~ke&&(f.value.splice(ke,1),le&&(h.value=""))}}else me.push(T[ce]),le&&(h.value="");I(me,N(me))}else{if(D&&!Q){const me=te(T[ce]);~me?f.value=[f.value[me]]:f.value=R}Di(),Me(),I(T[ce],T)}}function te(T){return f.value.findIndex(Q=>Q[e.valueField]===T)}function ne(T){x.value||ie();const{value:D}=T.target;h.value=D;const{tag:Q,remote:le}=e;if(J(D),Q&&!le){if(!D){p.value=R;return}const{onCreate:ce}=e,me=ce?ce(D):{[e.labelField]:D,[e.valueField]:D},{valueField:be,labelField:ke}=e;u.value.some(Xe=>Xe[be]===me[be]||Xe[ke]===me[ke])||f.value.some(Xe=>Xe[be]===me[be]||Xe[ke]===me[ke])?p.value=R:p.value=[me]}}function je(T){T.stopPropagation();const{multiple:D}=e;!D&&e.filterable&&Me(),O(),D?I([],[]):I(null,null)}function wr(T){!sr(T,"action")&&!sr(T,"empty")&&!sr(T,"header")&&T.preventDefault()}function Li(T){pe(T)}function yi(T){var D,Q,le,ce,me;if(!e.keyboard){T.preventDefault();return}switch(T.key){case" ":if(e.filterable)break;T.preventDefault();case"Enter":if(!(!((D=C.value)===null||D===void 0)&&D.isComposing)){if(x.value){const be=(Q=v.value)===null||Q===void 0?void 0:Q.getPendingTmNode();be?on(be):e.filterable||(Me(),Di())}else if(ie(),e.tag&&Ce.value){const be=p.value[0];if(be){const ke=be[e.valueField],{value:Xe}=c;e.multiple&&Array.isArray(Xe)&&Xe.includes(ke)||st(be)}}}T.preventDefault();break;case"ArrowUp":if(T.preventDefault(),e.loading)return;x.value&&((le=v.value)===null||le===void 0||le.prev());break;case"ArrowDown":if(T.preventDefault(),e.loading)return;x.value?(ce=v.value)===null||ce===void 0||ce.next():ie();break;case"Escape":x.value&&(Xb(T),Me()),(me=C.value)===null||me===void 0||me.focus();break}}function Di(){var T;(T=C.value)===null||T===void 0||T.focus()}function zn(){var T;(T=C.value)===null||T===void 0||T.focusInput()}function bi(){var T;x.value&&((T=B.value)===null||T===void 0||T.syncPosition())}re(),i.watch(i.toRef(e,"options"),re);const Hi={focus:()=>{var T;(T=C.value)===null||T===void 0||T.focus()},focusInput:()=>{var T;(T=C.value)===null||T===void 0||T.focusInput()},blur:()=>{var T;(T=C.value)===null||T===void 0||T.blur()},blurInput:()=>{var T;(T=C.value)===null||T===void 0||T.blurInput()}},qt=i.computed(()=>{const{self:{menuBoxShadow:T}}=o.value;return{"--n-menu-box-shadow":T}}),Cn=s?ui("select",void 0,qt,e):void 0;return Object.assign(Object.assign({},Hi),{mergedStatus:H,mergedClsPrefix:t,mergedBordered:n,namespace:r,treeMate:y,isMounted:ss(),triggerRef:C,menuRef:v,pattern:h,uncontrolledShow:S,mergedShow:x,adjustedTo:pn(e),uncontrolledValue:a,mergedValue:c,followerRef:B,localizedPlaceholder:F,selectedOption:L,selectedOptions:A,mergedSize:P,mergedDisabled:E,focused:d,activeWithoutMenuOpen:Ce,inlineThemeDisabled:s,onTriggerInputFocus:Fe,onTriggerInputBlur:Ie,handleTriggerOrMenuResize:bi,handleMenuFocus:Xt,handleMenuBlur:Tt,handleMenuTabOut:mi,handleTriggerClick:vt,handleToggle:on,handleDeleteOption:st,handlePatternInput:ne,handleClear:je,handleTriggerBlur:xn,handleTriggerFocus:Mt,handleKeydown:yi,handleMenuAfterLeave:xe,handleMenuClickOutside:_i,handleMenuScroll:Li,handleMenuKeydown:yi,handleMenuMousedown:wr,mergedTheme:o,cssVars:s?void 0:qt,themeClass:Cn==null?void 0:Cn.themeClass,onRender:Cn==null?void 0:Cn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(Jc,null,{default:()=>[i.h(Qc,null,{default:()=>i.h(Aw,{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(pd,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===pn.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(dw,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],[rs,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[rs,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),Xw={},xh=i.defineComponent({...Xw,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},wrapContent:{type:Boolean,default:!1},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:3},consistentMenuWidth:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>W.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"),u=b=>{b.length<r.minTermLength||(d.value=!0,r.searchDataHandler(b,d).then(S=>{if(W.isEmpty(S))return;const x=o.value?r.value:r.value?[r.value]:[],C=S.filter(B=>!x.some(v=>v.id===B.id));l.value=r.optionsListConverter([...x,...C])}).finally(()=>{d.value=!1}))};let f="";const p=W.debounce(()=>u(f),800),g=b=>{f=b,p()},m=b=>{var S;if(W.isArray(b)){const x=b.length>0?b.map(C=>{var B;return i.toRaw((B=l.value.find(v=>v.value===C))==null?void 0:B.item)}):[];s("update:value",x)}else if(b>0){const x=i.toRaw((S=l.value.find(C=>C.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(jw),{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"]))}}),qw={},Ch=i.defineComponent({...qw,__name:"searchable-product-select",props:{wrapContent:{type:Boolean,default:!1},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:3},consistentMenuWidth:{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 u=>r.searchType==="categories"?G.HttpRequester.getInstance(G.ProductCategoryDataProvider).publicSimpleSearch(u):r.searchType==="products"?G.HttpRequester.getInstance(G.ProductDataProvider).publicSimpleSearch(u):new Promise(f=>{f([])}),l=u=>r.searchType==="categories"?ln.convertReferencesToSelectOptionsList(u,!0,!1,f=>f!=null&&f.isNewRec()?"-":f.name):r.searchType==="products"?ln.convertReferencesToSelectOptionsList(u,!0,!1,f=>f!=null&&f.isNewRec()?"-":`[${f.code}] ${f.name}`):[],c=(u,f)=>{if(r.renderLabel)return r.renderLabel(u,f);if(r.searchType==="products"){const p=u.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},p.code),i.h("span",{},[p.name])])}if(r.searchType==="categories"){const p=u.item;return i.h("div",{},[p.name])}};return t({focus:()=>{var u;return(u=o.value)==null?void 0:u.focus()},blur:()=>{var u;return(u=o.value)==null?void 0:u.blur()}}),(u,f)=>(i.openBlock(),i.createBlock(xh,{ref:"select-component",value:u.value,clearable:u.clearable,disabled:u.disabled,placeholder:u.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":u.consistentMenuWidth,"wrap-content":u.wrapContent,"min-term-length":u.minTermLength,"render-label":c,"render-tag":u.renderTag,"onUpdate:value":f[0]||(f[0]=p=>s("update:value",p))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),Yw={class:"col-span-2 flex flex-row gap-2.5"},Uw={class:"flex-1"},Gw={class:"text-sc-grey"},Kw={class:"ml-2.5"},Zw={key:0,class:"flex-none"},Jw={},Qw=i.defineComponent({...Jw,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default: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(u=>i.toRaw(u)))},c=u=>{u&&(a.value=[...a.value.map(f=>i.toRaw(f)),...(W.isArray(u)?u:[u]).filter(f=>!a.value.some(p=>p.id===f.id))],i.nextTick(()=>{s.value=null}),l())},d=u=>{u&&(a.value=a.value.map(f=>f.id===u.id?u:i.toRaw(f)),l())},h=u=>{a.value=a.value.filter(f=>f.id!==u.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(u,f)=>{const p=V.NListItem,g=E_,m=V.NButton,_=V.NList;return i.openBlock(),i.createBlock(_,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(u.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Ch,{value:s.value,"onUpdate:value":[f[0]||(f[0]=y=>s.value=y),c],clearable:!0,disabled:u.disabled,"min-term-length":u.minTermLength,"search-type":u.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(p,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>f[1]||(f[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(p,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(m,{disabled:u.disabled,quaternary:"",type:"error",onClick:b=>h(y)},{default:i.withCtx(()=>[i.createVNode(g)]),_:2},1032,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",Yw,[i.createElementVNode("span",Uw,[i.createElementVNode("span",Gw,i.toDisplayString(y.code),1),i.createElementVNode("span",Kw,i.toDisplayString(y.name),1)]),u.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",Zw,[i.renderSlot(u.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),ev={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tv(e,t){return i.openBlock(),i.createElementBlock("svg",ev,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 nv=i.markRaw({name:"tabler-truck-filled",render:tv}),iv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rv(e,t){return i.openBlock(),i.createElementBlock("svg",iv,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 sv=i.markRaw({name:"tabler-truck-delivery",render:rv}),ov={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function av(e,t){return i.openBlock(),i.createElementBlock("svg",ov,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 lv=i.markRaw({name:"tabler-truck-loading",render:av}),cv={class:"flex flex-col gap-1"},dv={key:0,class:"flex flex-row gap-1 text-base"},hv={key:1,class:"text-sc-dark-grey text-sm"},uv={class:"text-sc-grey mr-1.5"},fv={key:0},pv={key:1},gv={key:2},mv={},ws=i.defineComponent({...mv,__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=G.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Sn.format(r.delivery.date,"dd.MM.yyyy")),r=e;return(s,o)=>{var d,h,u,f,p,g,m,_;const a=lv,l=sv,c=nv;return i.openBlock(),i.createElementBlock("div",cv,[s.showType?(i.openBlock(),i.createElementBlock("span",dv,[((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),((u=t.value)==null?void 0:u.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((f=t.value)==null?void 0:f.name),1)])):i.createCommentVNode("",!0),s.showDetails?(i.openBlock(),i.createElementBlock("span",hv,[i.createElementVNode("span",uv,i.toDisplayString(n.value),1),(g=(p=s.delivery)==null?void 0:p.address)!=null&&g.address?(i.openBlock(),i.createElementBlock("span",fv,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",pv,"со склада "+i.toDisplayString(s.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",gv,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),_v={class:"flex flex-col gap-2.5"},yv={class:"text-base"},bv=["href"],wv={class:"text-sc-grey"},vv={},Sh=i.defineComponent({...vv,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(e){const t=e,n=i.computed(()=>t.fields.includes(Ue.Id)?t.order.id:void 0),r=i.computed(()=>{var l,c;return t.fields.includes(Ue.Status)?(c=(l=G.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(Ue.CreatedAt)),o=i.computed(()=>t.fields.includes(Ue.ClientInfo)?t.order.client:void 0),a=i.computed(()=>t.fields.includes(Ue.DeliveryInfo)?t.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",_v,[i.createElementVNode("span",yv,[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,bv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ")),i.createVNode(co,{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",wv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(Sr,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(ws,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),kv={},Bh=i.defineComponent({...kv,__name:"order-payment",props:{payment:{}},setup(e){const t=e,n=i.computed(()=>{var r;return(r=G.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)}}}),xv={class:"flex flex-row gap-1.5"},Cv={class:"flex-none text-nowrap"},Sv={class:"flex flex-1 flex-col"},Bv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},Tv={key:0},Ev={key:1},$v={},Th=i.defineComponent({...$v,__name:"order-product-info",props:{product:{},index:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",xv,[i.createElementVNode("span",Cv,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Sv,[i.createVNode(Xi,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",Bv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",Tv,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",Ev,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)])])]))}}),Nv={},Pv=i.defineComponent({...Nv,__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(Xi,{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(pt.getDeviceTypeByResolution()){case G.WindowResolutionEnum.phone:case G.WindowResolutionEnum.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(Th,{product:o,index:a})}];case G.WindowResolutionEnum.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=V.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)}}}),Eh=Ln(Pv,[["__scopeId","data-v-b1bc6269"]]),Rv={class:"text-base"},Fv={},qo=i.defineComponent({...Fv,__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",Rv,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))}}),Mv={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},Av={class:"col-span-2"},Ov={class:"col-span-2"},Vv={class:"btn btn-primary",href:"{{ invoice }}"},zv={},$h=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",Mv,[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(qo,{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(Sr,{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(ka,{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",Av,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(Bh,{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(ws,{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",Ov,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(qo,{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",Vv," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),Iv={key:0},Lv={class:"text-sc-dark-grey my-2 text-center"},Dv={key:1,class:"text-sc-dark-grey my-2 text-center"},Hv={key:2},Wv={class:"text-sc-dark-grey mt-4 text-right font-bold"},jv={class:"text-sc-primary"},Xv={},Nh=i.defineComponent({...Xv,__name:"order-info",props:{order:{}},setup(e){const t=e,n=i.ref(!1),r=i.ref(new G.Order(t.order)),s=()=>{n.value=!0,G.HttpRequester.getInstance(G.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=V.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",Iv,[i.createElementVNode("div",Lv,[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",Dv," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",Hv,[i.createVNode(Eh,{order:r.value},null,8,["order"]),i.createElementVNode("div",Wv,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ")),i.createElementVNode("span",jv,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode($h,{order:r.value},null,8,["order"])]))}}}),qv={},Yv=i.defineComponent({...qv,__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(()=>G.useReferencesStore().orderStatusReference),l=()=>{const m=t.fields.length>0?t.fields:[Ue.CreatedAt,Ue.Id,Ue.DeliveryInfo,Ue.Status,Ue.SalesDirections,Ue.AttachedUser],_={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},y={type:"expand",expandable:W.constant(!0),renderExpand:S=>i.h(Nh,{order:S,class:"pl-10 pt-3 pb-10"}),width:"30"},b=[{title:"Дата заказа",key:Ue.CreatedAt,resizable:!0,minWidth:100,render:S=>i.h(co,{date:S.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Ue.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:Ue.ClientInfo,resizable:!0,render:S=>i.h(Sr,{client:S.client})},{title:"Тип доставки",key:Ue.DeliveryInfo,resizable:!0,render:S=>i.h(ws,{delivery:S.delivery})},{title:"Статус",key:Ue.Status,resizable:!0,minWidth:90,render:S=>{var x,C;return i.h("span",{class:"text-base"},[((C=(x=a.value)==null?void 0:x.find(B=>B.id===(S.status??-1)))==null?void 0:C.name)??""])}},{title:"Напр. продаж",key:Ue.SalesDirections,resizable:!0,minWidth:70,render:S=>i.h("span",{class:"text-base"},[S.salesDirection.name])},{title:"Закреплено за",key:Ue.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(pt.getDeviceTypeByResolution()){case G.WindowResolutionEnum.phone:case G.WindowResolutionEnum.tablet:return[y,{key:"order",title:"Заказ",resizable:!0,render:S=>i.h(Sh,{order:S,fields:m,orderUrl:t.orderUrl})}];case G.WindowResolutionEnum.laptop:return[y,...m.map(S=>b.find(x=>x.key===S)??_)];default:return[_]}},c=i.ref(l()),d=i.ref(new G.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,G.HttpRequester.getInstance(G.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}))},u=m=>{d.value.page=m,h()},f=m=>{d.value.pageSize=m,h()},p=m=>{W.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=V.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":u,"onUpdate:pageSize":f,"onUpdate:sorter":p},null,8,["columns","data","row-key","pagination","loading"])}}}),Uv=Ln(Yv,[["__scopeId","data-v-d66ad43e"]]),Gv=["href"],Kv={class:"text-sc-dark-grey"},Zv={},Jv=i.defineComponent({...Zv,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>Sn.format(n.order.createdAt,G.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{W.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,Gv),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",Kv,"автор: "+i.toDisplayString(a.order.creator.name)+" ["+i.toDisplayString(a.order.creator.type)+"]",1)],64))}}),Qv={class:"sc-page flex flex-col"},e2={class:"flex flex-row"},t2={class:"sc-title grow"},n2={key:0,class:"sc-title-buttons mt-1 flex-1 grow-0 lg:mt-3"},i2={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},r2={key:0,class:"sc-title-extra mt-2 sm:mt-4"},s2={},Ph=i.defineComponent({...s2,__name:"page",props:{title:{}},setup(e){return(t,n)=>{const r=V.NH1;return i.openBlock(),i.createElementBlock("div",Qv,[i.createElementVNode("div",e2,[i.createElementVNode("div",t2,[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",n2,[i.createElementVNode("div",i2,[i.renderSlot(t.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),t.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",r2,[i.renderSlot(t.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"default")])}}}),o2={class:"overflow-hidden transition-all duration-300"},a2={class:"text-lg font-medium leading-none"},l2={},Rh=i.defineComponent({...l2,__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(pt.getDeviceTypeByResolution()){case G.WindowResolutionEnum.phone:return window.innerWidth*.66;case G.WindowResolutionEnum.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?W.isUndefined(n.drawerWidth)?s.value=a():s.value=W.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=V.NDrawerContent,u=V.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",o2,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(u,{show:o.value,"onUpdate:show":d[0]||(d[0]=f=>o.value=f),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",a2,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)}}}),c2={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},d2={key:0},h2={class:"sc-page-preview-panel grow"},u2={key:1,class:"sc-page-preview-panel-extra flex-none"},f2={},p2=i.defineComponent({...f2,__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=V.NButton;return i.openBlock(),i.createBlock(Ph,{title:a.title},i.createSlots({default:i.withCtx(()=>[a.$slots["preview-panel"]||a.$slots["preview-panel-extra"]||a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",c2,[a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",d2,[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",h2,[i.renderSlot(a.$slots,"preview-panel")]),a.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",u2,[i.renderSlot(a.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Rh,{"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"])}}}),g2={},m2=i.defineComponent({...g2,__name:"reference-select",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},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(()=>W.isArray(r.value)),a=new G.Reference,l=i.computed(()=>{const p=o.value?[]:a,g=W.isUndefined(r.value)?p:r.value;return W.isArray(g)?g.map(m=>m.id):g==null?void 0:g.id}),c=i.computed(()=>ln.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,r.showEmptyValue)),d=p=>{var g;if(W.isArray(p)){const m=p.length>0?p.map(_=>{var y;return(y=c.value.find(b=>b.value===_))==null?void 0:y.item}):[];s("update:value",m)}else{const m=p===a.id||(g=c.value.find(_=>_.value===p))==null?void 0:g.item;s("update:value",m)}},h=i.useTemplateRef("select-component");return t({focus:()=>{var p;return(p=h.value)==null?void 0:p.focus()},blur:()=>{var p;return(p=h.value)==null?void 0:p.blur()}}),(p,g)=>(i.openBlock(),i.createBlock(i.unref(V.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":p.consistentMenuWidth,disabled:p.disabled||c.value.length===0,filterable:p.filterable,"max-tag-count":p.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"]))}}),_2={},y2=i.defineComponent({..._2,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},managerReferenceList:{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(()=>W.isArray(r.value)),a=i.computed(()=>{var f;return W.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>{var g;let f=r.showEmptyValue?[G.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList,p=[];if(r.showActualOnly){const m=W.isArray(r.value)?r.value.map(_=>_.id):[(g=r.value)==null?void 0:g.id];p=r.managerReferenceList.filter(_=>!_.isActive).map(_=>_.id),f=r.managerReferenceList.filter(_=>_.isActive||m.includes(_.id))}return ln.convertReferencesToSelectOptionsList(f,!0,!0,m=>m.salesDirection.isNewRec()?m.name:`${m.name} (${m.salesDirection.name})`,m=>p.includes(m.id))}),c=i.useTemplateRef("select-component"),d=f=>{var p;if(W.isArray(f)){const g=f.length>0?f.map(m=>{var _;return(_=l.value.find(y=>y.value===m))==null?void 0:_.item}):[];s("update:value",g)}else{const g=f>0?(p=l.value.find(m=>m.value===f))==null?void 0:p.item:new G.Manager;s("update:value",g)}};return t({focus:()=>{var f;return(f=c.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=c.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(V.NSelect),{ref:"select-component",value:a.value,clearable:f.clearable,disabled:l.value.length===0,multiple:o.value,options:l.value,placeholder:"","onUpdate:value":d},null,8,["value","clearable","disabled","multiple","options"]))}}),b2={class:"m-0.5 flex flex-col p-0.5"},w2={class:"flex flex-row gap-1"},v2={key:0},k2={key:1},x2={key:2},C2={key:3},S2={class:"flex flex-row gap-1"},B2={key:0},T2={key:1},E2={key:2},$2={key:3},N2={},Fh=i.defineComponent({...N2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",b2,[i.createElementVNode("span",w2,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",v2,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",k2,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",x2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",C2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",S2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",B2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",T2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",E2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",$2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Yo={clearable:!1,value:"",field:void 0,disabled:!1},P2={},R2=i.defineComponent({...P2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},searchDataHandler:{}},{...Yo,searchDataHandler:()=>e=>G.HttpRequester.getInstance(G.DataSuggestionProvider).searchAddresses(e)}),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=W.debounce(()=>h(),800),h=async()=>{!o.value||o.value.length<4||(a.value=!0,l.value=await r.searchDataHandler(o.value,a).finally(()=>{a.value=!1}))},u=(m,_)=>{const y=l.value.find(b=>b.id===m.value)||{};return i.h(Fh,{addr:y,selected:_},{default:W.constant("-")})},f=m=>{d.cancel();const _=l.value.find(y=>y.id===m)||{};s("select",_)},p=i.ref(null);function g(){p.value.focus()}return t({focus:g}),(m,_)=>{const y=V.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:p,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":u,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),F2={class:"m-0.5 flex flex-col p-0.5"},M2={class:"font-medium"},A2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},O2={key:0},V2={key:1},z2={},Mh=i.defineComponent({...z2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",F2,[i.createElementVNode("span",M2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",A2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",O2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",V2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),I2={},L2=i.defineComponent({...I2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{}},Yo),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=W.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<4)){a.value=!0;try{l.value=await G.HttpRequester.getInstance(G.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},u=(m,_)=>{const y=l.value.find(b=>b.id===m.value)||{};return i.h(Mh,{bank:y,selected:_},{default:W.constant("-")})},f=m=>{d.cancel();const _=l.value.find(y=>y.id===m)||{};s("select",_)},p=i.ref(null);function g(){p.value.focus()}return t({focus:g}),(m,_)=>{const y=V.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:p,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":u,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),D2={class:"font-medium"},H2={key:0,class:"flex flex-row gap-2"},W2={key:0,class:"text-xs font-light text-blue-800"},j2={key:1,class:"text-sc-dark-grey text-xs font-light"},X2={},Ah=i.defineComponent({...X2,__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",D2,i.toDisplayString(s.org.name),1),s.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",H2,[s.org.inn?(i.openBlock(),i.createElementBlock("span",W2,i.toDisplayString(s.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",j2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),q2={},Y2=i.defineComponent({...q2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},allowSelectTerminated:{type:Boolean}},Yo),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(()=>ln.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=W.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<4)){a.value=!0;try{l.value=await G.HttpRequester.getInstance(G.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},f=(_,y)=>{const b=l.value.find(S=>S.id===_.value)||{};return i.h(Ah,{org:b,selected:y},{default:W.constant("-")})},p=_=>{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=V.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":f,placeholder:"",onSelect:p},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),U2={},G2=i.defineComponent({...U2,__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=V.NButton,h=V.NPopover,u=V.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(u,{show:s.value,"onUpdate:show":c[1]||(c[1]=f=>s.value=f),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]=f=>s.value=!1)},{default:i.withCtx(()=>c[3]||(c[3]=[i.createTextVNode(" Отмена ")])),_:1,__:[3]})]),_:1},8,["show","content","title"])])}}}),K2={key:0,class:"whitespace-pre-line"},Z2={key:1,class:"text-sc-dark-grey"},J2={},Q2=i.defineComponent({...J2,__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=V.NInput;return i.openBlock(),i.createBlock(Mc,{disabled:l.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[l.comment?(i.openBlock(),i.createElementBlock("span",K2,i.toDisplayString(l.comment),1)):(i.openBlock(),i.createElementBlock("span",Z2," - Комментарий отсутствует - "))])]),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"])}}}),ek={key:0,class:"text-sm"},tk={key:1},nk={},ik=i.defineComponent({...nk,__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",ek,[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",tk,[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)]))}}),rk={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sk(e,t){return i.openBlock(),i.createElementBlock("svg",rk,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 ok=i.markRaw({name:"ion-warning",render:sk}),ak={},lk=i.defineComponent({...ak,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(e){return(t,n)=>{const r=ok,s=V.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"])}}});q.ConfiguratorSettingsKozyrek=qm,q.ContentHelper=In,q.KozyrekLine=ti,q.KozyrekTailTemplate=ao,q.KozyrekTemplate=Ri,q.OrdersTableFields=Ue,q.Point=oo,q.ScAddProductToCartForm=$f,q.ScAddressSuggestion=R2,q.ScAddressSuggestionLabel=Fh,q.ScBankSuggestion=L2,q.ScBankSuggestionLabel=Mh,q.ScBaseDialog=K0,q.ScButtonWithConfirmAction=G2,q.ScCategoryCollapse=va,q.ScClientNameWithShortInfo=Sr,q.ScCollapse=wa,q.ScCollapseItem=ga,q.ScCommentEditor=Q2,q.ScConfiguratorsProductInfo=qi,q.ScContragentWithShortInfo=ka,q.ScDateRange=z0,q.ScDateTimeLabel=co,q.ScDebouncedInput=g_,q.ScDebouncedInputNumber=Fi,q.ScDebt=ik,q.ScDialogHeader=q0,q.ScEmail=Xf,q.ScExternalLink=S_,q.ScImageGallery=ba,q.ScInlineEditableItem=Mc,q.ScInlineView=ho,q.ScKozyrekConfigurator=Xm,q.ScKozyrekConfiguratorParamsForm=Na,q.ScKozyrekConfiguratorPreview=Tc,q.ScKozyrekConfiguratorTemplates=Ta,q.ScLightGallery=ya,q.ScManagerSelect=y2,q.ScMetalForDoorsConfigurator=Jm,q.ScMetalForDoorsConfiguratorForm=Ec,q.ScMosquitoConfigurator=k0,q.ScMosquitoConfiguratorForm=$c,q.ScMosquitoConfiguratorMeasurementInstructions=Nc,q.ScMosquitoConfiguratorPreview=lo,q.ScOrderCommonInfo=Sh,q.ScOrderDeliveryLabel=ws,q.ScOrderDetails=$h,q.ScOrderInfo=Nh,q.ScOrderItemsList=Eh,q.ScOrderPayment=Bh,q.ScOrderProductInfo=Th,q.ScOrdersList=Uv,q.ScOrgSuggestion=Y2,q.ScOrgSuggestionLabel=Ah,q.ScPage=Ph,q.ScPageWithSlidingPanel=p2,q.ScPersonContactsBlock=Ap,q.ScPhone=gp,q.ScPhoneInput=y_,q.ScProductName=Xi,q.ScProductsList=Qw,q.ScReferenceSelect=m2,q.ScSearchableProductSelect=Ch,q.ScSearchableReferenceSelect=xh,q.ScShortTextOrderInfo=Jv,q.ScSingleFileUploadSelector=t_,q.ScSlidingContentWithDrawer=Rh,q.ScStripConfigurator=F0,q.ScStripConfiguratorForm=Rc,q.ScStripConfiguratorLineItem=Pc,q.ScStripConfiguratorPreview=Fc,q.ScUserShortInfo=qo,q.ScWarningIcon=lk,q.SelectOptionHelper=ln,q.UiProvider=pt,q.componentSizeInjectionKey=vr,q.naiveUiTheme=vu,q.renderConfig=ze,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
|
824
824
|
//# sourceMappingURL=sc-vue-ui-lib.umd.cjs.map
|